scanbot-web-sdk 8.0.0-beta.4 → 8.0.0-beta.5
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/@types/index.d.ts +1 -1
- package/@types/service/storage/indexed-db/sb-indexed-db.d.ts +3 -3
- package/@types/service/storage/sb-storage.d.ts +7 -7
- package/bundle/ScanbotSDK.min.js +3 -3
- package/bundle/ScanbotSDK.ui2.min.js +7 -7
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +1 -1
package/bundle/ScanbotSDK.min.js
CHANGED
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
stroke-dashoffset: -120;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
`;var a=e=>i.default.createElement(o,{viewBox:"0 0 50 50"},i.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:e.color||"black"})),s=n(41),c=n(13),u=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class l{}class d{constructor(){this.videoReady=!1,this.sdkReady=!1}}class m extends i.default.Component{constructor(e){super(e),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:e}=this.props;e&&e(this)}))},this.onVideoError=e=>{if(!0===this.state.videoReady){const{onError:t}=this.props.configuration;t?t(e):console.error(e)}else{const{onFailure:t}=this.props;t&&t(e),this.dispose()}},this.state=new d}get bridge(){var e;return(null!==(e=this.props.sdk)&&void 0!==e?e:r.a.instance).bridge}dispose(){c.a.unmountSafely(this.props.root)}onSdkReady(){return u(this,void 0,void 0,(function*(){}))}componentDidMount(){this.disposed=!1,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0}),this.onSdkReady()}))}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}setZoom(e){this.setState({zoom:e})}setCameraDirection(e){this.camera.setDirection(e)}swapCameraFacing(e){this.camera.swapCameraFacing(e)}switchCamera(e,t){return u(this,void 0,void 0,(function*(){this.camera.switchCamera(e,t)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return s.a.INSTANCE.load()}renderSpinner(e){return this.state.videoReady&&this.state.sdkReady?null:i.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},i.default.createElement(a,{color:e}))}setTorchState(e){return this.camera.setTorchState(e)}getCapabilities(){return this.camera.videoStream.getCapabilities()}}m.DEFAULT_DETECTION_RESOLUTION=600,m.DETECTION_RESOLUTION_4K=3840},function(e,t,n){"use strict";n.d(t,"e",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return l})),n.d(t,"g",(function(){return d}));var i=n(29),r=n(10);const o=["ML","LEGACY"];class a{constructor(e={}){this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.acceptedAspectRatioScore=85,this.aspectRatios=[],this.ignoreOrientationMismatch=!1,void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.acceptedAspectRatioScore&&(this.acceptedAspectRatioScore=e.acceptedAspectRatioScore),void 0!==e.aspectRatios&&(this.aspectRatios=e.aspectRatios.map((e=>new i.a(e)))),void 0!==e.ignoreOrientationMismatch&&(this.ignoreOrientationMismatch=e.ignoreOrientationMismatch)}}class s{constructor(e={}){this.engineMode="ML",this.processingMode="AUTO",this.parameters=new a({}),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.processingMode&&(this.processingMode=e.processingMode),void 0!==e.parameters&&(this.parameters=new a(e.parameters))}}const c=["NOT_ACQUIRED","OK","OK_BUT_TOO_SMALL","OK_BUT_BAD_ANGLES","OK_BUT_BAD_ASPECT_RATIO","OK_BUT_ORIENTATION_MISMATCH","OK_BUT_OFF_CENTER","OK_BUT_TOO_DARK","ERROR_NOTHING_DETECTED","ERROR_TOO_DARK","ERROR_TOO_NOISY"];class u{constructor(e={}){if(void 0===e.totalScore)throw new Error("totalScore must be present in constructor argument");if(this.totalScore=e.totalScore,void 0===e.distanceScore)throw new Error("distanceScore must be present in constructor argument");if(this.distanceScore=e.distanceScore,void 0===e.angleScore)throw new Error("angleScore must be present in constructor argument");if(this.angleScore=e.angleScore,void 0===e.sizeScore)throw new Error("sizeScore must be present in constructor argument");if(this.sizeScore=e.sizeScore,void 0===e.aspectRatioScore)throw new Error("aspectRatioScore must be present in constructor argument");if(this.aspectRatioScore=e.aspectRatioScore,void 0===e.lineCoverageScore)throw new Error("lineCoverageScore must be present in constructor argument");if(this.lineCoverageScore=e.lineCoverageScore,void 0===e.widthScore)throw new Error("widthScore must be present in constructor argument");if(this.widthScore=e.widthScore,void 0===e.heightScore)throw new Error("heightScore must be present in constructor argument");this.heightScore=e.heightScore}}class l{constructor(e={}){if(this.status="NOT_ACQUIRED",this.averageBrightness=0,void 0!==e.status&&(this.status=e.status),void 0===e.detectionScores)throw new Error("detectionScores must be present in constructor argument");if(this.detectionScores=new u(e.detectionScores),void 0===e.points)throw new Error("points must be present in constructor argument");if(this.points=e.points.map((e=>({x:e.x,y:e.y}))),void 0===e.horizontalLines)throw new Error("horizontalLines must be present in constructor argument");if(this.horizontalLines=e.horizontalLines.map((e=>new i.c(e))),void 0===e.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=e.verticalLines.map((e=>new i.c(e))),void 0===e.pointsNormalized)throw new Error("pointsNormalized must be present in constructor argument");if(this.pointsNormalized=e.pointsNormalized.map((e=>({x:e.x,y:e.y}))),void 0===e.horizontalLinesNormalized)throw new Error("horizontalLinesNormalized must be present in constructor argument");if(this.horizontalLinesNormalized=e.horizontalLinesNormalized.map((e=>new i.b(e))),void 0===e.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=e.verticalLinesNormalized.map((e=>new i.b(e))),void 0===e.aspectRatio)throw new Error("aspectRatio must be present in constructor argument");this.aspectRatio=e.aspectRatio,void 0!==e.averageBrightness&&(this.averageBrightness=e.averageBrightness)}}class d{constructor(e={}){if(this.croppedImage=null,void 0===e.detectionResult)throw new Error("detectionResult must be present in constructor argument");this.detectionResult=new l(e.detectionResult),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?new r.a(e.croppedImage):null)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var i=n(1),r=n(5);class o extends r.a{constructor(e={}){super(),this.visible=!0,this.title=new i.p({color:"?sbColorOnPrimary"}),this.background=new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new i.p(e.title)),void 0!==e.background&&(this.background=new i.a(e.background))}}class a extends r.a{constructor(e={}){super(),this.visible=!0,this.icon=new i.i({color:"?sbColorOnPrimary"}),this.title=new i.p({color:"?sbColorOnPrimary"}),this.background=new i.a({fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.icon&&(this.icon=new i.i(e.icon)),void 0!==e.title&&(this.title=new i.p(e.title)),void 0!==e.background&&(this.background=new i.a(e.background))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(80);class r extends i.a{constructor(e){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",this.videoConstraints={width:{ideal:e.width},height:{ideal:e.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(e,t){e.videoConstraints&&this.mapValues(e.videoConstraints,t.videoConstraints)}}r.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},r.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},r.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,r.DEFAULT_ACCEPTED_ANGLE_SCORE=75,r.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class r extends Error{constructor(e,t,n){super(t),this.name="",this.name=e,this.message=t,this.webApiError=n}static mediaDevicesUndefined(){return new r(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new r(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(e){return new r(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",e)}static permissionDenied(e){return new r(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",e)}static unknown(e){return new r(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevices.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",e)}static tryCheckPermission(){return i(this,void 0,void 0,(function*(){if(!this.permissionState)try{const e=yield navigator.permissions.query({name:"camera"});this.permissionState=e.state}catch(e){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}static createFromDOMException(e){return e instanceof DOMException?"NotAllowedError"===e.name?r.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===e.name?r.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:r.unknown(null==e?void 0:e.message)}}r.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},r.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"}},function(e,t,n){"use strict";n.d(t,"h",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return l})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return m}));var i=n(62),r=n(10);class o{constructor(e={}){if(void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=e.confidence}}const a=["INVALID","OBSTRUCTED","NONE","CONFIRMED","INFERRED","VALID","IGNORED"],s=["ISO_DATE","ISO_COUNTRY_ALPHA_2","ISO_COUNTRY_ALPHA_3","ISO_COUNTRY_NUMERIC","ISO_COUNTRY_NAME","GENDER"];class c{constructor(e={}){if(void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class u{constructor(e={}){if(this.listIndex=null,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=e.fullName,void 0===e.normalizedName)throw new Error("normalizedName must be present in constructor argument");if(this.normalizedName=e.normalizedName,void 0===e.commonType)throw new Error("commonType must be present in constructor argument");this.commonType=null!=e.commonType&&i.a.includes(e.commonType)?e.commonType:null,void 0!==e.listIndex&&(this.listIndex=null!=e.listIndex?e.listIndex:null)}}class l{constructor(e={}){if(this.confidenceWeight=1,this.image=null,this.validationStatus="NONE",this.parsedData=[],void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=new u(e.type),void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=null!=e.value?new o(e.value):null,void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight),void 0!==e.image&&(this.image=null!=e.image?new r.a(e.image):null),void 0===e.polygonInRoot)throw new Error("polygonInRoot must be present in constructor argument");this.polygonInRoot=e.polygonInRoot.map((e=>({x:e.x,y:e.y}))),void 0!==e.validationStatus&&(this.validationStatus=e.validationStatus),void 0!==e.parsedData&&(this.parsedData=e.parsedData.map((e=>new c(e))))}}class d{constructor(e={}){if(this.listIndex=null,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=e.fullName,void 0===e.normalizedName)throw new Error("normalizedName must be present in constructor argument");this.normalizedName=e.normalizedName,void 0!==e.listIndex&&(this.listIndex=null!=e.listIndex?e.listIndex:null)}}class m{constructor(e={}){if(this.crop=null,this.confidence=0,this.confidenceWeight=0,void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=new d(e.type),void 0===e.fields)throw new Error("fields must be present in constructor argument");if(this.fields=e.fields.map((e=>new l(e))),void 0===e.children)throw new Error("children must be present in constructor argument");if(this.children=e.children.map((e=>new m(e))),void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadInRoot)throw new Error("quadInRoot must be present in constructor argument");this.quadInRoot=e.quadInRoot.map((e=>({x:e.x,y:e.y}))),void 0!==e.crop&&(this.crop=null!=e.crop?new r.a(e.crop):null),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"SingleScanningMode",(function(){return u})),n.d(t,"BarcodeUseCase",(function(){return A})),n.d(t,"BarcodeItemErrorState",(function(){return a})),n.d(t,"BarcodeMappedData",(function(){return s})),n.d(t,"BarcodeInfoMapping",(function(){return c})),n.d(t,"ExpectedBarcode",(function(){return C})),n.d(t,"FindAndPickScanningMode",(function(){return b})),n.d(t,"BarcodeTextLocalization",(function(){return S})),n.d(t,"BarcodesExtensionFilterValues",(function(){return w})),n.d(t,"CommonBarcodeScannerConfiguration",(function(){return E})),n.d(t,"ArOverlayPolygonConfiguration",(function(){return i.c})),n.d(t,"BarcodeItemInfoPositionValues",(function(){return i.e})),n.d(t,"BarcodeItemConfiguration",(function(){return i.d})),n.d(t,"ArOverlayGeneralConfiguration",(function(){return i.b})),n.d(t,"FindAndPickArOverlayPolygonConfiguration",(function(){return i.f})),n.d(t,"FindAndPickBadgeConfiguration",(function(){return i.g})),n.d(t,"ArOverlayFindAndPickConfiguration",(function(){return i.a})),n.d(t,"BarcodeScannerUiItem",(function(){return x})),n.d(t,"BarcodeScannerUiResult",(function(){return B})),n.d(t,"MultipleBarcodesScanningModeValues",(function(){return l})),n.d(t,"SheetModeValues",(function(){return d})),n.d(t,"CollapsedVisibleHeightValues",(function(){return m})),n.d(t,"Sheet",(function(){return h})),n.d(t,"SwipeToDelete",(function(){return f})),n.d(t,"ManualCountEditDialog",(function(){return p})),n.d(t,"SheetContent",(function(){return g})),n.d(t,"MultipleScanningMode",(function(){return v})),n.d(t,"BarcodeScannerScreenConfiguration",(function(){return z})),n.d(t,"BarcodeItem",(function(){return D.c})),n.d(t,"BarcodeScannerEngineModeValues",(function(){return D.e})),n.d(t,"AcknowledgementModeValues",(function(){return H})),n.d(t,"AcknowledgementBottomBar",(function(){return U})),n.d(t,"AcknowledgementScreenConfiguration",(function(){return Z})),n.d(t,"ShutterButton",(function(){return $})),n.d(t,"PreviewButton",(function(){return X})),n.d(t,"ScanAssistanceOverlay",(function(){return ee})),n.d(t,"PagePreviewMode",(function(){return te})),n.d(t,"TextButtonMode",(function(){return ne})),n.d(t,"NoButtonMode",(function(){return ie})),n.d(t,"CameraBottomBar",(function(){return re})),n.d(t,"PageSnapFeedbackMode",(function(){return K})),n.d(t,"PageSnapFunnelAnimation",(function(){return oe})),n.d(t,"PageSnapCheckMarkAnimation",(function(){return ae})),n.d(t,"PageSnapFeedbackNone",(function(){return se})),n.d(t,"CaptureFeedback",(function(){return ce})),n.d(t,"DocumentPolygonConfiguration",(function(){return ue})),n.d(t,"SelectCameraMenu",(function(){return le})),n.d(t,"CameraScreenConfiguration",(function(){return de})),n.d(t,"CroppingBottomBar",(function(){return me})),n.d(t,"CroppingScreenConfiguration",(function(){return he})),n.d(t,"DocumentScannerCameraConfiguration",(function(){return G})),n.d(t,"UserGuidanceVisibilityValues",(function(){return fe})),n.d(t,"DocumentAnalysisModeValues",(function(){return ge})),n.d(t,"DocumentScannerOutputSettings",(function(){return ve})),n.d(t,"DocumentScannerScreens",(function(){return Se})),n.d(t,"DocumentScannerTextLocalization",(function(){return we})),n.d(t,"UserGuidanceStates",(function(){return Q})),n.d(t,"DocumentScannerUserGuidance",(function(){return q})),n.d(t,"DocumentFlowAppearanceConfiguration",(function(){return Ee})),n.d(t,"DocumentScanningFlow",(function(){return De})),n.d(t,"IntroListEntry",(function(){return J.g})),n.d(t,"IntroImage",(function(){return J.f})),n.d(t,"NoIntroImage",(function(){return J.j})),n.d(t,"CustomImage",(function(){return J.c})),n.d(t,"ReceiptsIntroImage",(function(){return J.k})),n.d(t,"MedicalCertificateIntroImage",(function(){return J.i})),n.d(t,"DocumentIntroImage",(function(){return J.d})),n.d(t,"CheckIntroImage",(function(){return J.a})),n.d(t,"IdCardIntroImage",(function(){return J.e})),n.d(t,"CreditCardIntroImage",(function(){return J.b})),n.d(t,"IntroductionScreenConfiguration",(function(){return J.h})),n.d(t,"ReviewBottomBarConfiguration",(function(){return ye})),n.d(t,"ReviewMorePopupMenu",(function(){return Ce})),n.d(t,"ZoomOverlay",(function(){return be})),n.d(t,"ReviewScreenConfiguration",(function(){return Ae})),n.d(t,"MrzFinderLayoutPreset",(function(){return xe})),n.d(t,"TwoLineMrzFinderLayoutPreset",(function(){return Be})),n.d(t,"ThreeLineMrzFinderLayoutPreset",(function(){return Ie})),n.d(t,"NoLayoutPreset",(function(){return Te})),n.d(t,"MrzScannerScreenConfiguration",(function(){return _e})),n.d(t,"MrzScannerIntroImage",(function(){return ke.d})),n.d(t,"MrzIntroDefaultImage",(function(){return ke.b})),n.d(t,"MrzIntroNoImage",(function(){return ke.c})),n.d(t,"MrzIntroCustomImage",(function(){return ke.a})),n.d(t,"MrzScannerIntroScreenConfiguration",(function(){return ke.e})),n.d(t,"MrzScannerUiResult",(function(){return Re.a})),n.d(t,"MrzScannerScreenTextLocalization",(function(){return Pe})),n.d(t,"Resolution",(function(){return O})),n.d(t,"CameraModuleValues",(function(){return k})),n.d(t,"CameraConfiguration",(function(){return P})),n.d(t,"TopBarConfiguration",(function(){return W.a})),n.d(t,"TopBarModeValues",(function(){return W.b})),n.d(t,"ActionBarConfiguration",(function(){return I})),n.d(t,"ScanbotAlertDialog",(function(){return y})),n.d(t,"CameraPermissionScreen",(function(){return L})),n.d(t,"OcrResult",(function(){return Me.h})),n.d(t,"FieldValidationStatusValues",(function(){return Me.e})),n.d(t,"FieldDataFormatValues",(function(){return Me.b})),n.d(t,"FieldParsedData",(function(){return Me.c})),n.d(t,"FieldType",(function(){return Me.d})),n.d(t,"Field",(function(){return Me.a})),n.d(t,"GenericDocumentType",(function(){return Me.g})),n.d(t,"GenericDocument",(function(){return Me.f})),n.d(t,"Palette",(function(){return r.j})),n.d(t,"StyledText",(function(){return r.p})),n.d(t,"IconStyle",(function(){return r.i})),n.d(t,"IconButton",(function(){return r.h})),n.d(t,"PolygonStyle",(function(){return r.k})),n.d(t,"BackgroundStyle",(function(){return r.a})),n.d(t,"ForegroundStyle",(function(){return r.g})),n.d(t,"BadgeStyle",(function(){return r.b})),n.d(t,"RoundButton",(function(){return r.m})),n.d(t,"BadgedButton",(function(){return r.c})),n.d(t,"ButtonConfiguration",(function(){return r.e})),n.d(t,"PopupMenuItem",(function(){return r.l})),n.d(t,"BarButtonConfiguration",(function(){return r.d})),n.d(t,"SoundTypeValues",(function(){return r.o})),n.d(t,"Sound",(function(){return r.n})),n.d(t,"Vibration",(function(){return r.r})),n.d(t,"Timeouts",(function(){return r.q})),n.d(t,"EdgeInsets",(function(){return r.f})),n.d(t,"BaseViewFinderConfiguration",(function(){return _})),n.d(t,"ViewFinderConfiguration",(function(){return M})),n.d(t,"PermanentViewFinderConfiguration",(function(){return F})),n.d(t,"FinderStyle",(function(){return R})),n.d(t,"FinderCorneredStyle",(function(){return N})),n.d(t,"FinderStrokedStyle",(function(){return V})),n.d(t,"UserGuidanceConfiguration",(function(){return j.b})),n.d(t,"IconUserGuidanceConfiguration",(function(){return j.a})),n.d(t,"NavigationBarModeValues",(function(){return Fe})),n.d(t,"ScanCompletionOverlay",(function(){return Le}));var i=n(12),r=n(1),o=n(5);class a extends o.a{constructor(e={}){super(),this.title=new r.p({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new r.p({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new r.e({}),this.cancelButton=new r.e({}),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.subtitle&&(this.subtitle=new r.p(e.subtitle)),void 0!==e.retryButton&&(this.retryButton=new r.e(e.retryButton)),void 0!==e.cancelButton&&(this.cancelButton=new r.e(e.cancelButton))}}class s extends o.a{constructor(e={}){if(super(),void 0===e.title)throw new Error("title must be present in constructor argument");if(this.title=e.title,void 0===e.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=e.subtitle,void 0===e.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=e.barcodeImage}}class c extends o.a{constructor(e={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new r.p({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new a({}),void 0!==e.barcodeItemMapper&&(this.barcodeItemMapper=null!=e.barcodeItemMapper?e.barcodeItemMapper:null),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.loadingMessage&&(this.loadingMessage=new r.p(e.loadingMessage)),void 0!==e.errorState&&(this.errorState=new a(e.errorState))}}class u extends o.a{constructor(e={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new r.p({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new r.e({visible:!0,text:"?sheetSubmitButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new r.e({visible:!0,text:"?singleModeConfirmationCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new c({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new r.p({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new r.p({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new r.e({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new r.e({text:"?barcodeInfoMappingErrorStateCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new i.b({visible:!1,counterBadge:new r.b({visible:!0,background:new r.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new i.c({visible:!0,deselected:new r.k({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new r.k({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new i.d({imageVisible:!0,titleSelected:new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new r.p({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new r.p({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new r.k({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new r.k({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==e.confirmationSheetEnabled&&(this.confirmationSheetEnabled=e.confirmationSheetEnabled),void 0!==e.barcodeImageVisible&&(this.barcodeImageVisible=e.barcodeImageVisible),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.barcodeTitle&&(this.barcodeTitle=new r.p(e.barcodeTitle)),void 0!==e.barcodeSubtitle&&(this.barcodeSubtitle=new r.p(e.barcodeSubtitle)),void 0!==e.submitButton&&(this.submitButton=new r.e(e.submitButton)),void 0!==e.cancelButton&&(this.cancelButton=new r.e(e.cancelButton)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new c(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new i.b(e.arOverlay))}}const l=["COUNTING","UNIQUE"],d=["BUTTON","COLLAPSED_SHEET"],m=["SMALL","LARGE"];class h extends o.a{constructor(e={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new r.c({}),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.collapsedVisibleHeight&&(this.collapsedVisibleHeight=e.collapsedVisibleHeight),void 0!==e.listButton&&(this.listButton=new r.c(e.listButton))}}class f extends o.a{constructor(e={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.iconColor&&(this.iconColor=e.iconColor)}}class p extends o.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new r.p({text:"Update count",color:"?sbColorOnSurface"}),this.info=new r.p({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new r.e({visible:!0,text:"Update",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new r.e({visible:!0,text:"Cancel",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new r.i({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.info&&(this.info=new r.p(e.info)),void 0!==e.updateButton&&(this.updateButton=new r.e(e.updateButton)),void 0!==e.cancelButton&&(this.cancelButton=new r.e(e.cancelButton)),void 0!==e.clearTextButton&&(this.clearTextButton=new r.i(e.clearTextButton))}}class g extends o.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new r.p({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new r.e({visible:!0,text:"Clear all",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new r.p({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new r.p({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new r.e({visible:!0,text:"Submit",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new r.e({visible:!0,text:"Start scanning",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new r.p({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new r.p({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new r.i({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new f({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.manualCountChangeEnabled&&(this.manualCountChangeEnabled=e.manualCountChangeEnabled),void 0!==e.manualCountOutlineColor&&(this.manualCountOutlineColor=e.manualCountOutlineColor),void 0!==e.manualCountChangeColor&&(this.manualCountChangeColor=e.manualCountChangeColor),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.clearAllButton&&(this.clearAllButton=new r.e(e.clearAllButton)),void 0!==e.barcodeItemTitle&&(this.barcodeItemTitle=new r.p(e.barcodeItemTitle)),void 0!==e.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new r.p(e.barcodeItemSubtitle)),void 0!==e.barcodeItemImageVisible&&(this.barcodeItemImageVisible=e.barcodeItemImageVisible),void 0!==e.submitButton&&(this.submitButton=new r.e(e.submitButton)),void 0!==e.startScanningButton&&(this.startScanningButton=new r.e(e.startScanningButton)),void 0!==e.placeholderTitle&&(this.placeholderTitle=new r.p(e.placeholderTitle)),void 0!==e.placeholderSubtitle&&(this.placeholderSubtitle=new r.p(e.placeholderSubtitle)),void 0!==e.placeholderIconBackground&&(this.placeholderIconBackground=e.placeholderIconBackground),void 0!==e.placeholderIcon&&(this.placeholderIcon=new r.i(e.placeholderIcon)),void 0!==e.swipeToDelete&&(this.swipeToDelete=new f(e.swipeToDelete))}}class v extends o.a{constructor(e={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.allowEmptySubmission=!1,this.mode="COUNTING",this.sheet=new h({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new r.c({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new r.p({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new r.e({visible:!0,text:"?sheetClearAllButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new r.p({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new r.p({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new r.e({visible:!0,text:"?sheetSubmitButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new r.e({visible:!0,text:"?sheetStartScanningButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new r.p({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new r.p({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new r.i({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new f({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new p({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new r.p({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new r.p({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new r.e({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?manualCountEditDialogCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new r.i({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new c({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new r.p({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new r.p({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new r.e({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new i.b({visible:!1,counterBadge:new r.b({visible:!0,background:new r.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new i.c({visible:!0,deselected:new r.k({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new r.k({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new i.d({imageVisible:!0,titleSelected:new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new r.p({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new r.p({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new r.p({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new r.k({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new r.k({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.allowEmptySubmission&&(this.allowEmptySubmission=e.allowEmptySubmission),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.sheet&&(this.sheet=new h(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new g(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new p(e.manualCountEditDialog)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new c(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new i.b(e.arOverlay))}}class y extends o.a{constructor(e={}){super(),this.title=new r.p({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new r.p({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",this.okButton=new r.e({background:new r.a({fillColor:"?sbColorPrimary"})}),this.actionButton=new r.e({visible:!1,background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),this.cancelButton=new r.e({visible:!0,background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.subtitle&&(this.subtitle=new r.p(e.subtitle)),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.okButton&&(this.okButton=new r.e(e.okButton)),void 0!==e.actionButton&&(this.actionButton=new r.e(e.actionButton)),void 0!==e.cancelButton&&(this.cancelButton=new r.e(e.cancelButton))}}class C extends o.a{constructor(e={}){if(super(),this.title=null,this.image=null,this.count=1,void 0===e.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");this.barcodeValue=e.barcodeValue,void 0!==e.title&&(this.title=null!=e.title?e.title:null),void 0!==e.image&&(this.image=null!=e.image?e.image:null),void 0!==e.count&&(this.count=e.count)}}class b extends o.a{constructor(e={}){super(),this._type="FindAndPickScanningMode",this.scanningCompletedColor="?sbColorPositive",this.scanningPartiallyColor="?sbColorWarning",this.scanningNotScannedColor="?sbColorOutline",this.allowPartialScan=!1,this.expectedBarcodes=[],this.countingRepeatDelay=1e3,this.sheet=new h({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new r.c({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new r.p({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new r.e({visible:!0,text:"?sheetResetButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new r.p({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new r.e({visible:!0,text:"?sheetSubmitButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new r.e({visible:!0,text:"?sheetStartScanningButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new r.p({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new r.p({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new r.i({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new f({enabled:!1,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new p({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new r.p({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new r.p({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new r.e({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?manualCountEditDialogCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new r.i({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new i.a({visible:!0,automaticSelectionEnabled:!0,polygon:new i.f({partiallyScanned:new r.k({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new r.k({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new r.k({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new i.g({partiallyScanned:new r.b({visible:!0,background:new r.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new r.b({visible:!0,background:new r.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new r.b({visible:!0,background:new r.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new y({title:new r.p({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new r.e({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new y({title:new r.p({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new r.e({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),void 0!==e.scanningCompletedColor&&(this.scanningCompletedColor=e.scanningCompletedColor),void 0!==e.scanningPartiallyColor&&(this.scanningPartiallyColor=e.scanningPartiallyColor),void 0!==e.scanningNotScannedColor&&(this.scanningNotScannedColor=e.scanningNotScannedColor),void 0!==e.allowPartialScan&&(this.allowPartialScan=e.allowPartialScan),void 0!==e.expectedBarcodes&&(this.expectedBarcodes=e.expectedBarcodes.map((e=>new C(e)))),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.sheet&&(this.sheet=new h(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new g(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new p(e.manualCountEditDialog)),void 0!==e.arOverlay&&(this.arOverlay=new i.a(e.arOverlay)),void 0!==e.partialScannedAlertDialogEnabled&&(this.partialScannedAlertDialogEnabled=e.partialScannedAlertDialogEnabled),void 0!==e.partialScannedAlertDialog&&(this.partialScannedAlertDialog=new y(e.partialScannedAlertDialog)),void 0!==e.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=e.confirmationAlertDialogEnabled),void 0!==e.confirmationAlertDialog&&(this.confirmationAlertDialog=new y(e.confirmationAlertDialog))}}var A;(A||(A={})).From=function(e){const t=e._type;switch(t){case"SingleScanningMode":return new u(e);case"MultipleScanningMode":return new v(e);case"FindAndPickScanningMode":return new b(e);default:throw`Unknown child class name: ${t}`}};class S extends o.a{constructor(e={}){super(),this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetResetButton="Reset",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",this.findAndPickSheetTitle="%d/%d scanned",this.findAndPickSheetBarcodeItemSubtitle="%d/%d added",this.findAndPickPartialAlertTitle="Incomplete scan!",this.findAndPickPartialAlertSubtitle="Some codes are yet to be scanned. Proceed with submission anyway?",this.findAndPickPartialAlertCancelButton="Cancel",this.findAndPickPartialAlertSubmitButton="Yes, Submit",this.findAndPickCompleteAlertTitle="All codes found!",this.findAndPickCompleteAlertSubtitle="You have successfully scanned all codes. Proceed with submission?",this.findAndPickCompleteAlertCancelButton="Dismiss",this.accessibilityDescriptionCancelButton="Cancel",this.accessibilityDescriptionFlashButton="Toggle flash",this.accessibilityDescriptionZoomButton="Toggle camera zoom",this.accessibilityDescriptionFlipCameraButton="Flip camera",this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionEnableCameraButton="Grant permission",this.cameraPermissionCloseButton="Close",this.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",void 0!==e.topBarCancelButton&&(this.topBarCancelButton=e.topBarCancelButton),void 0!==e.topBarTitle&&(this.topBarTitle=e.topBarTitle),void 0!==e.userGuidance&&(this.userGuidance=e.userGuidance),void 0!==e.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=e.barcodeInfoMappingLoadingMessage),void 0!==e.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=e.barcodeInfoMappingErrorStateTitle),void 0!==e.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=e.barcodeInfoMappingErrorStateSubtitle),void 0!==e.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=e.barcodeInfoMappingErrorStateRetryButton),void 0!==e.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=e.barcodeInfoMappingErrorStateCancelButton),void 0!==e.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=e.manualCountEditDialogTitle),void 0!==e.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=e.manualCountEditDialogInfo),void 0!==e.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=e.manualCountEditDialogUpdateButton),void 0!==e.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=e.manualCountEditDialogCancelButton),void 0!==e.sheetResetButton&&(this.sheetResetButton=e.sheetResetButton),void 0!==e.sheetClearAllButton&&(this.sheetClearAllButton=e.sheetClearAllButton),void 0!==e.sheetSubmitButton&&(this.sheetSubmitButton=e.sheetSubmitButton),void 0!==e.sheetStartScanningButton&&(this.sheetStartScanningButton=e.sheetStartScanningButton),void 0!==e.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=e.sheetPlaceholderTitle),void 0!==e.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=e.sheetPlaceholderSubtitle),void 0!==e.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=e.singleModeConfirmationCancelButton),void 0!==e.multipleModeSheetTitle&&(this.multipleModeSheetTitle=e.multipleModeSheetTitle),void 0!==e.findAndPickSheetTitle&&(this.findAndPickSheetTitle=e.findAndPickSheetTitle),void 0!==e.findAndPickSheetBarcodeItemSubtitle&&(this.findAndPickSheetBarcodeItemSubtitle=e.findAndPickSheetBarcodeItemSubtitle),void 0!==e.findAndPickPartialAlertTitle&&(this.findAndPickPartialAlertTitle=e.findAndPickPartialAlertTitle),void 0!==e.findAndPickPartialAlertSubtitle&&(this.findAndPickPartialAlertSubtitle=e.findAndPickPartialAlertSubtitle),void 0!==e.findAndPickPartialAlertCancelButton&&(this.findAndPickPartialAlertCancelButton=e.findAndPickPartialAlertCancelButton),void 0!==e.findAndPickPartialAlertSubmitButton&&(this.findAndPickPartialAlertSubmitButton=e.findAndPickPartialAlertSubmitButton),void 0!==e.findAndPickCompleteAlertTitle&&(this.findAndPickCompleteAlertTitle=e.findAndPickCompleteAlertTitle),void 0!==e.findAndPickCompleteAlertSubtitle&&(this.findAndPickCompleteAlertSubtitle=e.findAndPickCompleteAlertSubtitle),void 0!==e.findAndPickCompleteAlertCancelButton&&(this.findAndPickCompleteAlertCancelButton=e.findAndPickCompleteAlertCancelButton),void 0!==e.accessibilityDescriptionCancelButton&&(this.accessibilityDescriptionCancelButton=e.accessibilityDescriptionCancelButton),void 0!==e.accessibilityDescriptionFlashButton&&(this.accessibilityDescriptionFlashButton=e.accessibilityDescriptionFlashButton),void 0!==e.accessibilityDescriptionZoomButton&&(this.accessibilityDescriptionZoomButton=e.accessibilityDescriptionZoomButton),void 0!==e.accessibilityDescriptionFlipCameraButton&&(this.accessibilityDescriptionFlipCameraButton=e.accessibilityDescriptionFlipCameraButton),void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionEnableCameraButton&&(this.cameraPermissionEnableCameraButton=e.cameraPermissionEnableCameraButton),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton)}}const w=["REQUIRE_2","REQUIRE_5","REQUIRE_ANY","IGNORE","ALLOW_2","ALLOW_5","ALLOW_ANY"];class E extends o.a{constructor(e={}){super(),this.extractedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.onlyAcceptDocuments=!1,this.barcodesExtensionFilter="ALLOW_ANY",this.barcodesRegexFilter="",this.minimumSizeScore=0,this.minimumTextLength=0,this.maximumTextLength=0,this.minimum1DBarcodesQuietZone=10,this.stripCheckDigits=!1,this.useIATA2OF5Checksum=!0,this.useCode11Checksum=!0,this.barcodeFormats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],this.msiPlesseyChecksumAlgorithm="MOD_10",this.australiaPostCustomerFormat="ALPHA_NUMERIC",this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,this.returnBarcodeImage=!0,void 0!==e.extractedDocumentFormats&&(this.extractedDocumentFormats=e.extractedDocumentFormats.map((e=>e))),void 0!==e.onlyAcceptDocuments&&(this.onlyAcceptDocuments=e.onlyAcceptDocuments),void 0!==e.barcodesExtensionFilter&&(this.barcodesExtensionFilter=e.barcodesExtensionFilter),void 0!==e.barcodesRegexFilter&&(this.barcodesRegexFilter=e.barcodesRegexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.minimum1DBarcodesQuietZone&&(this.minimum1DBarcodesQuietZone=e.minimum1DBarcodesQuietZone),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=e.useIATA2OF5Checksum),void 0!==e.useCode11Checksum&&(this.useCode11Checksum=e.useCode11Checksum),void 0!==e.barcodeFormats&&(this.barcodeFormats=e.barcodeFormats.map((e=>e))),void 0!==e.msiPlesseyChecksumAlgorithm&&(this.msiPlesseyChecksumAlgorithm=e.msiPlesseyChecksumAlgorithm),void 0!==e.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=e.australiaPostCustomerFormat),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.maximumRecognizerResolution&&(this.maximumRecognizerResolution=e.maximumRecognizerResolution),void 0!==e.returnBarcodeImage&&(this.returnBarcodeImage=e.returnBarcodeImage)}}var D=n(28);class x extends o.a{constructor(e={}){if(super(),void 0===e.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new D.c(e.barcode),void 0===e.count)throw new Error("count must be present in constructor argument");this.count=e.count}}class B extends o.a{constructor(e={}){super(),this.items=[],void 0!==e.items&&(this.items=e.items.map((e=>new x(e))))}}class I extends o.a{constructor(e={}){super(),this.flashButton=new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionFlashButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionFlipCameraButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),void 0!==e.flashButton&&(this.flashButton=new r.m(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new r.m(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new r.m(e.flipCameraButton))}}var T=n(29);class O extends o.a{constructor(e={}){if(super(),void 0===e.width)throw new Error("width must be present in constructor argument");if(this.width=e.width,void 0===e.height)throw new Error("height must be present in constructor argument");this.height=e.height}}const k=["FRONT","BACK"];class P extends o.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new O({width:1920,height:1080}),void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.zoomSteps&&(this.zoomSteps=e.zoomSteps.map((e=>e))),void 0!==e.defaultZoomFactor&&(this.defaultZoomFactor=e.defaultZoomFactor),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.idealPreviewResolution&&(this.idealPreviewResolution=new O(e.idealPreviewResolution))}}class L extends o.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new r.i({color:"?sbColorOnSurface"}),this.closeButton=new r.e({text:"?cameraPermissionCloseButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary"})}),this.enableCameraTitle=new r.p({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),this.enableCameraExplanation=new r.p({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"}),void 0!==e.background&&(this.background=e.background),void 0!==e.iconBackground&&(this.iconBackground=e.iconBackground),void 0!==e.icon&&(this.icon=new r.i(e.icon)),void 0!==e.closeButton&&(this.closeButton=new r.e(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new r.p(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new r.p(e.enableCameraExplanation))}}var _,R;!function(e){e.From=function(e){const t=e._type;switch(t){case"ViewFinderConfiguration":return new M(e);case"PermanentViewFinderConfiguration":return new F(e);default:throw`Unknown child class name: ${t}`}}}(_||(_={}));class M extends o.a{constructor(e={}){super(),this._type="ViewFinderConfiguration",this.style=new N({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new T.a({width:1,height:1}),this.minimumInsets=new r.f({top:16,left:16,bottom:16,right:16}),this.preferredHeight=-1,this.visible=!0,void 0!==e.style&&(this.style=R.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new T.a(e.aspectRatio)),void 0!==e.minimumInsets&&(this.minimumInsets=new r.f(e.minimumInsets)),void 0!==e.preferredHeight&&(this.preferredHeight=e.preferredHeight),void 0!==e.visible&&(this.visible=e.visible)}}class F extends o.a{constructor(e={}){super(),this._type="PermanentViewFinderConfiguration",this.style=new N({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new T.a({width:1,height:1}),this.minimumInsets=new r.f({top:16,left:16,bottom:16,right:16}),this.preferredHeight=-1,void 0!==e.style&&(this.style=R.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new T.a(e.aspectRatio)),void 0!==e.minimumInsets&&(this.minimumInsets=new r.f(e.minimumInsets)),void 0!==e.preferredHeight&&(this.preferredHeight=e.preferredHeight)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new N(e);case"FinderStrokedStyle":return new V(e);default:throw`Unknown child class name: ${t}`}}}(R||(R={}));class N extends o.a{constructor(e={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class V extends o.a{constructor(e={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}var W=n(36),j=n(16);class z extends o.a{constructor(e={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new r.j({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new S({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new W.a({title:new r.p({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new r.e({visible:!0,text:"?topBarCancelButton",accessibilityDescription:"?accessibilityDescriptionCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new I({flashButton:new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionFlashButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionFlipCameraButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"})}),this.viewFinder=new M({style:new N({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new T.a({width:1,height:1}),visible:!0}),this.userGuidance=new j.b({visible:!0,title:new r.p({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new r.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new L({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new r.i({visible:!0,color:"?sbColorOnSurface"}),closeButton:new r.e({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new r.p({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new r.p({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new P({}),this.scannerConfiguration=new E({}),this.useCase=new u({}),this.sound=new r.n({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new r.r({enabled:!0}),this.timeouts=new r.q({autoCancelTimeout:0,initialScanDelay:0}),void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.palette&&(this.palette=new r.j(e.palette)),void 0!==e.localization&&(this.localization=new S(e.localization)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.topBar&&(this.topBar=new W.a(e.topBar)),void 0!==e.actionBar&&(this.actionBar=new I(e.actionBar)),void 0!==e.viewFinder&&(this.viewFinder=new M(e.viewFinder)),void 0!==e.userGuidance&&(this.userGuidance=new j.b(e.userGuidance)),void 0!==e.cameraPermission&&(this.cameraPermission=new L(e.cameraPermission)),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new P(e.cameraConfiguration)),void 0!==e.scannerConfiguration&&(this.scannerConfiguration=new E(e.scannerConfiguration)),void 0!==e.useCase&&(this.useCase=A.From(e.useCase)),void 0!==e.sound&&(this.sound=new r.n(e.sound)),void 0!==e.vibration&&(this.vibration=new r.r(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new r.q(e.timeouts))}}const H=["BAD_QUALITY","ALWAYS","NONE"];class U extends o.a{constructor(e={}){super(),this.retakeButton=new r.d({title:new r.p({text:"?acknowledgementRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementRetakeButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.acceptWhenOkButton=new r.d({title:new r.p({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.acceptWhenNotOkButton=new r.d({title:new r.p({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),void 0!==e.retakeButton&&(this.retakeButton=new r.d(e.retakeButton)),void 0!==e.acceptWhenOkButton&&(this.acceptWhenOkButton=new r.d(e.acceptWhenOkButton)),void 0!==e.acceptWhenNotOkButton&&(this.acceptWhenNotOkButton=new r.d(e.acceptWhenNotOkButton))}}class Z extends o.a{constructor(e={}){super(),this.topBarTitle=new r.p({visible:!1,text:"?acknowledgementTitle",color:"?sbColorOnPrimary"}),this.minimumQuality="POOR",this.acknowledgementMode="ALWAYS",this.badImageHint=new j.a({visible:!0,icon:new r.i({color:"?sbColorOnPrimary"}),title:new r.p({text:"?acknowledgementScreenBadDocumentHint",color:"?sbColorOnPrimary"}),background:new r.a({strokeColor:"?sbColorNegative",fillColor:"?sbColorNegative",strokeWidth:0})}),this.backgroundColor="?sbColorOutline",this.bottomBar=new U({}),void 0!==e.topBarTitle&&(this.topBarTitle=new r.p(e.topBarTitle)),void 0!==e.minimumQuality&&(this.minimumQuality=e.minimumQuality),void 0!==e.acknowledgementMode&&(this.acknowledgementMode=e.acknowledgementMode),void 0!==e.badImageHint&&(this.badImageHint=new j.a(e.badImageHint)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new U(e.bottomBar))}}class G extends o.a{constructor(e={}){super(),this.cameraModule="BACK",this.autoCropOnManualSnap=!0,this.flashEnabled=!1,this.idealPreviewResolution=new O({width:1920,height:1080}),this.autoSnappingSensitivity=.66,this.autoSnappingDelay=200,this.autoSnappingEnabled=!0,void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.autoCropOnManualSnap&&(this.autoCropOnManualSnap=e.autoCropOnManualSnap),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.idealPreviewResolution&&(this.idealPreviewResolution=new O(e.idealPreviewResolution)),void 0!==e.autoSnappingSensitivity&&(this.autoSnappingSensitivity=e.autoSnappingSensitivity),void 0!==e.autoSnappingDelay&&(this.autoSnappingDelay=e.autoSnappingDelay),void 0!==e.autoSnappingEnabled&&(this.autoSnappingEnabled=e.autoSnappingEnabled)}}var Y=n(59);class Q extends o.a{constructor(e={}){super(),this.noDocumentFound="?cameraUserGuidanceNoDocumentFound",this.badAspectRatio="?cameraUserGuidanceBadAspectRatio",this.badAngles="?cameraUserGuidanceBadAngles",this.orientationMismatch="?cameraUserGuidanceOrientationMismatch",this.textHintOffCenter="?cameraUserGuidanceTextHintOffCenter",this.tooSmall="?cameraUserGuidanceTooSmall",this.tooNoisy="?cameraUserGuidanceTooNoisy",this.tooDark="?cameraUserGuidanceTooDark",this.energySaveMode="?cameraUserGuidanceEnergySaveMode",this.readyToCapture="?cameraUserGuidanceReadyToCapture",this.capturing="?cameraUserGuidanceReadyToCapture",this.captureManual="?cameraUserGuidanceReadyToCaptureManual",void 0!==e.noDocumentFound&&(this.noDocumentFound=e.noDocumentFound),void 0!==e.badAspectRatio&&(this.badAspectRatio=e.badAspectRatio),void 0!==e.badAngles&&(this.badAngles=e.badAngles),void 0!==e.orientationMismatch&&(this.orientationMismatch=e.orientationMismatch),void 0!==e.textHintOffCenter&&(this.textHintOffCenter=e.textHintOffCenter),void 0!==e.tooSmall&&(this.tooSmall=e.tooSmall),void 0!==e.tooNoisy&&(this.tooNoisy=e.tooNoisy),void 0!==e.tooDark&&(this.tooDark=e.tooDark),void 0!==e.energySaveMode&&(this.energySaveMode=e.energySaveMode),void 0!==e.readyToCapture&&(this.readyToCapture=e.readyToCapture),void 0!==e.capturing&&(this.capturing=e.capturing),void 0!==e.captureManual&&(this.captureManual=e.captureManual)}}class q extends o.a{constructor(e={}){super(),this.visibility="ENABLED",this.title=new r.p({text:"?cameraUserGuidanceStart",color:"?sbColorOnPrimary"}),this.background=new r.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceHigh"}),this.statesTitles=new Q({}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.background&&(this.background=new r.a(e.background)),void 0!==e.statesTitles&&(this.statesTitles=new Q(e.statesTitles))}}var X,K,J=n(22);class $ extends o.a{constructor(e={}){super(),this.enabledInAutoSnappingMode=!0,this.accessibilityDescription="?accessibilityDescriptionCameraShutterButton",this.outerColor="?sbColorOnPrimary",this.innerColor="?sbColorOnPrimary",void 0!==e.enabledInAutoSnappingMode&&(this.enabledInAutoSnappingMode=e.enabledInAutoSnappingMode),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.outerColor&&(this.outerColor=e.outerColor),void 0!==e.innerColor&&(this.innerColor=e.innerColor)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PagePreviewMode":return new te(e);case"TextButtonMode":return new ne(e);case"NoButtonMode":return new ie(e);default:throw`Unknown child class name: ${t}`}}}(X||(X={}));class ee extends o.a{constructor(e={}){super(),this.visible=!0,this.backgroundColor="?sbColorModalOverlay",this.foregroundColor="?sbColorSurface",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class te extends o.a{constructor(e={}){super(),this._type="PagePreviewMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.imagePlaceholderColor="?sbColorOnSurfaceVariant",this.pageCounter=new r.b({visible:!0,background:new r.a({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface"}),foregroundColor:"?sbColorPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.imagePlaceholderColor&&(this.imagePlaceholderColor=e.imagePlaceholderColor),void 0!==e.pageCounter&&(this.pageCounter=new r.b(e.pageCounter))}}class ne extends o.a{constructor(e={}){super(),this._type="TextButtonMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.style=new r.p({text:"?cameraPreviewButtonTitle",color:"?sbColorOnPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.style&&(this.style=new r.p(e.style))}}class ie extends o.a{constructor(e={}){super(),this._type="NoButtonMode",this.visible=!1,void 0!==e.visible&&(this.visible=e.visible)}}class re extends o.a{constructor(e={}){super(),this.importButton=new r.d({title:new r.p({visible:!1,text:"?cameraImportButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraImportButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.autoSnappingModeButton=new r.d({title:new r.p({visible:!1,text:"?cameraAutoSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraAutoSnapButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.manualSnappingModeButton=new r.d({title:new r.p({visible:!1,text:"?cameraManualSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraManualSnapButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.shutterButton=new $({accessibilityDescription:"?accessibilityDescriptionCameraShutterButton"}),this.torchOnButton=new r.d({title:new r.p({visible:!1,text:"?cameraTorchOnButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOnButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.torchOffButton=new r.d({title:new r.p({visible:!1,text:"?cameraTorchOffButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOffButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.previewButton=new te({}),void 0!==e.importButton&&(this.importButton=new r.d(e.importButton)),void 0!==e.autoSnappingModeButton&&(this.autoSnappingModeButton=new r.d(e.autoSnappingModeButton)),void 0!==e.manualSnappingModeButton&&(this.manualSnappingModeButton=new r.d(e.manualSnappingModeButton)),void 0!==e.shutterButton&&(this.shutterButton=new $(e.shutterButton)),void 0!==e.torchOnButton&&(this.torchOnButton=new r.d(e.torchOnButton)),void 0!==e.torchOffButton&&(this.torchOffButton=new r.d(e.torchOffButton)),void 0!==e.previewButton&&(this.previewButton=X.From(e.previewButton))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PageSnapFunnelAnimation":return new oe(e);case"PageSnapCheckMarkAnimation":return new ae(e);case"PageSnapFeedbackNone":return new se(e);default:throw`Unknown child class name: ${t}`}}}(K||(K={}));class oe extends o.a{constructor(e={}){super(),this._type="PageSnapFunnelAnimation",this.overlayColor="?sbColorModalOverlay",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor)}}class ae extends o.a{constructor(e={}){super(),this._type="PageSnapCheckMarkAnimation",this.overlayColor="?sbColorModalOverlay",this.checkMarkBackgroundColor="?sbColorOutline",this.checkMarkColor="#00000000",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.checkMarkBackgroundColor&&(this.checkMarkBackgroundColor=e.checkMarkBackgroundColor),void 0!==e.checkMarkColor&&(this.checkMarkColor=e.checkMarkColor)}}class se extends o.a{constructor(e={}){super(),this._type="PageSnapFeedbackNone"}}class ce extends o.a{constructor(e={}){super(),this.cameraBlinkEnabled=!0,this.snapFeedbackMode=new oe({}),void 0!==e.cameraBlinkEnabled&&(this.cameraBlinkEnabled=e.cameraBlinkEnabled),void 0!==e.snapFeedbackMode&&(this.snapFeedbackMode=K.From(e.snapFeedbackMode))}}class ue extends o.a{constructor(e={}){super(),this.visibility="ENABLED",this.documentOk=new r.k({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2}),this.documentNotOk=new r.k({strokeColor:"?sbColorNegative",fillColor:"#00000000",strokeWidth:2}),this.autoSnapProgress=new r.k({strokeColor:"#40A9FF",fillColor:"#00000000",strokeWidth:2}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.documentOk&&(this.documentOk=new r.k(e.documentOk)),void 0!==e.documentNotOk&&(this.documentNotOk=new r.k(e.documentNotOk)),void 0!==e.autoSnapProgress&&(this.autoSnapProgress=new r.k(e.autoSnapProgress))}}class le extends o.a{constructor(e={}){super(),this.button=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraSelectButton"}),this.backgroundColor="?sbColorSurface",this.title=new r.p({text:"?cameraSelectCameraMenuTitle",color:"?sbColorOnSurfaceVariant"}),this.dividerColor="?sbColorOutline",this.menuEntry=new r.l({title:new r.p({color:"?sbColorOnSurface"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new r.i({color:"?sbColorOnSurface"})}),this.menuEntryActive=new r.l({title:new r.p({color:"?sbColorPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new r.i({color:"?sbColorPrimary"})}),void 0!==e.button&&(this.button=new r.h(e.button)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.menuEntry&&(this.menuEntry=new r.l(e.menuEntry)),void 0!==e.menuEntryActive&&(this.menuEntryActive=new r.l(e.menuEntryActive))}}class de extends o.a{constructor(e={}){super(),this.acknowledgement=new Z({}),this.introduction=new J.h({}),this.scanAssistanceOverlay=new ee({}),this.cameraPermission=new L({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new r.i({visible:!0,color:"?sbColorOnSurface"}),closeButton:new r.e({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),enableCameraTitle:new r.p({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new r.p({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.topBarTitle=new r.p({text:"?cameraTopBarTitle",color:"?sbColorOnPrimary"}),this.topBarIntroButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraTopBarIntroButton"}),this.topBarBackButton=new r.e({visible:!0,text:"?cameraTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraTopBarCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarCameraSelect=new le({}),this.topUserGuidance=new j.b({title:new r.p({text:"?cameraTopGuidance",color:"?sbColorOnPrimary"})}),this.userGuidance=new q({}),this.backgroundColor="#000000FF",this.autoRotateImages=!1,this.cameraConfiguration=new G({}),this.scannerParameters=new Y.b({}),this.polygon=new ue({}),this.bottomBar=new re({}),this.viewFinder=new M({aspectRatio:new T.a({width:21,height:29}),visible:!1}),this.captureFeedback=new ce({}),this.vibration=new r.r({enabled:!0}),this.timeouts=new r.q({autoCancelTimeout:0,initialScanDelay:0}),this.limitReachedAlertDialog=new y({title:new r.p({text:"?cameraLimitReachedAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?cameraLimitReachedAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new r.e({text:"?cameraLimitReachedOkButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraLimitReachedOkButton",background:new r.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),cancelButton:new r.e({visible:!1})}),this.cancelAlertDialog=new y({title:new r.p({text:"?cameraCancelAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?cameraCancelAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new r.e({text:"?cameraCancelYesButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelYesButton",background:new r.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),cancelButton:new r.e({text:"?cameraCancelNoButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelNoButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorPrimary"})})}),void 0!==e.acknowledgement&&(this.acknowledgement=new Z(e.acknowledgement)),void 0!==e.introduction&&(this.introduction=new J.h(e.introduction)),void 0!==e.scanAssistanceOverlay&&(this.scanAssistanceOverlay=new ee(e.scanAssistanceOverlay)),void 0!==e.cameraPermission&&(this.cameraPermission=new L(e.cameraPermission)),void 0!==e.topBarTitle&&(this.topBarTitle=new r.p(e.topBarTitle)),void 0!==e.topBarIntroButton&&(this.topBarIntroButton=new r.h(e.topBarIntroButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new r.e(e.topBarBackButton)),void 0!==e.topBarCameraSelect&&(this.topBarCameraSelect=new le(e.topBarCameraSelect)),void 0!==e.topUserGuidance&&(this.topUserGuidance=new j.b(e.topUserGuidance)),void 0!==e.userGuidance&&(this.userGuidance=new q(e.userGuidance)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.autoRotateImages&&(this.autoRotateImages=e.autoRotateImages),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new G(e.cameraConfiguration)),void 0!==e.scannerParameters&&(this.scannerParameters=new Y.b(e.scannerParameters)),void 0!==e.polygon&&(this.polygon=new ue(e.polygon)),void 0!==e.bottomBar&&(this.bottomBar=new re(e.bottomBar)),void 0!==e.viewFinder&&(this.viewFinder=new M(e.viewFinder)),void 0!==e.captureFeedback&&(this.captureFeedback=new ce(e.captureFeedback)),void 0!==e.vibration&&(this.vibration=new r.r(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new r.q(e.timeouts)),void 0!==e.limitReachedAlertDialog&&(this.limitReachedAlertDialog=new y(e.limitReachedAlertDialog)),void 0!==e.cancelAlertDialog&&(this.cancelAlertDialog=new y(e.cancelAlertDialog))}}class me extends o.a{constructor(e={}){super(),this.detectButton=new r.d({title:new r.p({text:"?croppingDetectButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingDetectButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.rotateButton=new r.d({title:new r.p({text:"?croppingRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingRotateButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.resetButton=new r.d({title:new r.p({text:"?croppingResetButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingResetButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),void 0!==e.detectButton&&(this.detectButton=new r.d(e.detectButton)),void 0!==e.rotateButton&&(this.rotateButton=new r.d(e.rotateButton)),void 0!==e.resetButton&&(this.resetButton=new r.d(e.resetButton))}}class he extends o.a{constructor(e={}){super(),this.topBarBackButton=new r.e({visible:!0,text:"?croppingTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarTitle=new r.p({text:"?croppingScreenTitle",color:"?sbColorOnPrimary"}),this.topBarConfirmButton=new r.e({visible:!0,text:"?croppingTopBarConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarConfirmButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.backgroundColor="?sbColorOutline",this.croppingHandlerColor="?sbColorSurface",this.croppingPolygonColor="?sbColorSurface",this.croppingPolygonMagneticLineColor="?sbColorSurface",this.bottomBar=new me({}),void 0!==e.topBarBackButton&&(this.topBarBackButton=new r.e(e.topBarBackButton)),void 0!==e.topBarTitle&&(this.topBarTitle=new r.p(e.topBarTitle)),void 0!==e.topBarConfirmButton&&(this.topBarConfirmButton=new r.e(e.topBarConfirmButton)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.croppingHandlerColor&&(this.croppingHandlerColor=e.croppingHandlerColor),void 0!==e.croppingPolygonColor&&(this.croppingPolygonColor=e.croppingPolygonColor),void 0!==e.croppingPolygonMagneticLineColor&&(this.croppingPolygonMagneticLineColor=e.croppingPolygonMagneticLineColor),void 0!==e.bottomBar&&(this.bottomBar=new me(e.bottomBar))}}const fe=["ENABLED","AUTO_CAPTURE_ONLY","DISABLED"];var pe=n(81);const ge=["FILTERED_DOCUMENT","UNFILTERED_DOCUMENT"];class ve extends o.a{constructor(e={}){super(),this.pagesScanLimit=0,this.documentImageSizeLimit=0,this.documentAnalysisMode="UNFILTERED_DOCUMENT",this.defaultFilter=null,void 0!==e.pagesScanLimit&&(this.pagesScanLimit=e.pagesScanLimit),void 0!==e.documentImageSizeLimit&&(this.documentImageSizeLimit=e.documentImageSizeLimit),void 0!==e.documentAnalysisMode&&(this.documentAnalysisMode=e.documentAnalysisMode),void 0!==e.defaultFilter&&(this.defaultFilter=null!=e.defaultFilter?pe.a.From(e.defaultFilter):null)}}class ye extends o.a{constructor(e={}){super(),this.addButton=new r.d({title:new r.p({text:"?reviewScreenAddButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewAddButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.retakeButton=new r.d({title:new r.p({text:"?reviewScreenRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRetakeButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.cropButton=new r.d({title:new r.p({text:"?reviewScreenCropButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewCropButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.rotateButton=new r.d({title:new r.p({text:"?reviewScreenRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRotateButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.deleteButton=new r.d({title:new r.p({text:"?reviewScreenDeleteButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.submitButton=new r.e({text:"?reviewScreenSubmitButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewSubmitButton",background:new r.a({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnSurface"})}),void 0!==e.addButton&&(this.addButton=new r.d(e.addButton)),void 0!==e.retakeButton&&(this.retakeButton=new r.d(e.retakeButton)),void 0!==e.cropButton&&(this.cropButton=new r.d(e.cropButton)),void 0!==e.rotateButton&&(this.rotateButton=new r.d(e.rotateButton)),void 0!==e.deleteButton&&(this.deleteButton=new r.d(e.deleteButton)),void 0!==e.submitButton&&(this.submitButton=new r.e(e.submitButton))}}class Ce extends o.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.deleteAll=new r.l({title:new r.p({text:"?reviewScreenDeleteAllButtonTitle",color:"?sbColorNegative"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllButton",icon:new r.i({color:"?sbColorNegative"})}),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.deleteAll&&(this.deleteAll=new r.l(e.deleteAll))}}class be extends o.a{constructor(e={}){super(),this.overlayColor="?sbColorModalOverlay",this.closeButton=new r.e({text:"?zoomOverlayCancelButtonText",accessibilityDescription:"?accessibilityDescriptionZoomOverlayCancelButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.closeButton&&(this.closeButton=new r.e(e.closeButton))}}class Ae extends o.a{constructor(e={}){super(),this.enabled=!0,this.topBarTitle=new r.p({text:"?reviewScreenTitle",color:"?sbColorOnPrimary"}),this.topBarMoreButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewMoreButton"}),this.topBarBackButton=new r.e({visible:!0,text:"?reviewTopBarBackButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewTopBarBackButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.morePopup=new Ce({}),this.zoomButton=new r.m({accessibilityDescription:"?accessibilityDescriptionReviewZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary"}),this.zoomOverlay=new be({}),this.backgroundColor="?sbColorOnSurfaceVariant",this.bottomBar=new ye({}),this.switchNextPageButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewNextPageButton"}),this.switchPreviousPageButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewPreviousPageButton"}),this.pageCounter=new j.b({title:new r.p({text:"?reviewScreenPageCount",color:"?sbColorOnPrimary"}),background:new r.a({fillColor:"?sbColorSurfaceHigh",strokeWidth:0})}),this.deleteAllPagesAlertDialog=new y({title:new r.p({text:"?reviewDeleteAllPagesAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?reviewDeleteAllPagesAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new r.e({text:"?reviewDeleteAllPagesAlertDeleteButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton",background:new r.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),actionButton:new r.e({visible:!1}),cancelButton:new r.e({text:"?reviewDeleteAllPagesAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorPrimary"})})}),this.deletePageAlertDialog=new y({title:new r.p({text:"?reviewDeletePageAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?reviewDeletePageAlertSubTitle",color:"?sbColorOnSurfaceVariant"}),okButton:new r.e({text:"?reviewDeletePageAlertConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertConfirmButton",background:new r.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),actionButton:new r.e({text:"?reviewDeletePageAlertDeleteRetakeButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorPrimary"})}),cancelButton:new r.e({text:"?reviewDeletePageAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertCancelButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorPrimary"})})}),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.topBarTitle&&(this.topBarTitle=new r.p(e.topBarTitle)),void 0!==e.topBarMoreButton&&(this.topBarMoreButton=new r.h(e.topBarMoreButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new r.e(e.topBarBackButton)),void 0!==e.morePopup&&(this.morePopup=new Ce(e.morePopup)),void 0!==e.zoomButton&&(this.zoomButton=new r.m(e.zoomButton)),void 0!==e.zoomOverlay&&(this.zoomOverlay=new be(e.zoomOverlay)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new ye(e.bottomBar)),void 0!==e.switchNextPageButton&&(this.switchNextPageButton=new r.h(e.switchNextPageButton)),void 0!==e.switchPreviousPageButton&&(this.switchPreviousPageButton=new r.h(e.switchPreviousPageButton)),void 0!==e.pageCounter&&(this.pageCounter=new j.b(e.pageCounter)),void 0!==e.deleteAllPagesAlertDialog&&(this.deleteAllPagesAlertDialog=new y(e.deleteAllPagesAlertDialog)),void 0!==e.deletePageAlertDialog&&(this.deletePageAlertDialog=new y(e.deletePageAlertDialog))}}class Se extends o.a{constructor(e={}){super(),this.camera=new de({}),this.review=new Ae({}),this.cropping=new he({}),void 0!==e.camera&&(this.camera=new de(e.camera)),void 0!==e.review&&(this.review=new Ae(e.review)),void 0!==e.cropping&&(this.cropping=new he(e.cropping))}}class we extends o.a{constructor(e={}){super(),this.cameraTopBarCancelButtonTitle="Cancel",this.cameraTopBarTitle="Scan Document",this.cameraTopGuidance="Scan each page of your document.",this.cameraUserGuidanceStart="Please hold your device over a document.",this.cameraUserGuidanceNoDocumentFound="No document found",this.cameraUserGuidanceBadAspectRatio="Bad aspect ratio",this.cameraUserGuidanceOrientationMismatch="Orientation mismatch",this.cameraUserGuidanceBadAngles="Bad angles",this.cameraUserGuidanceTooNoisy="Its too noisy. Try another background for the document",this.cameraUserGuidanceTextHintOffCenter="Document is off center",this.cameraUserGuidanceTooSmall="Document is too small. Move camera closer.",this.cameraUserGuidanceTooDark="Its too dark. Add more light.",this.cameraUserGuidanceEnergySaveMode="Energy save mode is on",this.cameraUserGuidanceReadyToCapture="Hold still capturing...",this.cameraUserGuidanceReadyToCaptureManual="Ready to capture!",this.cameraImportButtonTitle="Import",this.cameraTorchOnButtonTitle="On",this.cameraTorchOffButtonTitle="Off",this.cameraAutoSnapButtonTitle="Auto",this.cameraManualSnapButtonTitle="Manual",this.cameraPreviewButtonTitle="%d Pages",this.cameraIntroDoneButton="Done",this.cameraIntroTitle="How to scan a document",this.cameraIntroSubtitle="Follow the steps below to create a high-quality document scan",this.cameraIntroItem1="1. Place your document on a flat surface.",this.cameraIntroItem2="2. Hold your phone above the document.",this.cameraIntroItem3="3. Follow the on-screen guidance to find the optimal position.",this.cameraIntroItem4="4. Once you reach the optimal position, you can manually scan the document or let the app scan it automatically.",this.cameraProgressOverlayTitle="Please wait...",this.cameraCancelAlertTitle="Cancel?",this.cameraCancelAlertSubtitle="Canceling will delete all the pages scanned so far. Are you sure you want to cancel?",this.cameraCancelNoButtonTitle="No",this.cameraCancelYesButtonTitle="Yes, Cancel",this.cameraLimitReachedAlertTitle="You reached the limit!",this.cameraLimitReachedAlertSubtitle="You have scanned the maximum number of pages and cannot add any more. Please delete at least one page to perform a new scan.",this.cameraLimitReachedOkButtonTitle="Ok",this.cameraSelectCameraMenuTitle="Select camera",this.acknowledgementScreenBadDocumentHint="The quality of your scan does not seem sufficient.",this.acknowledgementRetakeButtonTitle="Retake",this.acknowledgementAcceptButtonTitle="Use Scan",this.reviewScreenTitle="Review (%d)",this.reviewTopBarBackButtonTitle="Back",this.reviewScreenPageCount="Page %d/%d",this.reviewScreenAddButtonTitle="Add",this.reviewScreenRetakeButtonTitle="Retake",this.reviewScreenCropButtonTitle="Crop",this.reviewScreenRotateButtonTitle="Rotate",this.reviewScreenDeleteButtonTitle="Delete",this.reviewScreenSubmitButtonTitle="Submit",this.reviewScreenDeleteAllButtonTitle="Delete all",this.reviewScreenReorderPagesButtonTitle="Reorder pages",this.zoomOverlayCancelButtonText="Close",this.reviewDeletePageAlertTitle="Delete page?",this.reviewDeleteAllPagesAlertTitle="Delete all?",this.reviewDeletePageAlertSubTitle="Are you sure you want to delete the page?",this.reviewDeleteAllPagesAlertSubtitle="Are you sure you want to delete all pages?",this.reviewDeletePageAlertConfirmButtonTitle="Yes, Delete",this.reviewDeleteAllPagesAlertDeleteButtonTitle="Yes, Delete all",this.reviewDeletePageAlertDeleteRetakeButtonTitle="Delete and Retake",this.reviewDeletePageAlertCancelButtonTitle="Cancel",this.reviewDeleteAllPagesAlertCancelButtonTitle="Cancel",this.acknowledgementTitle="Acknowledgement",this.reorderPageTitle="Reorder Pages",this.reorderPageGuidanceTitle="Drag pages to reorder",this.reorderPageText="%d",this.reorderTopBarConfirmButtonTitle="Done",this.reorderTopBarCancelButtonTitle="Cancel",this.croppingTopBarConfirmButtonTitle="Done",this.croppingTopBarCancelButtonTitle="Cancel",this.croppingDetectButtonTitle="Detect",this.croppingRotateButtonTitle="Rotate",this.croppingResetButtonTitle="Reset",this.croppingScreenTitle="Crop",this.accessibilityDescriptionCameraTopBarIntroButton="Tap to open introduction screen",this.accessibilityDescriptionCameraTopBarCancelButton="Tap to close scanner screen",this.accessibilityDescriptionCameraImportButton="Tap to import image",this.accessibilityDescriptionCameraTorchOnButton="Tap to disable torch",this.accessibilityDescriptionCameraTorchOffButton="Tap to enable torch",this.accessibilityDescriptionCameraShutterButton="Tap to take image",this.accessibilityDescriptionCameraAutoSnapButton="Tap to enable manual snapping mode",this.accessibilityDescriptionCameraManualSnapButton="Tap to enable auto snapping mode",this.accessibilityDescriptionCameraPreviewButton="Tap to preview scanned pages",this.accessibilityDescriptionCameraIntroDoneButton="Tap to close introduction screen",this.accessibilityDescriptionCameraSelectButton="Tap to open camera selection menu",this.accessibilityDescriptionCameraSelectMenuItem="Tap to select camera",this.accessibilityDescriptionAcknowledgementRetakeButton="Tap to retake the image",this.accessibilityDescriptionAcknowledgementAcceptButton="Tap to accept the image regardless of its quality",this.accessibilityDescriptionCroppingTopBarConfirmButton="Tap to apply changes",this.accessibilityDescriptionCroppingTopBarCancelButton="Tap to close screen without applying changes",this.accessibilityDescriptionCroppingDetectButton="Tap to detect document on the image",this.accessibilityDescriptionCroppingRotateButton="Tap to rotate document",this.accessibilityDescriptionCroppingResetButton="Tap to reset document contour to whole image",this.accessibilityDescriptionReorderTopBarConfirmButton="Tap to apply changes",this.accessibilityDescriptionReorderTopBarCancelButton="Tap to close screen without applying changes",this.accessibilityDescriptionReviewNextPageButton="Tap to switch to the new page",this.accessibilityDescriptionReviewPreviousPageButton="Tap to switch to the previous page",this.accessibilityDescriptionReviewAddButton="Tap to Add new page",this.accessibilityDescriptionReviewRetakeButton="Tap to Retake current selected page",this.accessibilityDescriptionReviewCropButton="Tap to Crop selected page",this.accessibilityDescriptionReviewRotateButton="Tap to Rotate selected page clockwise",this.accessibilityDescriptionReviewDeleteButton="Tap to Delete selected page",this.accessibilityDescriptionReviewSubmitButton="Tap to Submit document",this.accessibilityDescriptionReviewMoreButton="Tap to show additional options",this.accessibilityDescriptionReviewDeleteAllButton="Tap to Delete all pages",this.accessibilityDescriptionReviewReorderPagesButton="Tap to Reorder pages",this.accessibilityDescriptionZoomOverlayCancelButton="Tap to Close zoom overlay",this.accessibilityDescriptionReviewZoomButton="Tap to open zoom overlay for selected page",this.accessibilityDescriptionReviewTopBarBackButton="Tap to Close review screen",this.accessibilityDescriptionReviewDeletePageAlertConfirmButton="Tap to Delete page",this.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton="Tap to Delete all pages",this.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton="Tap to Delete page and Retake it",this.accessibilityDescriptionReviewDeletePageAlertCancelButton="Tap to Cancel operation",this.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton="Tap to Cancel operation",this.accessibilityDescriptionCameraLimitReachedOkButton="Tap to close alert dialog",this.accessibilityDescriptionCameraCancelYesButton="Tap to cancel document",this.accessibilityDescriptionCameraCancelNoButton="Tap to close alert dialog",this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionEnableCameraButton="Grant permission",this.cameraPermissionCloseButton="Close",this.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",void 0!==e.cameraTopBarCancelButtonTitle&&(this.cameraTopBarCancelButtonTitle=e.cameraTopBarCancelButtonTitle),void 0!==e.cameraTopBarTitle&&(this.cameraTopBarTitle=e.cameraTopBarTitle),void 0!==e.cameraTopGuidance&&(this.cameraTopGuidance=e.cameraTopGuidance),void 0!==e.cameraUserGuidanceStart&&(this.cameraUserGuidanceStart=e.cameraUserGuidanceStart),void 0!==e.cameraUserGuidanceNoDocumentFound&&(this.cameraUserGuidanceNoDocumentFound=e.cameraUserGuidanceNoDocumentFound),void 0!==e.cameraUserGuidanceBadAspectRatio&&(this.cameraUserGuidanceBadAspectRatio=e.cameraUserGuidanceBadAspectRatio),void 0!==e.cameraUserGuidanceOrientationMismatch&&(this.cameraUserGuidanceOrientationMismatch=e.cameraUserGuidanceOrientationMismatch),void 0!==e.cameraUserGuidanceBadAngles&&(this.cameraUserGuidanceBadAngles=e.cameraUserGuidanceBadAngles),void 0!==e.cameraUserGuidanceTooNoisy&&(this.cameraUserGuidanceTooNoisy=e.cameraUserGuidanceTooNoisy),void 0!==e.cameraUserGuidanceTextHintOffCenter&&(this.cameraUserGuidanceTextHintOffCenter=e.cameraUserGuidanceTextHintOffCenter),void 0!==e.cameraUserGuidanceTooSmall&&(this.cameraUserGuidanceTooSmall=e.cameraUserGuidanceTooSmall),void 0!==e.cameraUserGuidanceTooDark&&(this.cameraUserGuidanceTooDark=e.cameraUserGuidanceTooDark),void 0!==e.cameraUserGuidanceEnergySaveMode&&(this.cameraUserGuidanceEnergySaveMode=e.cameraUserGuidanceEnergySaveMode),void 0!==e.cameraUserGuidanceReadyToCapture&&(this.cameraUserGuidanceReadyToCapture=e.cameraUserGuidanceReadyToCapture),void 0!==e.cameraUserGuidanceReadyToCaptureManual&&(this.cameraUserGuidanceReadyToCaptureManual=e.cameraUserGuidanceReadyToCaptureManual),void 0!==e.cameraImportButtonTitle&&(this.cameraImportButtonTitle=e.cameraImportButtonTitle),void 0!==e.cameraTorchOnButtonTitle&&(this.cameraTorchOnButtonTitle=e.cameraTorchOnButtonTitle),void 0!==e.cameraTorchOffButtonTitle&&(this.cameraTorchOffButtonTitle=e.cameraTorchOffButtonTitle),void 0!==e.cameraAutoSnapButtonTitle&&(this.cameraAutoSnapButtonTitle=e.cameraAutoSnapButtonTitle),void 0!==e.cameraManualSnapButtonTitle&&(this.cameraManualSnapButtonTitle=e.cameraManualSnapButtonTitle),void 0!==e.cameraPreviewButtonTitle&&(this.cameraPreviewButtonTitle=e.cameraPreviewButtonTitle),void 0!==e.cameraIntroDoneButton&&(this.cameraIntroDoneButton=e.cameraIntroDoneButton),void 0!==e.cameraIntroTitle&&(this.cameraIntroTitle=e.cameraIntroTitle),void 0!==e.cameraIntroSubtitle&&(this.cameraIntroSubtitle=e.cameraIntroSubtitle),void 0!==e.cameraIntroItem1&&(this.cameraIntroItem1=e.cameraIntroItem1),void 0!==e.cameraIntroItem2&&(this.cameraIntroItem2=e.cameraIntroItem2),void 0!==e.cameraIntroItem3&&(this.cameraIntroItem3=e.cameraIntroItem3),void 0!==e.cameraIntroItem4&&(this.cameraIntroItem4=e.cameraIntroItem4),void 0!==e.cameraProgressOverlayTitle&&(this.cameraProgressOverlayTitle=e.cameraProgressOverlayTitle),void 0!==e.cameraCancelAlertTitle&&(this.cameraCancelAlertTitle=e.cameraCancelAlertTitle),void 0!==e.cameraCancelAlertSubtitle&&(this.cameraCancelAlertSubtitle=e.cameraCancelAlertSubtitle),void 0!==e.cameraCancelNoButtonTitle&&(this.cameraCancelNoButtonTitle=e.cameraCancelNoButtonTitle),void 0!==e.cameraCancelYesButtonTitle&&(this.cameraCancelYesButtonTitle=e.cameraCancelYesButtonTitle),void 0!==e.cameraLimitReachedAlertTitle&&(this.cameraLimitReachedAlertTitle=e.cameraLimitReachedAlertTitle),void 0!==e.cameraLimitReachedAlertSubtitle&&(this.cameraLimitReachedAlertSubtitle=e.cameraLimitReachedAlertSubtitle),void 0!==e.cameraLimitReachedOkButtonTitle&&(this.cameraLimitReachedOkButtonTitle=e.cameraLimitReachedOkButtonTitle),void 0!==e.cameraSelectCameraMenuTitle&&(this.cameraSelectCameraMenuTitle=e.cameraSelectCameraMenuTitle),void 0!==e.acknowledgementScreenBadDocumentHint&&(this.acknowledgementScreenBadDocumentHint=e.acknowledgementScreenBadDocumentHint),void 0!==e.acknowledgementRetakeButtonTitle&&(this.acknowledgementRetakeButtonTitle=e.acknowledgementRetakeButtonTitle),void 0!==e.acknowledgementAcceptButtonTitle&&(this.acknowledgementAcceptButtonTitle=e.acknowledgementAcceptButtonTitle),void 0!==e.reviewScreenTitle&&(this.reviewScreenTitle=e.reviewScreenTitle),void 0!==e.reviewTopBarBackButtonTitle&&(this.reviewTopBarBackButtonTitle=e.reviewTopBarBackButtonTitle),void 0!==e.reviewScreenPageCount&&(this.reviewScreenPageCount=e.reviewScreenPageCount),void 0!==e.reviewScreenAddButtonTitle&&(this.reviewScreenAddButtonTitle=e.reviewScreenAddButtonTitle),void 0!==e.reviewScreenRetakeButtonTitle&&(this.reviewScreenRetakeButtonTitle=e.reviewScreenRetakeButtonTitle),void 0!==e.reviewScreenCropButtonTitle&&(this.reviewScreenCropButtonTitle=e.reviewScreenCropButtonTitle),void 0!==e.reviewScreenRotateButtonTitle&&(this.reviewScreenRotateButtonTitle=e.reviewScreenRotateButtonTitle),void 0!==e.reviewScreenDeleteButtonTitle&&(this.reviewScreenDeleteButtonTitle=e.reviewScreenDeleteButtonTitle),void 0!==e.reviewScreenSubmitButtonTitle&&(this.reviewScreenSubmitButtonTitle=e.reviewScreenSubmitButtonTitle),void 0!==e.reviewScreenDeleteAllButtonTitle&&(this.reviewScreenDeleteAllButtonTitle=e.reviewScreenDeleteAllButtonTitle),void 0!==e.reviewScreenReorderPagesButtonTitle&&(this.reviewScreenReorderPagesButtonTitle=e.reviewScreenReorderPagesButtonTitle),void 0!==e.zoomOverlayCancelButtonText&&(this.zoomOverlayCancelButtonText=e.zoomOverlayCancelButtonText),void 0!==e.reviewDeletePageAlertTitle&&(this.reviewDeletePageAlertTitle=e.reviewDeletePageAlertTitle),void 0!==e.reviewDeleteAllPagesAlertTitle&&(this.reviewDeleteAllPagesAlertTitle=e.reviewDeleteAllPagesAlertTitle),void 0!==e.reviewDeletePageAlertSubTitle&&(this.reviewDeletePageAlertSubTitle=e.reviewDeletePageAlertSubTitle),void 0!==e.reviewDeleteAllPagesAlertSubtitle&&(this.reviewDeleteAllPagesAlertSubtitle=e.reviewDeleteAllPagesAlertSubtitle),void 0!==e.reviewDeletePageAlertConfirmButtonTitle&&(this.reviewDeletePageAlertConfirmButtonTitle=e.reviewDeletePageAlertConfirmButtonTitle),void 0!==e.reviewDeleteAllPagesAlertDeleteButtonTitle&&(this.reviewDeleteAllPagesAlertDeleteButtonTitle=e.reviewDeleteAllPagesAlertDeleteButtonTitle),void 0!==e.reviewDeletePageAlertDeleteRetakeButtonTitle&&(this.reviewDeletePageAlertDeleteRetakeButtonTitle=e.reviewDeletePageAlertDeleteRetakeButtonTitle),void 0!==e.reviewDeletePageAlertCancelButtonTitle&&(this.reviewDeletePageAlertCancelButtonTitle=e.reviewDeletePageAlertCancelButtonTitle),void 0!==e.reviewDeleteAllPagesAlertCancelButtonTitle&&(this.reviewDeleteAllPagesAlertCancelButtonTitle=e.reviewDeleteAllPagesAlertCancelButtonTitle),void 0!==e.acknowledgementTitle&&(this.acknowledgementTitle=e.acknowledgementTitle),void 0!==e.reorderPageTitle&&(this.reorderPageTitle=e.reorderPageTitle),void 0!==e.reorderPageGuidanceTitle&&(this.reorderPageGuidanceTitle=e.reorderPageGuidanceTitle),void 0!==e.reorderPageText&&(this.reorderPageText=e.reorderPageText),void 0!==e.reorderTopBarConfirmButtonTitle&&(this.reorderTopBarConfirmButtonTitle=e.reorderTopBarConfirmButtonTitle),void 0!==e.reorderTopBarCancelButtonTitle&&(this.reorderTopBarCancelButtonTitle=e.reorderTopBarCancelButtonTitle),void 0!==e.croppingTopBarConfirmButtonTitle&&(this.croppingTopBarConfirmButtonTitle=e.croppingTopBarConfirmButtonTitle),void 0!==e.croppingTopBarCancelButtonTitle&&(this.croppingTopBarCancelButtonTitle=e.croppingTopBarCancelButtonTitle),void 0!==e.croppingDetectButtonTitle&&(this.croppingDetectButtonTitle=e.croppingDetectButtonTitle),void 0!==e.croppingRotateButtonTitle&&(this.croppingRotateButtonTitle=e.croppingRotateButtonTitle),void 0!==e.croppingResetButtonTitle&&(this.croppingResetButtonTitle=e.croppingResetButtonTitle),void 0!==e.croppingScreenTitle&&(this.croppingScreenTitle=e.croppingScreenTitle),void 0!==e.accessibilityDescriptionCameraTopBarIntroButton&&(this.accessibilityDescriptionCameraTopBarIntroButton=e.accessibilityDescriptionCameraTopBarIntroButton),void 0!==e.accessibilityDescriptionCameraTopBarCancelButton&&(this.accessibilityDescriptionCameraTopBarCancelButton=e.accessibilityDescriptionCameraTopBarCancelButton),void 0!==e.accessibilityDescriptionCameraImportButton&&(this.accessibilityDescriptionCameraImportButton=e.accessibilityDescriptionCameraImportButton),void 0!==e.accessibilityDescriptionCameraTorchOnButton&&(this.accessibilityDescriptionCameraTorchOnButton=e.accessibilityDescriptionCameraTorchOnButton),void 0!==e.accessibilityDescriptionCameraTorchOffButton&&(this.accessibilityDescriptionCameraTorchOffButton=e.accessibilityDescriptionCameraTorchOffButton),void 0!==e.accessibilityDescriptionCameraShutterButton&&(this.accessibilityDescriptionCameraShutterButton=e.accessibilityDescriptionCameraShutterButton),void 0!==e.accessibilityDescriptionCameraAutoSnapButton&&(this.accessibilityDescriptionCameraAutoSnapButton=e.accessibilityDescriptionCameraAutoSnapButton),void 0!==e.accessibilityDescriptionCameraManualSnapButton&&(this.accessibilityDescriptionCameraManualSnapButton=e.accessibilityDescriptionCameraManualSnapButton),void 0!==e.accessibilityDescriptionCameraPreviewButton&&(this.accessibilityDescriptionCameraPreviewButton=e.accessibilityDescriptionCameraPreviewButton),void 0!==e.accessibilityDescriptionCameraIntroDoneButton&&(this.accessibilityDescriptionCameraIntroDoneButton=e.accessibilityDescriptionCameraIntroDoneButton),void 0!==e.accessibilityDescriptionCameraSelectButton&&(this.accessibilityDescriptionCameraSelectButton=e.accessibilityDescriptionCameraSelectButton),void 0!==e.accessibilityDescriptionCameraSelectMenuItem&&(this.accessibilityDescriptionCameraSelectMenuItem=e.accessibilityDescriptionCameraSelectMenuItem),void 0!==e.accessibilityDescriptionAcknowledgementRetakeButton&&(this.accessibilityDescriptionAcknowledgementRetakeButton=e.accessibilityDescriptionAcknowledgementRetakeButton),void 0!==e.accessibilityDescriptionAcknowledgementAcceptButton&&(this.accessibilityDescriptionAcknowledgementAcceptButton=e.accessibilityDescriptionAcknowledgementAcceptButton),void 0!==e.accessibilityDescriptionCroppingTopBarConfirmButton&&(this.accessibilityDescriptionCroppingTopBarConfirmButton=e.accessibilityDescriptionCroppingTopBarConfirmButton),void 0!==e.accessibilityDescriptionCroppingTopBarCancelButton&&(this.accessibilityDescriptionCroppingTopBarCancelButton=e.accessibilityDescriptionCroppingTopBarCancelButton),void 0!==e.accessibilityDescriptionCroppingDetectButton&&(this.accessibilityDescriptionCroppingDetectButton=e.accessibilityDescriptionCroppingDetectButton),void 0!==e.accessibilityDescriptionCroppingRotateButton&&(this.accessibilityDescriptionCroppingRotateButton=e.accessibilityDescriptionCroppingRotateButton),void 0!==e.accessibilityDescriptionCroppingResetButton&&(this.accessibilityDescriptionCroppingResetButton=e.accessibilityDescriptionCroppingResetButton),void 0!==e.accessibilityDescriptionReorderTopBarConfirmButton&&(this.accessibilityDescriptionReorderTopBarConfirmButton=e.accessibilityDescriptionReorderTopBarConfirmButton),void 0!==e.accessibilityDescriptionReorderTopBarCancelButton&&(this.accessibilityDescriptionReorderTopBarCancelButton=e.accessibilityDescriptionReorderTopBarCancelButton),void 0!==e.accessibilityDescriptionReviewNextPageButton&&(this.accessibilityDescriptionReviewNextPageButton=e.accessibilityDescriptionReviewNextPageButton),void 0!==e.accessibilityDescriptionReviewPreviousPageButton&&(this.accessibilityDescriptionReviewPreviousPageButton=e.accessibilityDescriptionReviewPreviousPageButton),void 0!==e.accessibilityDescriptionReviewAddButton&&(this.accessibilityDescriptionReviewAddButton=e.accessibilityDescriptionReviewAddButton),void 0!==e.accessibilityDescriptionReviewRetakeButton&&(this.accessibilityDescriptionReviewRetakeButton=e.accessibilityDescriptionReviewRetakeButton),void 0!==e.accessibilityDescriptionReviewCropButton&&(this.accessibilityDescriptionReviewCropButton=e.accessibilityDescriptionReviewCropButton),void 0!==e.accessibilityDescriptionReviewRotateButton&&(this.accessibilityDescriptionReviewRotateButton=e.accessibilityDescriptionReviewRotateButton),void 0!==e.accessibilityDescriptionReviewDeleteButton&&(this.accessibilityDescriptionReviewDeleteButton=e.accessibilityDescriptionReviewDeleteButton),void 0!==e.accessibilityDescriptionReviewSubmitButton&&(this.accessibilityDescriptionReviewSubmitButton=e.accessibilityDescriptionReviewSubmitButton),void 0!==e.accessibilityDescriptionReviewMoreButton&&(this.accessibilityDescriptionReviewMoreButton=e.accessibilityDescriptionReviewMoreButton),void 0!==e.accessibilityDescriptionReviewDeleteAllButton&&(this.accessibilityDescriptionReviewDeleteAllButton=e.accessibilityDescriptionReviewDeleteAllButton),void 0!==e.accessibilityDescriptionReviewReorderPagesButton&&(this.accessibilityDescriptionReviewReorderPagesButton=e.accessibilityDescriptionReviewReorderPagesButton),void 0!==e.accessibilityDescriptionZoomOverlayCancelButton&&(this.accessibilityDescriptionZoomOverlayCancelButton=e.accessibilityDescriptionZoomOverlayCancelButton),void 0!==e.accessibilityDescriptionReviewZoomButton&&(this.accessibilityDescriptionReviewZoomButton=e.accessibilityDescriptionReviewZoomButton),void 0!==e.accessibilityDescriptionReviewTopBarBackButton&&(this.accessibilityDescriptionReviewTopBarBackButton=e.accessibilityDescriptionReviewTopBarBackButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertConfirmButton&&(this.accessibilityDescriptionReviewDeletePageAlertConfirmButton=e.accessibilityDescriptionReviewDeletePageAlertConfirmButton),void 0!==e.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton&&(this.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton=e.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton&&(this.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton=e.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertCancelButton&&(this.accessibilityDescriptionReviewDeletePageAlertCancelButton=e.accessibilityDescriptionReviewDeletePageAlertCancelButton),void 0!==e.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton&&(this.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton=e.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton),void 0!==e.accessibilityDescriptionCameraLimitReachedOkButton&&(this.accessibilityDescriptionCameraLimitReachedOkButton=e.accessibilityDescriptionCameraLimitReachedOkButton),void 0!==e.accessibilityDescriptionCameraCancelYesButton&&(this.accessibilityDescriptionCameraCancelYesButton=e.accessibilityDescriptionCameraCancelYesButton),void 0!==e.accessibilityDescriptionCameraCancelNoButton&&(this.accessibilityDescriptionCameraCancelNoButton=e.accessibilityDescriptionCameraCancelNoButton),void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionEnableCameraButton&&(this.cameraPermissionEnableCameraButton=e.cameraPermissionEnableCameraButton),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton)}}class Ee extends o.a{constructor(e={}){super(),this.topBarBackgroundColor="?sbColorPrimary",this.bottomBarBackgroundColor="?sbColorPrimary",void 0!==e.topBarBackgroundColor&&(this.topBarBackgroundColor=e.topBarBackgroundColor),void 0!==e.bottomBarBackgroundColor&&(this.bottomBarBackgroundColor=e.bottomBarBackgroundColor)}}class De extends o.a{constructor(e={}){super(),this.version="1.0",this.screen="DocumentScanner",this.palette=new r.j({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new we({}),this.appearance=new Ee({}),this.outputSettings=new ve({}),this.screens=new Se({}),this.documentUuid=null,this.cleanScanningSession=!0,void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.palette&&(this.palette=new r.j(e.palette)),void 0!==e.localization&&(this.localization=new we(e.localization)),void 0!==e.appearance&&(this.appearance=new Ee(e.appearance)),void 0!==e.outputSettings&&(this.outputSettings=new ve(e.outputSettings)),void 0!==e.screens&&(this.screens=new Se(e.screens)),void 0!==e.documentUuid&&(this.documentUuid=null!=e.documentUuid?e.documentUuid:null),void 0!==e.cleanScanningSession&&(this.cleanScanningSession=e.cleanScanningSession)}}var xe;!function(e){e.From=function(e){const t=e._type;switch(t){case"TwoLineMRZFinderLayoutPreset":return new Be(e);case"ThreeLineMRZFinderLayoutPreset":return new Ie(e);case"NoLayoutPreset":return new Te(e);default:throw`Unknown child class name: ${t}`}}}(xe||(xe={}));class Be extends o.a{constructor(e={}){super(),this._type="TwoLineMRZFinderLayoutPreset",this.mrzTextLine1="I<USASMITH<<JACK<<<<<<<<<<<<<<<<<<<<",this.mrzTextLine2="2342353464USA9602300M2904076<<<<<<<2",this.adjustedFinderAspectRatio=5.390625,void 0!==e.mrzTextLine1&&(this.mrzTextLine1=e.mrzTextLine1),void 0!==e.mrzTextLine2&&(this.mrzTextLine2=e.mrzTextLine2),void 0!==e.adjustedFinderAspectRatio&&(this.adjustedFinderAspectRatio=e.adjustedFinderAspectRatio)}}class Ie extends o.a{constructor(e={}){super(),this._type="ThreeLineMRZFinderLayoutPreset",this.mrzTextLine1="I<USA2342353464<<<<<<<<<<<<<<<",this.mrzTextLine2="9602300M2904076USA<<<<<<<<<<<2",this.mrzTextLine3="SMITH<<JACK<<<<<<<<<<<<<<<<<<<",this.adjustedFinderAspectRatio=4.3125,void 0!==e.mrzTextLine1&&(this.mrzTextLine1=e.mrzTextLine1),void 0!==e.mrzTextLine2&&(this.mrzTextLine2=e.mrzTextLine2),void 0!==e.mrzTextLine3&&(this.mrzTextLine3=e.mrzTextLine3),void 0!==e.adjustedFinderAspectRatio&&(this.adjustedFinderAspectRatio=e.adjustedFinderAspectRatio)}}class Te extends o.a{constructor(e={}){super(),this._type="NoLayoutPreset"}}var Oe=n(8),ke=n(40);class Pe extends o.a{constructor(e={}){super(),this.topBarTitle="MRZ Scanner",this.topBarCancelButton="Cancel",this.topUserGuidance="Scan your Identity Document",this.finderViewUserGuidance="Scan the MRZ",this.introScreenTitle="How to scan an MRZ",this.introScreenDoneButton="Start Scanning",this.introScreenText="The Machine Readable Zone (MRZ) is a special code on your ID document (such as a passport or ID card) that contains your personal information in a machine-readable format.\n\nTo scan it, simply hold your camera over the document, so that it aligns with the MRZ section. Once scanned, the data will be automatically processed, and you will be directed to the results screen.\n\nPress 'Start Scanning' to begin.",this.completionOverlaySuccessMessage="Scanned successfully",this.accessibilityDescriptionOpenIntroScreenButton="Open introduction screen.",this.accessibilityDescriptionIntroScreenDoneButton="Start scanning",this.accessibilityDescriptionCancelButton="Cancel",this.accessibilityDescriptionFlashButton="Toggle flash",this.accessibilityDescriptionZoomButton="Toggle camera zoom",this.accessibilityDescriptionFlipCameraButton="Flip camera",this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionEnableCameraButton="Grant permission",this.cameraPermissionCloseButton="Close",this.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",void 0!==e.topBarTitle&&(this.topBarTitle=e.topBarTitle),void 0!==e.topBarCancelButton&&(this.topBarCancelButton=e.topBarCancelButton),void 0!==e.topUserGuidance&&(this.topUserGuidance=e.topUserGuidance),void 0!==e.finderViewUserGuidance&&(this.finderViewUserGuidance=e.finderViewUserGuidance),void 0!==e.introScreenTitle&&(this.introScreenTitle=e.introScreenTitle),void 0!==e.introScreenDoneButton&&(this.introScreenDoneButton=e.introScreenDoneButton),void 0!==e.introScreenText&&(this.introScreenText=e.introScreenText),void 0!==e.completionOverlaySuccessMessage&&(this.completionOverlaySuccessMessage=e.completionOverlaySuccessMessage),void 0!==e.accessibilityDescriptionOpenIntroScreenButton&&(this.accessibilityDescriptionOpenIntroScreenButton=e.accessibilityDescriptionOpenIntroScreenButton),void 0!==e.accessibilityDescriptionIntroScreenDoneButton&&(this.accessibilityDescriptionIntroScreenDoneButton=e.accessibilityDescriptionIntroScreenDoneButton),void 0!==e.accessibilityDescriptionCancelButton&&(this.accessibilityDescriptionCancelButton=e.accessibilityDescriptionCancelButton),void 0!==e.accessibilityDescriptionFlashButton&&(this.accessibilityDescriptionFlashButton=e.accessibilityDescriptionFlashButton),void 0!==e.accessibilityDescriptionZoomButton&&(this.accessibilityDescriptionZoomButton=e.accessibilityDescriptionZoomButton),void 0!==e.accessibilityDescriptionFlipCameraButton&&(this.accessibilityDescriptionFlipCameraButton=e.accessibilityDescriptionFlipCameraButton),void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionEnableCameraButton&&(this.cameraPermissionEnableCameraButton=e.cameraPermissionEnableCameraButton),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton)}}class Le extends o.a{constructor(e={}){super(),this.message=new r.p({text:"?completionOverlaySuccessMessage",color:"?sbColorOnPrimary"}),this.iconColor="?sbColorOnPrimary",this.overlayBackgroundColor="?sbColorSurfaceHigh",this.timeout=1e3,void 0!==e.message&&(this.message=new r.p(e.message)),void 0!==e.iconColor&&(this.iconColor=e.iconColor),void 0!==e.overlayBackgroundColor&&(this.overlayBackgroundColor=e.overlayBackgroundColor),void 0!==e.timeout&&(this.timeout=e.timeout)}}class _e extends o.a{constructor(e={}){super(),this.version="1.0",this.screen="MrzScanner",this.localization=new Pe({}),this.palette=new r.j({}),this.backgroundColor="?sbColorSurfaceLow",this.cameraConfiguration=new P({}),this.cameraPermission=new L({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new r.i({visible:!0,color:"?sbColorOnSurface"}),closeButton:new r.e({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new r.p({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new r.p({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.topUserGuidance=new j.b({title:new r.p({text:"?topUserGuidance"})}),this.finderViewUserGuidance=new j.b({title:new r.p({text:"?finderViewUserGuidance"})}),this.topBar=new W.a({title:new r.p({visible:!0,text:"?topBarTitle"}),cancelButton:new r.e({text:"?topBarCancelButton",accessibilityDescription:"?accessibilityDescriptionCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})})}),this.topBarOpenIntroScreenButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionOpenIntroScreenButton"}),this.introScreen=new ke.e({}),this.actionBar=new I({flipCameraButton:new r.m({visible:!1,accessibilityDescription:"?accessibilityDescriptionFlipCameraButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"})}),this.viewFinder=new F({style:new N({strokeColor:"?sbColorSurface",strokeWidth:2}),aspectRatio:new T.a({width:-1,height:-1}),minimumInsets:new r.f({top:24,left:24,bottom:24,right:24})}),this.scannerConfiguration=new Oe.MrzScannerConfiguration({}),this.mrzExampleOverlay=new Be({}),this.successOverlay=new Le({}),this.sound=new r.n({}),this.vibration=new r.r({}),void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.localization&&(this.localization=new Pe(e.localization)),void 0!==e.palette&&(this.palette=new r.j(e.palette)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new P(e.cameraConfiguration)),void 0!==e.cameraPermission&&(this.cameraPermission=new L(e.cameraPermission)),void 0!==e.topUserGuidance&&(this.topUserGuidance=new j.b(e.topUserGuidance)),void 0!==e.finderViewUserGuidance&&(this.finderViewUserGuidance=new j.b(e.finderViewUserGuidance)),void 0!==e.topBar&&(this.topBar=new W.a(e.topBar)),void 0!==e.topBarOpenIntroScreenButton&&(this.topBarOpenIntroScreenButton=new r.h(e.topBarOpenIntroScreenButton)),void 0!==e.introScreen&&(this.introScreen=new ke.e(e.introScreen)),void 0!==e.actionBar&&(this.actionBar=new I(e.actionBar)),void 0!==e.viewFinder&&(this.viewFinder=new F(e.viewFinder)),void 0!==e.scannerConfiguration&&(this.scannerConfiguration=new Oe.MrzScannerConfiguration(e.scannerConfiguration)),void 0!==e.mrzExampleOverlay&&(this.mrzExampleOverlay=xe.From(e.mrzExampleOverlay)),void 0!==e.successOverlay&&(this.successOverlay=new Le(e.successOverlay)),void 0!==e.sound&&(this.sound=new r.n(e.sound)),void 0!==e.vibration&&(this.vibration=new r.r(e.vibration))}}var Re=n(78),Me=n(79);const Fe=["DARK","LIGHT","HIDDEN"]},function(e,t,n){const{render:i,hydrate:r,unmountComponentAtNode:o}=n(0);function a(e){return{render(t){i(t,e)},unmount(){o(e)}}}t.createRoot=a,t.hydrateRoot=function(e,t){return r(t,e),a(e)}},function(e,t,n){"use strict";n.d(t,"g",(function(){return a})),n.d(t,"f",(function(){return i})),n.d(t,"j",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"k",(function(){return u})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"a",(function(){return m})),n.d(t,"e",(function(){return h})),n.d(t,"b",(function(){return f})),n.d(t,"h",(function(){return p}));var i,r=n(1),o=n(5);class a extends o.a{constructor(e={}){super(),this.image=new s({}),this.text=new r.p({text:"?cameraIntroDescription",color:"?sbColorOnSurface"}),void 0!==e.image&&(this.image=i.From(e.image)),void 0!==e.text&&(this.text=new r.p(e.text))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"NoIntroImage":return new s(e);case"CustomImage":return new c(e);case"ReceiptsIntroImage":return new u(e);case"MedicalCertificateIntroImage":return new l(e);case"DocumentIntroImage":return new d(e);case"CheckIntroImage":return new m(e);case"IdCardIntroImage":return new h(e);case"CreditCardIntroImage":return new f(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class s extends o.a{constructor(e={}){super(),this._type="NoIntroImage"}}class c extends o.a{constructor(e={}){if(super(),this._type="CustomImage",void 0===e.uri)throw new Error("uri must be present in constructor argument");this.uri=e.uri}}class u extends o.a{constructor(e={}){super(),this._type="ReceiptsIntroImage"}}class l extends o.a{constructor(e={}){super(),this._type="MedicalCertificateIntroImage"}}class d extends o.a{constructor(e={}){super(),this._type="DocumentIntroImage"}}class m extends o.a{constructor(e={}){super(),this._type="CheckIntroImage"}}class h extends o.a{constructor(e={}){super(),this._type="IdCardIntroImage"}}class f extends o.a{constructor(e={}){super(),this._type="CreditCardIntroImage"}}class p extends o.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.showAutomatically=!1,this.topBarDoneButton=new r.e({visible:!0,text:"?cameraIntroDoneButton",accessibilityDescription:"?accessibilityDescriptionCameraIntroDoneButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorPrimary",useShadow:!1})}),this.title=new r.p({text:"?cameraIntroTitle",color:"?sbColorOnSurface"}),this.subtitle=new r.p({text:"?cameraIntroSubtitle",color:"?sbColorOnSurface"}),this.items=[new a({image:new d({}),text:new r.p({text:"?cameraIntroItem1",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new r.p({text:"?cameraIntroItem2",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new r.p({text:"?cameraIntroItem3",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new r.p({text:"?cameraIntroItem4",color:"?sbColorOnSurface"})})],void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.showAutomatically&&(this.showAutomatically=e.showAutomatically),void 0!==e.topBarDoneButton&&(this.topBarDoneButton=new r.e(e.topBarDoneButton)),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.subtitle&&(this.subtitle=new r.p(e.subtitle)),void 0!==e.items&&(this.items=e.items.map((e=>new a(e))))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{static initialize(e=!1){this.verbose=e}static debug(e){this.verbose&&console.log("ScanbotSDK:",e)}static debugWarn(e){this.verbose&&console.warn("ScanbotSDK:",e)}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u}));var i=n(32),r=n(19);const o=["UNKNOWN","CREW_MEMBER_CERTIFICATE","ID_CARD","PASSPORT","VISA","CH_DRIVING_LICENSE"];class a{constructor(e={}){if(this.success=!1,void 0!==e.success&&(this.success=e.success),void 0===e.rawMRZ)throw new Error("rawMRZ must be present in constructor argument");if(this.rawMRZ=e.rawMRZ,void 0===e.document)throw new Error("document must be present in constructor argument");this.document=null!=e.document?new r.f(e.document):null}}const s=["ACCEPT","REJECT"];class c{constructor(e={}){this.frameAccumulationConfiguration=new i.a({}),this.enableDetection=!0,this.incompleteResultHandling="REJECT",this.returnCrops=!1,void 0!==e.frameAccumulationConfiguration&&(this.frameAccumulationConfiguration=new i.a(e.frameAccumulationConfiguration)),void 0!==e.enableDetection&&(this.enableDetection=e.enableDetection),void 0!==e.incompleteResultHandling&&(this.incompleteResultHandling=e.incompleteResultHandling),void 0!==e.returnCrops&&(this.returnCrops=e.returnCrops)}}class u{constructor(e={}){this.incompleteResultHandling="ACCEPT",void 0!==e.incompleteResultHandling&&(this.incompleteResultHandling=e.incompleteResultHandling)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var i=n(17),r=n(20),o=n(3);function a(){const e=new r.BarcodeScannerScreenConfiguration;return e.viewFinder.overlayColor=Object(o.d)(e.viewFinder.overlayColor,e.palette),e.viewFinder.style.strokeColor=Object(o.d)(e.viewFinder.style.strokeColor,e.palette),e.viewFinder}class s extends i.a{constructor(e){super(e),this.finder=a(),this.userGuidance=function(){const e=new r.BarcodeScannerScreenConfiguration;return e.userGuidance.background.fillColor=Object(o.d)(e.userGuidance.background.fillColor,e.palette),e.userGuidance.title.color=Object(o.d)(e.userGuidance.title.color,e.palette),e.userGuidance.title.text=Object(o.e)(e.userGuidance.title.text,[],e.localization),e.userGuidance}()}static mapFinderConfiguration(e,t){var n,r;i.a.mapValuesDeep(null!==(n=t.finder)&&void 0!==n?n:{},e.finder),i.a.mapValuesDeep(null!==(r=t.userGuidance)&&void 0!==r?r:{},e.userGuidance)}}},,function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"f",(function(){return m}));var i=n(50),r=n(19),o=n(10),a=n(51);class s{constructor(e={}){if(this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,this.sizeScore=0,this.globalIndex=-1,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=e.rawBytes,void 0===e.rawBytesEncodings)throw new Error("rawBytesEncodings must be present in constructor argument");if(this.rawBytesEncodings=e.rawBytesEncodings.map((e=>new a.e(e))),void 0===e.structuredAppendInfo)throw new Error("structuredAppendInfo must be present in constructor argument");if(this.structuredAppendInfo=null!=e.structuredAppendInfo?new a.f(e.structuredAppendInfo):null,void 0!==e.format&&(this.format=e.format),void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadNormalized)throw new Error("quadNormalized must be present in constructor argument");if(this.quadNormalized=e.quadNormalized.map((e=>({x:e.x,y:e.y}))),void 0===e.extendedQuad)throw new Error("extendedQuad must be present in constructor argument");if(this.extendedQuad=e.extendedQuad.map((e=>({x:e.x,y:e.y}))),void 0===e.extendedQuadNormalized)throw new Error("extendedQuadNormalized must be present in constructor argument");if(this.extendedQuadNormalized=e.extendedQuadNormalized.map((e=>({x:e.x,y:e.y}))),void 0!==e.isUpsideDown&&(this.isUpsideDown=e.isUpsideDown),void 0!==e.sourceImage&&(this.sourceImage=null!=e.sourceImage?new o.a(e.sourceImage):null),void 0===e.upcEanExtension)throw new Error("upcEanExtension must be present in constructor argument");if(this.upcEanExtension=e.upcEanExtension,void 0!==e.isGS1Message&&(this.isGS1Message=e.isGS1Message),void 0!==e.isGS1CompositePart&&(this.isGS1CompositePart=e.isGS1CompositePart),void 0!==e.dataBarStackSize&&(this.dataBarStackSize=e.dataBarStackSize),void 0!==e.sizeScore&&(this.sizeScore=e.sizeScore),void 0===e.extractedDocument)throw new Error("extractedDocument must be present in constructor argument");this.extractedDocument=null!=e.extractedDocument?new r.f(e.extractedDocument):null,void 0!==e.globalIndex&&(this.globalIndex=e.globalIndex)}}const c=["LEGACY","NEXT_GEN_LOW_POWER","NEXT_GEN","NEXT_GEN_LOW_POWER_FAR_DISTANCE","NEXT_GEN_FAR_DISTANCE"],u=["LAST_VISIBLE","INTERPOLATE_BY_CAMERA"];class l{constructor(e={}){this.minConfirmationsStandaloneEAN=1,this.accumulationTime=500,this.removeUnconnectedResults=!0,this.method="INTERPOLATE_BY_CAMERA",void 0!==e.minConfirmationsStandaloneEAN&&(this.minConfirmationsStandaloneEAN=e.minConfirmationsStandaloneEAN),void 0!==e.accumulationTime&&(this.accumulationTime=e.accumulationTime),void 0!==e.removeUnconnectedResults&&(this.removeUnconnectedResults=e.removeUnconnectedResults),void 0!==e.method&&(this.method=e.method)}}class d{constructor(e={}){this.barcodeFormatConfigurations=[new i.j({})],this.extractedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.onlyAcceptDocuments=!1,this.returnBarcodeImage=!1,this.engineMode="NEXT_GEN_LOW_POWER",this.accumulationConfig=new l({}),this.optimizedForOverlays=!1,this.processingMode="AUTO",void 0!==e.barcodeFormatConfigurations&&(this.barcodeFormatConfigurations=e.barcodeFormatConfigurations.map((e=>i.n.From(e)))),void 0!==e.extractedDocumentFormats&&(this.extractedDocumentFormats=e.extractedDocumentFormats.map((e=>e))),void 0!==e.onlyAcceptDocuments&&(this.onlyAcceptDocuments=e.onlyAcceptDocuments),void 0!==e.returnBarcodeImage&&(this.returnBarcodeImage=e.returnBarcodeImage),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.accumulationConfig&&(this.accumulationConfig=new l(e.accumulationConfig)),void 0!==e.optimizedForOverlays&&(this.optimizedForOverlays=e.optimizedForOverlays),void 0!==e.processingMode&&(this.processingMode=e.processingMode)}}class m{constructor(e={}){if(void 0===e.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=e.barcodes.map((e=>new s(e))),void 0===e.success)throw new Error("success must be present in constructor argument");this.success=e.success}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));class i{constructor(e={}){if(void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start={x:e.start.x,y:e.start.y},void 0===e.end)throw new Error("end must be present in constructor argument");this.end={x:e.end.x,y:e.end.y}}}class r{constructor(e={}){if(void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start={x:e.start.x,y:e.start.y},void 0===e.end)throw new Error("end must be present in constructor argument");this.end={x:e.end.x,y:e.end.y}}}class o{constructor(e={}){this.width=1,this.height=1,void 0!==e.width&&(this.width=e.width),void 0!==e.height&&(this.height=e.height)}}},function(e,t,n){"use strict";n.d(t,"d",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));var i=n(10);const r=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"];class o{constructor(e={}){if(void 0===e.symbolQuality)throw new Error("symbolQuality must be present in constructor argument");if(this.symbolQuality=e.symbolQuality,void 0===e.symbolRatio)throw new Error("symbolRatio must be present in constructor argument");this.symbolRatio=e.symbolRatio}}class a{constructor(e={}){this.qualityThresholds=[new o({symbolQuality:.5,symbolRatio:.5}),new o({symbolQuality:.7,symbolRatio:.3}),new o({symbolQuality:.85,symbolRatio:.3}),new o({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.detectOrientation=!1,this.inspectSmallText=!1,this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,this.returnQualityHeatmap=!1,void 0!==e.qualityThresholds&&(this.qualityThresholds=e.qualityThresholds.map((e=>new o(e)))),void 0!==e.qualityIndices&&(this.qualityIndices=e.qualityIndices.map((e=>e))),void 0!==e.detectOrientation&&(this.detectOrientation=e.detectOrientation),void 0!==e.inspectSmallText&&(this.inspectSmallText=e.inspectSmallText),void 0!==e.maxImageSize&&(this.maxImageSize=e.maxImageSize),void 0!==e.minEstimatedNumberOfSymbolsForDocument&&(this.minEstimatedNumberOfSymbolsForDocument=e.minEstimatedNumberOfSymbolsForDocument),void 0!==e.minProcessedFraction&&(this.minProcessedFraction=e.minProcessedFraction),void 0!==e.maxProcessedFraction&&(this.maxProcessedFraction=e.maxProcessedFraction),void 0!==e.earlyStopIfNSymbolsFound&&(this.earlyStopIfNSymbolsFound=e.earlyStopIfNSymbolsFound),void 0!==e.tileSize&&(this.tileSize=e.tileSize),void 0!==e.returnQualityHeatmap&&(this.returnQualityHeatmap=e.returnQualityHeatmap)}}class s{constructor(e={}){if(this.qualityHeatmap=null,void 0===e.documentFound)throw new Error("documentFound must be present in constructor argument");if(this.documentFound=e.documentFound,void 0===e.quality)throw new Error("quality must be present in constructor argument");if(this.quality=null!=e.quality&&r.includes(e.quality)?e.quality:null,void 0===e.orientation)throw new Error("orientation must be present in constructor argument");if(this.orientation=null!=e.orientation?e.orientation:null,void 0===e.cumulativeQualityHistogram)throw new Error("cumulativeQualityHistogram must be present in constructor argument");if(this.cumulativeQualityHistogram=e.cumulativeQualityHistogram.map((e=>e)),void 0===e.cumulativeContrastHistogram)throw new Error("cumulativeContrastHistogram must be present in constructor argument");if(this.cumulativeContrastHistogram=e.cumulativeContrastHistogram.map((e=>e)),void 0===e.cumulativeTextSizeHistogram)throw new Error("cumulativeTextSizeHistogram must be present in constructor argument");this.cumulativeTextSizeHistogram=e.cumulativeTextSizeHistogram.map((e=>e)),void 0!==e.qualityHeatmap&&(this.qualityHeatmap=null!=e.qualityHeatmap?new i.a(e.qualityHeatmap):null)}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"f",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"e",(function(){return u}));class i{constructor(e={}){if(this.recognitionConfidence=0,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.boundingRect)throw new Error("boundingRect must be present in constructor argument");this.boundingRect={x:e.boundingRect.x,y:e.boundingRect.y,width:e.boundingRect.width,height:e.boundingRect.height},void 0!==e.recognitionConfidence&&(this.recognitionConfidence=e.recognitionConfidence)}}class r{constructor(e={}){if(void 0===e.symbol)throw new Error("symbol must be present in constructor argument");if(this.symbol=e.symbol,void 0===e.boundingRect)throw new Error("boundingRect must be present in constructor argument");if(this.boundingRect={x:e.boundingRect.x,y:e.boundingRect.y,width:e.boundingRect.width,height:e.boundingRect.height},void 0===e.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=e.recognitionConfidence}}class o{constructor(e={}){if(this.confidence=0,this.validationSuccessful=!1,void 0===e.rawText)throw new Error("rawText must be present in constructor argument");if(this.rawText=e.rawText,void 0===e.wordBoxes)throw new Error("wordBoxes must be present in constructor argument");if(this.wordBoxes=e.wordBoxes.map((e=>new i(e))),void 0===e.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=e.symbolBoxes.map((e=>new r(e))),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful)}}var a;!function(e){e.From=function(e){const t=e._type;switch(t){case"DefaultContentValidator":return new s(e);case"PatternContentValidator":return new c(e);default:throw`Unknown child class name: ${t}`}}}(a||(a={}));class s{constructor(e={}){this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters)}}class c{constructor(e={}){if(this._type="PatternContentValidator",this.allowedCharacters="",this.matchSubstring=!1,void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters),void 0===e.pattern)throw new Error("pattern must be present in constructor argument");this.pattern=e.pattern,void 0!==e.matchSubstring&&(this.matchSubstring=e.matchSubstring)}}class u{constructor(e={}){this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.validator=new s({}),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult),void 0!==e.validator&&(this.validator=a.From(e.validator))}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o}));const i=["EXACT","INTERPOLATE"];class r{constructor(e={}){this.confirmationMethod="EXACT",this.minConfirmations=3,this.minConfidenceForStableField=.8,this.autoClearThreshold=4,void 0!==e.confirmationMethod&&(this.confirmationMethod=e.confirmationMethod),void 0!==e.minConfirmations&&(this.minConfirmations=e.minConfirmations),void 0!==e.minConfidenceForStableField&&(this.minConfidenceForStableField=e.minConfidenceForStableField),void 0!==e.autoClearThreshold&&(this.autoClearThreshold=e.autoClearThreshold)}}class o{constructor(e={}){this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u}));var i=n(0),r=n(14),o=n(56),a=n(58),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class c extends r.a{}r.b;class u extends r.c{constructor(e){super(e),this.paused=!1,Object.assign(this.state,{isFinderVisible:!0})}componentDidMount(){super.componentDidMount(),this.resumeDetection(),this.detect()}componentWillUnmount(){super.componentWillUnmount(),this.pauseDetection()}resumeDetection(){this.paused=!1}pauseDetection(){this.paused=!0}isDetectionPaused(){return this.paused}detect(){return s(this,void 0,void 0,(function*(){throw new Error("'detect' method needs to be overridden.")}))}renderView(e){var t;return i.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null==e?void 0:e.spinnerColor),i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},i.default.createElement(a.a,{configuration:e,videoConstraints:e.videoConstraints,mirrored:e.mirrored,preferredCamera:e.preferredCamera,zoom:null!==(t=this.state.zoom)&&void 0!==t?t:e.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&i.default.createElement(o.a,{ref:e=>{this.finder=e},guidanceConfiguration:e.userGuidance,configuration:e.finder}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(11);class r{constructor(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}scaleDown(e){return new r(this.x/e,this.y/e,this.width/e,this.height/e)}bottom(){return this.y+this.height}size(){return new i.a(this.width,this.height)}static withSize(e,t){return new r(0,0,e,t)}static empty(){return new r(0,0,0,0)}static fromRect(e){return e?new r(e.x,e.y,e.width,e.height):r.empty()}static fromPoint(e,t){return new r(e.x-t/2,e.y-t/2,t,t)}static fromDOMRect(e){return new r(e.x,e.y,e.width,e.height)}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"i",(function(){return o})),n.d(t,"j",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return d})),n.d(t,"k",(function(){return m})),n.d(t,"h",(function(){return h}));const i=["BINARY","ANTIALIASED"],r=["PRESET_1","PRESET_2","PRESET_3","PRESET_4","PRESET_5"];var o;!function(e){e.From=function(e){const t=e._type;switch(t){case"ScanbotBinarizationFilter":return new a(e);case"CustomBinarizationFilter":return new s(e);case"ColorDocumentFilter":return new c(e);case"BrightnessFilter":return new u(e);case"ContrastFilter":return new l(e);case"GrayscaleFilter":return new d(e);case"WhiteBlackPointFilter":return new m(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={}));class a{constructor(e={}){this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class s{constructor(e={}){this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==e.outputMode&&(this.outputMode=e.outputMode),void 0!==e.denoise&&(this.denoise=e.denoise),void 0!==e.radius&&(this.radius=e.radius),void 0!==e.preset&&(this.preset=e.preset)}}class c{constructor(e={}){this._type="ColorDocumentFilter"}}class u{constructor(e={}){this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class l{constructor(e={}){this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class d{constructor(e={}){this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==e.borderWidthFraction&&(this.borderWidthFraction=e.borderWidthFraction),void 0!==e.blackOutliersFraction&&(this.blackOutliersFraction=e.blackOutliersFraction),void 0!==e.whiteOutliersFraction&&(this.whiteOutliersFraction=e.whiteOutliersFraction)}}class m{constructor(e={}){this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==e.blackPoint&&(this.blackPoint=e.blackPoint),void 0!==e.whitePoint&&(this.whitePoint=e.whitePoint)}}const h=["DISABLED","ENABLED","ENABLED_IF_BINARIZATION_FILTER_SET"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var i=n(1),r=n(5);class o extends r.a{constructor(e={}){super(),this.title=new i.p({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new i.e({text:"Cancel",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.g({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new i.p(e.title)),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cancelButton&&(this.cancelButton=new i.e(e.cancelButton))}}const a=["SOLID","GRADIENT","HIDDEN"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u}));var i=n(15),r=n(19),o=n(10);const a=["DISABLED","DETECT_DOCUMENT","DETECT_AND_CROP_DOCUMENT"],s=["SUCCESS","INCOMPLETE_VALIDATION","ERROR_NOTHING_FOUND"];class c{constructor(e={}){if(this.status="ERROR_NOTHING_FOUND",this.croppedImage=null,void 0!==e.status&&(this.status=e.status),void 0===e.check)throw new Error("check must be present in constructor argument");if(this.check=null!=e.check?new r.f(e.check):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");this.documentDetectionResult=null!=e.documentDetectionResult?new i.a(e.documentDetectionResult):null,void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?new o.a(e.croppedImage):null)}}class u{constructor(e={}){this.documentDetectionMode="DISABLED",this.processingMode="AUTO",void 0!==e.documentDetectionMode&&(this.documentDetectionMode=e.documentDetectionMode),void 0!==e.processingMode&&(this.processingMode=e.processingMode)}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var i=n(19),r=n(32);const o=["SUCCESS","ERROR_NOTHING_FOUND","INCOMPLETE"];class a{constructor(e={}){if(void 0===e.detectionStatus)throw new Error("detectionStatus must be present in constructor argument");if(this.detectionStatus=e.detectionStatus,void 0===e.scanningStatus)throw new Error("scanningStatus must be present in constructor argument");if(this.scanningStatus=e.scanningStatus,void 0===e.creditCard)throw new Error("creditCard must be present in constructor argument");if(this.creditCard=null!=e.creditCard?new i.f(e.creditCard):null,void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadNormalized)throw new Error("quadNormalized must be present in constructor argument");this.quadNormalized=e.quadNormalized.map((e=>({x:e.x,y:e.y})))}}class s{constructor(e={}){this.useDocumentDetector=!0,this.requireExpiryDate=!0,this.requireCardholderName=!0,this.resultAccumulationConfig=new r.c({}),this.returnCreditCardImage=!1,this.processingMode="AUTO",void 0!==e.useDocumentDetector&&(this.useDocumentDetector=e.useDocumentDetector),void 0!==e.requireExpiryDate&&(this.requireExpiryDate=e.requireExpiryDate),void 0!==e.requireCardholderName&&(this.requireCardholderName=e.requireCardholderName),void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new r.c(e.resultAccumulationConfig)),void 0!==e.returnCreditCardImage&&(this.returnCreditCardImage=e.returnCreditCardImage),void 0!==e.processingMode&&(this.processingMode=e.processingMode)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return s}));var i=n(31);const r=["SUCCESS","BARCODE_WITHOUT_VIN","NO_BARCODE_FOUND","BARCODE_EXTRACTION_DISABLED"];class o{constructor(e={}){if(void 0===e.extractedVIN)throw new Error("extractedVIN must be present in constructor argument");if(this.extractedVIN=e.extractedVIN,void 0===e.rectangle)throw new Error("rectangle must be present in constructor argument");if(this.rectangle=e.rectangle.map((e=>({x:e.x,y:e.y}))),void 0===e.status)throw new Error("status must be present in constructor argument");this.status=e.status}}class a{constructor(e={}){if(void 0===e.textResult)throw new Error("textResult must be present in constructor argument");if(this.textResult=new i.f(e.textResult),void 0===e.barcodeResult)throw new Error("barcodeResult must be present in constructor argument");this.barcodeResult=new o(e.barcodeResult)}}class s{constructor(e={}){this.extractVINFromBarcode=!1,this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,void 0!==e.extractVINFromBarcode&&(this.extractVINFromBarcode=e.extractVINFromBarcode),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult)}}},function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"e",(function(){return u}));var i,r=n(1),o=n(5);!function(e){e.From=function(e){const t=e._type;switch(t){case"MrzIntroDefaultImage":return new a(e);case"MrzIntroNoImage":return new s(e);case"MrzIntroCustomImage":return new c(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class a extends o.a{constructor(e={}){super(),this._type="MrzIntroDefaultImage"}}class s extends o.a{constructor(e={}){super(),this._type="MrzIntroNoImage"}}class c extends o.a{constructor(e={}){if(super(),this._type="MrzIntroCustomImage",void 0===e.uri)throw new Error("uri must be present in constructor argument");this.uri=e.uri}}class u extends o.a{constructor(e={}){super(),this.image=new a({}),this.backgroundColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.handlerColor="?sbColorOutline",this.showAutomatically=!1,this.title=new r.p({text:"?introScreenTitle",color:"?sbColorOnSurface"}),this.text=new r.p({text:"?introScreenText",color:"?sbColorOnSurface"}),this.doneButton=new r.e({text:"?introScreenDoneButton",accessibilityDescription:"?accessibilityDescriptionIntroScreenDoneButton",background:new r.a({strokeColor:"#00000000",fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),void 0!==e.image&&(this.image=i.From(e.image)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.handlerColor&&(this.handlerColor=e.handlerColor),void 0!==e.showAutomatically&&(this.showAutomatically=e.showAutomatically),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.text&&(this.text=new r.p(e.text)),void 0!==e.doneButton&&(this.doneButton=new r.e(e.doneButton))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(18),r=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class o{static get INSTANCE(){return o._INSTANCE||(o._INSTANCE=new o),o._INSTANCE}constructor(){this.listOfCameras=[],this.strategy="FAST_DEFERRED"}initialize(e){if(e&&(this.strategy=e),"SLOW"===e||"FAST"===e){const t=e;this.load(t)}}load(e){return r(this,void 0,void 0,(function*(){if(!e)if("SLOW_DEFERRED"===this.strategy||"SLOW"===this.strategy)e="SLOW";else if("FAST_DEFERRED"===this.strategy||"FAST"===this.strategy)e="FAST";else if("NONE"===this.strategy)return this.listOfCameras;let t;if("SLOW"===e)t=this.loadSlow();else{if("FAST"!==e)throw new Error(`Unknown mode ${e}`);t=this.loadFast()}try{return this.listOfCameras=yield t,this.listOfCameras}catch(e){throw this.loadSlowResult=void 0,i.a.createFromDOMException(e)}}))}loadSlow(){return this.loadSlowResult=this.loadSlowResult||(()=>r(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){let n;try{n=yield this.getUserMedia({video:{deviceId:t.deviceId}}),e.push(o.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((e=>setTimeout(e,0)))}}return e})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>r(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){const n=o.guessparseCameraLabelFacingMode(t.label),i=o.guessparseCameraLabelMaxNumPixels(t.label);e.push({maxNumPixels:i,facingMode:n,supportsTorchControl:void 0,deviceId:t.deviceId,label:t.label})}return e})))(),this.loadFastResult}getMainCamera(e){var t,n,i,r,o,a;return null!==(a=null===(o=null===(r=null===(i=null===(n=null===(t=this.listOfCameras)||void 0===t?void 0:t.filter((t=>t.facingMode===e)))||void 0===n?void 0:n.map(((e,t)=>({camera:e,index:t}))))||void 0===i?void 0:i.sort(((e,t)=>{var n;return-(+e.camera.supportsTorchControl||0)-(+t.camera.supportsTorchControl||0)||-((e.camera.maxNumPixels||0)-(t.camera.maxNumPixels||0))||(null===(n=e.camera.label)||void 0===n?void 0:n.localeCompare(t.camera.label))||e.index-t.index})))||void 0===r?void 0:r[0])||void 0===o?void 0:o.camera)&&void 0!==a?a:null}getVideoDevices(){return r(this,void 0,void 0,(function*(){let e=yield navigator.mediaDevices.enumerateDevices();if(e=e.filter((e=>"videoinput"===e.kind)),e.some((e=>""===e.label))){let t;try{t=yield this.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1}),e=yield navigator.mediaDevices.enumerateDevices(),e=e.filter((e=>"videoinput"===e.kind))}finally{this.stopStream(t)}}return e}))}stopStream(e){null==e||e.getTracks().forEach((e=>e.stop()))}static guessparseCameraLabelFacingMode(e){return function(e){const t=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];for(const n of t)if(e.toLowerCase().includes(n.toLowerCase()))return!0;return!1}(e)?"back":"front"}static guessparseCameraLabelMaxNumPixels(e){const t=RegExp(/\b([0-9]+)mp?\b/).exec(e.toLowerCase()),n=t?1e6*parseInt(t[1],10):NaN;return Number.isNaN(n)?void 0:n}assertPermissionsAreOk(){return r(this,void 0,void 0,(function*(){if(i.a.hasCheckedPermission()||(yield i.a.tryCheckPermission()),i.a.hasDeniedPermission())throw i.a.permissionDenied();if(!navigator.mediaDevices)throw i.a.unknown()}))}static getCameraInfoFromStream(e){var t;return null===(t=e.getVideoTracks().map((e=>{var t,n,i,r,o,a;const s=null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e),c=null===(n=e.getSettings)||void 0===n?void 0:n.call(e),u=e.label;let l=function(e){if("user"===(null==e?void 0:e.toLowerCase()))return"front";if("environment"===(null==e?void 0:e.toLowerCase()))return"back";return"unknown"}(null!==(r=null===(i=null==s?void 0:s.facingMode)||void 0===i?void 0:i[0])&&void 0!==r?r:c.facingMode);"unknown"===l&&(l=this.guessparseCameraLabelFacingMode(u));let d=function(e){var t,n;let i=(null===(t=null==e?void 0:e.width)||void 0===t?void 0:t.max)*(null===(n=null==e?void 0:e.height)||void 0===n?void 0:n.max);if(!i||Number.isNaN(i))return;return i}(s);Number.isNaN(d)&&(d=this.guessparseCameraLabelMaxNumPixels(u));return{facingMode:l,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(o=null==s?void 0:s.torch)&&void 0!==o?o:"torch"in c)&&void 0!==a&&a,label:u,deviceId:c.deviceId}})).sort(((e,t)=>t.maxNumPixels-e.maxNumPixels)))||void 0===t?void 0:t[0]}getUserMedia(e){return r(this,void 0,void 0,(function*(){try{return yield navigator.mediaDevices.getUserMedia(e)}catch(e){throw i.a.mediaDeviceNotFound()}}))}}},function(e,t,n){"use strict";(function(e){function i(e,t=!1){const n=[];if(t)return n;return function e(t){if(t)if(t.constructor===ImageData)n.push(t.data.buffer);else if(t.constructor===ArrayBuffer)n.push(t);else if(ArrayBuffer.isView(t))n.push(t.buffer);else if(Array.isArray(t))for(let n=0;n<t.length;++n)e(t[n]);else if("object"==typeof t)for(const n in t)t.hasOwnProperty(n)&&e(t[n])}(e),n}function r(e){return e.startsWith("http:")||e.startsWith("https:")}function o(){if("undefined"!=typeof e&&"undefined"!=typeof e.versions&&"undefined"!=typeof e.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}}function a(e){const{allowSimd:t=!0,allowThreads:n=!0}=e||{};let i="";if(t&&function(){try{const e=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11])),t=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0]));return e&&t}catch(e){return!1}}()){i+="-simd";n&&o()&&(i+="-threads")}return i}n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return a}))}).call(this,n(84))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return p}));class i extends Error{constructor(){super(...arguments),this.errorType="UnknownError"}}class r extends Error{constructor(){super(...arguments),this.errorType="InvalidLicense"}}class o extends Error{constructor(){super(...arguments),this.errorType="NullPointer"}}class a extends Error{constructor(){super(...arguments),this.errorType="InvalidArgument"}}class s extends Error{constructor(){super(...arguments),this.errorType="InvalidImageRef"}}class c extends Error{constructor(){super(...arguments),this.errorType="ComponentUnavailable"}}class u extends Error{constructor(){super(...arguments),this.errorType="IllegalState"}}class l extends Error{constructor(){super(...arguments),this.errorType="IoError"}}class d extends Error{constructor(){super(...arguments),this.errorType="InvalidData"}}class m extends Error{constructor(){super(...arguments),this.errorType="OperationCanceled"}}class h extends Error{constructor(){super(...arguments),this.errorType="OutOfMemory"}}class f extends Error{constructor(){super(...arguments),this.errorType="Timeout"}}function p(e,t,n){const p=n?{cause:n}:void 0;switch(e){case"UnknownError":return new i(t,p);case"InvalidLicense":return new r("Your license is not valid to use this feature of the ScanbotSDK. This can be because of one of the following reasons: \n 1) You did not successfully initialize the SDK with your license. \n 2) Your license expired \n 3) Your license does not allow the use of this feature of the ScanbotSDK",p);case"NullPointer":return new o(t,p);case"InvalidArgument":return new a(t,p);case"InvalidImageRef":return new s(t,p);case"ComponentUnavailable":return new c(t,p);case"IllegalState":return new u(t,p);case"IoError":return new l(t,p);case"InvalidData":return new d(t,p);case"OperationCanceled":return new m(t,p);case"OutOfMemory":return new h(t,p);case"Timeout":return new f(t,p);default:throw new Error(t)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return G})),n.d(t,"c",(function(){return ee})),n.d(t,"d",(function(){return ne})),n.d(t,"e",(function(){return te})),n.d(t,"f",(function(){return J})),n.d(t,"g",(function(){return $}));var i="-ms-",r="-moz-",o="-webkit-",a="comm",s="rule",c="decl",u="@keyframes",l=Math.abs,d=String.fromCharCode,m=Object.assign;function h(e){return e.trim()}function f(e,t){return(e=t.exec(e))?e[0]:e}function p(e,t,n){return e.replace(t,n)}function g(e,t,n){return e.indexOf(t,n)}function v(e,t){return 0|e.charCodeAt(t)}function y(e,t,n){return e.slice(t,n)}function C(e){return e.length}function b(e){return e.length}function A(e,t){return t.push(e),e}function S(e,t){return e.map(t).join("")}function w(e,t){return e.filter((function(e){return!f(e,t)}))}var E=1,D=1,x=0,B=0,I=0,T="";function O(e,t,n,i,r,o,a,s){return{value:e,root:t,parent:n,type:i,props:r,children:o,line:E,column:D,length:a,return:"",siblings:s}}function k(e,t){return m(O("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function P(e){for(;e.root;)e=k(e.root,{children:[e]});A(e,e.siblings)}function L(){return I=B<x?v(T,B++):0,D++,10===I&&(D=1,E++),I}function _(){return v(T,B)}function R(){return B}function M(e,t){return y(T,e,t)}function F(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function N(e){return E=D=1,x=C(T=e),B=0,[]}function V(e){return T="",e}function W(e){return h(M(B-1,H(91===e?e+2:40===e?e+1:e)))}function j(e){for(;(I=_())&&I<33;)L();return F(e)>2||F(I)>3?"":" "}function z(e,t){for(;--t&&L()&&!(I<48||I>102||I>57&&I<65||I>70&&I<97););return M(e,R()+(t<6&&32==_()&&32==L()))}function H(e){for(;L();)switch(I){case e:return B;case 34:case 39:34!==e&&39!==e&&H(I);break;case 40:41===e&&H(e);break;case 92:L()}return B}function U(e,t){for(;L()&&e+I!==57&&(e+I!==84||47!==_()););return"/*"+M(t,B-1)+"*"+d(47===e?e:L())}function Z(e){for(;!F(_());)L();return M(e,B)}function G(e){return V(Y("",null,null,null,[""],e=N(e),0,[0],e))}function Y(e,t,n,i,r,o,a,s,c){for(var u=0,m=0,h=a,f=0,y=0,b=0,S=1,w=1,x=1,O=0,k="",P=r,M=o,F=i,N=k;w;)switch(b=O,O=L()){case 40:if(108!=b&&58==v(N,h-1)){-1!=g(N+=p(W(O),"&","&\f"),"&\f",l(u?s[u-1]:0))&&(x=-1);break}case 34:case 39:case 91:N+=W(O);break;case 9:case 10:case 13:case 32:N+=j(b);break;case 92:N+=z(R()-1,7);continue;case 47:switch(_()){case 42:case 47:A(q(U(L(),R()),t,n,c),c);break;default:N+="/"}break;case 123*S:s[u++]=C(N)*x;case 125*S:case 59:case 0:switch(O){case 0:case 125:w=0;case 59+m:-1==x&&(N=p(N,/\f/g,"")),y>0&&C(N)-h&&A(y>32?X(N+";",i,n,h-1,c):X(p(N," ","")+";",i,n,h-2,c),c);break;case 59:N+=";";default:if(A(F=Q(N,t,n,u,m,r,s,k,P=[],M=[],h,o),o),123===O)if(0===m)Y(N,t,F,F,P,o,h,s,M);else switch(99===f&&110===v(N,3)?100:f){case 100:case 108:case 109:case 115:Y(e,F,F,i&&A(Q(e,F,F,0,0,r,s,k,r,P=[],h,M),M),r,M,h,s,i?P:M);break;default:Y(N,F,F,F,[""],M,0,s,M)}}u=m=y=0,S=x=1,k=N="",h=a;break;case 58:h=1+C(N),y=b;default:if(S<1)if(123==O)--S;else if(125==O&&0==S++&&125==(I=B>0?v(T,--B):0,D--,10===I&&(D=1,E--),I))continue;switch(N+=d(O),O*S){case 38:x=m>0?1:(N+="\f",-1);break;case 44:s[u++]=(C(N)-1)*x,x=1;break;case 64:45===_()&&(N+=W(L())),f=_(),m=h=C(k=N+=Z(R())),O++;break;case 45:45===b&&2==C(N)&&(S=0)}}return o}function Q(e,t,n,i,r,o,a,c,u,d,m,f){for(var g=r-1,v=0===r?o:[""],C=b(v),A=0,S=0,w=0;A<i;++A)for(var E=0,D=y(e,g+1,g=l(S=a[A])),x=e;E<C;++E)(x=h(S>0?v[E]+" "+D:p(D,/&\f/g,v[E])))&&(u[w++]=x);return O(e,t,n,0===r?s:c,u,d,m,f)}function q(e,t,n,i){return O(e,t,n,a,d(I),y(e,2,-2),0,i)}function X(e,t,n,i,r){return O(e,t,n,c,y(e,0,i),y(e,i+1,-1),i,r)}function K(e,t,n){switch(function(e,t){return 45^v(e,0)?(((t<<2^v(e,0))<<2^v(e,1))<<2^v(e,2))<<2^v(e,3):0}(e,t)){case 5103:return o+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return o+e+e;case 4789:return r+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return o+e+r+e+i+e+e;case 5936:switch(v(e,t+11)){case 114:return o+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return o+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return o+e+i+p(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return o+e+i+e+e;case 6165:return o+e+i+"flex-"+e+e;case 5187:return o+e+p(e,/(\w+).+(:[^]+)/,o+"box-$1$2"+i+"flex-$1$2")+e;case 5443:return o+e+i+"flex-item-"+p(e,/flex-|-self/g,"")+(f(e,/flex-|baseline/)?"":i+"grid-row-"+p(e,/flex-|-self/g,""))+e;case 4675:return o+e+i+"flex-line-pack"+p(e,/align-content|flex-|-self/g,"")+e;case 5548:return o+e+i+p(e,"shrink","negative")+e;case 5292:return o+e+i+p(e,"basis","preferred-size")+e;case 6060:return o+"box-"+p(e,"-grow","")+o+e+i+p(e,"grow","positive")+e;case 4554:return o+p(e,/([^-])(transform)/g,"$1"+o+"$2")+e;case 6187:return p(p(p(e,/(zoom-|grab)/,o+"$1"),/(image-set)/,o+"$1"),e,"")+e;case 5495:case 3959:return p(e,/(image-set\([^]*)/,o+"$1$`$1");case 4968:return p(p(e,/(.+:)(flex-)?(.*)/,o+"box-pack:$3"+i+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+o+e+e;case 4200:if(!f(e,/flex-|baseline/))return i+"grid-column-align"+y(e,t)+e;break;case 2592:case 3360:return i+p(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,f(e.props,/grid-\w+-end/)}))?~g(e+(n=n[t].value),"span",0)?e:i+p(e,"-start","")+e+i+"grid-row-span:"+(~g(n,"span",0)?f(n,/\d+/):+f(n,/\d+/)-+f(e,/\d+/))+";":i+p(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return f(e.props,/grid-\w+-start/)}))?e:i+p(p(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return p(e,/(.+)-inline(.+)/,o+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(C(e)-1-t>6)switch(v(e,t+1)){case 109:if(45!==v(e,t+4))break;case 102:return p(e,/(.+:)(.+)-([^]+)/,"$1"+o+"$2-$3$1"+r+(108==v(e,t+3)?"$3":"$2-$3"))+e;case 115:return~g(e,"stretch",0)?K(p(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return p(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,o,a,s,c){return i+n+":"+r+c+(o?i+n+"-span:"+(a?s:+s-+r)+c:"")+e}));case 4949:if(121===v(e,t+6))return p(e,":",":"+o)+e;break;case 6444:switch(v(e,45===v(e,14)?18:11)){case 120:return p(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+o+(45===v(e,14)?"inline-":"")+"box$3$1"+o+"$2$3$1"+i+"$2box$3")+e;case 100:return p(e,":",":"+i)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return p(e,"scroll-","scroll-snap-")+e}return e}function J(e,t){for(var n="",i=0;i<e.length;i++)n+=t(e[i],i,e,t)||"";return n}function $(e,t,n,i){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case c:return e.return=e.return||e.value;case a:return"";case u:return e.return=e.value+"{"+J(e.children,i)+"}";case s:if(!C(e.value=e.props.join(",")))return""}return C(n=J(e.children,i))?e.return=e.value+"{"+n+"}":""}function ee(e){var t=b(e);return function(n,i,r,o){for(var a="",s=0;s<t;s++)a+=e[s](n,i,r,o)||"";return a}}function te(e){return function(t){t.root||(t=t.return)&&e(t)}}function ne(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case c:return void(e.return=K(e.value,e.length,n));case u:return J([k(e,{value:p(e.value,"@","@"+o)})],r);case s:if(e.length)return S(n=e.props,(function(t){switch(f(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":P(k(e,{props:[p(t,/:(read-\w+)/,":-moz-$1")]})),P(k(e,{props:[t]})),m(e,{props:w(n,r)});break;case"::placeholder":P(k(e,{props:[p(t,/:(plac\w+)/,":"+o+"input-$1")]})),P(k(e,{props:[p(t,/:(plac\w+)/,":-moz-$1")]})),P(k(e,{props:[p(t,/:(plac\w+)/,i+"input-$1")]})),P(k(e,{props:[t]})),m(e,{props:w(n,r)})}return""}))}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var i=n(6);function r(e,t,n){return Math.min(Math.max(e,t),n)}function o(e,t,n){return new i.a(r(e.x,-t/2,n.width-t/2),r(e.y,-t/2,n.height-t/2))}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Ge})),n.d(t,"b",(function(){return Ye}));var i=n(4),r=(n(89),n(0)),o=n(85),a=n.n(o),s=n(44),c=n(86),u="undefined"!=typeof e&&void 0!==e.env&&(e.env.REACT_APP_SC_ATTR||e.env.SC_ATTR)||"data-styled",l="active",d="data-styled-version",m="6.1.8",h="/*!sc*/\n",f="undefined"!=typeof window&&"HTMLElement"in window,p=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof e&&void 0!==e.env&&void 0!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==e.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&e.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof e&&void 0!==e.env&&void 0!==e.env.SC_DISABLE_SPEEDY&&""!==e.env.SC_DISABLE_SPEEDY&&("false"!==e.env.SC_DISABLE_SPEEDY&&e.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function y(e,t,n){return void 0===n&&(n=v),e.theme!==n.theme&&e.theme||t||n.theme}var C=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),b=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,A=/(^-|-$)/g;function S(e){return e.replace(b,"-").replace(A,"")}var w=/(a)(d)/gi,E=function(e){return String.fromCharCode(e+(e>25?39:97))};function D(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=E(t%52)+n;return(E(t%52)+n).replace(w,"$1-$2")}var x,B=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},I=function(e){return B(5381,e)};function T(e){return D(I(e)>>>0)}function O(e){return e.displayName||e.name||"Component"}function k(e){return"string"==typeof e&&!0}var P="function"==typeof Symbol&&Symbol.for,L=P?Symbol.for("react.memo"):60115,_=P?Symbol.for("react.forward_ref"):60112,R={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},M={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},F={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},N=((x={})[_]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},x[L]=F,x);function V(e){return("type"in(t=e)&&t.type.$$typeof)===L?F:"$$typeof"in e?N[e.$$typeof]:R;var t}var W=Object.defineProperty,j=Object.getOwnPropertyNames,z=Object.getOwnPropertySymbols,H=Object.getOwnPropertyDescriptor,U=Object.getPrototypeOf,Z=Object.prototype;function G(e,t,n){if("string"!=typeof t){if(Z){var i=U(t);i&&i!==Z&&G(e,i,n)}var r=j(t);z&&(r=r.concat(z(t)));for(var o=V(e),a=V(t),s=0;s<r.length;++s){var c=r[s];if(!(c in M||n&&n[c]||a&&c in a||o&&c in o)){var u=H(t,c);try{W(e,c,u)}catch(e){}}}}return e}function Y(e){return"function"==typeof e}function Q(e){return"object"==typeof e&&"styledComponentId"in e}function q(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function X(e,t){if(0===e.length)return"";for(var n=e[0],i=1;i<e.length;i++)n+=t?t+e[i]:e[i];return n}function K(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function J(e,t,n){if(void 0===n&&(n=!1),!n&&!K(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var i=0;i<t.length;i++)e[i]=J(e[i],t[i]);else if(K(t))for(var i in t)e[i]=J(e[i],t[i]);return e}function $(e,t){Object.defineProperty(e,"toString",{value:t})}function ee(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var te=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,r=i;e>=r;)if((r<<=1)<0)throw ee(16,"".concat(e));this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var o=i;o<r;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(e+1),s=(o=0,t.length);o<s;o++)this.tag.insertRule(a,t[o])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),i=n+t;this.groupSizes[e]=0;for(var r=n;r<i;r++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),r=i+n,o=i;o<r;o++)t+="".concat(this.tag.getRule(o)).concat(h);return t},e}(),ne=new Map,ie=new Map,re=1,oe=function(e){if(ne.has(e))return ne.get(e);for(;ie.has(re);)re++;var t=re++;return ne.set(e,t),ie.set(t,e),t},ae=function(e,t){re=t+1,ne.set(e,t),ie.set(t,e)},se="style[".concat(u,"][").concat(d,'="').concat(m,'"]'),ce=new RegExp("^".concat(u,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ue=function(e,t,n){for(var i,r=n.split(","),o=0,a=r.length;o<a;o++)(i=r[o])&&e.registerName(t,i)},le=function(e,t){for(var n,i=(null!==(n=t.textContent)&&void 0!==n?n:"").split(h),r=[],o=0,a=i.length;o<a;o++){var s=i[o].trim();if(s){var c=s.match(ce);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(ae(l,u),ue(e,l,c[3]),e.getTag().insertRules(u,r)),r.length=0}else r.push(s)}}};function de(){return n.nc}var me=function(e){var t=document.head,n=e||t,i=document.createElement("style"),r=function(e){var t=Array.from(e.querySelectorAll("style[".concat(u,"]")));return t[t.length-1]}(n),o=void 0!==r?r.nextSibling:null;i.setAttribute(u,l),i.setAttribute(d,m);var a=de();return a&&i.setAttribute("nonce",a),n.insertBefore(i,o),i},he=function(){function e(e){this.element=me(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,i=t.length;n<i;n++){var r=t[n];if(r.ownerNode===e)return r}throw ee(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),fe=function(){function e(e){this.element=me(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),pe=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),ge=f,ve={isServer:!f,useCSSOMInjection:!p},ye=function(){function e(e,t,n){void 0===e&&(e=v),void 0===t&&(t={});var r=this;this.options=Object(i.a)(Object(i.a)({},ve),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&f&&ge&&(ge=!1,function(e){for(var t=document.querySelectorAll(se),n=0,i=t.length;n<i;n++){var r=t[n];r&&r.getAttribute(u)!==l&&(le(e,r),r.parentNode&&r.parentNode.removeChild(r))}}(this)),$(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,i="",r=function(n){var r=function(e){return ie.get(e)}(n);if(void 0===r)return"continue";var o=e.names.get(r),a=t.getGroup(n);if(void 0===o||0===a.length)return"continue";var s="".concat(u,".g").concat(n,'[id="').concat(r,'"]'),c="";void 0!==o&&o.forEach((function(e){e.length>0&&(c+="".concat(e,","))})),i+="".concat(a).concat(s,'{content:"').concat(c,'"}').concat(h)},o=0;o<n;o++)r(o);return i}(r)}))}return e.registerId=function(e){return oe(e)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(Object(i.a)(Object(i.a)({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new pe(n):t?new he(n):new fe(n)}(this.options),new te(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(oe(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(oe(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(oe(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Ce=/&/g,be=/^\s*\/\/.*$/gm;function Ae(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=Ae(e.children,t)),e}))}function Se(e){var t,n,i,r=void 0===e?v:e,o=r.options,a=void 0===o?v:o,c=r.plugins,u=void 0===c?g:c,l=function(e,i,r){return r.startsWith(n)&&r.endsWith(n)&&r.replaceAll(n,"").length>0?".".concat(t):e},d=u.slice();d.push((function(e){e.type===s.a&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Ce,n).replace(i,l))})),a.prefix&&d.push(s.d),d.push(s.g);var m=function(e,r,o,c){void 0===r&&(r=""),void 0===o&&(o=""),void 0===c&&(c="&"),t=c,n=r,i=new RegExp("\\".concat(n,"\\b"),"g");var u=e.replace(be,""),l=s.b(o||r?"".concat(o," ").concat(r," { ").concat(u," }"):u);a.namespace&&(l=Ae(l,a.namespace));var m=[];return s.f(l,s.c(d.concat(s.e((function(e){return m.push(e)}))))),m};return m.hash=u.length?u.reduce((function(e,t){return t.name||ee(15),B(e,t.name)}),5381).toString():"",m}var we=new ye,Ee=Se(),De=r.default.createContext({shouldForwardProp:void 0,styleSheet:we,stylis:Ee}),xe=(De.Consumer,r.default.createContext(void 0));function Be(){return Object(r.useContext)(De)}function Ie(e){var t=Object(r.useState)(e.stylisPlugins),n=t[0],i=t[1],o=Be().styleSheet,s=Object(r.useMemo)((function(){var t=o;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target,o]),c=Object(r.useMemo)((function(){return Se({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);Object(r.useEffect)((function(){a()(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]);var u=Object(r.useMemo)((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:s,stylis:c}}),[e.shouldForwardProp,s,c]);return r.default.createElement(De.Provider,{value:u},r.default.createElement(xe.Provider,{value:c},e.children))}var Te=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ee);var i=n.name+t.hash;e.hasNameForId(n.id,i)||e.insertRules(n.id,i,t(n.rules,i,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,$(this,(function(){throw ee(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=Ee),this.name+e.hash},e}(),Oe=function(e){return e>="A"&&e<="Z"};function ke(e){for(var t="",n=0;n<e.length;n++){var i=e[n];if(1===n&&"-"===i&&"-"===e[0])return e;Oe(i)?t+="-"+i.toLowerCase():t+=i}return t.startsWith("ms-")?"-"+t:t}var Pe=function(e){return null==e||!1===e||""===e},Le=function(e){var t,n,r=[];for(var o in e){var a=e[o];e.hasOwnProperty(o)&&!Pe(a)&&(Array.isArray(a)&&a.isCss||Y(a)?r.push("".concat(ke(o),":"),a,";"):K(a)?r.push.apply(r,Object(i.e)(Object(i.e)(["".concat(o," {")],Le(a),!1),["}"],!1)):r.push("".concat(ke(o),": ").concat((t=o,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in c.a||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function _e(e,t,n,i){return Pe(e)?[]:Q(e)?[".".concat(e.styledComponentId)]:Y(e)?!Y(r=e)||r.prototype&&r.prototype.isReactComponent||!t?[e]:_e(e(t),t,n,i):e instanceof Te?n?(e.inject(n,i),[e.getName(i)]):[e]:K(e)?Le(e):Array.isArray(e)?Array.prototype.concat.apply(g,e.map((function(e){return _e(e,t,n,i)}))):[e.toString()];var r}function Re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Y(n)&&!Q(n))return!1}return!0}var Me=I(m),Fe=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Re(e),this.componentId=t,this.baseHash=B(Me,t),this.baseStyle=n,ye.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))i=q(i,this.staticRulesId);else{var r=X(_e(this.rules,e,t,n)),o=D(B(this.baseHash,r)>>>0);if(!t.hasNameForId(this.componentId,o)){var a=n(r,".".concat(o),void 0,this.componentId);t.insertRules(this.componentId,o,a)}i=q(i,o),this.staticRulesId=o}else{for(var s=B(this.baseHash,n.hash),c="",u=0;u<this.rules.length;u++){var l=this.rules[u];if("string"==typeof l)c+=l;else if(l){var d=X(_e(l,e,t,n));s=B(s,d+u),c+=d}}if(c){var m=D(s>>>0);t.hasNameForId(this.componentId,m)||t.insertRules(this.componentId,m,n(c,".".concat(m),void 0,this.componentId)),i=q(i,m)}}return i},e}(),Ne=r.default.createContext(void 0);Ne.Consumer;var Ve={};new Set;function We(e,t,n){var o=Q(e),a=e,s=!k(e),c=t.attrs,u=void 0===c?g:c,l=t.componentId,d=void 0===l?function(e,t){var n="string"!=typeof e?"sc":S(e);Ve[n]=(Ve[n]||0)+1;var i="".concat(n,"-").concat(T(m+n+Ve[n]));return t?"".concat(t,"-").concat(i):i}(t.displayName,t.parentComponentId):l,h=t.displayName,f=void 0===h?function(e){return k(e)?"styled.".concat(e):"Styled(".concat(O(e),")")}(e):h,p=t.displayName&&t.componentId?"".concat(S(t.displayName),"-").concat(t.componentId):t.componentId||d,b=o&&a.attrs?a.attrs.concat(u).filter(Boolean):u,A=t.shouldForwardProp;if(o&&a.shouldForwardProp){var w=a.shouldForwardProp;if(t.shouldForwardProp){var E=t.shouldForwardProp;A=function(e,t){return w(e,t)&&E(e,t)}}else A=w}var D=new Fe(n,p,o?a.componentStyle:void 0);function x(e,t){return function(e,t,n){var o=e.attrs,a=e.componentStyle,s=e.defaultProps,c=e.foldedComponentIds,u=e.styledComponentId,l=e.target,d=r.default.useContext(Ne),m=Be(),h=e.shouldForwardProp||m.shouldForwardProp,f=y(t,d,s)||v,p=function(e,t,n){for(var r,o=Object(i.a)(Object(i.a)({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var s=Y(r=e[a])?r(o):r;for(var c in s)o[c]="className"===c?q(o[c],s[c]):"style"===c?Object(i.a)(Object(i.a)({},o[c]),s[c]):s[c]}return t.className&&(o.className=q(o.className,t.className)),o}(o,t,f),g=p.as||l,b={};for(var A in p)void 0===p[A]||"$"===A[0]||"as"===A||"theme"===A&&p.theme===f||("forwardedAs"===A?b.as=p.forwardedAs:h&&!h(A,g)||(b[A]=p[A]));var S=function(e,t){var n=Be();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(a,p),w=q(c,u);return S&&(w+=" "+S),p.className&&(w+=" "+p.className),b[k(g)&&!C.has(g)?"class":"className"]=w,b.ref=n,Object(r.createElement)(g,b)}(B,e,t)}x.displayName=f;var B=r.default.forwardRef(x);return B.attrs=b,B.componentStyle=D,B.displayName=f,B.shouldForwardProp=A,B.foldedComponentIds=o?q(a.foldedComponentIds,a.styledComponentId):"",B.styledComponentId=p,B.target=o?a.target:e,Object.defineProperty(B,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=o?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0,r=t;i<r.length;i++)J(e,r[i],!0);return e}({},a.defaultProps,e):e}}),$(B,(function(){return".".concat(B.styledComponentId)})),s&&G(B,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),B}function je(e,t){for(var n=[e[0]],i=0,r=t.length;i<r;i+=1)n.push(t[i],e[i+1]);return n}var ze=function(e){return Object.assign(e,{isCss:!0})};function He(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Y(e)||K(e))return ze(_e(je(g,Object(i.e)([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?_e(r):ze(_e(je(r,t)))}function Ue(e,t,n){if(void 0===n&&(n=v),!t)throw ee(1,t);var r=function(r){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,He.apply(void 0,Object(i.e)([r],o,!1)))};return r.attrs=function(r){return Ue(e,t,Object(i.a)(Object(i.a)({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return Ue(e,t,Object(i.a)(Object(i.a)({},n),r))},r}var Ze=function(e){return Ue(We,e)},Ge=Ze;C.forEach((function(e){Ge[e]=Ze(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Re(e),ye.registerId(this.componentId+1)}e.prototype.createStyles=function(e,t,n,i){var r=i(X(_e(this.rules,t,n,i)),""),o=this.componentId+e;n.insertRules(o,o,r)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,i){e>2&&ye.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,i)}}();function Ye(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=X(He.apply(void 0,Object(i.e)([e],t,!1))),o=T(r);return new Te(o,r)}(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=de(),i=X([n&&'nonce="'.concat(n,'"'),"".concat(u,'="true"'),"".concat(d,'="').concat(m,'"')].filter(Boolean)," ");return"<style ".concat(i,">").concat(t,"</style>")},this.getStyleTags=function(){if(e.sealed)throw ee(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw ee(2);var n=((t={})[u]="",t[d]=m,t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=de();return o&&(n.nonce=o),[r.default.createElement("style",Object(i.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new ye({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw ee(2);return r.default.createElement(Ie,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw ee(3)}})(),"__sc-".concat(u,"__")}).call(this,n(84))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(42),r=n(61),o=n(43);class a{constructor(e,t){this.errorInWorker=null,this.createProxy=e=>new Proxy({},{get:(t,n,i)=>new Proxy((()=>{}),{apply:(t,i,r)=>this.post(n,r,e),get:(t,i,r)=>(...t)=>this.post(n+"."+i,t,e)})}),this.handleUnrecoverableError=e=>{this.errorInWorker=e;for(const t in this.continuations)this.continuations[t].reject(e),delete this.continuations[t]},this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),this.api=new r.a(this),a.SINGLETON=this;const{requestSuffix:n=""}=t||{},s=Object(i.c)(t),c=`${e}${e.endsWith("/")?"":"/"}ScanbotSDK.Core${s}.js${n}`;if(Object(i.d)(c)){const e=new Blob([`importScripts("${c}")`]);this.instance=new Worker(URL.createObjectURL(e))}else this.instance=new Worker(c);this.continuations={},this.nextTicketId=1,this.instance.onmessage=e=>{const{log:t,logError:n}=e.data;if(t)return void console.log(...t);if(n)return void console.error(...n);const{ticket:i,result:r,recoverableError:a,unrecoverableError:s}=e.data,c=this.continuations[i];if(!c)return;const{resolve:u,reject:l,command:d}=c;if(delete this.continuations[i],s)l(s),this.handleUnrecoverableError(s);else if(a){l("errorType"in e.data?Object(o.b)(e.data.errorType,`Error in worker while running command '${d}'`,a):a)}else u(r)},this.instance.onerror=e=>{this.handleUnrecoverableError(e.error)}}post(e,t,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((r,o)=>{const a=Object(i.b)(t,"copy"==n),s=this.nextTicketId++;this.continuations[s]={resolve:r,reject:o,command:e},this.instance.postMessage({command:e,args:t,ticket:s},a)}))}destroy(){this.instance.terminate()}}a.SINGLETON=null},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a}));var i=n(19);const r=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"];class o{constructor(e={}){}}!function(e){e.all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],e.documentBarcodeFormats={AAMVA:["PDF_417"],ID_CARD_PDF_417:["PDF_417"],SEPA:["QR_CODE"],MEDICAL_CERTIFICATE:["PDF_417"],DE_MEDICAL_PLAN:["DATA_MATRIX"],BOARDING_PASS:["PDF_417","AZTEC","QR_CODE"],VCARD:["QR_CODE","DATA_MATRIX"],SWISS_QR:["QR_CODE"],GS1:["CODE_128","AZTEC","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","ITF","MICRO_PDF_417","PDF_417","QR_CODE","UPC_A","UPC_E"],HIBC:["CODE_39","CODE_128","AZTEC","DATA_MATRIX","MICRO_PDF_417","PDF_417","QR_CODE"]}}(o||(o={}));class a{constructor(e={}){if(void 0===e.success)throw new Error("success must be present in constructor argument");if(this.success=e.success,void 0===e.parsedDocument)throw new Error("parsedDocument must be present in constructor argument");this.parsedDocument=null!=e.parsedDocument?new i.f(e.parsedDocument):null}}},function(e,t,n){"use strict";var i,r;n.d(t,"n",(function(){return i})),n.d(t,"z",(function(){return r})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"h",(function(){return s})),n.d(t,"i",(function(){return c})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return l})),n.d(t,"o",(function(){return d})),n.d(t,"p",(function(){return m})),n.d(t,"q",(function(){return h})),n.d(t,"u",(function(){return f})),n.d(t,"J",(function(){return p})),n.d(t,"y",(function(){return g})),n.d(t,"H",(function(){return v})),n.d(t,"B",(function(){return y})),n.d(t,"G",(function(){return C})),n.d(t,"c",(function(){return A})),n.d(t,"D",(function(){return S})),n.d(t,"A",(function(){return w})),n.d(t,"x",(function(){return E})),n.d(t,"r",(function(){return D})),n.d(t,"w",(function(){return x})),n.d(t,"s",(function(){return b})),n.d(t,"a",(function(){return B})),n.d(t,"b",(function(){return I})),n.d(t,"v",(function(){return T})),n.d(t,"E",(function(){return O})),n.d(t,"F",(function(){return k})),n.d(t,"I",(function(){return P})),n.d(t,"C",(function(){return L})),n.d(t,"t",(function(){return _})),n.d(t,"l",(function(){return R})),n.d(t,"m",(function(){return M})),n.d(t,"k",(function(){return F})),n.d(t,"j",(function(){return N})),function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new o(e);case"BarcodeFormatCode11Configuration":return new a(e);case"BarcodeFormatCode39Configuration":return new s(e);case"BarcodeFormatCode93Configuration":return new c(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new l(e);case"BarcodeFormatDataBarConfiguration":return new d(e);case"BarcodeFormatDataBarExpandedConfiguration":return new m(e);case"BarcodeFormatDataBarLimitedConfiguration":return new h(e);case"BarcodeFormatITFConfiguration":return new f(e);case"BarcodeFormatMSIPlesseyConfiguration":return new g(e);case"BarcodeFormatUpcEanConfiguration":return new v(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);case"BarcodeFormatAztecConfiguration":return new A(e);case"BarcodeFormatQRCodeConfiguration":return new S(e);case"BarcodeFormatPDF417Configuration":return new w(e);case"BarcodeFormatMicroPDF417Configuration":return new E(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new x(e);case"BarcodeFormatAustraliaPostConfiguration":return new I(e);case"BarcodeFormatJapanPostConfiguration":return new T(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new L(e);case"BarcodeFormatGS1CompositeConfiguration":return new _(e);case"BarcodeFormatCommonOneDConfiguration":return new R(e);case"BarcodeFormatCommonTwoDConfiguration":return new M(e);case"BarcodeFormatCommonFourStateConfiguration":return new F(e);case"BarcodeFormatCommonConfiguration":return new N(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={})),function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new o(e);case"BarcodeFormatCode11Configuration":return new a(e);case"BarcodeFormatCode39Configuration":return new s(e);case"BarcodeFormatCode93Configuration":return new c(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new l(e);case"BarcodeFormatDataBarConfiguration":return new d(e);case"BarcodeFormatDataBarExpandedConfiguration":return new m(e);case"BarcodeFormatDataBarLimitedConfiguration":return new h(e);case"BarcodeFormatITFConfiguration":return new f(e);case"BarcodeFormatMSIPlesseyConfiguration":return new g(e);case"BarcodeFormatUpcEanConfiguration":return new v(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);default:throw`Unknown child class name: ${t}`}}}(r||(r={}));class o{constructor(e={}){this._type="BarcodeFormatCodabarConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=1,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.returnStartEnd&&(this.returnStartEnd=e.returnStartEnd)}}class a{constructor(e={}){this._type="BarcodeFormatCode11Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.checksum=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksum&&(this.checksum=e.checksum)}}class s{constructor(e={}){this._type="BarcodeFormatCode39Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn7=!0,this.pzn8=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.code32&&(this.code32=e.code32),void 0!==e.code39&&(this.code39=e.code39),void 0!==e.pzn7&&(this.pzn7=e.pzn7),void 0!==e.pzn8&&(this.pzn8=e.pzn8),void 0!==e.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=e.tryCode39ExtendedMode),void 0!==e.useCode39CheckDigit&&(this.useCode39CheckDigit=e.useCode39CheckDigit)}}class c{constructor(e={}){this._type="BarcodeFormatCode93Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class u{constructor(e={}){this._type="BarcodeFormatCode128Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.minimumTextLength=1,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class l{constructor(e={}){this._type="BarcodeFormatCode2Of5Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.iata2of5&&(this.iata2of5=e.iata2of5),void 0!==e.code25&&(this.code25=e.code25),void 0!==e.industrial2of5&&(this.industrial2of5=e.industrial2of5),void 0!==e.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=e.useIATA2OF5Checksum)}}class d{constructor(e={}){this._type="BarcodeFormatDataBarConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class m{constructor(e={}){this._type="BarcodeFormatDataBarExpandedConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class h{constructor(e={}){this._type="BarcodeFormatDataBarLimitedConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class f{constructor(e={}){this._type="BarcodeFormatITFConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=1,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}const p=["MOD_10","MOD_11_IBM","MOD_11_NCR","MOD_10_10","MOD_11_10_IBM","MOD_11_10_NCR"];class g{constructor(e={}){this._type="BarcodeFormatMSIPlesseyConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksumAlgorithms&&(this.checksumAlgorithms=e.checksumAlgorithms.map((e=>e)))}}class v{constructor(e={}){this._type="BarcodeFormatUpcEanConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="ALLOW_ANY",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.ean8&&(this.ean8=e.ean8),void 0!==e.ean13&&(this.ean13=e.ean13),void 0!==e.upca&&(this.upca=e.upca),void 0!==e.upce&&(this.upce=e.upce),void 0!==e.extensions&&(this.extensions=e.extensions)}}class y{constructor(e={}){this._type="BarcodeFormatPharmaCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue),void 0!==e.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=e.allowNarrowBarsOnly),void 0!==e.allowWideBarsOnly&&(this.allowWideBarsOnly=e.allowWideBarsOnly)}}var C,b;!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAztecConfiguration":return new A(e);case"BarcodeFormatQRCodeConfiguration":return new S(e);case"BarcodeFormatPDF417Configuration":return new w(e);case"BarcodeFormatMicroPDF417Configuration":return new E(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new x(e);default:throw`Unknown child class name: ${t}`}}}(C||(C={}));class A{constructor(e={}){this._type="BarcodeFormatAztecConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class S{constructor(e={}){this._type="BarcodeFormatQRCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.qr&&(this.qr=e.qr),void 0!==e.microQr&&(this.microQr=e.microQr),void 0!==e.rmqr&&(this.rmqr=e.rmqr)}}class w{constructor(e={}){this._type="BarcodeFormatPDF417Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class E{constructor(e={}){this._type="BarcodeFormatMicroPDF417Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class D{constructor(e={}){this._type="BarcodeFormatDataMatrixConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class x{constructor(e={}){this._type="BarcodeFormatMaxiCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAustraliaPostConfiguration":return new I(e);case"BarcodeFormatJapanPostConfiguration":return new T(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new L(e);default:throw`Unknown child class name: ${t}`}}}(b||(b={}));const B=["NUMERIC","ALPHA_NUMERIC"];class I{constructor(e={}){this._type="BarcodeFormatAustraliaPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=e.australiaPostCustomerFormat)}}class T{constructor(e={}){this._type="BarcodeFormatJapanPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class O{constructor(e={}){this._type="BarcodeFormatRoyalMailConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.stripCheckDigits=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits)}}class k{constructor(e={}){this._type="BarcodeFormatRoyalTNTPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class P{constructor(e={}){this._type="BarcodeFormatUSPSIntelligentMailConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class L{constructor(e={}){this._type="BarcodeFormatPharmaCodeTwoTrackConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimumValue=364,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue)}}class _{constructor(e={}){this._type="BarcodeFormatGS1CompositeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class R{constructor(e={}){this._type="BarcodeFormatCommonOneDConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.gs1Handling="PARSE",this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN_7","PZN_8","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class M{constructor(e={}){this._type="BarcodeFormatCommonTwoDConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class F{constructor(e={}){this._type="BarcodeFormatCommonFourStateConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class N{constructor(e={}){this._type="BarcodeFormatCommonConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"e",(function(){return r})),n.d(t,"f",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"g",(function(){return u}));const i=["UNKNOWN","ASCII","ISO_8859_PART1","ISO_8859_PART2","ISO_8859_PART3","ISO_8859_PART4","ISO_8859_PART5","ISO_8859_PART6","ISO_8859_PART7","ISO_8859_PART8","ISO_8859_PART9","ISO_8859_PART10","ISO_8859_PART11","ISO_8859_PART13","ISO_8859_PART14","ISO_8859_PART15","ISO_8859_PART16","CP_437","CP_1250","CP_1251","CP_1252","CP_1256","SHIFT_JIS","BIG_5","GB_2312","GB_18030","EUC_JP","EUC_KR","UTF_16_BE","UTF_8","UTF_16_LE","UTF_32_BE","UTF_32_LE","BINARY"];class r{constructor(e={}){if(void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start=e.start,void 0===e.end)throw new Error("end must be present in constructor argument");if(this.end=e.end,void 0===e.encoding)throw new Error("encoding must be present in constructor argument");this.encoding=e.encoding}}class o{constructor(e={}){if(void 0===e.count)throw new Error("count must be present in constructor argument");if(this.count=e.count,void 0===e.index)throw new Error("index must be present in constructor argument");if(this.index=e.index,void 0===e.id)throw new Error("id must be present in constructor argument");this.id=e.id}}const a=["NONE","AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","EAN_8","EAN_13","ITF","MAXI_CODE","PDF_417","QR_CODE","DATABAR","DATABAR_EXPANDED","UPC_A","UPC_E","MSI_PLESSEY","IATA_2_OF_5","INDUSTRIAL_2_OF_5","CODE_25","MICRO_QR_CODE","USPS_INTELLIGENT_MAIL","ROYAL_MAIL","JAPAN_POST","ROYAL_TNT_POST","AUSTRALIA_POST","DATABAR_LIMITED","MICRO_PDF_417","GS1_COMPOSITE","RMQR_CODE","CODE_11","CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN_7","PZN_8"];class s{constructor(e={}){}}!function(e){e.oned=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN_7","PZN_8","UPC_A","UPC_E"],e.twod=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],e.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],e.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN_7","PZN_8"],e.common=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],e.all=["AUSTRALIA_POST","AZTEC","CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","JAPAN_POST","MAXI_CODE","MICRO_PDF_417","MICRO_QR_CODE","MSI_PLESSEY","PDF_417","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN_7","PZN_8","QR_CODE","RMQR_CODE","ROYAL_MAIL","ROYAL_TNT_POST","UPC_A","UPC_E","USPS_INTELLIGENT_MAIL"]}(s||(s={}));const c=["PARSE","VALIDATE_STRUCTURE","DECODE_STRUCTURE","VALIDATE_FULL","DECODE_FULL"],u=["REQUIRE_2","REQUIRE_5","REQUIRE_ANY","IGNORE","ALLOW_2","ALLOW_5","ALLOW_ANY"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return s}));var i=n(15);class r{constructor(e={}){this.crop=!0,void 0!==e.crop&&(this.crop=e.crop)}}const o=["SUCCESS","FAILURE_SCANNING"],a=["UNKNOWN","BILL_OF_LADING","PAY_SHEET","SCALE_TICKET","TOLL_RECEIPT","WASH_RECEIPT"];class s{constructor(e={}){if(void 0===e.documentType)throw new Error("documentType must be present in constructor argument");if(this.documentType=e.documentType,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.status)throw new Error("status must be present in constructor argument");if(this.status=e.status,void 0===e.documentScanningResult)throw new Error("documentScanningResult must be present in constructor argument");this.documentScanningResult=new i.g(e.documentScanningResult)}}},function(e,t,n){"use strict";n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"f",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"p",(function(){return m})),n.d(t,"i",(function(){return h})),n.d(t,"b",(function(){return f})),n.d(t,"q",(function(){return p})),n.d(t,"l",(function(){return g})),n.d(t,"a",(function(){return v})),n.d(t,"n",(function(){return y})),n.d(t,"k",(function(){return C})),n.d(t,"o",(function(){return b})),n.d(t,"j",(function(){return A})),n.d(t,"m",(function(){return S})),n.d(t,"h",(function(){return w})),n.d(t,"g",(function(){return E}));var i=n(69),r=n(15),o=n(19),a=n(10),s=n(32);const c=["SUCCESS","ERROR_NOTHING_FOUND","ERROR_BAD_CROP","ERROR_UNKNOWN_DOCUMENT","ERROR_UNACCEPTABLE_DOCUMENT","ERROR_STILL_FOCUSSING","INCOMPLETE_VALIDATION"];class u{constructor(e={}){if(this.croppedImage=null,void 0===e.status)throw new Error("status must be present in constructor argument");if(this.status=e.status,void 0===e.document)throw new Error("document must be present in constructor argument");if(this.document=null!=e.document?new o.f(e.document):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");this.documentDetectionResult=new r.a(e.documentDetectionResult),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?new a.a(e.croppedImage):null)}}const l=["TRUSTED","UNTRUSTED"];class d{constructor(e={}){if(this.resultAccumulationConfig=new s.c({}),this.fieldExcludeList=[],this.returnCrops=!1,this.documentTrustMode="TRUSTED",this.processingMode="AUTO",void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new s.c(e.resultAccumulationConfig)),void 0!==e.fieldExcludeList&&(this.fieldExcludeList=e.fieldExcludeList.map((e=>e))),void 0===e.configurations)throw new Error("configurations must be present in constructor argument");this.configurations=e.configurations.map((e=>i.e.From(e))),void 0!==e.returnCrops&&(this.returnCrops=e.returnCrops),void 0!==e.documentTrustMode&&(this.documentTrustMode=e.documentTrustMode),void 0!==e.processingMode&&(this.processingMode=e.processingMode)}}const m=["OK","OK_PUNCTUATION_UPPER_CASE_CLEANED","OK_DEBURRED","OK_DEBURRED_EXTENDED","OK_TRUNCATED","INCONSISTENT"];class h{constructor(e={}){if(void 0===e.fieldType)throw new Error("fieldType must be present in constructor argument");if(this.fieldType=e.fieldType,void 0===e.consistency)throw new Error("consistency must be present in constructor argument");if(this.consistency=e.consistency,void 0===e.fieldFullNames)throw new Error("fieldFullNames must be present in constructor argument");this.fieldFullNames=e.fieldFullNames.map((e=>e))}}class f{constructor(e={}){if(void 0===e.overallConsistency)throw new Error("overallConsistency must be present in constructor argument");if(this.overallConsistency=e.overallConsistency,void 0===e.fieldDetails)throw new Error("fieldDetails must be present in constructor argument");this.fieldDetails=e.fieldDetails.map((e=>new h(e)))}}const p=["SKIPPED","VALID","INVALID"];class g{constructor(e={}){if(void 0===e.fieldFullName)throw new Error("fieldFullName must be present in constructor argument");if(this.fieldFullName=e.fieldFullName,void 0===e.invalidSemantics)throw new Error("invalidSemantics must be present in constructor argument");this.invalidSemantics=e.invalidSemantics}}class v{constructor(e={}){if(void 0===e.overallFieldValueSemantics)throw new Error("overallFieldValueSemantics must be present in constructor argument");if(this.overallFieldValueSemantics=e.overallFieldValueSemantics,void 0===e.fieldDetails)throw new Error("fieldDetails must be present in constructor argument");this.fieldDetails=e.fieldDetails.map((e=>new g(e)))}}class y{constructor(e={}){if(void 0===e.overallInvalidSemantics)throw new Error("overallInvalidSemantics must be present in constructor argument");if(this.overallInvalidSemantics=e.overallInvalidSemantics,void 0===e.expiryDateSemantics)throw new Error("expiryDateSemantics must be present in constructor argument");if(this.expiryDateSemantics=new v(e.expiryDateSemantics),void 0===e.issueDateSemantics)throw new Error("issueDateSemantics must be present in constructor argument");if(this.issueDateSemantics=new v(e.issueDateSemantics),void 0===e.birthDateSemantics)throw new Error("birthDateSemantics must be present in constructor argument");if(this.birthDateSemantics=new v(e.birthDateSemantics),void 0===e.issueDateBeforeExpiryDate)throw new Error("issueDateBeforeExpiryDate must be present in constructor argument");if(this.issueDateBeforeExpiryDate=e.issueDateBeforeExpiryDate,void 0===e.birthDateBeforeIssueDate)throw new Error("birthDateBeforeIssueDate must be present in constructor argument");if(this.birthDateBeforeIssueDate=e.birthDateBeforeIssueDate,void 0===e.birthDateBeforeExpiryDate)throw new Error("birthDateBeforeExpiryDate must be present in constructor argument");this.birthDateBeforeExpiryDate=e.birthDateBeforeExpiryDate}}class C{constructor(e={}){if(void 0===e.fieldFullName)throw new Error("fieldFullName must be present in constructor argument");if(this.fieldFullName=e.fieldFullName,void 0===e.isSuspicious)throw new Error("isSuspicious must be present in constructor argument");this.isSuspicious=e.isSuspicious}}class b{constructor(e={}){if(void 0===e.overallSuspiciousData)throw new Error("overallSuspiciousData must be present in constructor argument");if(this.overallSuspiciousData=e.overallSuspiciousData,void 0===e.fieldDetails)throw new Error("fieldDetails must be present in constructor argument");this.fieldDetails=e.fieldDetails.map((e=>new C(e)))}}class A{constructor(e={}){if(void 0===e.fieldFullName)throw new Error("fieldFullName must be present in constructor argument");if(this.fieldFullName=e.fieldFullName,void 0===e.isInvalid)throw new Error("isInvalid must be present in constructor argument");this.isInvalid=e.isInvalid}}class S{constructor(e={}){if(void 0===e.overallIsInvalid)throw new Error("overallIsInvalid must be present in constructor argument");if(this.overallIsInvalid=e.overallIsInvalid,void 0===e.fieldDetails)throw new Error("fieldDetails must be present in constructor argument");this.fieldDetails=e.fieldDetails.map((e=>new A(e)))}}const w=["OK","OK_WITH_WARNINGS","INVALID"];class E{constructor(e={}){if(void 0===e.overallVerificationStatus)throw new Error("overallVerificationStatus must be present in constructor argument");if(this.overallVerificationStatus=e.overallVerificationStatus,void 0===e.consistencyVerificationReport)throw new Error("consistencyVerificationReport must be present in constructor argument");if(this.consistencyVerificationReport=new f(e.consistencyVerificationReport),void 0===e.semanticsVerificationReport)throw new Error("semanticsVerificationReport must be present in constructor argument");if(this.semanticsVerificationReport=new y(e.semanticsVerificationReport),void 0===e.suspiciousDataVerificationReport)throw new Error("suspiciousDataVerificationReport must be present in constructor argument");if(this.suspiciousDataVerificationReport=new b(e.suspiciousDataVerificationReport),void 0===e.invalidDataVerificationReport)throw new Error("invalidDataVerificationReport must be present in constructor argument");this.invalidDataVerificationReport=new S(e.invalidDataVerificationReport)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var i=n(10),r=n(25),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new r.d({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.MrzScanner.create(new r.d(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.MrzScanner.run(this.objectId,e);return{result:new r.e(o.result),originalImage:new i.a(o.originalImage)}}))}clearResult(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.MrzScanner.clearResult(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.MrzScanner.destroy(this.objectId)}))}}class s{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new r.c({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.MrzParser.create(new r.c(t));return new s(e,n)}))}parse(e){return o(this,void 0,void 0,(function*(){const t=this.workerBridge.copyArgs;return yield t.MrzParser.parse(this.objectId,e)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.MrzParser.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"i",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return h})),n.d(t,"j",(function(){return f}));var i=n(15),r=n(10);class o{constructor(e={}){this.shouldCropDocument=!0,this.recognizePatientInfoBox=!0,this.recognizeBarcode=!0,this.extractCroppedImage=!1,this.preprocessInput=!1,void 0!==e.shouldCropDocument&&(this.shouldCropDocument=e.shouldCropDocument),void 0!==e.recognizePatientInfoBox&&(this.recognizePatientInfoBox=e.recognizePatientInfoBox),void 0!==e.recognizeBarcode&&(this.recognizeBarcode=e.recognizeBarcode),void 0!==e.extractCroppedImage&&(this.extractCroppedImage=e.extractCroppedImage),void 0!==e.preprocessInput&&(this.preprocessInput=e.preprocessInput)}}const a=["UNKNOWN","WORK_ACCIDENT","ASSIGNED_TO_ACCIDENT_INSURANCE_DOCTOR","INITIAL_CERTIFICATE","RENEWED_CERTIFICATE","INSURED_PAY_CASE","FINAL_CERTIFICATE","REQUIRES_CARE_YES","REQUIRES_CARE_NO","ACCIDENT_YES","ACCIDENT_NO","OTHER_ACCIDENT","ENTITLEMENT_TO_CONTINUED_PAYMENT_YES","ENTITLEMENT_TO_CONTINUED_PAYMENT_NO","SICK_PAY_WAS_CLAIMED_NO","SICK_PAY_WAS_CLAIMED_YES","SINGLE_PARENT_NO","SINGLE_PARENT_YES"];class s{constructor(e={}){if(this.type="UNKNOWN",this.checked=!1,this.checkedConfidence=0,void 0!==e.type&&(this.type=e.type),void 0!==e.checked&&(this.checked=e.checked),void 0!==e.checkedConfidence&&(this.checkedConfidence=e.checkedConfidence),void 0===e.quad)throw new Error("quad must be present in constructor argument");this.quad=e.quad.map((e=>({x:e.x,y:e.y})))}}const c=["INCAPABLE_OF_WORK_SINCE","INCAPABLE_OF_WORK_UNTIL","DIAGNOSED_ON","DOCUMENT_DATE","BIRTH_DATE","CHILD_NEEDS_CARE_FROM","CHILD_NEEDS_CARE_UNTIL","UNDEFINED"];class u{constructor(e={}){if(this.value="",this.rawString="",this.type="UNDEFINED",this.recognitionConfidence=0,void 0===e.quad)throw new Error("quad must be present in constructor argument");this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0!==e.value&&(this.value=e.value),void 0!==e.rawString&&(this.rawString=e.rawString),void 0!==e.type&&(this.type=e.type),void 0!==e.recognitionConfidence&&(this.recognitionConfidence=e.recognitionConfidence)}}const l=["INSURANCE_PROVIDER","FIRST_NAME","LAST_NAME","ADDRESS_STRING1","ADDRESS_STRING2","DIAGNOSE","HEALTH_INSURANCE_NUMBER","INSURED_PERSON_NUMBER","STATUS","PLACE_OF_OPERATION_NUMBER","DOCTOR_NUMBER","UNDEFINED"];class d{constructor(e={}){if(void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=e.value,void 0===e.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=e.recognitionConfidence}}class m{constructor(e={}){if(this.hasContents=!1,void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.fields)throw new Error("fields must be present in constructor argument");this.fields=e.fields.map((e=>new d(e))),void 0!==e.hasContents&&(this.hasContents=e.hasContents)}}const h=["UNKNOWN","FORM_1A","FORM_1B","FORM_1C","FORM_1D","FORM_21A","FORM_21A_BACK","FORM_1B_CUSTOM"];class f{constructor(e={}){if(this.scanningSuccessful=!1,this.formType="UNKNOWN",this.clockwiseRotations=0,this.croppedImage=null,this.scaleX=1,this.scaleY=1,void 0!==e.scanningSuccessful&&(this.scanningSuccessful=e.scanningSuccessful),void 0===e.patientInfoBox)throw new Error("patientInfoBox must be present in constructor argument");if(this.patientInfoBox=new m(e.patientInfoBox),void 0===e.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=e.checkBoxes.map((e=>new s(e))),void 0===e.dates)throw new Error("dates must be present in constructor argument");if(this.dates=e.dates.map((e=>new u(e))),void 0!==e.formType&&(this.formType=e.formType),void 0!==e.clockwiseRotations&&(this.clockwiseRotations=e.clockwiseRotations),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?new r.a(e.croppedImage):null),void 0!==e.scaleX&&(this.scaleX=e.scaleX),void 0!==e.scaleY&&(this.scaleY=e.scaleY),void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");this.documentDetectionResult=null!=e.documentDetectionResult?new i.a(e.documentDetectionResult):null}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(0),r=n(34),o=n(3),a=n(9);class s extends i.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(e){super(e),this.holePosition=r.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=e=>{var t,n,i,r;(null===(t=this.props.configuration.minimumInsets)||void 0===t?void 0:t.top)===(null===(n=e.configuration.minimumInsets)||void 0===n?void 0:n.top)&&(null===(i=this.props.configuration)||void 0===i?void 0:i.minimumInsets.bottom)===(null===(r=e.configuration)||void 0===r?void 0:r.minimumInsets.bottom)&&this.props.configuration===e.configuration&&this.props.guidanceConfiguration===e.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var e;return null!==(e=this.holeCanvas.getBoundingClientRect())&&void 0!==e?e:new DOMRect},this.scaleForRetinaDisplay=e=>{if(window.devicePixelRatio>1){const t=e.width,n=e.height;e.width=t*window.devicePixelRatio,e.height=n*window.devicePixelRatio,e.style.width=t+"px",e.style.height=n+"px",e.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var e,t,n;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const i=this.getVideoSize().width,r=this.getVideoSize().height;this.holeCanvas.width=i,this.holeCanvas.height=r,this.crosshairCanvas.width=i,this.crosshairCanvas.height=r,this.scaleForRetinaDisplay(this.crosshairCanvas);const o=this.props.configuration.minimumInsets,a=i-(2*this.props.configuration.style.strokeWidth+o.left+o.right),s=null!==(e=null==o?void 0:o.top)&&void 0!==e?e:0,c=null!==(t=null==o?void 0:o.bottom)&&void 0!==t?t:0,u=Math.min(a,i-(o.left+o.right)),l=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;if(-1!==this.props.configuration.preferredHeight){const e=this.props.configuration.preferredHeight,t=e*l;t>a?(this.holePosition.width=a,this.holePosition.height=a/l):(this.holePosition.width=t,this.holePosition.height=e)}else this.holePosition.width=u,this.holePosition.height=this.holePosition.width/l;const d=(i-this.holePosition.width)/2;o.left>d||o.right>d?(o.left>d&&(this.holePosition.x=o.left),o.right>d&&(this.holePosition.x=i-this.holePosition.width-o.right)):this.holePosition.x=d;const m=r-s-c-((null===(n=this.guidanceText)||void 0===n?void 0:n.clientHeight)+this.guidanceTextTopPadding||0);this.holePosition.height>m?(this.holePosition.height=m,this.holePosition.width=this.holePosition.height*l,this.holePosition.x=i/2-this.holePosition.width/2,this.holePosition.y=s):this.holePosition.y=s+(m-this.holePosition.height)/1.9;const h=this.holeCanvas.getContext("2d");h.save(),this.drawBackground(h),h.globalCompositeOperation="destination-out",this.drawHole();const f=this.crosshairCanvas.getContext("2d");f.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),h.restore(),f.restore()},this.drawBackground=e=>{const{width:t,height:n}=this.getVideoSize();e.clearRect(0,0,t,n),e.beginPath(),e.rect(0,0,t,n),e.fillStyle=o.b.getColorValue(this.props.configuration.overlayColor),e.fill()},this.drawHole=()=>{const e=this.holeCanvas.getContext("2d"),t=this.cornerRadius(),n=this.holePosition.x,i=this.holePosition.y,r=this.holePosition.width,o=this.holePosition.height;e.beginPath(),e.fillStyle="black",e.moveTo(n+t,i),e.arcTo(n+r,i,n+r,i+o,t),e.arcTo(n+r,i+o,n,i+o,t),e.arcTo(n,i+o,n,i,t),e.arcTo(n,i,n+r,i,t),e.closePath(),e.fill()},this.drawCrosshair=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;e.beginPath(),e.moveTo(t-10,n),e.lineTo(t+10,n),e.moveTo(t,n-10),e.lineTo(t,n+10),e.strokeStyle="white",e.fillStyle="white",e.lineWidth=1,e.stroke()},this.drawHoleCorners=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x,n=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height,a=15,s=this.style.strokeWidth,c=this.cornerRadius();e.beginPath(),e.moveTo(t,n+a),e.arcTo(t,n,t+i,n,c),e.lineTo(t+a,n),e.moveTo(t+i-a,n),e.arcTo(t+i,n,t+i,n+r,c),e.lineTo(t+i,n+a),e.moveTo(t+i,n+r-a),e.arcTo(t+i,n+r,t,n+r,c),e.lineTo(t+i-a,n+r),e.moveTo(t,n+r-a),e.arcTo(t,n+r,t+i,n+r,c),e.lineTo(t+a,n+r),e.strokeStyle=o.b.getColorValue(this.style.strokeColor),e.lineWidth=s,e.stroke()},this.drawHoleOutline=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x,n=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+i,n,t+i,n+r,a),e.moveTo(t+i,n+a),e.arcTo(t+i,n+r,t,n+r,a),e.moveTo(t+i-a,n+r),e.arcTo(t,n+r,t,n,a),e.moveTo(t,n+r-a),e.arcTo(t,n,t+i,n,a),e.strokeStyle=o.b.getColorValue(this.style.strokeColor),e.lineWidth=s,e.stroke()},this.guidanceTextTopPadding=20,this.render=()=>i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",textAlign:"left"},onClick:e=>{const t=this.holePosition;e.clientX>this.holePosition.x&&e.clientX<t.x+t.width&&e.clientY>t.y&&e.clientY<t.y+t.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},i.default.createElement("canvas",{ref:e=>{this.holeCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),i.default.createElement("canvas",{ref:e=>{this.crosshairCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&i.default.createElement("div",{ref:e=>{this.guidanceText=e},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},i.default.createElement(a.a,{style:{display:"inline-block",backgroundColor:o.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:o.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1,maxWidth:"94%",wordWrap:"break-word"},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var e,t;return this.holeRect.bottom()+(null!==(t=null===(e=this.guidanceText)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){const e=this.holePosition;return Math.max(0,Math.min(this.style.cornerRadius,e.width/2,e.height/2))}}},function(e,t,n){var i;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var o=typeof i;if("string"===o||"number"===o)e.push(i);else if(Array.isArray(i)){if(i.length){var a=r.apply(null,i);a&&e.push(a)}}else if("object"===o)if(i.toString===Object.prototype.toString)for(var s in i)n.call(i,s)&&i[s]&&e.push(s);else e.push(i.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(i=function(){return r}.apply(t,[]))||(e.exports=i)}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var i=n(0),r=n(18),o=n(41),a=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class s extends i.default.Component{constructor(e){super(e),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(e){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(e){var t,n;return a(this,void 0,void 0,(function*(){const i=this.props.preferredCamera;if(i)try{const t=(yield navigator.mediaDevices.enumerateDevices()).find((e=>e.deviceId===i||e.label===i));if(t)return Object.assign(Object.assign({},e),{deviceId:t.deviceId})}catch(e){throw r.a.enumerateDevicesFailed()}else{const i={user:"front",environment:"back"},r=(null===(t=null==e?void 0:e.facingMode)||void 0===t?void 0:t.ideal)||(null===(n=null==e?void 0:e.facingMode)||void 0===n?void 0:n.exact)||(null==e?void 0:e.facingMode);if("string"==typeof r&&r in i){yield o.a.INSTANCE.load();const t=o.a.INSTANCE.getMainCamera(i[r]);if(t)return Object.assign(Object.assign({},e),{deviceId:t.deviceId})}}return e}))}componentDidMount(){return a(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var e,t,n,i,o,s,c,u;return a(this,void 0,void 0,(function*(){if(r.a.hasCheckedPermission()||(yield r.a.tryCheckPermission()),r.a.hasDeniedPermission())null===(t=(e=this.props).onError)||void 0===t||t.call(e,r.a.permissionDenied());else try{const e={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};if(!navigator.mediaDevices){const e=r.a.unknown();return null===(i=(n=this.props).onError)||void 0===i||i.call(n,e),void console.log(e)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(e);this.setState({stream:t},(()=>{var e,n,i,r;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(r=(i=this.props).onReady)||void 0===r||r.call(i)}))}catch(e){const t=r.a.mediaDeviceNotFound();return null===(s=(o=this.props).onError)||void 0===s||s.call(o,t),void console.error(t)}}catch(e){const t=r.a.createFromDOMException(e);return null===(u=(c=this.props).onError)||void 0===u||u.call(c,t),void console.error(t)}}))}stopCurrentStreams(){const e=this.state.stream,t=null==e?void 0:e.getTracks();t&&t.forEach((e=>{e.stop()}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationchangeCallback),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((e=>e.stop())),this.state.stream.getAudioTracks().forEach((e=>e.stop()))),this.setState({stream:void 0}))}render(){return this.props.children}updateTorch(e){return a(this,void 0,void 0,(function*(){const t=[{torch:e}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:t})}))}getCapabilities(){if(this.state.stream.getVideoTracks){const e=this.getVideoTrack();return s.getMediaTrackCapabilities(e)}}static getMediaTrackCapabilities(e){if(e&&e.getCapabilities)return e.getCapabilities()}getVideoTrack(){const e=this.state.stream.getVideoTracks();if(e.length>0)return e[0]}}var c=n(11),u=n(34),l=n(23),d=n(60);class m{static isSupported(){return!!document.createElement("canvas").getContext("webgl")}constructor(){this._type="WebGL",this.canvas=document.createElement("canvas");const e=this.gl=this.canvas.getContext("webgl",{willReadFrequently:!0}),t=e.createTexture();e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR);const n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,"attribute vec2 p;void main(){ gl_Position = vec4(p,0,1);}"),e.compileShader(n);const i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,"precision mediump float;uniform sampler2D texture; uniform vec2 scale; uniform vec2 offset; void main() { gl_FragColor=texture2D( texture, gl_FragCoord.xy * scale + offset );}"),e.compileShader(i);const r=this.program=e.createProgram();e.attachShader(r,n),e.attachShader(r,i),e.linkProgram(r),e.useProgram(r),e.uniform1i(e.getUniformLocation(r,"texture"),0),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(0),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0)}getImageData(e,t,n,i,r,o,a,s){let c,u;if(o=Math.floor(o),a=Math.floor(a),t=Math.floor(t),n=Math.floor(n),i=Math.floor(i),r=Math.floor(r),e instanceof HTMLVideoElement)[u,c]=[e.videoWidth,e.videoHeight];else{if(!(e instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[u,c]=[e.width,e.height]}(u<t+i||c<n+r)&&l.a.debug("Crop region exceeds source video dimensions. This can happen when the screen is resized or rotated and the video has not yet changed its size. Most likely, the frame we analyzed now contains some garbage data. This is not a problem, unless it happens very frequently.");const m=this.gl;this.canvas.width=o,this.canvas.height=a,m.viewport(0,0,o,a);const h=[i/(o*u),r/(a*c)],f=[t/u,n/c];return m.uniform2fv(m.getUniformLocation(this.program,"scale"),h),m.uniform2fv(m.getUniformLocation(this.program,"offset"),f),m.texImage2D(m.TEXTURE_2D,0,m.RGB,m.RGB,m.UNSIGNED_BYTE,e),m.drawArrays(m.TRIANGLES,0,6),(null==s?void 0:s.byteLength)!==o*a*4&&(s=new Uint8ClampedArray(o*a*4),d.a.INSTANCE.values.set("WebGLNumBufferAllocations",(d.a.INSTANCE.values.get("WebGLNumBufferAllocations")||0)+1)),m.readPixels(0,0,o,a,m.RGBA,m.UNSIGNED_BYTE,s),new ImageData(s,o,a)}}class h{constructor(){this._type="TwoD",this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0,alpha:!1}),this.ctx.imageSmoothingEnabled=!1}getImageData(e,t,n,i,r,o,a,s){return this.canvas.width=o,this.canvas.height=a,this.ctx.drawImage(e,t,n,i,r,0,0,o,a),this.ctx.getImageData(0,0,o,a)}}var f=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class p extends i.default.Component{constructor(e){super(e),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this._reusableImageBuffer=null,this.onStreamChanged=e=>{this.video.srcObject=e,this.updateCameraInfo(e),this.video.addEventListener("resize",(e=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(e=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:e,clientVideoHeight:t}=this.calculateClientVideoConstraints();return new c.a(e,t)}saveExtractedData(){this.save=!0}zoom(){var e;return null!==(e=this.props.zoom)&&void 0!==e?e:1}imageCapture(){if(this.capture)return this.capture;const e=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(e),this.capture}set reusableImageBuffer(e){let t=e.__image_data;this._reusableImageBuffer=t.data}createImageData(e=0,t){return f(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(t){const e=yield this.imageCapture().takePhoto(),t=yield createImageBitmap(e);l.a.debug("Bitmap size: "+t.width*t.height);const i=this.windowSize(),r=t.height/(i.height+i.y),o=i.width*r,a=i.height*r,s=t.width/2-o/2,c=i.y*r,d=new u.a(s,c,o,a);return l.a.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height),n.getImageData(this.video,d.x,d.y,t.width,t.height,d.width,d.height,this._reusableImageBuffer)}let{videoWidth:i,videoHeight:r}=this.video,{clientVideoWidth:o,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const c=this.finderFrame||new u.a(0,0,o,a);if(c.width<=0||c.height<=0)return;const d=this.zoom(),m=(i-o/d)/2,h=(r-a/d)/2,f=c.x/s+m,p=c.y/s+h,g=this.finderFrame?s:d,v=c.width/g,y=c.height/g,C=this.calculateFrameSize(e,v,y);return n.getImageData(this.video,f,p,v,y,C.width,C.height,this._reusableImageBuffer)}))}windowSize(){var e;const t=this.props.configuration,n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return u.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:e,videoHeight:t}=this.video,n=this.video.getBoundingClientRect(),i=e,r=t,o=1;return n.width/n.height<=e/t?(o=n.height/t,o>0&&(i=n.width/o)):(o=n.width/e,o>0&&(r=n.height/o)),{clientVideoWidth:i,clientVideoHeight:r,coef:o}}calculateFrameSize(e,t,n){let i=t,r=n;if(e>0&&0!=t&&0!=n){const o=t/n;t>n?(i=t>e?e:t,r=i/o):(r=n>e?e:n,i=r*o)}return new c.a(i,r)}getCanvasRenderingContext(){return this.video?0===this.video.videoWidth?null:(this.canvas&&!this.reloadCanvas||(this.canvas&&this.releaseCanvas(),this.canvas=m.isSupported()?new m:new h,this.reloadCanvas=!1),this.canvas):null}releaseCanvas(){this.canvas&&(this.canvas=null)}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){var e;const t={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(e=this.props.configuration)||void 0===e?void 0:e.backgroundColor};return this.state.mirrored&&(t.transform="scaleX(-1)"),t}zoomMargin(){const e=this.zoom();return 1===e?0:(1-e)/2*100}render(){const{videoConstraints:e,onReady:t,onError:n}=this.props;return i.default.createElement(s,{videoConstraints:e,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:t,onStreamChanged:this.onStreamChanged,onError:n,ref:e=>{this.videoStream=e}},i.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:e=>{this.video=e},style:this.style()}))}setDirection(e){this.props.videoConstraints.facingMode={ideal:e},this.setState({facingModeBack:"environment"===e,mirrored:"user"===e},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}swapCameraFacing(e){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const t=!this.state.facingModeBack,n=t?"environment":"user";this.props.videoConstraints.facingMode=!0===e?{exact:n}:{ideal:n},this.setState({facingModeBack:t,mirrored:!t},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(e,t){return f(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=t?t:this.state.mirrored,deviceId:e},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(e){this.activeCamera=o.a.getCameraInfoFromStream(e)}getActiveCameraInfo(){return this.activeCamera}setTorchState(e){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:e}]})}return Promise.reject("Torch is not supported for current camera.")}}},function(e,t,n){"use strict";var i=n(15);n.d(t,"a",(function(){return i.c})),n.d(t,"b",(function(){return i.f}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(){this.values=new Map}}i.INSTANCE=new i},function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var i=n(49),r=n(28),o=n(37),a=n(38),s=n(30),c=n(15),u=n(25),l=n(31),d=n(39),m=n(63),h=n(64),f=n(65),p=n(66),g=n(67),v=n(68),y=n(70),C=n(71),b=n(72),A=n(54),S=n(73),w=n(74),E=n(76),D=n(77);class x{constructor(e){this.workerBridge=e,this.BarcodeDocumentParser={create:(e=i.b.all)=>m.a.create(this.workerBridge,e)},this.BarcodeScanner={create:(e=new r.d({}))=>h.a.create(this.workerBridge,e)},this.CheckScanner={create:(e=new o.c({}))=>f.a.create(this.workerBridge,e)},this.CreditCardScanner={create:(e=new a.a({}))=>p.a.create(this.workerBridge,e)},this.DocumentClassifier={create:e=>g.a.create(this.workerBridge,e)},this.DocumentDataExtractor={create:e=>v.a.create(this.workerBridge,e)},this.DocumentQualityAnalyzer={create:(e=new s.a({}))=>y.a.create(this.workerBridge,e)},this.DocumentScanner={create:(e=new c.d({}))=>C.a.create(this.workerBridge,e)},this.ImageProcessor={create:()=>b.a.create(this.workerBridge)},this.MrzScanner={create:(e=new u.d({}))=>A.b.create(this.workerBridge,e)},this.MrzParser={create:(e=new u.c({}))=>A.a.create(this.workerBridge,e)},this.MedicalCertificateScanner={create:()=>S.a.create(this.workerBridge)},this.OcrEngine={create:()=>w.a.create(this.workerBridge)},this.TextPatternScanner={create:(e=new l.e({}))=>E.a.create(this.workerBridge,e)},this.VinScanner={create:(e=new d.c({}))=>D.a.create(this.workerBridge,e)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=["ID","SURNAME","MAIDEN_NAME","GIVEN_NAMES","BIRTH_DATE","NATIONALITY","BIRTHPLACE","EXPIRY_DATE","EYE_COLOR","HEIGHT","ISSUE_DATE","ISSUING_AUTHORITY","ADDRESS","PSEUDONYM","MRZ","COUNTRY_CODE","GENDER","SIGNATURE","PHOTO","VALID_FROM_DATE","ROUTING_NUMBER","ACCOUNT_NUMBER","PLACE_OF_ISSUE","TITLE_TYPE","REMARKS","NAME","CARD_ACCESS_NUMBER"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(49),r=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class o{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=i.b.all){return r(this,void 0,void 0,(function*(){const n=yield e.copyArgs.BarcodeDocumentParser.create(t.map((e=>e)));return new o(e,n)}))}parse(e){return r(this,void 0,void 0,(function*(){const t=this.workerBridge.copyArgs;return yield t.BarcodeDocumentParser.parse(this.objectId,e)}))}destroy(){return r(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.BarcodeDocumentParser.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(28),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.d({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.BarcodeScanner.create(new i.d(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.BarcodeScanner.run(this.objectId,e);return{result:new i.f(o.result),originalImage:new r.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.BarcodeScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(37),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.c({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.CheckScanner.create(new i.c(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.CheckScanner.run(this.objectId,e);return{result:new i.d(o.result),originalImage:new r.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.CheckScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(38),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.a({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.CreditCardScanner.create(new i.a(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.CreditCardScanner.run(this.objectId,e);return{result:new i.b(o.result),originalImage:new r.a(o.originalImage)}}))}clearResult(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.CreditCardScanner.clearResult(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.CreditCardScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(52),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.DocumentClassifier.create(new i.a(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.DocumentClassifier.run(this.objectId,e);return{result:new i.b(o.result),originalImage:new r.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.DocumentClassifier.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(53),r=n(19),o=n(10),a=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class s{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t){return a(this,void 0,void 0,(function*(){const n=yield e.copyArgs.DocumentDataExtractor.create(new i.e(t));return new s(e,n)}))}run(e,t="COPY_IMAGE"){return a(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,r=yield n.DocumentDataExtractor.run(this.objectId,e);return{result:new i.c(r.result),originalImage:new o.a(r.originalImage)}}))}clearResult(){return a(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.DocumentDataExtractor.clearResult(this.objectId)}))}verifyDocument(e){return a(this,void 0,void 0,(function*(){const t=this.workerBridge.copyArgs;return yield t.DocumentDataExtractor.verifyDocument(this.objectId,e.map((e=>new r.f(e))))}))}destroy(){return a(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.DocumentDataExtractor.destroy(this.objectId)}))}}},function(e,t,n){"use strict";var i;n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"g",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"i",(function(){return c})),n.d(t,"a",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"d",(function(){return d})),function(e){e.From=function(e){const t=e._type;switch(t){case"DateValidationConfiguration":return new r(e);case"DeAddressParserConfiguration":return new o(e);case"EuropeanHealthInsuranceCardConfiguration":return new s(e);case"MRZFallbackConfiguration":return new c(e);case"AutoFocusConfiguration":return new u(e);case"GlareDetectionConfiguration":return new l(e);case"DocumentDataExtractorCommonConfiguration":return new d(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class r{constructor(e={}){if(this._type="DateValidationConfiguration",this.minYear=0,this.maxYear=2999,void 0!==e.minYear&&(this.minYear=e.minYear),void 0!==e.maxYear&&(this.maxYear=e.maxYear),void 0===e.fieldTypeName)throw new Error("fieldTypeName must be present in constructor argument");this.fieldTypeName=e.fieldTypeName}}class o{constructor(e={}){this._type="DeAddressParserConfiguration",this.documentTypes=[],this.binaryFileAddressDatabase="",void 0!==e.documentTypes&&(this.documentTypes=e.documentTypes.map((e=>e))),void 0!==e.binaryFileAddressDatabase&&(this.binaryFileAddressDatabase=e.binaryFileAddressDatabase)}}const a=["AUSTRIA","BELGIUM","BULGARIA","CROATIA","CYPRUS","CZECH_REPUBLIC","DENMARK","ESTONIA","FINLAND","FRANCE","GERMANY","GREECE","HUNGARY","IRELAND","ITALY","LATVIA","LITHUANIA","LUXEMBOURG","MALTA","NETHERLANDS","POLAND","PORTUGAL","ROMANIA","SLOVAKIA","SLOVENIA","SPAIN","SWEDEN","SWITZERLAND"];class s{constructor(e={}){this._type="EuropeanHealthInsuranceCardConfiguration",this.expectedCountry=null,void 0!==e.expectedCountry&&(this.expectedCountry=null!=e.expectedCountry&&a.includes(e.expectedCountry)?e.expectedCountry:null)}}class c{constructor(e={}){this._type="MRZFallbackConfiguration",this.acceptedCountries=[],this.acceptedMRZTypes=[],void 0!==e.acceptedCountries&&(this.acceptedCountries=e.acceptedCountries.map((e=>e))),void 0!==e.acceptedMRZTypes&&(this.acceptedMRZTypes=e.acceptedMRZTypes.map((e=>e)))}}class u{constructor(e={}){this._type="AutoFocusConfiguration",this.sensitivityThreshold=.02,void 0!==e.sensitivityThreshold&&(this.sensitivityThreshold=e.sensitivityThreshold)}}class l{constructor(e={}){this._type="GlareDetectionConfiguration",this.glareDetectionThreshold=.5,void 0!==e.glareDetectionThreshold&&(this.glareDetectionThreshold=e.glareDetectionThreshold)}}class d{constructor(e={}){if(this._type="DocumentDataExtractorCommonConfiguration",void 0===e.acceptedDocumentTypes)throw new Error("acceptedDocumentTypes must be present in constructor argument");this.acceptedDocumentTypes=e.acceptedDocumentTypes.map((e=>e))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(30),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.a({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.DocumentQualityAnalyzer.create(new i.a(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.DocumentQualityAnalyzer.run(this.objectId,e);return{result:new i.b(o.result),originalImage:new r.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.DocumentQualityAnalyzer.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(15),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.d({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.DocumentScanner.create(new i.d(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.DocumentScanner.run(this.objectId,e);return{result:new i.a(o.result),originalImage:new r.a(o.originalImage)}}))}scan(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.DocumentScanner.scan(this.objectId,e);return{result:new i.g(o.result),originalImage:new r.a(o.originalImage)}}))}clearResult(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.DocumentScanner.clearResult(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.DocumentScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(35),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e){return o(this,void 0,void 0,(function*(){const t=yield e.copyArgs.ImageProcessor.create();return new a(e,t)}))}crop(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const r="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield r.ImageProcessor.crop(this.objectId,e,t.map((e=>({x:e.x,y:e.y}))));return{result:new i.a(o.result),originalImage:new i.a(o.originalImage)}}))}resize(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const r="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield r.ImageProcessor.resize(this.objectId,e,t);return{result:new i.a(o.result),originalImage:new i.a(o.originalImage)}}))}rotate(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const r="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield r.ImageProcessor.rotate(this.objectId,e,t);return{result:new i.a(o.result),originalImage:new i.a(o.originalImage)}}))}applyFilter(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const o="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,a=yield o.ImageProcessor.applyFilter(this.objectId,e,r.i.From(t));return{result:new i.a(a.result),originalImage:new i.a(a.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.ImageProcessor.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(55),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e){return o(this,void 0,void 0,(function*(){const t=yield e.copyArgs.MedicalCertificateScanner.create();return new a(e,t)}))}run(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const o="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,a=yield o.MedicalCertificateScanner.run(this.objectId,e,new r.i(t));return{result:new r.j(a.result),originalImage:new i.a(a.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.MedicalCertificateScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(75),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e){return o(this,void 0,void 0,(function*(){const t=yield e.copyArgs.OcrEngine.create();return new a(e,t)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.OcrEngine.run(this.objectId,e);return{result:new r.e(o.result),originalImage:new i.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.OcrEngine.destroy(this.objectId)}))}}},function(e,t,n){"use strict";var i;n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"f",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return c})),function(e){e.From=function(e){const t=e._type;switch(t){case"Glyph":return new r(e);case"Word":return new o(e);case"Line":return new a(e);case"Block":return new s(e);case"Page":return new c(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class r{constructor(e={}){if(this._type="Glyph",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");this.roi=e.roi.map((e=>({x:e.x,y:e.y})))}}class o{constructor(e={}){if(this._type="Word",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.glyphs)throw new Error("glyphs must be present in constructor argument");this.glyphs=e.glyphs.map((e=>new r(e)))}}class a{constructor(e={}){if(this._type="Line",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.words)throw new Error("words must be present in constructor argument");this.words=e.words.map((e=>new o(e)))}}class s{constructor(e={}){if(this._type="Block",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.lines)throw new Error("lines must be present in constructor argument");this.lines=e.lines.map((e=>new a(e)))}}class c{constructor(e={}){if(this._type="Page",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.blocks)throw new Error("blocks must be present in constructor argument");this.blocks=e.blocks.map((e=>new s(e)))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(31),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new r.e({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.TextPatternScanner.create(new r.e(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.TextPatternScanner.run(this.objectId,e);return{result:new r.f(o.result),originalImage:new i.a(o.originalImage)}}))}cleanRecognitionQueue(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.TextPatternScanner.cleanRecognitionQueue(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.TextPatternScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(39),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new r.c({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.VinScanner.create(new r.c(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.VinScanner.run(this.objectId,e);return{result:new r.d(o.result),originalImage:new i.a(o.originalImage)}}))}cleanRecognitionQueue(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.VinScanner.cleanRecognitionQueue(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.VinScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(5),r=n(79);class o extends i.a{constructor(e={}){if(super(),void 0===e.rawMRZ)throw new Error("rawMRZ must be present in constructor argument");if(this.rawMRZ=e.rawMRZ,void 0===e.mrzDocument)throw new Error("mrzDocument must be present in constructor argument");this.mrzDocument=null!=e.mrzDocument?new r.f(e.mrzDocument):null}}},function(e,t,n){"use strict";var i=n(19);n.d(t,"a",(function(){return i.a})),n.d(t,"b",(function(){return i.b})),n.d(t,"c",(function(){return i.c})),n.d(t,"d",(function(){return i.d})),n.d(t,"e",(function(){return i.e})),n.d(t,"f",(function(){return i.f})),n.d(t,"g",(function(){return i.g})),n.d(t,"h",(function(){return i.h}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(e,t,n){Object.keys(e).forEach((i=>{(null==n?void 0:n.includes(i))||(t[i]=e[i])}))}static mapValuesDeep(e,t){const n=e=>e&&"object"==typeof e&&!Array.isArray(e);Object.keys(e).forEach((r=>{r in t&&n(e[r])&&n(t[r])?i.mapValuesDeep(e[r],t[r]):t[r]=e[r]}))}static _fromJson(e,t){return this.mapValuesDeep(t,e),e}}},function(e,t,n){"use strict";var i=n(35);n.d(t,"a",(function(){return i.i}))},function(e,t,n){"use strict";class i{}i.VERSION="8.0.0-beta.4",i.BUILD_WITH_UI=!1;var r=n(48);class o extends Error{constructor(e){super("License error!",{cause:e})}}class a extends Error{constructor(){super('Error initializing the ScanbotSDK worker. Most likely, this is caused by an incorrect enginePath parameter set during the SDK initialization. Please check your browser\'s developer tools -> "Network" tab to see if any JS or WASM files failed to load. Note that you need to set up your webserver to serve these files under a certain path and then adjust the "enginePath" parameter accordingly. Please refer to the "Initialization" section in our documentation for more information.')}}class s extends Error{constructor(e,t,n){super(`Version mismatch! Version of ScanbotSDK.(ui2.)min.js is "${t}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${n}". \nThe ScanbotSDK.Core*.js file was loaded from ${e}.`)}}var c=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class u{constructor(e,t,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),this.core=new r.a(e,t),this.initializationStatus=(()=>c(this,void 0,void 0,(function*(){try{yield this.core.copyArgs.initialize(...n)}catch(e){return"InvalidLicense"===(null==e?void 0:e.errorType)?new o(e):new a}let t;try{t=yield this.core.copyArgs.version()}catch(e){t="Error"}const r=i.VERSION;return t!==r?new s(e,r,t):"OK"})))(),this.api=(()=>{const e={};for(const t in this.core.api){const n=this.core.api[t];e[t]={};for(const i in n)e[t][i]=(...e)=>c(this,void 0,void 0,(function*(){return(yield this.getCoreForCommand()).api[t][i](...e)}))}return e})()}awaitInitialized(){return c(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(e){return new Proxy({},{get:(t,n,i)=>(...t)=>c(this,void 0,void 0,(function*(){const i=yield this.getCoreForCommand(n),r="copy"===e?i.copyArgs:i.transferArgs;return yield r[n](...t)}))})}getCoreForCommand(e=""){return c(this,void 0,void 0,(function*(){const t=yield this.initializationStatus;if("OK"===t||"getLicenseInfo"===e&&t instanceof o)return this.core;throw t}))}}var l=n(42),d=n(8);class m extends d.LicenseInfo{isValid(){return"OKAY"===this.status||"TRIAL"===this.status||"OKAY_EXPIRING_SOON"===this.status}constructor(e){super(e)}}var h=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class f{constructor(e,t){this._sdk=e,this._pdfOperation=t}addPage(e,t={}){return h(this,void 0,void 0,(function*(){const{consumeImage:n="COPY_IMAGE",runOcr:i}=t,r=this._sdk.getBridge(n);i?yield r.addPageToPdfWithOcr(this._pdfOperation,e):yield r.addPageToPdf(this._pdfOperation,e)}))}addPages(e,t){return h(this,void 0,void 0,(function*(){for(const n of e.pages){const e=yield n.finalRawImage();yield this.addPage(e,{runOcr:t})}}))}complete(){return h(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var p=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class g{constructor(e,t){this._sdk=e,this._tiffOperation=t}addPage(e,t={}){return p(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:i="COPY_IMAGE"}=t,r=this._sdk.getBridge(i);yield r.addPageToTiff(this._tiffOperation,e,n)}))}addPages(e,t={}){return p(this,void 0,void 0,(function*(){for(const n of e.pages){const e=yield n.finalRawImage();yield this.addPage(e,t)}}))}complete(){return p(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var v=n(34);class y{static toPixelSize(e){return e+"px"}static containsString(e,t){return!!e&&-1!==e.indexOf(t)}static copy(e){return JSON.parse(JSON.stringify(e))}static getProperty(e,t){if(e&&e.hasOwnProperty(t))return e[t]}static uuid(){let e="";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}}var C=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class b{static toDataUrl(e){return new Promise(((t,n)=>{const i=new Blob([e],{type:"image/jpeg"}),r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error),r.readAsDataURL(i)}))}static getObjectFitSize(e,t,n=!0){const i=t.width/t.height,r=e.width/e.height;let o=0,a=0;(n?i>r:i<r)?(o=e.width,a=o/i):(a=e.height,o=a*i);const s=(e.width-o)/2,c=(e.height-a)/2;return new v.a(s,c,o,a)}static loadFromUrl(e){return new Promise(((t,n)=>{const i=document.createElement("img");i.src=e,i.onload=()=>C(this,void 0,void 0,(function*(){const e=document.createElement("canvas");e.width=i.width,e.height=i.height;const n=e.getContext("2d");n.drawImage(i,0,0);const r=n.getImageData(0,0,i.width,i.height);t(r)})),i.onerror=n}))}static saveImageData(e){const t=this.createImageDataCanvas(e),n=" ("+e.width+"x"+e.height+")";t.toBlob((e=>this.saveBlob(e,y.uuid()+n+".png")))}static createImageDataCanvas(e){const t=document.createElement("canvas");return t.className="scanbot-sdk-canvas-element",t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t}static saveBlob(e,t){let n=document.createElement("a");n.setAttribute("download",t);let i=URL.createObjectURL(e);n.setAttribute("href",i),n.click()}static convertImageDataWrapperToImageData(e){if(e)return new ImageData(e.data,e.width,e.height)}static wrapperToBase64(e){return b.createImageDataCanvas(b.convertImageDataWrapperToImageData(e)).toDataURL("image/png")}static toBase64(e,t=!0){return C(this,void 0,void 0,(function*(){const n=yield new Promise((t=>{const n=new FileReader;n.onload=()=>t(n.result),n.readAsDataURL(new Blob([e]))}));return t?n.slice(n.indexOf(",")+1):n}))}static imageUrlToImageData(e){return C(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const i=document.createElement("canvas"),r=document.createElement("img");r.src=e,r.onload=()=>C(this,void 0,void 0,(function*(){i.width=r.width,i.height=r.height;const e=i.getContext("2d");e.drawImage(r,0,0);const n=e.getImageData(0,0,r.width,r.height);t(n)})),r.onerror=n}))}))}}class A{saveImageAsJpeg(e,t){if(!e||0===e.length)return void console.log("Data cannot be null or empty");t||(t=y.uuid()+".jpeg");let n=new Blob([e],{type:"image/jpeg"});b.saveBlob(n,t)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let e=this.findFlashElement();e.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{e.style.opacity="1.0",e.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(e,t){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=e,t()}),150)}getOrCreateElement(e,t){let n=this.getElementByClassName(e);return n||(this.createElement(e,t),n=this.getElementByClassName(e)),n}createElement(e,t){let n=document.createElement("div");n.className=e,n.style.cssText=this.cssToString(t),document.body.append(n)}cssToString(e){let t="";return Object.keys(e).forEach((n=>{t+=n+":"+e[n]+";"})),t}getElementByClassName(e){const t=document.getElementsByClassName(e);if(0!==t.length)return t[0]}}var S=n(17),w=n(26);class E extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new d.TextPatternScannerConfiguration,this.onTextDetected=function(e){},this.finder.aspectRatio=new d.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(e){const t=new E;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class D extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.detectionConfiguration=new d.VinScannerConfiguration,this.onVinDetected=function(e){},this.finder.aspectRatio=new d.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(e){const t=new D;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class x extends Error{constructor(e){super(e.licenseStatusMessage),this.name="LicenseError"}}class B{static throwIfMissingBuffer(e){B.throwIfMissing(e,"ImageBuffer may not be null")}static throwIfMissing(e,t){if(!e)throw new Error(t)}}var I=n(23),T=n(0),O=n(21),k=n(20),P=n(2),L=n.n(P),_=n(3);const R="var(--1-sb-dvh, 1vh)";function M(){const e=Object(T.useMemo)((()=>{var e,t;return null===(t=null===(e=null===window||void 0===window?void 0:window.CSS)||void 0===e?void 0:e.supports)||void 0===t?void 0:t.call(e,"height: 100dvh")}),[]),t=()=>{var t=e?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",t)};return Object(T.useEffect)((()=>{if(t(),!e)return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}})),null}var F=n(36),N=n(9),V=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function W(e){const{polygonConfig:t}=e,n=V(e,["polygonConfig"]),i=Object.assign(Object.assign({},e.style),{backgroundColor:_.b.getColorValue(t.fillColor),borderColor:_.b.getColorValue(t.strokeColor),borderWidth:t.strokeWidth,borderRadius:t.cornerRadius,borderStyle:"solid"});return T.default.createElement(P.Box,Object.assign({},n,{style:i}))}function j(e){return e=_.b.getColorValue(e),Object.assign(Object.assign({},function(e){return{color:e=_.b.getColorValue(e),"&:hover":{textDecoration:"underline !important",backgroundColor:"transparent !important"}}}(e)),z(e))}function z(e){return{"&:focus-visible":{outlineColor:`${e=_.b.getColorValue(e)} !important`,outlineWidth:"2px !important",outlineStyle:"solid !important"}}}function H(e){var t;const n=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{};return T.default.createElement(T.default.Fragment,null,e.config.visible&&T.default.createElement(P.IconButton,Object.assign({disabled:!e.enabled,component:null!==(t=e.iconButtonComponent)&&void 0!==t?t:"button","aria-label":_.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign({opacity:e.enabled?1:.5,backgroundColor:_.b.getColorValue(e.config.background.fillColor),borderWidth:e.config.background.strokeWidth,borderColor:_.b.getColorValue(e.config.background.strokeColor),borderStyle:"solid",borderRadius:"4px",visibility:e.config.visible?"visible":"hidden",flexDirection:"column"},j(e.config.title.color)),onClick:e.onClick},n),e.config.icon.visible&&T.default.createElement(e.icon,{color:_.b.getColorValue(e.config.icon.color)}),e.children,T.default.createElement(N.a,{config:e.config.title,style:{fontSize:12,marginTop:8}})))}const U=new Map;function Z(e){const t=function(e){if(!U.has(e)){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");n.clearRect(0,0,1,1),n.fillStyle="#000",n.fillStyle=e;const i=n.fillStyle;if(n.fillStyle="#fff",n.fillStyle=e,i!==n.fillStyle)return U.set(e,null),null;n.fillRect(0,0,1,1);const r=[...n.getImageData(0,0,1,1).data];U.set(e,{r:r[0],g:r[1],b:r[2],a:r[3]})}return U.get(e)}(e);return 0===(null==t?void 0:t.a)}function G(e){var t,n;if(!e.visible)return T.default.createElement("div",{style:{display:"flex",flex:1}});const i=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{},r="right"===(null!==(t=e.iconPosition)&&void 0!==t?t:"left");let o={};Z(_.b.getColorValue(e.background.fillColor))&&(o={textDecoration:"underline"});return T.default.createElement(P.Button,Object.assign({id:e.id,"aria-label":e.ariaLabel,disabled:null!==(n=e.disabled)&&void 0!==n&&n,variant:"text",onClick:e.onClick,style:Object(N.b)(e.foreground),sx:Object.assign({opacity:e.disabled?.5:1,flex:1,textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},"&:hover":o,"&:focus-visible > div":{outlineColor:_.b.getColorValue(e.foreground.color),outlineWidth:2,outlineStyle:"solid"},px:0,alignItems:"center"},e.buttonWidth?{width:(()=>{if(e.buttonWidth)return"string"==typeof e.buttonWidth?e.buttonWidth:`${e.buttonWidth}px`})(),minWidth:0}:{}),disableRipple:!0},i),T.default.createElement(W,{polygonConfig:Object.assign(Object.assign({},e.background),{cornerRadius:4}),sx:Object.assign({borderStyle:"solid",mx:"4px",px:"4px",display:"flex",alignItems:"center"},e.styleOverrides)},e.foreground.iconVisible&&!r&&e.icon,_.b.getLocalizedText(e.text),e.foreground.iconVisible&&r&&e.icon))}F.a;const Y=T.default.createContext(null);function Q(e){const t=e.mode,n="HIDDEN"===t?0:48;Object(T.useEffect)((()=>{if("HIDDEN"===t)return;const n=document.createElement("meta");return n.name="theme-color",n.content=_.b.getColorValue(e.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[t]);const i="SOLID"===t?0:n,r={height:n,remainingVisibleBodyHeight:"SOLID"===t?`calc(100 * ${R} - ${n}px)`:`calc(100 * ${R})`,minTopPaddingForContent:i,minTopPaddingForViewFinder:10+i},o="SOLID"===t?{backgroundColor:_.b.getColorValue(e.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${_.b.getColorValue(e.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"},a=T.default.createElement(L.a,{sx:{fontSize:24}}),s=e.cancelButton.visible&&!e.cameraPermissionDenied;return T.default.createElement(T.default.Fragment,null,"HIDDEN"!==t&&T.default.createElement(P.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},o)},T.default.createElement(P.Toolbar,{variant:"dense",sx:{height:n,minHeight:n,padding:0}},T.default.createElement(P.Box,{sx:{flex:1}},s&&T.default.createElement(T.default.Fragment,null,T.default.createElement(G,Object.assign({onClick:e.onBackPress,icon:e.cancelButton.foreground.iconVisible&&a},e.cancelButton)))),T.default.createElement(P.Box,null,T.default.createElement(P.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},T.default.createElement(N.a,{config:e.title}))),T.default.createElement(P.Box,{sx:{flex:1,alignItems:"right"}},!e.cameraPermissionDenied&&e.rightItem))),T.default.createElement(Y.Provider,{value:r},e.children))}function q(e){return{textOverflow:"ellipsis",WebkitBoxOrient:"vertical",WebkitLineClamp:`${e}`,overflow:"hidden",whiteSpace:e>1?"normal":"nowrap",display:e>1?"-webkit-box":"block"}}function X(e){if(e.loading)return T.default.createElement(P.Skeleton,{variant:"rounded",width:e.imageSize,height:e.imageSize,style:{borderRadius:8}});if(null===e.data.barcodeImage){const t={width:e.imageSize,height:e.imageSize,backgroundColor:"#E0E0E0",borderRadius:3};return T.default.createElement(P.Box,{sx:t})}const t={width:e.imageSize,height:e.imageSize,borderRadius:8};return T.default.createElement("img",{src:e.data.barcodeImage,alt:e.data.title,style:t})}function K(e){var t,n;const i=(null===(t=e.barcodeMappedData)||void 0===t?void 0:t.state)||"LOADING",r=(null===(n=e.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},o=!e||"LOADED"!==i,a=e.imageSize,s=e.barcodeTitle.visible||e.barcodeSubtitle.visible||e.counterForm,c=e.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:_.b.getColorValue(e.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}},u=Object(T.useRef)(),[l,d]=Object(T.useState)("100%");return Object(T.useEffect)((()=>{var t;const n=e.readonlyCount?.87:.97,i=null===(t=u.current)||void 0===t?void 0:t.parentNode,r=i&&i.clientWidth>0?i.clientWidth*n:"100%";d(r)})),T.default.createElement(P.Box,{ref:u,sx:{display:"flex",maxWidth:l},"data-sb-barcode-info":"1"},e.barcodeImageVisible&&T.default.createElement(P.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},T.default.createElement(X,{data:r,imageSize:a,loading:o})),s&&T.default.createElement(P.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},e.barcodeTitle.visible&&T.default.createElement(P.Box,{display:o?"block":"flex",sx:{alignItems:"center"}},T.default.createElement(P.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign(Object.assign({},q(e.maxNumberOfTitleLines)),Object(N.b)(e.barcodeTitle)),{textOverflow:"ellipsis",overflow:"hidden",display:"inline-block"})},o?T.default.createElement(P.Skeleton,{variant:"text"}):r.title),e.displayRightArrow&&!o&&T.default.createElement(L.a,{sx:{fontSize:16,fontWeight:"bold",color:_.b.getColorValue(e.barcodeTitle.color)}})),e.barcodeSubtitle.visible&&T.default.createElement(P.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},q(e.maxNumberOfSubtitleLines)),Object(N.b)(e.barcodeSubtitle))},o?T.default.createElement(P.Skeleton,{variant:"text"}):r.subtitle),e.counterForm&&T.default.createElement(P.ButtonGroup,{variant:"outlined"},T.default.createElement(P.Button,{disabled:!e.counterForm.removeButtonEnabled,sx:c,style:{opacity:e.counterForm.removeButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter-1),disableRipple:!0},T.default.createElement(L.a,{sx:{color:_.b.getColorValue(e.counterForm.manualCountChangeColor)}})),T.default.createElement(P.Button,{sx:Object.assign(Object.assign({},c),{color:_.b.getColorValue(e.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:e.counterForm.onNumberClick,disableRipple:!0},e.counterForm.counter),T.default.createElement(P.Button,{disabled:!e.counterForm.addButtonEnabled,sx:c,style:{opacity:e.counterForm.addButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter+1),disableRipple:!0},T.default.createElement(L.a,{sx:{color:_.b.getColorValue(e.counterForm.manualCountChangeColor)}})))))}k.ButtonConfiguration;function J(e){var t;if(!e.visible)return null;const n={["data-sb-button-"+e.debugName]:!0};return T.default.createElement(P.Button,Object.assign({disabled:null!==(t=e.disabled)&&void 0!==t&&t,onClick:e.onClick,type:e.type,"aria-label":e.accessibilityDescription,sx:Object.assign(Object.assign({},e.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:_.b.getColorValue(e.background.strokeColor),borderWidth:e.background.strokeWidth,backgroundColor:_.b.getColorValue(e.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},n),e.foreground.iconVisible&&e.icon&&T.default.createElement(e.icon,{sx:{color:_.b.getColorValue(e.foreground.color),pr:2}}),T.default.createElement(N.a,{config:{visible:!0,text:e.text,color:e.foreground.color,useShadow:e.foreground.useShadow}}))}var $=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function ee(e){var t,{modalOverlayColor:n}=e,i=$(e,["modalOverlayColor"]);const r={backdrop:{style:{backgroundColor:_.b.getColorValue(n)}}},o=Object.assign(Object.assign({},i.PaperProps),{sx:Object.assign(Object.assign({},null===(t=i.PaperProps)||void 0===t?void 0:t.sx),i.width?{width:i.width}:{maxWidth:400})});return T.default.createElement(P.Dialog,Object.assign({},i,{componentsProps:r,PaperProps:o}))}function te(e){const t=Object(T.useContext)(_.a).getColorValue,n=!e.barcodeMappedData||"LOADED"!==e.barcodeMappedData.state,i={backgroundColor:t(n?e.sheetColorLoading:e.sheetColorLoaded)},[r,o]=T.default.useState(),a=Object(T.useRef)((()=>{}));Object(T.useEffect)((()=>{e.open&&o(!1)}),[e.open]);const s=()=>{a.current=e.handleCancel,o(!0)};return T.default.createElement(ee,{modalOverlayColor:e.modalOverlayColor,open:e.open&&!r,fullWidth:!0,TransitionProps:{onExited:()=>{r&&a.current()}},onClose:()=>{n||s()}},T.default.createElement(P.DialogContent,{style:i},T.default.createElement(K,Object.assign({},e,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),T.default.createElement(P.DialogActions,{style:i},T.default.createElement(L.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},T.default.createElement(L.a,{item:!0,xs:12},T.default.createElement(L.a,{color:t(e.dividerColor)})),n?T.default.createElement(L.a,{item:!0,xs:12,sx:{textAlign:"center"}},T.default.createElement(P.Box,null,T.default.createElement(P.CircularProgress,{sx:{color:t(e.loadingMessage.color),verticalAlign:"middle",mr:2}}),T.default.createElement(N.a,{config:e.loadingMessage}))):T.default.createElement(T.default.Fragment,null,T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},onClick:s},e.cancelButton))),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},onClick:()=>{a.current=e.handleSubmit,o(!0)}},e.submitButton)))))))}var ne=n(1);ne.m;function ie(e){if(!1===e.visible)return null;const t={backgroundColor:e.active?_.b.getColorValue(e.activeBackgroundColor):_.b.getColorValue(e.backgroundColor),color:e.active?_.b.getColorValue(e.activeForegroundColor):_.b.getColorValue(e.foregroundColor)};return T.default.createElement(P.IconButton,{sx:Object.assign(Object.assign({},t),{"&:hover, &:focus":Object.assign({outline:"none"},t),width:48,height:48}),onClick:e.onClick},e.text&&T.default.createElement("span",{style:{fontSize:15}},_.b.getLocalizedText(e.text)),e.icon&&T.default.createElement(e.icon,{style:{padding:7}}))}var re=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class oe{constructor(){this.audioFile=new Audio}initialize(e){return re(this,void 0,void 0,(function*(){e.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===e.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===e.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(e){e.successBeepEnabled&&this.play()}play(){return re(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(e){}}))}}oe.INSTANCE=new oe;var ae=oe;class se{constructor(){this.DURATION=200}vibrate(e){e.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}se.INSTANCE=new se;var ce=se,ue=n(14),le=n(58),de=n(56),me=n(4),he=function(e){return{isEnabled:function(t){return e.some((function(e){return!!t[e]}))}}},fe={measureLayout:he(["layout","layoutId","drag","_layoutResetTransform"]),animation:he(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:he(["exit"]),drag:he(["drag","dragControls"]),focus:he(["whileFocus"]),hover:he(["whileHover","onHoverStart","onHoverEnd"]),tap:he(["whileTap","onTap","onTapStart","onTapCancel"]),pan:he(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:he(["layout","layoutId"])};var pe=Object(T.createContext)({strict:!1}),ge=Object.keys(fe),ve=ge.length;var ye=Object(T.createContext)({transformPagePoint:function(e){return e},isStatic:!1}),Ce=Object(T.createContext)({});var be=Object(T.createContext)(null);function Ae(e){var t=Object(T.useRef)(null);return null===t.current&&(t.current=e()),t.current}function Se(){var e=Object(T.useContext)(be);if(null===e)return[!0,null];var t=e.isPresent,n=e.onExitComplete,i=e.register,r=xe();Object(T.useEffect)((function(){return i(r)}),[]);return!t&&n?[!1,function(){return null==n?void 0:n(r)}]:[!0]}function we(e){return null===e||e.isPresent}var Ee=0,De=function(){return Ee++},xe=function(){return Ae(De)},Be=Object(T.createContext)(null),Ie="undefined"!=typeof window,Te=Ie?T.useLayoutEffect:T.useEffect;function Oe(e,t,n,i){var r=Object(T.useContext)(ye),o=Object(T.useContext)(pe),a=Object(T.useContext)(Ce).visualElement,s=Object(T.useContext)(be),c=function(e){var t=e.layoutId,n=Object(T.useContext)(Be);return n&&void 0!==t?n+"-"+t:t}(n),u=Object(T.useRef)(void 0);i||(i=o.renderer),!u.current&&i&&(u.current=i(e,{visualState:t,parent:a,props:Object(me.a)(Object(me.a)({},n),{layoutId:c}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var l=u.current;return Te((function(){l&&(l.setProps(Object(me.a)(Object(me.a)(Object(me.a)({},r),n),{layoutId:c})),l.isPresent=we(s),l.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),l.syncRender())})),Object(T.useEffect)((function(){var e;l&&(null===(e=l.animationState)||void 0===e||e.animateChanges())})),Te((function(){return function(){return null==l?void 0:l.notifyUnmount()}}),[]),l}function ke(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Pe(e){return Array.isArray(e)}function Le(e){return"string"==typeof e||Pe(e)}function _e(e,t,n,i,r){var o;return void 0===i&&(i={}),void 0===r&&(r={}),"string"==typeof t&&(t=null===(o=e.variants)||void 0===o?void 0:o[t]),"function"==typeof t?t(null!=n?n:e.custom,i,r):t}function Re(e,t,n){var i=e.getProps();return _e(i,t,null!=n?n:i.custom,function(e){var t={};return e.forEachValue((function(e,n){return t[n]=e.get()})),t}(e),function(e){var t={};return e.forEachValue((function(e,n){return t[n]=e.getVelocity()})),t}(e))}function Me(e){var t;return"function"==typeof(null===(t=e.animate)||void 0===t?void 0:t.start)||Le(e.initial)||Le(e.animate)||Le(e.whileHover)||Le(e.whileDrag)||Le(e.whileTap)||Le(e.whileFocus)||Le(e.exit)}function Fe(e){return Boolean(Me(e)||e.variants)}function Ne(e,t){var n=function(e,t){if(Me(e)){var n=e.initial,i=e.animate;return{initial:!1===n||Le(n)?n:void 0,animate:Le(i)?i:void 0}}return!1!==e.inherit?t:{}}(e,Object(T.useContext)(Ce)),i=n.initial,r=n.animate;return Object(T.useMemo)((function(){return{initial:i,animate:r}}),t?[Ve(i),Ve(r)]:[])}function Ve(e){return Array.isArray(e)?e.join(" "):e}function We(e){var t=e.preloadedFeatures,n=e.createVisualElement,i=e.useRender,r=e.useVisualState,o=e.Component;return t&&function(e){for(var t in e){var n=e[t];null!==n&&(fe[t].Component=n)}}(t),Object(T.forwardRef)((function(e,t){var a=Object(T.useContext)(ye).isStatic,s=null,c=Ne(e,a),u=r(e,a);return!a&&Ie&&(c.visualElement=Oe(o,u,e,n),s=function(e,t,n){var i=[];if(Object(T.useContext)(pe),!t)return null;for(var r=0;r<ve;r++){var o=ge[r],a=fe[o],s=a.isEnabled,c=a.Component;s(e)&&c&&i.push(T.createElement(c,Object(me.a)({key:o},e,{visualElement:t})))}return i}(e,c.visualElement)),T.createElement(T.Fragment,null,T.createElement(Ce.Provider,{value:c},i(o,e,function(e,t,n){return Object(T.useCallback)((function(i){var r;i&&(null===(r=e.mount)||void 0===r||r.call(e,i)),t&&(i?t.mount(i):t.unmount()),n&&("function"==typeof n?n(i):ke(n)&&(n.current=i))}),[t])}(u,c.visualElement,t),u,a)),s)}))}function je(e){function t(t,n){return void 0===n&&(n={}),We(e(t,n))}var n=new Map;return new Proxy(t,{get:function(e,i){return n.has(i)||n.set(i,t(i)),n.get(i)}})}var ze=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function He(e){return"string"==typeof e&&!e.includes("-")&&!!(ze.indexOf(e)>-1||/[A-Z]/.test(e))}var Ue={};var Ze=["","X","Y","Z"],Ge=["transformPerspective","x","y","z"];function Ye(e,t){return Ge.indexOf(e)-Ge.indexOf(t)}["translate","scale","rotate","skew"].forEach((function(e){return Ze.forEach((function(t){return Ge.push(e+t)}))}));var Qe=new Set(Ge);function qe(e){return Qe.has(e)}var Xe=new Set(["originX","originY","originZ"]);function Ke(e){return Xe.has(e)}function Je(e,t){var n=t.layout,i=t.layoutId;return qe(e)||Ke(e)||(n||void 0!==i)&&(!!Ue[e]||"opacity"===e)}var $e=function(e){return null!==e&&"object"==typeof e&&e.getVelocity},et={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function tt(e){return e.startsWith("--")}var nt=function(e,t){return t&&"number"==typeof e?t.transform(e):e},it=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},rt=function(e){return e%1?Number(e.toFixed(5)):e},ot=/(-)?([\d]*\.?[\d])+/g,at=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,st=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function ct(e){return"string"==typeof e}var ut=function(e){return{test:function(t){return ct(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},lt=ut("deg"),dt=ut("%"),mt=ut("px"),ht=ut("vh"),ft=ut("vw"),pt=Object(me.a)(Object(me.a)({},dt),{parse:function(e){return dt.parse(e)/100},transform:function(e){return dt.transform(100*e)}}),gt={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},vt=Object(me.a)(Object(me.a)({},gt),{transform:it(0,1)}),yt=Object(me.a)(Object(me.a)({},gt),{default:1}),Ct=Object(me.a)(Object(me.a)({},gt),{transform:Math.round}),bt={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,radius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,size:mt,top:mt,right:mt,bottom:mt,left:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,rotate:lt,rotateX:lt,rotateY:lt,rotateZ:lt,scale:yt,scaleX:yt,scaleY:yt,scaleZ:yt,skew:lt,skewX:lt,skewY:lt,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:vt,originX:pt,originY:pt,originZ:mt,zIndex:Ct,fillOpacity:vt,strokeOpacity:vt,numOctaves:Ct};function At(e,t,n,i,r,o,a,s){var c,u=e.style,l=e.vars,d=e.transform,m=e.transformKeys,h=e.transformOrigin;m.length=0;var f=!1,p=!1,g=!0;for(var v in t){var y=t[v];if(tt(v))l[v]=y;else{var C=bt[v],b=nt(y,C);if(qe(v)){if(f=!0,d[v]=b,m.push(v),!g)continue;y!==(null!==(c=C.default)&&void 0!==c?c:0)&&(g=!1)}else if(Ke(v))h[v]=b,p=!0;else if((null==n?void 0:n.isHydrated)&&(null==i?void 0:i.isHydrated)&&Ue[v]){var A=Ue[v].process(y,i,n),S=Ue[v].applyTo;if(S)for(var w=S.length,E=0;E<w;E++)u[S[E]]=A;else u[v]=A}else u[v]=b}}i&&n&&a&&s?(u.transform=a(i.deltaFinal,i.treeScale,f?d:void 0),o&&(u.transform=o(d,u.transform)),u.transformOrigin=s(i)):(f&&(u.transform=function(e,t,n,i){var r=e.transform,o=e.transformKeys,a=t.enableHardwareAcceleration,s=void 0===a||a,c=t.allowTransformNone,u=void 0===c||c,l="";o.sort(Ye);for(var d=!1,m=o.length,h=0;h<m;h++){var f=o[h];l+=(et[f]||f)+"("+r[f]+") ","z"===f&&(d=!0)}return!d&&s?l+="translateZ(0)":l=l.trim(),i?l=i(r,n?"":l):u&&n&&(l="none"),l}(e,r,g,o)),p&&(u.transformOrigin=function(e){var t=e.originX,n=void 0===t?"50%":t,i=e.originY,r=void 0===i?"50%":i,o=e.originZ;return n+" "+r+" "+(void 0===o?0:o)}(h)))}var St=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function wt(e,t,n){for(var i in t)$e(t[i])||Je(i,n)||(e[i]=t[i])}function Et(e,t,n){var i={};return wt(i,e.style||{},e),Object.assign(i,function(e,t,n){var i=e.transformTemplate;return Object(T.useMemo)((function(){var e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};At(e,t,void 0,void 0,{enableHardwareAcceleration:!n},i);var r=e.vars,o=e.style;return Object(me.a)(Object(me.a)({},r),o)}),[t])}(e,t,n)),e.transformValues&&(i=e.transformValues(i)),i}function Dt(e,t,n){var i={},r=Et(e,t,n);return Boolean(e.drag)&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),i.style=r,i}var xt=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function Bt(e){return xt.has(e)}var It=function(e){return!Bt(e)};try{var Tt=n(93).default;It=function(e){return e.startsWith("on")?!Bt(e):Tt(e)}}catch(e){}function Ot(e,t,n){return"string"==typeof e?e:mt.transform(t+n*e)}var kt=function(e,t){return mt.transform(e*t)},Pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Lt={offset:"strokeDashoffset",array:"strokeDasharray"};function _t(e,t,n,i,r,o,a,s){var c=t.attrX,u=t.attrY,l=t.originX,d=t.originY,m=t.pathLength,h=t.pathSpacing,f=void 0===h?1:h,p=t.pathOffset,g=void 0===p?0:p;At(e,Object(me.d)(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,i,r,o,a,s),e.attrs=e.style,e.style={};var v=e.attrs,y=e.style,C=e.dimensions,b=e.totalPathLength;v.transform&&(C&&(y.transform=v.transform),delete v.transform),C&&(void 0!==l||void 0!==d||y.transform)&&(y.transformOrigin=function(e,t,n){return Ot(t,e.x,e.width)+" "+Ot(n,e.y,e.height)}(C,void 0!==l?l:.5,void 0!==d?d:.5)),void 0!==c&&(v.x=c),void 0!==u&&(v.y=u),void 0!==b&&void 0!==m&&function(e,t,n,i,r,o){void 0===i&&(i=1),void 0===r&&(r=0),void 0===o&&(o=!0);var a=o?Pt:Lt;e[a.offset]=kt(-r,t);var s=kt(n,t),c=kt(i,t);e[a.array]=s+" "+c}(v,b,m,f,g,!1)}var Rt=function(){return Object(me.a)(Object(me.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Mt(e,t){var n=Object(T.useMemo)((function(){var n=Rt();return _t(n,t,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Object(me.a)(Object(me.a)({},n.attrs),{style:Object(me.a)({},n.style)})}),[t]);if(e.style){var i={};wt(i,e.style,e),n.style=Object(me.a)(Object(me.a)({},i),n.style)}return n}function Ft(e){void 0===e&&(e=!1);return function(t,n,i,r,o){var a=r.latestValues,s=(He(t)?Mt:Dt)(n,a,o),c=function(e,t,n){var i={};for(var r in e)(It(r)||!0===n&&Bt(r)||!t&&!Bt(r))&&(i[r]=e[r]);return i}(n,"string"==typeof t,e),u=Object(me.a)(Object(me.a)(Object(me.a)({},c),s),{ref:i});return Object(T.createElement)(t,u)}}var Nt=/([a-z])([A-Z])/g,Vt=function(e){return e.replace(Nt,"$1-$2").toLowerCase()};function Wt(e,t){var n=t.style,i=t.vars;for(var r in Object.assign(e.style,n),i)e.style.setProperty(r,i[r])}var jt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function zt(e,t){for(var n in Wt(e,t),t.attrs)e.setAttribute(jt.has(n)?n:Vt(n),t.attrs[n])}function Ht(e){var t=e.style,n={};for(var i in t)($e(t[i])||Je(i,e))&&(n[i]=t[i]);return n}function Ut(e){var t=Ht(e);for(var n in e){if($e(e[n]))t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function Zt(e){return"object"==typeof e&&"function"==typeof e.start}var Gt=function(e){return Array.isArray(e)};function Yt(e){var t,n=$e(e)?e.get():e;return t=n,Boolean(t&&"object"==typeof t&&t.mix&&t.toValue)?n.toValue():n}function Qt(e,t,n,i){var r=e.scrapeMotionValuesFromProps,o=e.createRenderState,a=e.onMount,s={latestValues:Xt(t,n,i,r),renderState:o()};return a&&(s.mount=function(e){return a(t,e,s)}),s}var qt=function(e){return function(t,n){var i=Object(T.useContext)(Ce),r=Object(T.useContext)(be);return n?Qt(e,t,i,r):Ae((function(){return Qt(e,t,i,r)}))}};function Xt(e,t,n,i){var r={},o=!1===(null==n?void 0:n.initial),a=i(e);for(var s in a)r[s]=Yt(a[s]);var c=e.initial,u=e.animate,l=Me(e),d=Fe(e);t&&d&&!l&&!1!==e.inherit&&(null!=c||(c=t.initial),null!=u||(u=t.animate));var m=o||!1===c?u:c;m&&"boolean"!=typeof m&&!Zt(m)&&(Array.isArray(m)?m:[m]).forEach((function(t){var n=_e(e,t);if(n){var i=n.transitionEnd;n.transition;var o=Object(me.d)(n,["transitionEnd","transition"]);for(var a in o)r[a]=o[a];for(var a in i)r[a]=i[a]}}));return r}var Kt={useVisualState:qt({scrapeMotionValuesFromProps:Ut,createRenderState:Rt,onMount:function(e,t,n){var i=n.renderState,r=n.latestValues;try{i.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){i.dimensions={x:0,y:0,width:0,height:0}}"path"===t.tagName&&(i.totalPathLength=t.getTotalLength()),_t(i,r,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),zt(t,i)}})};var Jt,$t={useVisualState:qt({scrapeMotionValuesFromProps:Ht,createRenderState:St})};function en(e,t,n,i){var r=t.forwardMotionProps,o=void 0!==r&&r,a=He(e)?Kt:$t;return Object(me.a)(Object(me.a)({},a),{preloadedFeatures:n,useRender:Ft(o),createVisualElement:i,Component:e})}function tn(e,t,n,i){return e.addEventListener(t,n,i),function(){return e.removeEventListener(t,n,i)}}function nn(e,t,n,i){Object(T.useEffect)((function(){var r=e.current;if(n&&r)return tn(r,t,n,i)}),[e,t,n,i])}function rn(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function on(e){return!!e.touches}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.Exit="exit"}(Jt||(Jt={}));var an={pageX:0,pageY:0};function sn(e,t){void 0===t&&(t="page");var n=e.touches[0]||e.changedTouches[0]||an;return{x:n[t+"X"],y:n[t+"Y"]}}function cn(e,t){return void 0===t&&(t="page"),{x:e[t+"X"],y:e[t+"Y"]}}function un(e,t){return void 0===t&&(t="page"),{point:on(e)?sn(e,t):cn(e,t)}}var ln=function(e,t){void 0===t&&(t=!1);var n,i=function(t){return e(t,un(t))};return t?(n=i,function(e){var t=e instanceof MouseEvent;(!t||t&&0===e.button)&&n(e)}):i},dn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},mn={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function hn(e){return Ie&&null===window.onpointerdown?e:Ie&&null===window.ontouchstart?mn[e]:Ie&&null===window.onmousedown?dn[e]:e}function fn(e,t,n,i){return tn(e,hn(t),ln(n,"pointerdown"===t),i)}function pn(e,t,n,i){return nn(e,hn(t),n&&ln(n,"pointerdown"===t),i)}function gn(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var vn=gn("dragHorizontal"),yn=gn("dragVertical");function Cn(e){var t=!1;if("y"===e)t=yn();else if("x"===e)t=vn();else{var n=vn(),i=yn();n&&i?t=function(){n(),i()}:(n&&n(),i&&i())}return t}function bn(){var e=Cn(!0);return!e||(e(),!1)}function An(e,t,n){return function(i,r){var o;rn(i)&&!bn()&&(null==n||n(i,r),null===(o=e.animationState)||void 0===o||o.setActive(Jt.Hover,t))}}var Sn=function(e,t){return!!t&&(e===t||Sn(e,t.parentElement))};function wn(e){return Object(T.useEffect)((function(){return function(){return e()}}),[])}var En=function(e,t){return function(n){return t(e(n))}},Dn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(En)};var xn=function(e){return function(t){return e(t),null}},Bn={tap:xn((function(e){var t=e.onTap,n=e.onTapStart,i=e.onTapCancel,r=e.whileTap,o=e.visualElement,a=t||n||i||r,s=Object(T.useRef)(!1),c=Object(T.useRef)(null);function u(){var e;null===(e=c.current)||void 0===e||e.call(c),c.current=null}function l(){var e;return u(),s.current=!1,null===(e=o.animationState)||void 0===e||e.setActive(Jt.Tap,!1),!bn()}function d(e,n){l()&&(Sn(o.getInstance(),e.target)?null==t||t(e,n):null==i||i(e,n))}function m(e,t){l()&&(null==i||i(e,t))}pn(o,"pointerdown",a?function(e,t){var i;u(),s.current||(s.current=!0,c.current=Dn(fn(window,"pointerup",d),fn(window,"pointercancel",m)),null==n||n(e,t),null===(i=o.animationState)||void 0===i||i.setActive(Jt.Tap,!0))}:void 0),wn(u)})),focus:xn((function(e){var t=e.whileFocus,n=e.visualElement;nn(n,"focus",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Jt.Focus,!0)}:void 0),nn(n,"blur",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Jt.Focus,!1)}:void 0)})),hover:xn((function(e){var t=e.onHoverStart,n=e.onHoverEnd,i=e.whileHover,r=e.visualElement;pn(r,"pointerenter",t||i?An(r,!0,t):void 0),pn(r,"pointerleave",n||i?An(r,!1,n):void 0)}))};function In(e,t){if(!Array.isArray(t))return!1;var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}var Tn=function(e,t,n){return Math.min(Math.max(n,e),t)},On=.001;function kn(e){var t,n,i=e.duration,r=void 0===i?800:i,o=e.bounce,a=void 0===o?.25:o,s=e.velocity,c=void 0===s?0:s,u=e.mass,l=void 0===u?1:u,d=1-a;d=Tn(.05,1,d),r=Tn(.01,10,r/1e3),d<1?(t=function(e){var t=e*d,n=t*r,i=t-c,o=Pn(e,d),a=Math.exp(-n);return On-i/o*a},n=function(e){var n=e*d*r,i=n*c+c,o=Math.pow(d,2)*Math.pow(e,2)*r,a=Math.exp(-n),s=Pn(Math.pow(e,2),d);return(-t(e)+On>0?-1:1)*((i-o)*a)/s}):(t=function(e){return Math.exp(-e*r)*((e-c)*r+1)-.001},n=function(e){return Math.exp(-e*r)*(r*r*(c-e))});var m=function(e,t,n){for(var i=n,r=1;r<12;r++)i-=e(i)/t(i);return i}(t,n,5/r);if(r*=1e3,isNaN(m))return{stiffness:100,damping:10,duration:r};var h=Math.pow(m,2)*l;return{stiffness:h,damping:2*d*Math.sqrt(l*h),duration:r}}function Pn(e,t){return e*Math.sqrt(1-t*t)}var Ln=["duration","bounce"],_n=["stiffness","damping","mass"];function Rn(e,t){return t.some((function(t){return void 0!==e[t]}))}function Mn(e){var t=e.from,n=void 0===t?0:t,i=e.to,r=void 0===i?1:i,o=e.restSpeed,a=void 0===o?2:o,s=e.restDelta,c=Object(me.d)(e,["from","to","restSpeed","restDelta"]),u={done:!1,value:n},l=function(e){var t=Object(me.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Rn(e,_n)&&Rn(e,Ln)){var n=kn(e);(t=Object(me.a)(Object(me.a)(Object(me.a)({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(c),d=l.stiffness,m=l.damping,h=l.mass,f=l.velocity,p=l.duration,g=l.isResolvedFromDuration,v=Fn,y=Fn;function C(){var e=f?-f/1e3:0,t=r-n,i=m/(2*Math.sqrt(d*h)),o=Math.sqrt(d/h)/1e3;if(null!=s||(s=Math.abs(r-n)<=1?.01:.4),i<1){var a=Pn(o,i);v=function(n){var s=Math.exp(-i*o*n);return r-s*((e+i*o*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},y=function(n){var r=Math.exp(-i*o*n);return i*o*r*(Math.sin(a*n)*(e+i*o*t)/a+t*Math.cos(a*n))-r*(Math.cos(a*n)*(e+i*o*t)-a*t*Math.sin(a*n))}}else if(1===i)v=function(n){return r-Math.exp(-o*n)*(t+(e+o*t)*n)};else{var c=o*Math.sqrt(i*i-1);v=function(n){var a=Math.exp(-i*o*n),s=Math.min(c*n,300);return r-a*((e+i*o*t)*Math.sinh(s)+c*t*Math.cosh(s))/c}}}return C(),{next:function(e){var t=v(e);if(g)u.done=e>=p;else{var n=1e3*y(e),i=Math.abs(n)<=a,o=Math.abs(r-t)<=s;u.done=i&&o}return u.value=u.done?r:t,u},flipTarget:function(){var e;f=-f,n=(e=[r,n])[0],r=e[1],C()}}}Mn.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var Fn=function(e){return 0},Nn=function(e,t,n){var i=t-e;return 0===i?1:(n-e)/i},Vn=function(e,t,n){return-n*e+n*t+e},Wn=function(e,t){return function(n){return Boolean(ct(n)&&st.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},jn=function(e,t,n){return function(i){var r;if(!ct(i))return i;var o=i.match(ot),a=o[0],s=o[1],c=o[2],u=o[3];return(r={})[e]=parseFloat(a),r[t]=parseFloat(s),r[n]=parseFloat(c),r.alpha=void 0!==u?parseFloat(u):1,r}},zn=it(0,255),Hn=Object(me.a)(Object(me.a)({},gt),{transform:function(e){return Math.round(zn(e))}}),Un={test:Wn("rgb","red"),parse:jn("red","green","blue"),transform:function(e){var t=e.red,n=e.green,i=e.blue,r=e.alpha,o=void 0===r?1:r;return"rgba("+Hn.transform(t)+", "+Hn.transform(n)+", "+Hn.transform(i)+", "+rt(vt.transform(o))+")"}};var Zn={test:Wn("#"),parse:function(e){var t="",n="",i="",r="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),i=e.substr(5,2),r=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),i=e.substr(3,1),r=e.substr(4,1),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:Un.transform},Gn={test:Wn("hsl","hue"),parse:jn("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,i=e.lightness,r=e.alpha,o=void 0===r?1:r;return"hsla("+Math.round(t)+", "+dt.transform(rt(n))+", "+dt.transform(rt(i))+", "+rt(vt.transform(o))+")"}},Yn=function(e,t,n){var i=e*e,r=t*t;return Math.sqrt(Math.max(0,n*(r-i)+i))},Qn=[Zn,Un,Gn],qn=function(e){return Qn.find((function(t){return t.test(e)}))},Xn=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},Kn=function(e,t){var n=qn(e),i=qn(t);Xn(e),Xn(t),n.transform,i.transform;var r=n.parse(e),o=i.parse(t),a=Object(me.a)({},r),s=n===Gn?Vn:Yn;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(r[t],o[t],e));return a.alpha=Vn(r.alpha,o.alpha,e),n.transform(a)}},Jn={test:function(e){return Un.test(e)||Zn.test(e)||Gn.test(e)},parse:function(e){return Un.test(e)?Un.parse(e):Gn.test(e)?Gn.parse(e):Zn.parse(e)},transform:function(e){return ct(e)?e:e.hasOwnProperty("red")?Un.transform(e):Gn.transform(e)}},$n="${c}",ei="${n}";function ti(e){var t=[],n=0,i=e.match(at);i&&(n=i.length,e=e.replace(at,$n),t.push.apply(t,i.map(Jn.parse)));var r=e.match(ot);return r&&(e=e.replace(ot,ei),t.push.apply(t,r.map(gt.parse))),{values:t,numColors:n,tokenised:e}}function ni(e){return ti(e).values}function ii(e){var t=ti(e),n=t.values,i=t.numColors,r=t.tokenised,o=n.length;return function(e){for(var t=r,n=0;n<o;n++)t=t.replace(n<i?$n:ei,n<i?Jn.transform(e[n]):rt(e[n]));return t}}var ri=function(e){return"number"==typeof e?0:e};var oi={test:function(e){var t,n,i,r;return isNaN(e)&&ct(e)&&(null!==(n=null===(t=e.match(ot))||void 0===t?void 0:t.length)&&void 0!==n?n:0)+(null!==(r=null===(i=e.match(at))||void 0===i?void 0:i.length)&&void 0!==r?r:0)>0},parse:ni,createTransformer:ii,getAnimatableNone:function(e){var t=ni(e);return ii(e)(t.map(ri))}},ai=function(e){return"number"==typeof e};function si(e,t){return ai(e)?function(n){return Vn(e,t,n)}:Jn.test(e)?Kn(e,t):di(e,t)}var ci=function(e,t){var n=Object(me.e)([],e),i=n.length,r=e.map((function(e,n){return si(e,t[n])}));return function(e){for(var t=0;t<i;t++)n[t]=r[t](e);return n}},ui=function(e,t){var n=Object(me.a)(Object(me.a)({},e),t),i={};for(var r in n)void 0!==e[r]&&void 0!==t[r]&&(i[r]=si(e[r],t[r]));return function(e){for(var t in i)n[t]=i[t](e);return n}};function li(e){for(var t=oi.parse(e),n=t.length,i=0,r=0,o=0,a=0;a<n;a++)i||"number"==typeof t[a]?i++:void 0!==t[a].hue?o++:r++;return{parsed:t,numNumbers:i,numRGB:r,numHSL:o}}var di=function(e,t){var n=oi.createTransformer(t),i=li(e),r=li(t);return i.numHSL===r.numHSL&&i.numRGB===r.numRGB&&(i.numNumbers,r.numNumbers),Dn(ci(i.parsed,r.parsed),n)},mi=function(e,t){return function(n){return Vn(e,t,n)}};function hi(e,t,n){for(var i,r=[],o=n||("number"==typeof(i=e[0])?mi:"string"==typeof i?Jn.test(i)?Kn:di:Array.isArray(i)?ci:"object"==typeof i?ui:void 0),a=e.length-1,s=0;s<a;s++){var c=o(e[s],e[s+1]);if(t){var u=Array.isArray(t)?t[s]:t;c=Dn(u,c)}r.push(c)}return r}function fi(e,t,n){var i=void 0===n?{}:n,r=i.clamp,o=void 0===r||r,a=i.ease,s=i.mixer,c=e.length;t.length,!a||!Array.isArray(a)||a.length,e[0]>e[c-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var u=hi(t,a,s),l=2===c?function(e,t){var n=e[0],i=e[1],r=t[0];return function(e){return r(Nn(n,i,e))}}(e,u):function(e,t){var n=e.length,i=n-1;return function(r){var o=0,a=!1;if(r<=e[0]?a=!0:r>=e[i]&&(o=i-1,a=!0),!a){for(var s=1;s<n&&!(e[s]>r||s===i);s++);o=s-1}var c=Nn(e[o],e[o+1],r);return t[o](c)}}(e,u);return o?function(t){return l(Tn(e[0],e[c-1],t))}:l}var pi,gi=function(e){return function(t){return 1-e(1-t)}},vi=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},yi=function(e){return function(t){return t*t*((e+1)*t-e)}},Ci=function(e){return e},bi=(pi=2,function(e){return Math.pow(e,pi)}),Ai=gi(bi),Si=vi(bi),wi=function(e){return 1-Math.sin(Math.acos(e))},Ei=gi(wi),Di=vi(Ei),xi=yi(1.525),Bi=gi(xi),Ii=vi(xi),Ti=function(e){var t=yi(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),Oi=function(e){if(1===e||0===e)return e;var t=e*e;return e<.36363636363636365?7.5625*t:e<.7272727272727273?9.075*t-9.9*e+3.4:e<.9?12.066481994459833*t-19.63545706371191*e+8.898060941828255:10.8*e*e-20.52*e+10.72},ki=gi(Oi);function Pi(e,t){return e.map((function(){return t||Si})).splice(0,e.length-1)}function Li(e){var t=e.from,n=void 0===t?0:t,i=e.to,r=void 0===i?1:i,o=e.ease,a=e.offset,s=e.duration,c=void 0===s?300:s,u={done:!1,value:n},l=Array.isArray(r)?r:[n,r],d=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===l.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(l),c);function m(){return fi(d,l,{ease:Array.isArray(o)?o:Pi(l,o)})}var h=m();return{next:function(e){return u.value=h(e),u.done=e>=c,u},flipTarget:function(){l.reverse(),h=m()}}}var _i={keyframes:Li,spring:Mn,decay:function(e){var t=e.velocity,n=void 0===t?0:t,i=e.from,r=void 0===i?0:i,o=e.power,a=void 0===o?.8:o,s=e.timeConstant,c=void 0===s?350:s,u=e.restDelta,l=void 0===u?.5:u,d=e.modifyTarget,m={done:!1,value:r},h=a*n,f=r+h,p=void 0===d?f:d(f);return p!==f&&(h=p-r),{next:function(e){var t=-h*Math.exp(-e/c);return m.done=!(t>l||t<-l),m.value=m.done?p:p+t,m},flipTarget:function(){}}}};var Ri=1/60*1e3,Mi="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Fi="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(Mi())}),Ri)};var Ni=!0,Vi=!1,Wi=!1,ji={delta:0,timestamp:0},zi=["read","update","preRender","render","postRender"],Hi=zi.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],i=0,r=!1,o=new WeakSet,a={schedule:function(e,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var c=s&&r,u=c?t:n;return a&&o.add(e),-1===u.indexOf(e)&&(u.push(e),c&&r&&(i=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),o.delete(e)},process:function(s){var c;if(r=!0,t=(c=[n,t])[0],(n=c[1]).length=0,i=t.length)for(var u=0;u<i;u++){var l=t[u];l(s),o.has(l)&&(a.schedule(l),e())}r=!1}};return a}((function(){return Vi=!0})),e}),{}),Ui=zi.reduce((function(e,t){var n=Hi[t];return e[t]=function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!1),Vi||qi(),n.schedule(e,t,i)},e}),{}),Zi=zi.reduce((function(e,t){return e[t]=Hi[t].cancel,e}),{}),Gi=zi.reduce((function(e,t){return e[t]=function(){return Hi[t].process(ji)},e}),{}),Yi=function(e){return Hi[e].process(ji)},Qi=function(e){Vi=!1,ji.delta=Ni?Ri:Math.max(Math.min(e-ji.timestamp,40),1),ji.timestamp=e,Wi=!0,zi.forEach(Yi),Wi=!1,Vi&&(Ni=!1,Fi(Qi))},qi=function(){Vi=!0,Ni=!0,Wi||Fi(Qi)},Xi=function(){return ji},Ki=Ui;function Ji(e,t,n){return void 0===n&&(n=0),e-t-n}var $i=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return Ki.update(t,!0)},stop:function(){return Zi.update(t)}}};function er(e){var t,n,i,r,o,a=e.from,s=e.autoplay,c=void 0===s||s,u=e.driver,l=void 0===u?$i:u,d=e.elapsed,m=void 0===d?0:d,h=e.repeat,f=void 0===h?0:h,p=e.repeatType,g=void 0===p?"loop":p,v=e.repeatDelay,y=void 0===v?0:v,C=e.onPlay,b=e.onStop,A=e.onComplete,S=e.onRepeat,w=e.onUpdate,E=Object(me.d)(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),D=E.to,x=0,B=E.duration,I=!1,T=!0,O=function(e){if(Array.isArray(e.to))return Li;if(_i[e.type])return _i[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Li:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Mn:Li}(E);(null===(n=(t=O).needsInterpolation)||void 0===n?void 0:n.call(t,a,D))&&(o=fi([0,100],[a,D],{clamp:!1}),a=0,D=100);var k=O(Object(me.a)(Object(me.a)({},E),{from:a,to:D}));function P(){x++,"reverse"===g?m=function(e,t,n,i){return void 0===n&&(n=0),void 0===i&&(i=!0),i?Ji(t+-e,t,n):t-(e-t)+n}(m,B,y,T=x%2==0):(m=Ji(m,B,y),"mirror"===g&&k.flipTarget()),I=!1,S&&S()}function L(e){if(T||(e=-e),m+=e,!I){var t=k.next(Math.max(0,m));r=t.value,o&&(r=o(r)),I=T?t.done:m<=0}null==w||w(r),I&&(0===x&&(null!=B||(B=m)),x<f?function(e,t,n,i){return i?e>=t+n:e<=-n}(m,B,y,T)&&P():(i.stop(),A&&A()))}return c&&(null==C||C(),(i=l(L)).start()),{stop:function(){null==b||b(),i.stop()}}}function tr(e,t){return t?e*(1e3/t):0}var nr=function(e){return 1e3*e},ir=function(e,t){return 1-3*t+3*e},rr=function(e,t){return 3*t-6*e},or=function(e){return 3*e},ar=function(e,t,n){return((ir(t,n)*e+rr(t,n))*e+or(t))*e},sr=function(e,t,n){return 3*ir(t,n)*e*e+2*rr(t,n)*e+or(t)};var cr=.1;function ur(e,t,n,i){if(e===t&&n===i)return Ci;for(var r=new Float32Array(11),o=0;o<11;++o)r[o]=ar(o*cr,e,n);function a(t){for(var i=0,o=1;10!==o&&r[o]<=t;++o)i+=cr;--o;var a=i+(t-r[o])/(r[o+1]-r[o])*cr,s=sr(a,e,n);return s>=.001?function(e,t,n,i){for(var r=0;r<8;++r){var o=sr(t,n,i);if(0===o)return t;t-=(ar(t,n,i)-e)/o}return t}(t,a,e,n):0===s?a:function(e,t,n,i,r){var o,a,s=0;do{(o=ar(a=t+(n-t)/2,i,r)-e)>0?n=a:t=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,i,i+cr,e,n)}return function(e){return 0===e||1===e?e:ar(a(e),t,i)}}var lr={linear:Ci,easeIn:bi,easeInOut:Si,easeOut:Ai,circIn:wi,circInOut:Di,circOut:Ei,backIn:xi,backInOut:Ii,backOut:Bi,anticipate:Ti,bounceIn:ki,bounceInOut:function(e){return e<.5?.5*(1-Oi(1-2*e)):.5*Oi(2*e-1)+.5},bounceOut:Oi},dr=function(e){if(Array.isArray(e)){e.length;var t=Object(me.c)(e,4);return ur(t[0],t[1],t[2],t[3])}return"string"==typeof e?lr[e]:e},mr=function(e,t){return"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!oi.test(t)||t.startsWith("url(")))},hr=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},fr=function(e){return{type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},pr=function(){return{type:"keyframes",ease:"linear",duration:.3}},gr=function(e){return{type:"keyframes",duration:.8,values:e}},vr={x:hr,y:hr,z:hr,rotate:hr,rotateX:hr,rotateY:hr,rotateZ:hr,scaleX:fr,scaleY:fr,scale:fr,opacity:pr,backgroundColor:pr,color:pr,default:fr},yr=new Set(["brightness","contrast","saturate","opacity"]);function Cr(e){var t=e.slice(0,-1).split("("),n=t[0],i=t[1];if("drop-shadow"===n)return e;var r=(i.match(ot)||[])[0];if(!r)return e;var o=i.replace(r,""),a=yr.has(n)?1:0;return r!==i&&(a*=100),n+"("+a+o+")"}var br=/([a-z-]*)\(.*?\)/g,Ar=Object(me.a)(Object(me.a)({},oi),{getAnimatableNone:function(e){var t=e.match(br);return t?t.map(Cr).join(" "):e}}),Sr=Object(me.a)(Object(me.a)({},bt),{color:Jn,backgroundColor:Jn,outlineColor:Jn,fill:Jn,stroke:Jn,borderColor:Jn,borderTopColor:Jn,borderRightColor:Jn,borderBottomColor:Jn,borderLeftColor:Jn,filter:Ar,WebkitFilter:Ar}),wr=function(e){return Sr[e]};function Er(e,t){var n,i=wr(e);return i!==Ar&&(i=oi),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,t)}function Dr(e){var t=e.ease,n=e.times,i=e.yoyo,r=e.flip,o=e.loop,a=Object(me.d)(e,["ease","times","yoyo","flip","loop"]),s=Object(me.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=nr(a.duration)),a.repeatDelay&&(s.repeatDelay=nr(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!=typeof e[0]}(t)?t.map(dr):dr(t)),"tween"===a.type&&(s.type="keyframes"),(i||o||r)&&(!0,i?s.repeatType="reverse":o?s.repeatType="loop":r&&(s.repeatType="mirror"),s.repeat=o||i||r||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function xr(e,t,n){var i,r,o,a;return Array.isArray(t.to)&&(null!==(i=e.duration)&&void 0!==i||(e.duration=.8)),function(e){Array.isArray(e.to)&&null===e.to[0]&&(e.to=Object(me.e)([],Object(me.c)(e.to)),e.to[0]=e.from)}(t),function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=Object(me.d)(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}(e)||(e=Object(me.a)(Object(me.a)({},e),(r=n,o=t.to,a=Gt(o)?gr:vr[r]||vr.default,Object(me.a)({to:o},a(o))))),Object(me.a)(Object(me.a)({},t),Dr(e))}function Br(e,t,n,i,r){var o,a=Or(i,e),s=null!==(o=a.from)&&void 0!==o?o:t.get(),c=mr(e,n);"none"===s&&c&&"string"==typeof n?s=Er(e,n):Ir(s)&&"string"==typeof n?s=Tr(n):!Array.isArray(n)&&Ir(n)&&"string"==typeof s&&(n=Tr(s));var u=mr(e,s);return u&&c&&!1!==a.type?function(){var i={from:s,to:n,velocity:t.getVelocity(),onComplete:r,onUpdate:function(e){return t.set(e)}};return"inertia"===a.type||"decay"===a.type?function(e){var t,n=e.from,i=void 0===n?0:n,r=e.velocity,o=void 0===r?0:r,a=e.min,s=e.max,c=e.power,u=void 0===c?.8:c,l=e.timeConstant,d=void 0===l?750:l,m=e.bounceStiffness,h=void 0===m?500:m,f=e.bounceDamping,p=void 0===f?10:f,g=e.restDelta,v=void 0===g?1:g,y=e.modifyTarget,C=e.driver,b=e.onUpdate,A=e.onComplete;function S(e){return void 0!==a&&e<a||void 0!==s&&e>s}function w(e){return void 0===a?s:void 0===s||Math.abs(a-e)<Math.abs(s-e)?a:s}function E(e){null==t||t.stop(),t=er(Object(me.a)(Object(me.a)({},e),{driver:C,onUpdate:function(t){var n;null==b||b(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:A}))}function D(e){E(Object(me.a)({type:"spring",stiffness:h,damping:p,restDelta:v},e))}if(S(i))D({from:i,velocity:o,to:w(i)});else{var x=u*o+i;"undefined"!=typeof y&&(x=y(x));var B,I,T=w(x),O=T===a?-1:1;E({type:"decay",from:i,velocity:o,timeConstant:d,power:u,restDelta:v,modifyTarget:y,onUpdate:S(x)?function(e){B=I,I=e,o=tr(e-B,Xi().delta),(1===O&&e>T||-1===O&&e<T)&&D({from:e,to:T,velocity:o})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}}(Object(me.a)(Object(me.a)({},i),a)):er(Object(me.a)(Object(me.a)({},xr(a,i,e)),{onUpdate:function(e){var t;i.onUpdate(e),null===(t=a.onUpdate)||void 0===t||t.call(a,e)},onComplete:function(){var e;i.onComplete(),null===(e=a.onComplete)||void 0===e||e.call(a)}}))}:function(){var e;return t.set(n),r(),null===(e=null==a?void 0:a.onComplete)||void 0===e||e.call(a),{stop:function(){}}}}function Ir(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function Tr(e){return"number"==typeof e?0:Er("",e)}function Or(e,t){return e[t]||e.default||e}function kr(e,t,n,i){return void 0===i&&(i={}),t.start((function(r){var o,a,s=Br(e,t,n,i,r),c=function(e,t){var n;return null!==(n=(Or(e,t)||{}).delay)&&void 0!==n?n:0}(i,e),u=function(){return a=s()};return c?o=setTimeout(u,nr(c)):u(),function(){clearTimeout(o),null==a||a.stop()}}))}function Pr(e,t){-1===e.indexOf(t)&&e.push(t)}function Lr(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var _r=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return Pr(this.subscriptions,e),function(){return Lr(t.subscriptions,e)}},e.prototype.notify=function(e,t,n){var i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(var r=0;r<i;r++){var o=this.subscriptions[r];o&&o(e,t,n)}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),Rr=function(){function e(e){var t,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new _r,this.velocityUpdateSubscribers=new _r,this.renderSubscribers=new _r,this.canTrackVelocity=!1,this.updateAndNotify=function(e,t){void 0===t&&(t=!0),n.prev=n.current,n.current=e;var i=Xi(),r=i.delta,o=i.timestamp;n.lastUpdated!==o&&(n.timeDelta=r,n.lastUpdated=o,Ki.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),t&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return Ki.postRender(n.velocityCheck)},this.velocityCheck=function(e){e.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t)))}return e.prototype.onChange=function(e){return this.updateSubscribers.add(e)},e.prototype.clearListeners=function(){this.updateSubscribers.clear()},e.prototype.onRenderRequest=function(e){return e(this.get()),this.renderSubscribers.add(e)},e.prototype.attach=function(e){this.passiveEffect=e},e.prototype.set=function(e,t){void 0===t&&(t=!0),t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)},e.prototype.get=function(){return this.current},e.prototype.getPrevious=function(){return this.prev},e.prototype.getVelocity=function(){return this.canTrackVelocity?tr(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(e){var t=this;return this.stop(),new Promise((function(n){t.hasAnimated=!0,t.stopAnimation=e(n)})).then((function(){return t.clearAnimation()}))},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},e}();function Mr(e){return new Rr(e)}var Fr=function(e){return function(t){return t.test(e)}},Nr=[gt,mt,dt,lt,ft,ht,{test:function(e){return"auto"===e},parse:function(e){return e}}],Vr=function(e){return Nr.find(Fr(e))},Wr=Object(me.e)(Object(me.e)([],Object(me.c)(Nr)),[Jn,oi]),jr=function(e){return Wr.find(Fr(e))};function zr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Mr(n))}function Hr(e,t){var n=Re(e,t),i=n?e.makeTargetAnimatable(n,!1):{},r=i.transitionEnd,o=void 0===r?{}:r;i.transition;var a,s=Object(me.d)(i,["transitionEnd","transition"]);for(var c in s=Object(me.a)(Object(me.a)({},s),o)){zr(e,c,(a=s[c],Gt(a)?a[a.length-1]||0:a))}}function Ur(e,t){if(t)return(t[e]||t.default||t).from}function Zr(e,t,n){var i;void 0===n&&(n={});var r=Re(e,t,n.custom),o=(r||{}).transition,a=void 0===o?e.getDefaultTransition()||{}:o;n.transitionOverride&&(a=n.transitionOverride);var s=r?function(){return Gr(e,r,n)}:function(){return Promise.resolve()},c=(null===(i=e.variantChildren)||void 0===i?void 0:i.size)?function(i){void 0===i&&(i=0);var r=a.delayChildren,o=void 0===r?0:r,s=a.staggerChildren,c=a.staggerDirection;return function(e,t,n,i,r,o){void 0===n&&(n=0);void 0===i&&(i=0);void 0===r&&(r=1);var a=[],s=(e.variantChildren.size-1)*i,c=1===r?function(e){return void 0===e&&(e=0),e*i}:function(e){return void 0===e&&(e=0),s-e*i};return Array.from(e.variantChildren).sort(Yr).forEach((function(e,i){a.push(Zr(e,t,Object(me.a)(Object(me.a)({},o),{delay:n+c(i)})).then((function(){return e.notifyAnimationComplete(t)})))})),Promise.all(a)}(e,t,o+i,s,c,n)}:function(){return Promise.resolve()},u=a.when;if(u){var l=Object(me.c)("beforeChildren"===u?[s,c]:[c,s],2),d=l[0],m=l[1];return d().then(m)}return Promise.all([s(),c(n.delay)])}function Gr(e,t,n){var i,r=void 0===n?{}:n,o=r.delay,a=void 0===o?0:o,s=r.transitionOverride,c=r.type,u=e.makeTargetAnimatable(t),l=u.transition,d=void 0===l?e.getDefaultTransition():l,m=u.transitionEnd,h=Object(me.d)(u,["transition","transitionEnd"]);s&&(d=s);var f=[],p=c&&(null===(i=e.animationState)||void 0===i?void 0:i.getState()[c]);for(var g in h){var v=e.getValue(g),y=h[g];if(!(!v||void 0===y||p&&Qr(p,g))){var C=kr(g,v,y,Object(me.a)({delay:a},d));f.push(C)}}return Promise.all(f).then((function(){m&&Hr(e,m)}))}function Yr(e,t){return e.sortNodePosition(t)}function Qr(e,t){var n=e.protectedKeys,i=e.needsAnimating,r=n.hasOwnProperty(t)&&!0!==i[t];return i[t]=!1,r}var qr=[Jt.Animate,Jt.Hover,Jt.Tap,Jt.Drag,Jt.Focus,Jt.Exit],Xr=Object(me.e)([],Object(me.c)(qr)).reverse(),Kr=qr.length;function Jr(e){return function(t){return Promise.all(t.map((function(t){var n=t.animation,i=t.options;return function(e,t,n){var i;if(void 0===n&&(n={}),e.notifyAnimationStart(),Array.isArray(t)){var r=t.map((function(t){return Zr(e,t,n)}));i=Promise.all(r)}else if("string"==typeof t)i=Zr(e,t,n);else{var o="function"==typeof t?Re(e,t,n.custom):t;i=Gr(e,o,n)}return i.then((function(){return e.notifyAnimationComplete(t)}))}(e,n,i)})))}}function $r(e){var t,n=Jr(e),i=((t={})[Jt.Animate]=eo(!0),t[Jt.Hover]=eo(),t[Jt.Tap]=eo(),t[Jt.Drag]=eo(),t[Jt.Focus]=eo(),t[Jt.Exit]=eo(),t),r={},o=!0,a=function(t,n){var i=Re(e,n);if(i){i.transition;var r=i.transitionEnd,o=Object(me.d)(i,["transition","transitionEnd"]);t=Object(me.a)(Object(me.a)(Object(me.a)({},t),o),r)}return t};function s(t,s){for(var c,u=e.getProps(),l=e.getVariantContext(!0)||{},d=[],m=new Set,h={},f=1/0,p=function(n){var r=Xr[n],p=i[r],g=null!==(c=u[r])&&void 0!==c?c:l[r],v=Le(g),y=r===s?p.isActive:null;!1===y&&(f=n);var C=g===l[r]&&g!==u[r]&&v;if(C&&o&&e.manuallyAnimateOnMount&&(C=!1),p.protectedKeys=Object(me.a)({},h),!p.isActive&&null===y||!g&&!p.prevProp||Zt(g)||"boolean"==typeof g)return"continue";var b=function(e,t){if("string"==typeof t)return t!==e;if(Pe(t))return!In(t,e);return!1}(p.prevProp,g)||r===s&&p.isActive&&!C&&v||n>f&&v,A=Array.isArray(g)?g:[g],S=A.reduce(a,{});!1===y&&(S={});var w=p.prevResolvedValues,E=void 0===w?{}:w,D=Object(me.a)(Object(me.a)({},E),S),x=function(e){b=!0,m.delete(e),p.needsAnimating[e]=!0};for(var B in D){var I=S[B],T=E[B];h.hasOwnProperty(B)||(I!==T?Gt(I)&&Gt(T)?In(I,T)?p.protectedKeys[B]=!0:x(B):void 0!==I?x(B):m.add(B):void 0!==I&&m.has(B)?x(B):p.protectedKeys[B]=!0)}p.prevProp=g,p.prevResolvedValues=S,p.isActive&&(h=Object(me.a)(Object(me.a)({},h),S)),o&&e.blockInitialAnimation&&(b=!1),b&&!C&&d.push.apply(d,Object(me.e)([],Object(me.c)(A.map((function(e){return{animation:e,options:Object(me.a)({type:r},t)}})))))},g=0;g<Kr;g++)p(g);if(r=Object(me.a)({},h),m.size){var v={};m.forEach((function(t){var n=e.getBaseTarget(t);void 0!==n&&(v[t]=n)})),d.push({animation:v})}var y=Boolean(d.length);return o&&!1===u.initial&&!e.manuallyAnimateOnMount&&(y=!1),o=!1,y?n(d):Promise.resolve()}return{isAnimated:function(e){return void 0!==r[e]},animateChanges:s,setActive:function(t,n,r){var o;return i[t].isActive===n?Promise.resolve():(null===(o=e.variantChildren)||void 0===o||o.forEach((function(e){var i;return null===(i=e.animationState)||void 0===i?void 0:i.setActive(t,n)})),i[t].isActive=n,s(r,t))},setAnimateFunction:function(t){n=t(e)},getState:function(){return i}}}function eo(e){return void 0===e&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var to={animation:xn((function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=$r(t)),Zt(n)&&Object(T.useEffect)((function(){return n.subscribe(t)}),[n])})),exit:xn((function(e){var t=e.custom,n=e.visualElement,i=Object(me.c)(Se(),2),r=i[0],o=i[1],a=Object(T.useContext)(be);Object(T.useEffect)((function(){var e,i,s=null===(e=n.animationState)||void 0===e?void 0:e.setActive(Jt.Exit,!r,{custom:null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:t});!r&&(null==s||s.then(o))}),[r])}))},no=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},io=function(e){return no(e)&&e.hasOwnProperty("z")},ro=function(e,t){return Math.abs(e-t)};function oo(e,t){if(ai(e)&&ai(t))return ro(e,t);if(no(e)&&no(t)){var n=ro(e.x,t.x),i=ro(e.y,t.y),r=io(e)&&io(t)?ro(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(r,2))}}var ao=function(){function e(e,t,n){var i=this,r=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(i.lastMoveEvent&&i.lastMoveEventInfo){var e=uo(i.lastMoveEventInfo,i.history),t=null!==i.startEvent,n=oo(e.offset,{x:0,y:0})>=3;if(t||n){var r=e.point,o=Xi().timestamp;i.history.push(Object(me.a)(Object(me.a)({},r),{timestamp:o}));var a=i.handlers,s=a.onStart,c=a.onMove;t||(s&&s(i.lastMoveEvent,e),i.startEvent=i.lastMoveEvent),c&&c(i.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){i.lastMoveEvent=e,i.lastMoveEventInfo=so(t,i.transformPagePoint),rn(e)&&0===e.buttons?i.handlePointerUp(e,t):Ki.update(i.updatePoint,!0)},this.handlePointerUp=function(e,t){i.end();var n=i.handlers,r=n.onEnd,o=n.onSessionEnd,a=uo(so(t,i.transformPagePoint),i.history);i.startEvent&&r&&r(e,a),o&&o(e,a)},!(on(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=r;var o=so(un(e),this.transformPagePoint),a=o.point,s=Xi().timestamp;this.history=[Object(me.a)(Object(me.a)({},a),{timestamp:s})];var c=t.onSessionStart;c&&c(e,uo(o,this.history)),this.removeListeners=Dn(fn(window,"pointermove",this.handlePointerMove),fn(window,"pointerup",this.handlePointerUp),fn(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),Zi.update(this.updatePoint)},e}();function so(e,t){return t?{point:t(e.point)}:e}function co(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uo(e,t){var n=e.point;return{point:n,delta:co(n,mo(t)),offset:co(n,lo(t)),velocity:ho(t,.1)}}function lo(e){return e[0]}function mo(e){return e[e.length-1]}function ho(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,i=null,r=mo(e);n>=0&&(i=e[n],!(r.timestamp-i.timestamp>nr(t)));)n--;if(!i)return{x:0,y:0};var o=(r.timestamp-i.timestamp)/1e3;if(0===o)return{x:0,y:0};var a={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function fo(e){return e}function po(e){var t=e.top;return{x:{min:e.left,max:e.right},y:{min:t,max:e.bottom}}}var go={translate:0,scale:1,origin:0,originPoint:0};function vo(){return{x:Object(me.a)({},go),y:Object(me.a)({},go)}}function yo(e){return[e("x"),e("y")]}function Co(e,t,n){var i=t.min,r=t.max;return void 0!==i&&e<i?e=n?Vn(i,e,n.min):Math.max(e,i):void 0!==r&&e>r&&(e=n?Vn(r,e,n.max):Math.min(e,r)),e}function bo(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ao(e,t){var n,i=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&(i=(n=Object(me.c)([r,i],2))[0],r=n[1]),{min:e.min+i,max:e.min+r}}function So(e,t,n){return{min:wo(e,t),max:wo(e,n)}}function wo(e,t){var n;return"number"==typeof e?e:null!==(n=e[t])&&void 0!==n?n:0}function Eo(e,t){return po(function(e,t){var n=e.top,i=e.left,r=e.bottom,o=e.right;void 0===t&&(t=fo);var a=t({x:i,y:n}),s=t({x:o,y:r});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(e.getBoundingClientRect(),t))}function Do(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=.01),oo(e,t)<n}function xo(e){return e.max-e.min}function Bo(e,t){var n=.5,i=xo(e),r=xo(t);return r>i?n=Nn(t.min,t.max-i,e.min):i>r&&(n=Nn(e.min,e.max-r,t.min)),Tn(0,1,n)}function Io(e,t,n,i){void 0===i&&(i=.5),e.origin=i,e.originPoint=Vn(t.min,t.max,e.origin),e.scale=xo(n)/xo(t),Do(e.scale,1,1e-4)&&(e.scale=1),e.translate=Vn(n.min,n.max,e.origin)-e.originPoint,Do(e.translate)&&(e.translate=0)}function To(e,t,n,i){Io(e.x,t.x,n.x,Oo(i.originX)),Io(e.y,t.y,n.y,Oo(i.originY))}function Oo(e){return"number"==typeof e?e:.5}function ko(e,t,n){e.min=n.min+t.min,e.max=e.min+xo(t)}var Po=function(e,t){return e.depth-t.depth};function Lo(e){return e.projection.isEnabled||e.shouldResetTransform()}function _o(e,t){void 0===t&&(t=[]);var n=e.parent;return n&&_o(n,t),Lo(e)&&t.push(e),t}function Ro(e){if(!e.shouldResetTransform()){var t,n=e.getLayoutState();e.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=e.measureViewportBox(),n.layoutCorrected=(t=n.layout,{x:Object(me.a)({},t.x),y:Object(me.a)({},t.y)}),e.notifyLayoutMeasure(n.layout,e.prevViewportBox||n.layout),Ki.update((function(){return e.rebaseProjectionTarget()}))}}function Mo(e,t){return{min:t.min-e.min,max:t.max-e.min}}function Fo(e,t){return{x:Mo(e.x,t.x),y:Mo(e.y,t.y)}}function No(e,t){var n=e.getLayoutId(),i=t.getLayoutId();return n!==i||void 0===i&&e!==t}function Vo(e){var t=e.getProps(),n=t.drag,i=t._dragX;return n&&!i}function Wo(e,t){e.min=t.min,e.max=t.max}function jo(e,t,n){return n+t*(e-n)}function zo(e,t,n,i,r){return void 0!==r&&(e=jo(e,r,i)),jo(e,n,i)+t}function Ho(e,t,n,i,r){void 0===t&&(t=0),void 0===n&&(n=1),e.min=zo(e.min,t,n,i,r),e.max=zo(e.max,t,n,i,r)}function Uo(e,t){var n=t.x,i=t.y;Ho(e.x,n.translate,n.scale,n.originPoint),Ho(e.y,i.translate,i.scale,i.originPoint)}function Zo(e,t,n,i){var r=Object(me.c)(i,3),o=r[0],a=r[1],s=r[2];e.min=t.min,e.max=t.max;var c=void 0!==n[s]?n[s]:.5,u=Vn(t.min,t.max,c);Ho(e,n[o],n[a],u,n.scale)}var Go=["x","scaleX","originX"],Yo=["y","scaleY","originY"];function Qo(e,t,n){Zo(e.x,t.x,n,Go),Zo(e.y,t.y,n,Yo)}function qo(e,t,n,i,r){return e=jo(e-=t,1/n,i),void 0!==r&&(e=jo(e,1/r,i)),e}function Xo(e,t,n){var i=Object(me.c)(n,3),r=i[0],o=i[1],a=i[2];!function(e,t,n,i,r){void 0===t&&(t=0),void 0===n&&(n=1),void 0===i&&(i=.5);var o=Vn(e.min,e.max,i)-t;e.min=qo(e.min,t,n,o,r),e.max=qo(e.max,t,n,o,r)}(e,t[r],t[o],t[a],t.scale)}function Ko(e,t){Xo(e.x,t,Go),Xo(e.y,t,Yo)}var Jo=new Set;function $o(e,t,n){e[n]||(e[n]=[]),e[n].push(t)}function ea(e){return Jo.add(e),function(){return Jo.delete(e)}}function ta(){if(Jo.size){var e=0,t=[[]],n=[],i=function(n){return $o(t,n,e)},r=function(t){$o(n,t,e),e++};Jo.forEach((function(t){t(i,r),e=0})),Jo.clear();for(var o=n.length,a=0;a<=o;a++)t[a]&&t[a].forEach(ia),n[a]&&n[a].forEach(ia)}}var na,ia=function(e){return e()},ra=new WeakMap,oa=function(){function e(e){var t=e.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=t,this.visualElement.enableLayoutProjection(),ra.set(t,this)}return e.prototype.start=function(e,t){var n=this,i=void 0===t?{}:t,r=i.snapToCursor,o=void 0!==r&&r,a=i.cursorProgress,s=this.props.transformPagePoint;this.panSession=new ao(e,{onSessionStart:function(e){var t;n.stopMotion();var i=function(e){return un(e,"client")}(e).point;null===(t=n.cancelLayout)||void 0===t||t.call(n),n.cancelLayout=ea((function(e,t){var r=_o(n.visualElement),s=function(e){var t=[],n=function(e){Lo(e)&&t.push(e),e.children.forEach(n)};return e.children.forEach(n),t.sort(Po)}(n.visualElement),c=Object(me.e)(Object(me.e)([],Object(me.c)(r)),Object(me.c)(s)),u=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),t((function(){c.forEach((function(e){return e.resetTransform()}))})),e((function(){Ro(n.visualElement),s.forEach(Ro)})),t((function(){c.forEach((function(e){return e.restoreTransform()})),o&&(u=n.snapToCursor(i))})),e((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var e=n.visualElement.projection;yo((function(t){if(!u){var r=e.target[t],o=r.min,s=r.max;n.cursorProgress[t]=a?a[t]:Nn(o,s,i[t])}var c=n.getAxisMotionValue(t);c&&(n.originPoint[t]=c.get())}))})),t((function(){Gi.update(),Gi.preRender(),Gi.render(),Gi.postRender()})),e((function(){return n.resolveDragConstraints()}))}))},onStart:function(e,t){var i,r,o,a=n.props,s=a.drag,c=a.dragPropagation;(!s||c||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Cn(s),n.openGlobalLock))&&(ta(),n.isDragging=!0,n.currentDirection=null,null===(r=(i=n.props).onDragStart)||void 0===r||r.call(i,e,t),null===(o=n.visualElement.animationState)||void 0===o||o.setActive(Jt.Drag,!0))},onMove:function(e,t){var i,r,o,a,s=n.props,c=s.dragPropagation,u=s.dragDirectionLock;if(c||n.openGlobalLock){var l=t.offset;if(u&&null===n.currentDirection)return n.currentDirection=function(e,t){void 0===t&&(t=10);var n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(l),void(null!==n.currentDirection&&(null===(r=(i=n.props).onDirectionLock)||void 0===r||r.call(i,n.currentDirection)));n.updateAxis("x",t.point,l),n.updateAxis("y",t.point,l),null===(a=(o=n.props).onDrag)||void 0===a||a.call(o,e,t),na=e}},onSessionEnd:function(e,t){return n.stop(e,t)}},{transformPagePoint:s})},e.prototype.resolveDragConstraints=function(){var e=this,t=this.props,n=t.dragConstraints,i=t.dragElastic,r=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(ke(n)?this.resolveRefConstraints(r,n):function(e,t){var n=t.top,i=t.left,r=t.bottom,o=t.right;return{x:bo(e.x,i,o),y:bo(e.y,n,r)}}(r,n)),this.elastic=function(e){return!1===e?e=0:!0===e&&(e=.35),{x:So(e,"left","right"),y:So(e,"top","bottom")}}(i),this.constraints&&!this.hasMutatedConstraints&&yo((function(t){e.getAxisMotionValue(t)&&(e.constraints[t]=function(e,t){var n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r[t],e.constraints[t]))}))},e.prototype.resolveRefConstraints=function(e,t){var n=this.props,i=n.onMeasureDragConstraints,r=n.transformPagePoint,o=t.current;this.constraintsBox=Eo(o,r);var a=function(e,t){return{x:Ao(e.x,t.x),y:Ao(e.y,t.y)}}(e,this.constraintsBox);if(i){var s=i(function(e){var t=e.x,n=e.y;return{top:n.min,bottom:n.max,left:t.min,right:t.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=po(s))}return a},e.prototype.cancelDrag=function(){var e,t;this.visualElement.unlockProjectionTarget(),null===(e=this.cancelLayout)||void 0===e||e.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(Jt.Drag,!1)},e.prototype.stop=function(e,t){var n,i,r;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var o=this.isDragging;if(this.cancelDrag(),o){var a=t.velocity;this.animateDragEnd(a),null===(r=(i=this.props).onDragEnd)||void 0===r||r.call(i,e,t)}},e.prototype.snapToCursor=function(e){var t=this;return yo((function(n){if(aa(n,t.props.drag,t.currentDirection)){var i=t.getAxisMotionValue(n);if(!i)return t.cursorProgress[n]=.5,!0;var r=t.visualElement.getLayoutState().layout,o=r[n].max-r[n].min,a=r[n].min+o/2,s=e[n]-a;t.originPoint[n]=e[n],i.set(s)}})).includes(!0)},e.prototype.updateAxis=function(e,t,n){if(aa(e,this.props.drag,this.currentDirection))return this.getAxisMotionValue(e)?this.updateAxisMotionValue(e,n):this.updateVisualElementAxis(e,t)},e.prototype.updateAxisMotionValue=function(e,t){var n=this.getAxisMotionValue(e);if(t&&n){var i=this.originPoint[e]+t[e],r=this.constraints?Co(i,this.constraints[e],this.elastic[e]):i;n.set(r)}},e.prototype.updateVisualElementAxis=function(e,t){var n,i=this.visualElement.getLayoutState().layout[e],r=i.max-i.min,o=this.cursorProgress[e],a=function(e,t,n,i,r){var o=e-t*n;return i?Co(o,i,r):o}(t[e],r,o,null===(n=this.constraints)||void 0===n?void 0:n[e],this.elastic[e]);this.visualElement.setProjectionTargetAxis(e,a,a+r)},e.prototype.setProps=function(e){var t=e.drag,n=void 0!==t&&t,i=e.dragDirectionLock,r=void 0!==i&&i,o=e.dragPropagation,a=void 0!==o&&o,s=e.dragConstraints,c=void 0!==s&&s,u=e.dragElastic,l=void 0===u?.35:u,d=e.dragMomentum,m=void 0===d||d,h=Object(me.d)(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(me.a)({drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:c,dragElastic:l,dragMomentum:m},h)},e.prototype.getAxisMotionValue=function(e){var t=this.props,n=t.layout,i=t.layoutId,r="_drag"+e.toUpperCase();return this.props[r]?this.props[r]:n||void 0!==i?void 0:this.visualElement.getValue(e,0)},e.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},e.prototype.isExternalDrag=function(){var e=this.props,t=e._dragX,n=e._dragY;return t||n},e.prototype.animateDragEnd=function(e){var t=this,n=this.props,i=n.drag,r=n.dragMomentum,o=n.dragElastic,a=n.dragTransition,s=function(e,t){void 0===t&&(t=!0);var n,i=e.getProjectionParent();return!!i&&(t?Ko(n=Fo(i.projection.target,e.projection.target),i.getLatestValues()):n=Fo(i.getLayoutState().layout,e.getLayoutState().layout),yo((function(t){return e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),c=this.constraints||{};if(s&&Object.keys(c).length&&this.isLayoutDrag()){var u=this.visualElement.getProjectionParent();if(u){var l=Fo(u.projection.targetFinal,c);yo((function(e){var t=l[e],n=t.min,i=t.max;c[e]={min:isNaN(n)?void 0:n,max:isNaN(i)?void 0:i}}))}}var d=yo((function(n){var u;if(aa(n,i,t.currentDirection)){var l=null!==(u=null==c?void 0:c[n])&&void 0!==u?u:{},d=o?200:1e6,m=o?40:1e7,h=Object(me.a)(Object(me.a)({type:"inertia",velocity:r?e[n]:0,bounceStiffness:d,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10},a),l);return t.getAxisMotionValue(n)?t.startAxisValueAnimation(n,h):t.visualElement.startLayoutAnimation(n,h,s)}}));return Promise.all(d).then((function(){var e,n;null===(n=(e=t.props).onDragTransitionEnd)||void 0===n||n.call(e)}))},e.prototype.stopMotion=function(){var e=this;yo((function(t){var n=e.getAxisMotionValue(t);n?n.stop():e.visualElement.stopLayoutAnimation()}))},e.prototype.startAxisValueAnimation=function(e,t){var n=this.getAxisMotionValue(e);if(n){var i=n.get();return n.set(i),n.set(i),kr(e,n,0,t)}},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.drag;if(ke(t.dragConstraints)&&this.constraintsBox){this.stopMotion();var i={x:0,y:0};yo((function(t){i[t]=Bo(e.visualElement.projection.target[t],e.constraintsBox[t])})),this.updateConstraints((function(){yo((function(t){if(aa(t,n,null)){var r=function(e,t,n){var i=e.max-e.min,r=Vn(t.min,t.max-i,n);return{min:r,max:r+i}}(e.visualElement.projection.target[t],e.constraintsBox[t],i[t]),o=r.min,a=r.max;e.visualElement.setProjectionTargetAxis(t,o,a)}}))})),setTimeout(ta,1)}},e.prototype.updateConstraints=function(e){var t=this;this.cancelLayout=ea((function(n,i){var r=_o(t.visualElement);i((function(){return r.forEach((function(e){return e.resetTransform()}))})),n((function(){return Ro(t.visualElement)})),i((function(){return r.forEach((function(e){return e.restoreTransform()}))})),n((function(){t.resolveDragConstraints()})),e&&i(e)}))},e.prototype.mount=function(e){var t=this,n=fn(e.getInstance(),"pointerdown",(function(e){var n=t.props,i=n.drag,r=n.dragListener;i&&(void 0===r||r)&&t.start(e)})),i=tn(window,"resize",(function(){t.scalePoint()})),r=e.onLayoutUpdate((function(){t.isDragging&&t.resolveDragConstraints()})),o=e.prevDragCursor;return o&&this.start(na,{cursorProgress:o}),function(){null==n||n(),null==i||i(),null==r||r(),t.cancelDrag()}},e}();function aa(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}var sa,ca,ua={pan:xn((function(e){var t=e.onPan,n=e.onPanStart,i=e.onPanEnd,r=e.onPanSessionStart,o=e.visualElement,a=t||n||i||r,s=Object(T.useRef)(null),c=Object(T.useContext)(ye).transformPagePoint,u={onSessionStart:r,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,i&&i(e,t)}};Object(T.useEffect)((function(){null!==s.current&&s.current.updateHandlers(u)})),pn(o,"pointerdown",a&&function(e){s.current=new ao(e,u,{transformPagePoint:c})}),wn((function(){return s.current&&s.current.end()}))})),drag:xn((function(e){var t=e.dragControls,n=e.visualElement,i=Object(T.useContext)(ye).transformPagePoint,r=Ae((function(){return new oa({visualElement:n})}));r.setProps(Object(me.a)(Object(me.a)({},e),{transformPagePoint:i})),Object(T.useEffect)((function(){return t&&t.subscribe(r)}),[r]),Object(T.useEffect)((function(){return r.mount(n)}),[])}))};function la(e){return"string"==typeof e&&e.startsWith("var(--")}!function(e){e[e.Entering=0]="Entering",e[e.Present=1]="Present",e[e.Exiting=2]="Exiting"}(sa||(sa={})),function(e){e[e.Hide=0]="Hide",e[e.Show=1]="Show"}(ca||(ca={}));var da=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function ma(e,t,n){void 0===n&&(n=1);var i=Object(me.c)(function(e){var t=da.exec(e);if(!t)return[,];var n=Object(me.c)(t,3);return[n[1],n[2]]}(e),2),r=i[0],o=i[1];if(r){var a=window.getComputedStyle(t).getPropertyValue(r);return a?a.trim():la(o)?ma(o,t,n+1):o}}function ha(e,t){return e/(t.max-t.min)*100}var fa="_$css";var pa={process:function(e,t,n){var i=n.target;if("string"==typeof e){if(!mt.test(e))return e;e=parseFloat(e)}return ha(e,i.x)+"% "+ha(e,i.y)+"%"}},ga={borderRadius:Object(me.a)(Object(me.a)({},pa),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:pa,borderTopRightRadius:pa,borderBottomLeftRadius:pa,borderBottomRightRadius:pa,boxShadow:{process:function(e,t){var n=t.delta,i=t.treeScale,r=e,o=e.includes("var("),a=[];o&&(e=e.replace(da,(function(e){return a.push(e),fa})));var s=oi.parse(e);if(s.length>5)return r;var c=oi.createTransformer(e),u="number"!=typeof s[0]?1:0,l=n.x.scale*i.x,d=n.y.scale*i.y;s[0+u]/=l,s[1+u]/=d;var m=Vn(l,d,.5);"number"==typeof s[2+u]&&(s[2+u]/=m),"number"==typeof s[3+u]&&(s[3+u]/=m);var h=c(s);if(o){var f=0;h=h.replace(fa,(function(){var e=a[f];return f++,e}))}return h}}},va=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},t.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},t.isAnimating={x:!1,y:!1},t.stopAxisAnimation={x:void 0,y:void 0},t.isAnimatingTree=!1,t.animate=function(e,n,i){void 0===i&&(i={});var r=i.originBox,o=i.targetBox,a=i.visibilityAction,s=i.shouldStackAnimate,c=i.onComplete,u=i.prevParent,l=Object(me.d)(i,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=t.props,m=d.visualElement,h=d.layout;if(!1===s)return t.isAnimatingTree=!1,t.safeToRemove();if(!t.isAnimatingTree||!0===s){s&&(t.isAnimatingTree=!0),n=r||n,e=o||e;var f=!1,p=m.getProjectionParent();if(p){var g=p.prevViewportBox,v=p.getLayoutState().layout;u&&(o&&(v=u.getLayoutState().layout),r&&!No(u,p)&&u.prevViewportBox&&(g=u.prevViewportBox)),g&&wa(u,r,o)&&(f=!0,n=Fo(g,n),e=Fo(v,e))}var y=ya(n,e),C=yo((function(i){var r,o;if("position"===h){var s=e[i].max-e[i].min;n[i].max=n[i].min+s}if(!m.projection.isTargetLocked)return void 0===a?y?t.animateAxis(i,e[i],n[i],Object(me.a)(Object(me.a)({},l),{isRelative:f})):(null===(o=(r=t.stopAxisAnimation)[i])||void 0===o||o.call(r),m.setProjectionTargetAxis(i,e[i].min,e[i].max,f)):void m.setVisibility(a===ca.Show)}));return m.syncRender(),Promise.all(C).then((function(){t.isAnimatingTree=!1,c&&c(),m.notifyLayoutAnimationComplete()}))}},t}return Object(me.b)(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.visualElement;t.animateMotionValue=kr,t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate),t.layoutSafeToRemove=function(){return e.safeToRemove()},function(e){for(var t in e)Ue[t]=e[t]}(ga)},t.prototype.componentWillUnmount=function(){var e=this;this.unsubLayoutReady(),yo((function(t){var n,i;return null===(i=(n=e.stopAxisAnimation)[t])||void 0===i?void 0:i.call(n)}))},t.prototype.animateAxis=function(e,t,n,i){var r,o,a=this,s=void 0===i?{}:i,c=s.transition,u=s.isRelative;if(!this.isAnimating[e]||!Aa(t,this.currentAnimationTarget[e])){null===(o=(r=this.stopAxisAnimation)[e])||void 0===o||o.call(r),this.isAnimating[e]=!0;var l=this.props.visualElement,d=this.frameTarget[e],m=l.getProjectionAnimationProgress()[e];m.clearListeners(),m.set(0),m.set(0);var h=function(){var i=m.get()/1e3;!function(e,t,n,i){e.min=Vn(t.min,n.min,i),e.max=Vn(t.max,n.max,i)}(d,n,t,i),l.setProjectionTargetAxis(e,d.min,d.max,u)};h();var f=m.onChange(h);this.stopAxisAnimation[e]=function(){a.isAnimating[e]=!1,m.stop(),f()},this.currentAnimationTarget[e]=t;var p=c||l.getDefaultTransition()||Sa;return kr("x"===e?"layoutX":"layoutY",m,1e3,p&&Or(p,"layout")).then(this.stopAxisAnimation[e])}},t.prototype.safeToRemove=function(){var e,t;null===(t=(e=this.props).safeToRemove)||void 0===t||t.call(e)},t.prototype.render=function(){return null},t}(T.Component);function ya(e,t){return!(ba(e)||ba(t)||Aa(e.x,t.x)&&Aa(e.y,t.y))}var Ca={min:0,max:0};function ba(e){return Aa(e.x,Ca)&&Aa(e.y,Ca)}function Aa(e,t){return e.min===t.min&&e.max===t.max}var Sa={duration:.45,ease:[.4,0,.1,1]};function wa(e,t,n){return e||!e&&!(t||n)}var Ea={layoutReady:function(e){return e.notifyLayoutReady()}};function Da(){var e=new Set;return{add:function(t){return e.add(t)},flush:function(t){var n=void 0===t?Ea:t,i=n.layoutReady,r=n.parent;ea((function(t,n){var o=Array.from(e).sort(Po),a=r?_o(r):[];n((function(){Object(me.e)(Object(me.e)([],Object(me.c)(a)),Object(me.c)(o)).forEach((function(e){return e.resetTransform()}))})),t((function(){o.forEach(Ro)})),n((function(){a.forEach((function(e){return e.restoreTransform()})),o.forEach(i)})),t((function(){o.forEach((function(e){e.isPresent&&(e.presence=sa.Present)}))})),n((function(){Gi.preRender(),Gi.render()})),t((function(){Ki.postRender((function(){return o.forEach(xa)})),e.clear()}))})),ta()}}}function xa(e){e.prevViewportBox=e.projection.target}var Ba=Object(T.createContext)(Da()),Ia=Object(T.createContext)(Da());function Ta(e){return!!e.forceUpdate}var Oa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(me.b)(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.syncLayout,n=e.framerSyncLayout,i=e.visualElement;Ta(t)&&t.register(i),Ta(n)&&n.register(i),i.onUnmount((function(){Ta(t)&&t.remove(i),Ta(n)&&n.remove(i)}))},t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.syncLayout,n=e.visualElement;return Ta(t)?t.syncUpdate():(!function(e){e.shouldResetTransform()||(e.prevViewportBox=e.measureViewportBox(!1),e.rebaseProjectionTarget(!1,e.prevViewportBox))}(n),t.add(n)),null},t.prototype.componentDidUpdate=function(){var e=this.props.syncLayout;Ta(e)||e.flush()},t.prototype.render=function(){return null},t}(T.default.Component);var ka={measureLayout:function(e){var t=Object(T.useContext)(Ba),n=Object(T.useContext)(Ia);return T.default.createElement(Oa,Object(me.a)({},e,{syncLayout:t,framerSyncLayout:n}))},layoutAnimation:function(e){var t=Object(me.c)(Se(),2)[1];return T.createElement(va,Object(me.a)({},e,{safeToRemove:t}))}};function Pa(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:vo(),deltaFinal:vo(),deltaTransform:""}}var La=Pa();function _a(e,t,n){var i=e.x,r=e.y,o="translate3d("+i.translate/t.x+"px, "+r.translate/t.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,c=n.rotateY;a&&(o+="rotate("+a+") "),s&&(o+="rotateX("+s+") "),c&&(o+="rotateY("+c+") ")}return o+="scale("+i.scale+", "+r.scale+")",n||o!==Ma?o:""}function Ra(e){var t=e.deltaFinal;return 100*t.x.origin+"% "+100*t.y.origin+"% 0"}var Ma=_a(La.delta,La.treeScale,{x:1,y:1}),Fa=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Na(e,t,n,i){var r,o,a=e.delta,s=e.layout,c=e.layoutCorrected,u=e.treeScale,l=t.target;o=s,Wo((r=c).x,o.x),Wo(r.y,o.y),function(e,t,n){var i=n.length;if(i){var r,o;t.x=t.y=1;for(var a=0;a<i;a++)o=(r=n[a]).getLayoutState().delta,t.x*=o.x.scale,t.y*=o.y.scale,Uo(e,o),Vo(r)&&Qo(e,e,r.getLatestValues())}}(c,u,n),To(a,c,l,i)}var Va=function(){function e(){this.children=[],this.isDirty=!1}return e.prototype.add=function(e){Pr(this.children,e),this.isDirty=!0},e.prototype.remove=function(e){Lr(this.children,e),this.isDirty=!0},e.prototype.forEach=function(e){this.isDirty&&this.children.sort(Po),this.isDirty=!1,this.children.forEach(e)},e}();var Wa=function(e){var t=e.treeType,n=void 0===t?"":t,i=e.build,r=e.getBaseTarget,o=e.makeTargetAnimatable,a=e.measureViewportBox,s=e.render,c=e.readValueFromInstance,u=e.resetTransform,l=e.restoreTransform,d=e.removeValueFromRenderState,m=e.sortNodePosition,h=e.scrapeMotionValuesFromProps;return function(e,t){var f=e.parent,p=e.props,g=e.presenceId,v=e.blockInitialAnimation,y=e.visualState;void 0===t&&(t={});var C,b,A,S,w,E,D=y.latestValues,x=y.renderState,B=function(){var e=Fa.map((function(){return new _r})),t={},n={clearAllListeners:function(){return e.forEach((function(e){return e.clear()}))},updatePropListeners:function(e){return Fa.forEach((function(i){var r;null===(r=t[i])||void 0===r||r.call(t);var o="on"+i,a=e[o];a&&(t[i]=n[o](a))}))}};return e.forEach((function(e,t){n["on"+Fa[t]]=function(t){return e.add(t)},n["notify"+Fa[t]]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.notify.apply(e,Object(me.e)([],Object(me.c)(t)))}})),n}(),I={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},T=I,O=D,k=Pa(),P=!1,L=new Map,_=new Map,R={},M=Object(me.a)({},D);function F(){C&&(G.isProjectionReady()&&(Qo(T.targetFinal,T.target,O),To(k.deltaFinal,k.layoutCorrected,T.targetFinal,D)),N(),s(C,x))}function N(){var e=D;if(S&&S.isActive()){var n=S.getCrossfadeState(G);n&&(e=n)}i(G,x,e,T,k,t,p)}function V(){B.notifyUpdate(D)}function W(){G.layoutTree.forEach(za)}var j=h(p);for(var z in j){var H=j[z];void 0!==D[z]&&$e(H)&&H.set(D[z],!1)}var U=Me(p),Z=Fe(p),G=Object(me.a)(Object(me.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(me.e)(Object(me.e)([],Object(me.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new Va,presenceId:g,projection:I,variantChildren:Z?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(C)},mount:function(e){C=G.current=e,G.pointTo(G),Z&&f&&!U&&(E=null==f?void 0:f.addVariantChild(G)),null==f||f.children.add(G)},unmount:function(){Zi.update(V),Zi.render(F),Zi.preRender(G.updateLayoutProjection),_.forEach((function(e){return e()})),G.stopLayoutAnimation(),G.layoutTree.remove(G),null==E||E(),null==f||f.children.delete(G),null==A||A(),B.clearAllListeners()},addVariantChild:function(e){var t,n=G.getClosestVariantNode();if(n)return null===(t=n.variantChildren)||void 0===t||t.add(e),function(){return n.variantChildren.delete(e)}},sortNodePosition:function(e){return m&&n===e.treeType?m(G.getInstance(),e.getInstance()):0},getClosestVariantNode:function(){return Z?G:null==f?void 0:f.getClosestVariantNode()},scheduleUpdateLayoutProjection:f?f.scheduleUpdateLayoutProjection:function(){return Ki.preRender(G.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return p.layoutId},getInstance:function(){return C},getStaticValue:function(e){return D[e]},setStaticValue:function(e,t){return D[e]=t},getLatestValues:function(){return D},setVisibility:function(e){G.isVisible!==e&&(G.isVisible=e,G.scheduleRender())},makeTargetAnimatable:function(e,t){return void 0===t&&(t=!0),o(G,e,p,t)},addValue:function(e,t){G.hasValue(e)&&G.removeValue(e),L.set(e,t),D[e]=t.get(),function(e,t){var n=t.onChange((function(t){D[e]=t,p.onUpdate&&Ki.update(V,!1,!0)})),i=t.onRenderRequest(G.scheduleRender);_.set(e,(function(){n(),i()}))}(e,t)},removeValue:function(e){var t;L.delete(e),null===(t=_.get(e))||void 0===t||t(),_.delete(e),delete D[e],d(e,x)},hasValue:function(e){return L.has(e)},getValue:function(e,t){var n=L.get(e);return void 0===n&&void 0!==t&&(n=Mr(t),G.addValue(e,n)),n},forEachValue:function(e){return L.forEach(e)},readValue:function(e){var n;return null!==(n=D[e])&&void 0!==n?n:c(C,e,t)},setBaseTarget:function(e,t){M[e]=t},getBaseTarget:function(e){if(r){var t=r(p,e);if(void 0!==t&&!$e(t))return t}return M[e]}},B),{build:function(){return N(),x},scheduleRender:function(){Ki.render(F,!1,!0)},syncRender:F,setProps:function(e){p=e,B.updatePropListeners(e),R=function(e,t,n){var i;for(var r in t){var o=t[r],a=n[r];if($e(o))e.addValue(r,o);else if($e(a))e.addValue(r,Mr(o));else if(a!==o)if(e.hasValue(r)){var s=e.getValue(r);!s.hasAnimated&&s.set(o)}else e.addValue(r,Mr(null!==(i=e.getStaticValue(r))&&void 0!==i?i:o))}for(var r in n)void 0===t[r]&&e.removeValue(r);return t}(G,h(p),R)},getProps:function(){return p},getVariant:function(e){var t;return null===(t=p.variants)||void 0===t?void 0:t[e]},getDefaultTransition:function(){return p.transition},getVariantContext:function(e){if(void 0===e&&(e=!1),e)return null==f?void 0:f.getVariantContext();if(!U){var t=(null==f?void 0:f.getVariantContext())||{};return void 0!==p.initial&&(t.initial=p.initial),t}for(var n={},i=0;i<Za;i++){var r=Ua[i],o=p[r];(Le(o)||!1===o)&&(n[r]=o)}return n},enableLayoutProjection:function(){I.isEnabled=!0,G.layoutTree.add(G)},lockProjectionTarget:function(){I.isTargetLocked=!0},unlockProjectionTarget:function(){G.stopLayoutAnimation(),I.isTargetLocked=!1},getLayoutState:function(){return k},setCrossfader:function(e){S=e},isProjectionReady:function(){return I.isEnabled&&I.isHydrated&&k.isHydrated},startLayoutAnimation:function(e,t,n){void 0===n&&(n=!1);var i=G.getProjectionAnimationProgress()[e],r=n?I.relativeTarget[e]:I.target[e],o=r.min,a=r.max-o;return i.clearListeners(),i.set(o),i.set(o),i.onChange((function(t){G.setProjectionTargetAxis(e,t,t+a,n)})),G.animateMotionValue(e,i,0,t)},stopLayoutAnimation:function(){yo((function(e){return G.getProjectionAnimationProgress()[e].stop()}))},measureViewportBox:function(e){void 0===e&&(e=!0);var n=a(C,t);return e||Ko(n,D),n},getProjectionAnimationProgress:function(){return w||(w={x:Mr(0),y:Mr(0)}),w},setProjectionTargetAxis:function(e,t,n,i){var r;void 0===i&&(i=!1),i?(I.relativeTarget||(I.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),r=I.relativeTarget[e]):(I.relativeTarget=void 0,r=I.target[e]),I.isHydrated=!0,r.min=t,r.max=n,P=!0,B.notifySetAxisTarget()},rebaseProjectionTarget:function(e,t){void 0===t&&(t=k.layout);var n=G.getProjectionAnimationProgress(),i=n.x,r=n.y,o=!(I.relativeTarget||I.isTargetLocked||i.isAnimating()||r.isAnimating());(e||o)&&yo((function(e){var n=t[e],i=n.min,r=n.max;G.setProjectionTargetAxis(e,i,r)}))},notifyLayoutReady:function(e){!function(e){var t=e.getProjectionParent();if(t){var n=Fo(t.getLayoutState().layout,e.getLayoutState().layout);yo((function(t){e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)}))}else e.rebaseProjectionTarget()}(G),G.notifyLayoutUpdate(k.layout,G.prevViewportBox||k.layout,e)},resetTransform:function(){return u(G,C,p)},restoreTransform:function(){return l(C,x)},updateLayoutProjection:function(){if(G.isProjectionReady()){var e=k.delta,t=k.treeScale,n=t.x,i=t.y,r=k.deltaTransform;Na(k,T,G.path,D),P&&G.notifyViewportBoxUpdate(T.target,e),P=!1;var o=_a(e,t);o===r&&n===t.x&&i===t.y||G.scheduleRender(),k.deltaTransform=o}},updateTreeLayoutProjection:function(){G.layoutTree.forEach(ja),Ki.preRender(W,!1,!0)},getProjectionParent:function(){if(void 0===b){for(var e=!1,t=G.path.length-1;t>=0;t--){var n=G.path[t];if(n.projection.isEnabled){e=n;break}}b=e}return b},resolveRelativeTargetBox:function(){var e=G.getProjectionParent();if(I.relativeTarget&&e&&(function(e,t){ko(e.target.x,e.relativeTarget.x,t.target.x),ko(e.target.y,e.relativeTarget.y,t.target.y)}(I,e.projection),Vo(e))){var t=I.target;Qo(t,t,e.getLatestValues())}},shouldResetTransform:function(){return Boolean(p._layoutResetTransform)},pointTo:function(e){T=e.projection,O=e.getLatestValues(),null==A||A(),A=Dn(e.onSetAxisTarget(G.scheduleUpdateLayoutProjection),e.onLayoutAnimationComplete((function(){var e;G.isPresent?G.presence=sa.Present:null===(e=G.layoutSafeToRemove)||void 0===e||e.call(G)})))},isPresent:!0,presence:sa.Entering});return G}};function ja(e){e.resolveRelativeTargetBox()}function za(e){e.updateLayoutProjection()}var Ha,Ua=Object(me.e)(["initial"],Object(me.c)(qr)),Za=Ua.length,Ga=new Set(["width","height","top","left","right","bottom","x","y"]),Ya=function(e){return Ga.has(e)},Qa=function(e,t){e.set(t,!1),e.set(t)},qa=function(e){return e===gt||e===mt};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(Ha||(Ha={}));var Xa=function(e,t){return parseFloat(e.split(", ")[t])},Ka=function(e,t){return function(n,i){var r=i.transform;if("none"===r||!r)return 0;var o=r.match(/^matrix3d\((.+)\)$/);if(o)return Xa(o[1],t);var a=r.match(/^matrix\((.+)\)$/);return a?Xa(a[1],e):0}},Ja=new Set(["x","y","z"]),$a=Ge.filter((function(e){return!Ja.has(e)}));var es={width:function(e){var t=e.x;return t.max-t.min},height:function(e){var t=e.y;return t.max-t.min},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,i=t.top;return parseFloat(i)+(n.max-n.min)},right:function(e,t){var n=e.x,i=t.left;return parseFloat(i)+(n.max-n.min)},x:Ka(4,13),y:Ka(5,14)},ts=function(e,t,n,i){void 0===n&&(n={}),void 0===i&&(i={}),t=Object(me.a)({},t),i=Object(me.a)({},i);var r=Object.keys(t).filter(Ya),o=[],a=!1,s=[];if(r.forEach((function(r){var c=e.getValue(r);if(e.hasValue(r)){var u,l=n[r],d=t[r],m=Vr(l);if(Gt(d))for(var h=d.length,f=null===d[0]?1:0;f<h;f++)u?Vr(d[f]):(u=Vr(d[f]))===m||qa(m)&&qa(u);else u=Vr(d);if(m!==u)if(qa(m)&&qa(u)){var p=c.get();"string"==typeof p&&c.set(parseFloat(p)),"string"==typeof d?t[r]=parseFloat(d):Array.isArray(d)&&u===mt&&(t[r]=d.map(parseFloat))}else(null==m?void 0:m.transform)&&(null==u?void 0:u.transform)&&(0===l||0===d)?0===l?c.set(u.transform(l)):t[r]=m.transform(d):(a||(o=function(e){var t=[];return $a.forEach((function(n){var i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),t.length&&e.syncRender(),t}(e),a=!0),s.push(r),i[r]=void 0!==i[r]?i[r]:t[r],Qa(c,d))}})),s.length){var c=function(e,t,n){var i=t.measureViewportBox(),r=t.getInstance(),o=getComputedStyle(r),a=o.display,s={top:o.top,left:o.left,bottom:o.bottom,right:o.right,transform:o.transform};"none"===a&&t.setStaticValue("display",e.display||"block"),t.syncRender();var c=t.measureViewportBox();return n.forEach((function(n){var r=t.getValue(n);Qa(r,es[n](i,s)),e[n]=es[n](c,o)})),e}(t,e,s);return o.length&&o.forEach((function(t){var n=Object(me.c)(t,2),i=n[0],r=n[1];e.getValue(i).set(r)})),e.syncRender(),{target:c,transitionEnd:i}}return{target:t,transitionEnd:i}};function ns(e,t,n,i){return function(e){return Object.keys(e).some(Ya)}(t)?ts(e,t,n,i):{target:t,transitionEnd:i}}var is=function(e,t,n,i){var r=function(e,t,n){var i,r=Object(me.d)(t,[]),o=e.getInstance();if(!(o instanceof HTMLElement))return{target:r,transitionEnd:n};for(var a in n&&(n=Object(me.a)({},n)),e.forEachValue((function(e){var t=e.get();if(la(t)){var n=ma(t,o);n&&e.set(n)}})),r){var s=r[a];if(la(s)){var c=ma(s,o);c&&(r[a]=c,n&&(null!==(i=n[a])&&void 0!==i||(n[a]=s)))}}return{target:r,transitionEnd:n}}(e,t,i);return ns(e,t=r.target,n,i=r.transitionEnd)};var rs={treeType:"dom",readValueFromInstance:function(e,t){if(qe(t)){var n=wr(t);return n&&n.default||0}var i,r=(i=e,window.getComputedStyle(i));return(tt(t)?r.getPropertyValue(t):r[t])||0},sortNodePosition:function(e,t){return 2&e.compareDocumentPosition(t)?1:-1},getBaseTarget:function(e,t){var n;return null===(n=e.style)||void 0===n?void 0:n[t]},measureViewportBox:function(e,t){return Eo(e,t.transformPagePoint)},resetTransform:function(e,t,n){var i=n.transformTemplate;t.style.transform=i?i({},""):"none",e.scheduleRender()},restoreTransform:function(e,t){e.style.transform=t.style.transform},removeValueFromRenderState:function(e,t){var n=t.vars,i=t.style;delete n[e],delete i[e]},makeTargetAnimatable:function(e,t,n,i){var r=n.transformValues;void 0===i&&(i=!0);var o=t.transition,a=t.transitionEnd,s=Object(me.d)(t,["transition","transitionEnd"]),c=function(e,t,n){var i,r,o={};for(var a in e)o[a]=null!==(i=Ur(a,t))&&void 0!==i?i:null===(r=n.getValue(a))||void 0===r?void 0:r.get();return o}(s,o||{},e);if(r&&(a&&(a=r(a)),s&&(s=r(s)),c&&(c=r(c))),i){!function(e,t,n){var i,r,o,a,s=Object.keys(t).filter((function(t){return!e.hasValue(t)})),c=s.length;if(c)for(var u=0;u<c;u++){var l=s[u],d=t[l],m=null;Array.isArray(d)&&(m=d[0]),null===m&&(m=null!==(r=null!==(i=n[l])&&void 0!==i?i:e.readValue(l))&&void 0!==r?r:t[l]),null!=m&&("string"==typeof m&&/^\-?\d*\.?\d+$/.test(m)?m=parseFloat(m):!jr(m)&&oi.test(d)&&(m=Er(l,d)),e.addValue(l,Mr(m)),null!==(o=(a=n)[l])&&void 0!==o||(a[l]=m),e.setBaseTarget(l,m))}}(e,s,c);var u=is(e,s,c,a);a=u.transitionEnd,s=u.target}return Object(me.a)({transition:o,transitionEnd:a},s)},scrapeMotionValuesFromProps:Ht,build:function(e,t,n,i,r,o,a){void 0!==e.isVisible&&(t.style.visibility=e.isVisible?"visible":"hidden");var s=i.isEnabled&&r.isHydrated;At(t,n,i,r,o,a.transformTemplate,s?_a:void 0,s?Ra:void 0)},render:Wt},os=Wa(rs),as=Wa(Object(me.a)(Object(me.a)({},rs),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var n;return qe(t)?(null===(n=wr(t))||void 0===n?void 0:n.default)||0:(t=jt.has(t)?t:Vt(t),e.getAttribute(t))},scrapeMotionValuesFromProps:Ut,build:function(e,t,n,i,r,o,a){var s=i.isEnabled&&r.isHydrated;_t(t,n,i,r,o,a.transformTemplate,s?_a:void 0,s?Ra:void 0)},render:zt})),ss=function(e,t){return He(e)?as(t,{enableHardwareAcceleration:!1}):os(t,{enableHardwareAcceleration:!0})},cs=Object(me.a)(Object(me.a)(Object(me.a)(Object(me.a)({},to),Bn),ua),ka),us=je((function(e,t){return en(e,t,cs,ss)}));function ls(e,t){return e.format===t.format&&e.text===t.text}function ds(e){return e.text+e.format}class ms{constructor(e){this.highlighted=!1,this.code=e,this.points=[]}}var hs=n(6);class fs{static now(){return Date.now()}}function ps(e){var t=Ae((function(){return Mr(e)}));if(Object(T.useContext)(ye).isStatic){var n=Object(me.c)(Object(T.useState)(e),2)[1];Object(T.useEffect)((function(){return t.onChange(n)}),[])}return t}var gs=function(e){return function(e){return"object"==typeof e&&e.mix}(e)?e.mix:void 0};function vs(e,t){var n=ps(t()),i=function(){return n.set(t())};return i(),function(e,t){Object(T.useEffect)((function(){var n=e.map((function(e){return e.onChange(t)}));return function(){return n.forEach((function(e){return e()}))}}))}(e,(function(){return Ki.update(i,!1,!0)})),n}function ys(e,t,n,i){var r="function"==typeof t?t:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!Array.isArray(e[0]),i=n?0:-1,r=e[0+i],o=e[1+i],a=e[2+i],s=e[3+i],c=fi(o,a,Object(me.a)({mixer:gs(a[0])},s));return n?c(r):c}(t,n,i);return Array.isArray(e)?Cs(e,r):Cs([e],(function(e){var t=Object(me.c)(e,1)[0];return r(t)}))}function Cs(e,t){var n=Ae((function(){return[]}));return vs(e,(function(){n.length=0;for(var i=e.length,r=0;r<i;r++)n[r]=e[r].get();return t(n)}))}function bs(e,t,n){void 0===n&&(n={});var i=$e(e)?e:Mr(e);return kr("",i,t,n),{stop:function(){return i.stop()}}}var As=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};class Ss extends T.default.Component{constructor(e){super(e),this.state={element:e.element}}update(e){this.setState({element:e})}style(e){this.customStyle=e,this.forceUpdate()}render(){var e,t,n,i,r,o,a,s,c;const u=this.state.element,l=this.props.configuration.style;!u.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(u);const d=null!==(t=null===(e=this.customStyle)||void 0===e?void 0:e.fillColor)&&void 0!==t?t:u.highlighted?l.highlightedPolygonFillColor:l.polygonFillColor,m=null!==(i=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==i?i:u.highlighted?l.highlightedPolygonStrokeColor:l.polygonStrokeColor,h=null!==(o=null===(r=this.customStyle)||void 0===r?void 0:r.strokeWidth)&&void 0!==o?o:u.highlighted?l.highlightedPolygonStrokeWidth:l.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:u.highlighted?l.highlightedPolygonCornerRadius:l.polygonCornerRadius,p=null!==(c=this.props.animateToPoints)&&void 0!==c?c:u.points;return T.default.createElement(ws,{points:p,onClick:()=>{this.props.onClick&&this.props.onClick(u)},fill:d,stroke:m,strokeWidth:h,cornerRadius:f})}}function ws(e){var{points:t,cornerRadius:n}=e,i=As(e,["points","cornerRadius"]);const r=[t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y],o=r.map(ps),a=ys(o,(([e,t,i,r,o,a,s,c])=>{const u=[{x:e,y:t},{x:i,y:r},{x:o,y:a},{x:s,y:c}];return hs.a.toSvgPathStringWithRoundedCorners(u,n)}));return Object(T.useEffect)((()=>{const e=[];for(let t=0;t<r.length;t++)e.push(bs(o[t],r[t]));return()=>{e.forEach((e=>e.stop()))}}),[t]),T.default.createElement(us.path,Object.assign({d:a},i))}class Es{constructor(){this.detectedAt=0}update(e,t,n,i,r,o){this.polygon=e,this.polygonRef=t,this.label=n,this.labelRef=i,this.element=r,this.updatedAt=o}}class Ds extends T.default.Component{constructor(e){super(e),this.state={polygonElements:[]}}update(e,t,n,i){const r=[];(class{static keepOnlyCenterMostDuplicate(e,t){const n=new Map;e.forEach((e=>{const t=ds(e),i=n.get(t);i?i.push(e):n.set(t,[e])})),n.forEach(((t,i)=>{t.length<2?n.delete(i):t.forEach(((t,n)=>{e.splice(e.indexOf(t),1)}))})),n.forEach(((n,i)=>{const r=e=>{let t={x:0,y:0};return e.forEach((e=>{t.x+=e.x,t.y+=e.y})),t.x/=e.length,t.y/=e.length,t},o=t.width/2,a=n.reduce(((e,t)=>{const n=r(e.quad),i=r(t.quad);return Math.abs(o-n.x)<Math.abs(o-i.x)?e:t}));e.push(a)}))}}).keepOnlyCenterMostDuplicate(i,n),i.forEach((i=>{const o=new ms(i);o.points=void 0===e?hs.a.scaleListToHtmlElement(i.quad,n,t.video):i.quad.map((t=>{const i=new hs.a(t.x,t.y);return i.x*=e.width/n.width,i.y*=e.height/n.height,i.y+=e.y,i.x+=e.x,i})),o.points.forEach((e=>{t.state.mirrored&&this.container&&(e.x=this.container.clientWidth-e.x)})),r.push(o)}));const o=[];this.state.polygonElements.forEach((e=>{const t=r.find((t=>ls(t.code,e.element.code)));let n=!1;const i=fs.now();void 0===t?e.updatedAt+1e3<i&&(n=!0):(e.element=t,e.polygon=T.default.createElement(Ss,{key:ds(e.element.code),ref:t=>e.polygonRef=t,configuration:this.props.configuration,element:e.element,animateToPoints:t.points,onClick:this.onPolygonClick.bind(this)}),e.label=T.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:ds(e.element.code),ref:t=>e.labelRef=t,configuration:this.props.configuration,element:e.element,animateToPoints:t.points,onClick:this.onPolygonClick.bind(this)})),this.props.configuration.automaticSelectionEnabled&&this.props.configuration.countingRepeatDelay>-1&&e.detectedAt>0&&i>this.props.configuration.countingRepeatDelay+e.detectedAt&&(this.props.onPolygonSelected(t.code),e.detectedAt=i),e.updatedAt=i),n||o.push(e)})),r.forEach((e=>{if(void 0===this.state.polygonElements.find((t=>ls(t.element.code,e.code)))){let t,n;const i=new Es,r=T.default.createElement(Ss,{key:ds(e.code),ref:i=>{t=i,void 0!==n&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}),a=T.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:ds(e.code),ref:i=>{n=i,void 0!==t&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}));i.update(r,t,a,n,e,fs.now()),o.push(i)}})),this.setState({polygonElements:o})}onPolygonClick(e){var t,n,i,r;let o;e.highlighted=!e.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((t=>{var n;const i=t.labelRef,r=t.label.props.element;ls(r.code,e.code)&&(o=t),i&&ls(r.code,e.code)&&(i.update(e),null===(n=t.polygonRef)||void 0===n||n.update(e))})),e.highlighted&&(null===(n=(t=this.props).onPolygonSelected)||void 0===n||n.call(t,e.code),o&&(o.detectedAt=fs.now())),null===(r=(i=this.props).onPolygonClick)||void 0===r||r.call(i,e.code)}render(){var e,t;return T.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:e=>this.container=e},T.default.createElement(us.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((e=>e.polygon))),null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((e=>e.label)))}}var xs=n(47);class Bs extends T.default.Component{render(){if(!this.props.visible)return null;const e=xs.a.svg`
|
|
31
|
+
`;var a=e=>i.default.createElement(o,{viewBox:"0 0 50 50"},i.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:e.color||"black"})),s=n(41),c=n(13),u=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class l{}class d{constructor(){this.videoReady=!1,this.sdkReady=!1}}class m extends i.default.Component{constructor(e){super(e),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:e}=this.props;e&&e(this)}))},this.onVideoError=e=>{if(!0===this.state.videoReady){const{onError:t}=this.props.configuration;t?t(e):console.error(e)}else{const{onFailure:t}=this.props;t&&t(e),this.dispose()}},this.state=new d}get bridge(){var e;return(null!==(e=this.props.sdk)&&void 0!==e?e:r.a.instance).bridge}dispose(){c.a.unmountSafely(this.props.root)}onSdkReady(){return u(this,void 0,void 0,(function*(){}))}componentDidMount(){this.disposed=!1,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0}),this.onSdkReady()}))}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}setZoom(e){this.setState({zoom:e})}setCameraDirection(e){this.camera.setDirection(e)}swapCameraFacing(e){this.camera.swapCameraFacing(e)}switchCamera(e,t){return u(this,void 0,void 0,(function*(){this.camera.switchCamera(e,t)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return s.a.INSTANCE.load()}renderSpinner(e){return this.state.videoReady&&this.state.sdkReady?null:i.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},i.default.createElement(a,{color:e}))}setTorchState(e){return this.camera.setTorchState(e)}getCapabilities(){return this.camera.videoStream.getCapabilities()}}m.DEFAULT_DETECTION_RESOLUTION=600,m.DETECTION_RESOLUTION_4K=3840},function(e,t,n){"use strict";n.d(t,"e",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return l})),n.d(t,"g",(function(){return d}));var i=n(29),r=n(10);const o=["ML","LEGACY"];class a{constructor(e={}){this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.acceptedAspectRatioScore=85,this.aspectRatios=[],this.ignoreOrientationMismatch=!1,void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.acceptedAspectRatioScore&&(this.acceptedAspectRatioScore=e.acceptedAspectRatioScore),void 0!==e.aspectRatios&&(this.aspectRatios=e.aspectRatios.map((e=>new i.a(e)))),void 0!==e.ignoreOrientationMismatch&&(this.ignoreOrientationMismatch=e.ignoreOrientationMismatch)}}class s{constructor(e={}){this.engineMode="ML",this.processingMode="AUTO",this.parameters=new a({}),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.processingMode&&(this.processingMode=e.processingMode),void 0!==e.parameters&&(this.parameters=new a(e.parameters))}}const c=["NOT_ACQUIRED","OK","OK_BUT_TOO_SMALL","OK_BUT_BAD_ANGLES","OK_BUT_BAD_ASPECT_RATIO","OK_BUT_ORIENTATION_MISMATCH","OK_BUT_OFF_CENTER","OK_BUT_TOO_DARK","ERROR_NOTHING_DETECTED","ERROR_TOO_DARK","ERROR_TOO_NOISY"];class u{constructor(e={}){if(void 0===e.totalScore)throw new Error("totalScore must be present in constructor argument");if(this.totalScore=e.totalScore,void 0===e.distanceScore)throw new Error("distanceScore must be present in constructor argument");if(this.distanceScore=e.distanceScore,void 0===e.angleScore)throw new Error("angleScore must be present in constructor argument");if(this.angleScore=e.angleScore,void 0===e.sizeScore)throw new Error("sizeScore must be present in constructor argument");if(this.sizeScore=e.sizeScore,void 0===e.aspectRatioScore)throw new Error("aspectRatioScore must be present in constructor argument");if(this.aspectRatioScore=e.aspectRatioScore,void 0===e.lineCoverageScore)throw new Error("lineCoverageScore must be present in constructor argument");if(this.lineCoverageScore=e.lineCoverageScore,void 0===e.widthScore)throw new Error("widthScore must be present in constructor argument");if(this.widthScore=e.widthScore,void 0===e.heightScore)throw new Error("heightScore must be present in constructor argument");this.heightScore=e.heightScore}}class l{constructor(e={}){if(this.status="NOT_ACQUIRED",this.averageBrightness=0,void 0!==e.status&&(this.status=e.status),void 0===e.detectionScores)throw new Error("detectionScores must be present in constructor argument");if(this.detectionScores=new u(e.detectionScores),void 0===e.points)throw new Error("points must be present in constructor argument");if(this.points=e.points.map((e=>({x:e.x,y:e.y}))),void 0===e.horizontalLines)throw new Error("horizontalLines must be present in constructor argument");if(this.horizontalLines=e.horizontalLines.map((e=>new i.c(e))),void 0===e.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=e.verticalLines.map((e=>new i.c(e))),void 0===e.pointsNormalized)throw new Error("pointsNormalized must be present in constructor argument");if(this.pointsNormalized=e.pointsNormalized.map((e=>({x:e.x,y:e.y}))),void 0===e.horizontalLinesNormalized)throw new Error("horizontalLinesNormalized must be present in constructor argument");if(this.horizontalLinesNormalized=e.horizontalLinesNormalized.map((e=>new i.b(e))),void 0===e.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=e.verticalLinesNormalized.map((e=>new i.b(e))),void 0===e.aspectRatio)throw new Error("aspectRatio must be present in constructor argument");this.aspectRatio=e.aspectRatio,void 0!==e.averageBrightness&&(this.averageBrightness=e.averageBrightness)}}class d{constructor(e={}){if(this.croppedImage=null,void 0===e.detectionResult)throw new Error("detectionResult must be present in constructor argument");this.detectionResult=new l(e.detectionResult),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?new r.a(e.croppedImage):null)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var i=n(1),r=n(5);class o extends r.a{constructor(e={}){super(),this.visible=!0,this.title=new i.p({color:"?sbColorOnPrimary"}),this.background=new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new i.p(e.title)),void 0!==e.background&&(this.background=new i.a(e.background))}}class a extends r.a{constructor(e={}){super(),this.visible=!0,this.icon=new i.i({color:"?sbColorOnPrimary"}),this.title=new i.p({color:"?sbColorOnPrimary"}),this.background=new i.a({fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.icon&&(this.icon=new i.i(e.icon)),void 0!==e.title&&(this.title=new i.p(e.title)),void 0!==e.background&&(this.background=new i.a(e.background))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(80);class r extends i.a{constructor(e){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",this.videoConstraints={width:{ideal:e.width},height:{ideal:e.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(e,t){e.videoConstraints&&this.mapValues(e.videoConstraints,t.videoConstraints)}}r.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},r.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},r.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,r.DEFAULT_ACCEPTED_ANGLE_SCORE=75,r.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class r extends Error{constructor(e,t,n){super(t),this.name="",this.name=e,this.message=t,this.webApiError=n}static mediaDevicesUndefined(){return new r(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new r(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(e){return new r(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",e)}static permissionDenied(e){return new r(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",e)}static unknown(e){return new r(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevices.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",e)}static tryCheckPermission(){return i(this,void 0,void 0,(function*(){if(!this.permissionState)try{const e=yield navigator.permissions.query({name:"camera"});this.permissionState=e.state}catch(e){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}static createFromDOMException(e){return e instanceof DOMException?"NotAllowedError"===e.name?r.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===e.name?r.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:r.unknown(null==e?void 0:e.message)}}r.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},r.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"}},function(e,t,n){"use strict";n.d(t,"h",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return l})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return m}));var i=n(62),r=n(10);class o{constructor(e={}){if(void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=e.confidence}}const a=["INVALID","OBSTRUCTED","NONE","CONFIRMED","INFERRED","VALID","IGNORED"],s=["ISO_DATE","ISO_COUNTRY_ALPHA_2","ISO_COUNTRY_ALPHA_3","ISO_COUNTRY_NUMERIC","ISO_COUNTRY_NAME","GENDER"];class c{constructor(e={}){if(void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class u{constructor(e={}){if(this.listIndex=null,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=e.fullName,void 0===e.normalizedName)throw new Error("normalizedName must be present in constructor argument");if(this.normalizedName=e.normalizedName,void 0===e.commonType)throw new Error("commonType must be present in constructor argument");this.commonType=null!=e.commonType&&i.a.includes(e.commonType)?e.commonType:null,void 0!==e.listIndex&&(this.listIndex=null!=e.listIndex?e.listIndex:null)}}class l{constructor(e={}){if(this.confidenceWeight=1,this.image=null,this.validationStatus="NONE",this.parsedData=[],void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=new u(e.type),void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=null!=e.value?new o(e.value):null,void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight),void 0!==e.image&&(this.image=null!=e.image?new r.a(e.image):null),void 0===e.polygonInRoot)throw new Error("polygonInRoot must be present in constructor argument");this.polygonInRoot=e.polygonInRoot.map((e=>({x:e.x,y:e.y}))),void 0!==e.validationStatus&&(this.validationStatus=e.validationStatus),void 0!==e.parsedData&&(this.parsedData=e.parsedData.map((e=>new c(e))))}}class d{constructor(e={}){if(this.listIndex=null,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=e.fullName,void 0===e.normalizedName)throw new Error("normalizedName must be present in constructor argument");this.normalizedName=e.normalizedName,void 0!==e.listIndex&&(this.listIndex=null!=e.listIndex?e.listIndex:null)}}class m{constructor(e={}){if(this.crop=null,this.confidence=0,this.confidenceWeight=0,void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=new d(e.type),void 0===e.fields)throw new Error("fields must be present in constructor argument");if(this.fields=e.fields.map((e=>new l(e))),void 0===e.children)throw new Error("children must be present in constructor argument");if(this.children=e.children.map((e=>new m(e))),void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadInRoot)throw new Error("quadInRoot must be present in constructor argument");this.quadInRoot=e.quadInRoot.map((e=>({x:e.x,y:e.y}))),void 0!==e.crop&&(this.crop=null!=e.crop?new r.a(e.crop):null),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"SingleScanningMode",(function(){return u})),n.d(t,"BarcodeUseCase",(function(){return A})),n.d(t,"BarcodeItemErrorState",(function(){return a})),n.d(t,"BarcodeMappedData",(function(){return s})),n.d(t,"BarcodeInfoMapping",(function(){return c})),n.d(t,"ExpectedBarcode",(function(){return C})),n.d(t,"FindAndPickScanningMode",(function(){return b})),n.d(t,"BarcodeTextLocalization",(function(){return S})),n.d(t,"BarcodesExtensionFilterValues",(function(){return w})),n.d(t,"CommonBarcodeScannerConfiguration",(function(){return E})),n.d(t,"ArOverlayPolygonConfiguration",(function(){return i.c})),n.d(t,"BarcodeItemInfoPositionValues",(function(){return i.e})),n.d(t,"BarcodeItemConfiguration",(function(){return i.d})),n.d(t,"ArOverlayGeneralConfiguration",(function(){return i.b})),n.d(t,"FindAndPickArOverlayPolygonConfiguration",(function(){return i.f})),n.d(t,"FindAndPickBadgeConfiguration",(function(){return i.g})),n.d(t,"ArOverlayFindAndPickConfiguration",(function(){return i.a})),n.d(t,"BarcodeScannerUiItem",(function(){return x})),n.d(t,"BarcodeScannerUiResult",(function(){return B})),n.d(t,"MultipleBarcodesScanningModeValues",(function(){return l})),n.d(t,"SheetModeValues",(function(){return d})),n.d(t,"CollapsedVisibleHeightValues",(function(){return m})),n.d(t,"Sheet",(function(){return h})),n.d(t,"SwipeToDelete",(function(){return f})),n.d(t,"ManualCountEditDialog",(function(){return p})),n.d(t,"SheetContent",(function(){return g})),n.d(t,"MultipleScanningMode",(function(){return v})),n.d(t,"BarcodeScannerScreenConfiguration",(function(){return z})),n.d(t,"BarcodeItem",(function(){return D.c})),n.d(t,"BarcodeScannerEngineModeValues",(function(){return D.e})),n.d(t,"AcknowledgementModeValues",(function(){return H})),n.d(t,"AcknowledgementBottomBar",(function(){return U})),n.d(t,"AcknowledgementScreenConfiguration",(function(){return Z})),n.d(t,"ShutterButton",(function(){return $})),n.d(t,"PreviewButton",(function(){return X})),n.d(t,"ScanAssistanceOverlay",(function(){return ee})),n.d(t,"PagePreviewMode",(function(){return te})),n.d(t,"TextButtonMode",(function(){return ne})),n.d(t,"NoButtonMode",(function(){return ie})),n.d(t,"CameraBottomBar",(function(){return re})),n.d(t,"PageSnapFeedbackMode",(function(){return K})),n.d(t,"PageSnapFunnelAnimation",(function(){return oe})),n.d(t,"PageSnapCheckMarkAnimation",(function(){return ae})),n.d(t,"PageSnapFeedbackNone",(function(){return se})),n.d(t,"CaptureFeedback",(function(){return ce})),n.d(t,"DocumentPolygonConfiguration",(function(){return ue})),n.d(t,"SelectCameraMenu",(function(){return le})),n.d(t,"CameraScreenConfiguration",(function(){return de})),n.d(t,"CroppingBottomBar",(function(){return me})),n.d(t,"CroppingScreenConfiguration",(function(){return he})),n.d(t,"DocumentScannerCameraConfiguration",(function(){return G})),n.d(t,"UserGuidanceVisibilityValues",(function(){return fe})),n.d(t,"DocumentAnalysisModeValues",(function(){return ge})),n.d(t,"DocumentScannerOutputSettings",(function(){return ve})),n.d(t,"DocumentScannerScreens",(function(){return Se})),n.d(t,"DocumentScannerTextLocalization",(function(){return we})),n.d(t,"UserGuidanceStates",(function(){return Q})),n.d(t,"DocumentScannerUserGuidance",(function(){return q})),n.d(t,"DocumentFlowAppearanceConfiguration",(function(){return Ee})),n.d(t,"DocumentScanningFlow",(function(){return De})),n.d(t,"IntroListEntry",(function(){return J.g})),n.d(t,"IntroImage",(function(){return J.f})),n.d(t,"NoIntroImage",(function(){return J.j})),n.d(t,"CustomImage",(function(){return J.c})),n.d(t,"ReceiptsIntroImage",(function(){return J.k})),n.d(t,"MedicalCertificateIntroImage",(function(){return J.i})),n.d(t,"DocumentIntroImage",(function(){return J.d})),n.d(t,"CheckIntroImage",(function(){return J.a})),n.d(t,"IdCardIntroImage",(function(){return J.e})),n.d(t,"CreditCardIntroImage",(function(){return J.b})),n.d(t,"IntroductionScreenConfiguration",(function(){return J.h})),n.d(t,"ReviewBottomBarConfiguration",(function(){return ye})),n.d(t,"ReviewMorePopupMenu",(function(){return Ce})),n.d(t,"ZoomOverlay",(function(){return be})),n.d(t,"ReviewScreenConfiguration",(function(){return Ae})),n.d(t,"MrzFinderLayoutPreset",(function(){return xe})),n.d(t,"TwoLineMrzFinderLayoutPreset",(function(){return Be})),n.d(t,"ThreeLineMrzFinderLayoutPreset",(function(){return Ie})),n.d(t,"NoLayoutPreset",(function(){return Te})),n.d(t,"MrzScannerScreenConfiguration",(function(){return _e})),n.d(t,"MrzScannerIntroImage",(function(){return ke.d})),n.d(t,"MrzIntroDefaultImage",(function(){return ke.b})),n.d(t,"MrzIntroNoImage",(function(){return ke.c})),n.d(t,"MrzIntroCustomImage",(function(){return ke.a})),n.d(t,"MrzScannerIntroScreenConfiguration",(function(){return ke.e})),n.d(t,"MrzScannerUiResult",(function(){return Re.a})),n.d(t,"MrzScannerScreenTextLocalization",(function(){return Pe})),n.d(t,"Resolution",(function(){return O})),n.d(t,"CameraModuleValues",(function(){return k})),n.d(t,"CameraConfiguration",(function(){return P})),n.d(t,"TopBarConfiguration",(function(){return W.a})),n.d(t,"TopBarModeValues",(function(){return W.b})),n.d(t,"ActionBarConfiguration",(function(){return I})),n.d(t,"ScanbotAlertDialog",(function(){return y})),n.d(t,"CameraPermissionScreen",(function(){return L})),n.d(t,"OcrResult",(function(){return Me.h})),n.d(t,"FieldValidationStatusValues",(function(){return Me.e})),n.d(t,"FieldDataFormatValues",(function(){return Me.b})),n.d(t,"FieldParsedData",(function(){return Me.c})),n.d(t,"FieldType",(function(){return Me.d})),n.d(t,"Field",(function(){return Me.a})),n.d(t,"GenericDocumentType",(function(){return Me.g})),n.d(t,"GenericDocument",(function(){return Me.f})),n.d(t,"Palette",(function(){return r.j})),n.d(t,"StyledText",(function(){return r.p})),n.d(t,"IconStyle",(function(){return r.i})),n.d(t,"IconButton",(function(){return r.h})),n.d(t,"PolygonStyle",(function(){return r.k})),n.d(t,"BackgroundStyle",(function(){return r.a})),n.d(t,"ForegroundStyle",(function(){return r.g})),n.d(t,"BadgeStyle",(function(){return r.b})),n.d(t,"RoundButton",(function(){return r.m})),n.d(t,"BadgedButton",(function(){return r.c})),n.d(t,"ButtonConfiguration",(function(){return r.e})),n.d(t,"PopupMenuItem",(function(){return r.l})),n.d(t,"BarButtonConfiguration",(function(){return r.d})),n.d(t,"SoundTypeValues",(function(){return r.o})),n.d(t,"Sound",(function(){return r.n})),n.d(t,"Vibration",(function(){return r.r})),n.d(t,"Timeouts",(function(){return r.q})),n.d(t,"EdgeInsets",(function(){return r.f})),n.d(t,"BaseViewFinderConfiguration",(function(){return _})),n.d(t,"ViewFinderConfiguration",(function(){return M})),n.d(t,"PermanentViewFinderConfiguration",(function(){return F})),n.d(t,"FinderStyle",(function(){return R})),n.d(t,"FinderCorneredStyle",(function(){return N})),n.d(t,"FinderStrokedStyle",(function(){return V})),n.d(t,"UserGuidanceConfiguration",(function(){return j.b})),n.d(t,"IconUserGuidanceConfiguration",(function(){return j.a})),n.d(t,"NavigationBarModeValues",(function(){return Fe})),n.d(t,"ScanCompletionOverlay",(function(){return Le}));var i=n(12),r=n(1),o=n(5);class a extends o.a{constructor(e={}){super(),this.title=new r.p({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new r.p({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new r.e({}),this.cancelButton=new r.e({}),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.subtitle&&(this.subtitle=new r.p(e.subtitle)),void 0!==e.retryButton&&(this.retryButton=new r.e(e.retryButton)),void 0!==e.cancelButton&&(this.cancelButton=new r.e(e.cancelButton))}}class s extends o.a{constructor(e={}){if(super(),void 0===e.title)throw new Error("title must be present in constructor argument");if(this.title=e.title,void 0===e.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=e.subtitle,void 0===e.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=e.barcodeImage}}class c extends o.a{constructor(e={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new r.p({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new a({}),void 0!==e.barcodeItemMapper&&(this.barcodeItemMapper=null!=e.barcodeItemMapper?e.barcodeItemMapper:null),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.loadingMessage&&(this.loadingMessage=new r.p(e.loadingMessage)),void 0!==e.errorState&&(this.errorState=new a(e.errorState))}}class u extends o.a{constructor(e={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new r.p({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new r.e({visible:!0,text:"?sheetSubmitButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new r.e({visible:!0,text:"?singleModeConfirmationCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new c({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new r.p({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new r.p({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new r.e({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new r.e({text:"?barcodeInfoMappingErrorStateCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new i.b({visible:!1,counterBadge:new r.b({visible:!0,background:new r.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new i.c({visible:!0,deselected:new r.k({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new r.k({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new i.d({imageVisible:!0,titleSelected:new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new r.p({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new r.p({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new r.k({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new r.k({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==e.confirmationSheetEnabled&&(this.confirmationSheetEnabled=e.confirmationSheetEnabled),void 0!==e.barcodeImageVisible&&(this.barcodeImageVisible=e.barcodeImageVisible),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.barcodeTitle&&(this.barcodeTitle=new r.p(e.barcodeTitle)),void 0!==e.barcodeSubtitle&&(this.barcodeSubtitle=new r.p(e.barcodeSubtitle)),void 0!==e.submitButton&&(this.submitButton=new r.e(e.submitButton)),void 0!==e.cancelButton&&(this.cancelButton=new r.e(e.cancelButton)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new c(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new i.b(e.arOverlay))}}const l=["COUNTING","UNIQUE"],d=["BUTTON","COLLAPSED_SHEET"],m=["SMALL","LARGE"];class h extends o.a{constructor(e={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new r.c({}),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.collapsedVisibleHeight&&(this.collapsedVisibleHeight=e.collapsedVisibleHeight),void 0!==e.listButton&&(this.listButton=new r.c(e.listButton))}}class f extends o.a{constructor(e={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.iconColor&&(this.iconColor=e.iconColor)}}class p extends o.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new r.p({text:"Update count",color:"?sbColorOnSurface"}),this.info=new r.p({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new r.e({visible:!0,text:"Update",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new r.e({visible:!0,text:"Cancel",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new r.i({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.info&&(this.info=new r.p(e.info)),void 0!==e.updateButton&&(this.updateButton=new r.e(e.updateButton)),void 0!==e.cancelButton&&(this.cancelButton=new r.e(e.cancelButton)),void 0!==e.clearTextButton&&(this.clearTextButton=new r.i(e.clearTextButton))}}class g extends o.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new r.p({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new r.e({visible:!0,text:"Clear all",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new r.p({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new r.p({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new r.e({visible:!0,text:"Submit",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new r.e({visible:!0,text:"Start scanning",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new r.p({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new r.p({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new r.i({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new f({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.manualCountChangeEnabled&&(this.manualCountChangeEnabled=e.manualCountChangeEnabled),void 0!==e.manualCountOutlineColor&&(this.manualCountOutlineColor=e.manualCountOutlineColor),void 0!==e.manualCountChangeColor&&(this.manualCountChangeColor=e.manualCountChangeColor),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.clearAllButton&&(this.clearAllButton=new r.e(e.clearAllButton)),void 0!==e.barcodeItemTitle&&(this.barcodeItemTitle=new r.p(e.barcodeItemTitle)),void 0!==e.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new r.p(e.barcodeItemSubtitle)),void 0!==e.barcodeItemImageVisible&&(this.barcodeItemImageVisible=e.barcodeItemImageVisible),void 0!==e.submitButton&&(this.submitButton=new r.e(e.submitButton)),void 0!==e.startScanningButton&&(this.startScanningButton=new r.e(e.startScanningButton)),void 0!==e.placeholderTitle&&(this.placeholderTitle=new r.p(e.placeholderTitle)),void 0!==e.placeholderSubtitle&&(this.placeholderSubtitle=new r.p(e.placeholderSubtitle)),void 0!==e.placeholderIconBackground&&(this.placeholderIconBackground=e.placeholderIconBackground),void 0!==e.placeholderIcon&&(this.placeholderIcon=new r.i(e.placeholderIcon)),void 0!==e.swipeToDelete&&(this.swipeToDelete=new f(e.swipeToDelete))}}class v extends o.a{constructor(e={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.allowEmptySubmission=!1,this.mode="COUNTING",this.sheet=new h({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new r.c({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new r.p({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new r.e({visible:!0,text:"?sheetClearAllButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new r.p({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new r.p({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new r.e({visible:!0,text:"?sheetSubmitButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new r.e({visible:!0,text:"?sheetStartScanningButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new r.p({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new r.p({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new r.i({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new f({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new p({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new r.p({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new r.p({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new r.e({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?manualCountEditDialogCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new r.i({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new c({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new r.p({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new r.p({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new r.e({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new i.b({visible:!1,counterBadge:new r.b({visible:!0,background:new r.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new i.c({visible:!0,deselected:new r.k({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new r.k({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new i.d({imageVisible:!0,titleSelected:new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new r.p({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new r.p({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new r.p({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new r.k({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new r.k({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.allowEmptySubmission&&(this.allowEmptySubmission=e.allowEmptySubmission),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.sheet&&(this.sheet=new h(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new g(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new p(e.manualCountEditDialog)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new c(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new i.b(e.arOverlay))}}class y extends o.a{constructor(e={}){super(),this.title=new r.p({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new r.p({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",this.okButton=new r.e({background:new r.a({fillColor:"?sbColorPrimary"})}),this.actionButton=new r.e({visible:!1,background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),this.cancelButton=new r.e({visible:!0,background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.subtitle&&(this.subtitle=new r.p(e.subtitle)),void 0!==e.sheetColor&&(this.sheetColor=e.sheetColor),void 0!==e.modalOverlayColor&&(this.modalOverlayColor=e.modalOverlayColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.okButton&&(this.okButton=new r.e(e.okButton)),void 0!==e.actionButton&&(this.actionButton=new r.e(e.actionButton)),void 0!==e.cancelButton&&(this.cancelButton=new r.e(e.cancelButton))}}class C extends o.a{constructor(e={}){if(super(),this.title=null,this.image=null,this.count=1,void 0===e.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");this.barcodeValue=e.barcodeValue,void 0!==e.title&&(this.title=null!=e.title?e.title:null),void 0!==e.image&&(this.image=null!=e.image?e.image:null),void 0!==e.count&&(this.count=e.count)}}class b extends o.a{constructor(e={}){super(),this._type="FindAndPickScanningMode",this.scanningCompletedColor="?sbColorPositive",this.scanningPartiallyColor="?sbColorWarning",this.scanningNotScannedColor="?sbColorOutline",this.allowPartialScan=!1,this.expectedBarcodes=[],this.countingRepeatDelay=1e3,this.sheet=new h({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new r.c({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new r.p({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new r.e({visible:!0,text:"?sheetResetButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new r.p({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new r.p({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new r.e({visible:!0,text:"?sheetSubmitButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new r.e({visible:!0,text:"?sheetStartScanningButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new r.p({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new r.p({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new r.i({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new f({enabled:!1,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new p({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new r.p({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new r.p({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new r.e({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?manualCountEditDialogCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new r.i({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new i.a({visible:!0,automaticSelectionEnabled:!0,polygon:new i.f({partiallyScanned:new r.k({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new r.k({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new r.k({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new i.g({partiallyScanned:new r.b({visible:!0,background:new r.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new r.b({visible:!0,background:new r.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new r.b({visible:!0,background:new r.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new y({title:new r.p({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new r.e({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new y({title:new r.p({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new r.e({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new r.e({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),void 0!==e.scanningCompletedColor&&(this.scanningCompletedColor=e.scanningCompletedColor),void 0!==e.scanningPartiallyColor&&(this.scanningPartiallyColor=e.scanningPartiallyColor),void 0!==e.scanningNotScannedColor&&(this.scanningNotScannedColor=e.scanningNotScannedColor),void 0!==e.allowPartialScan&&(this.allowPartialScan=e.allowPartialScan),void 0!==e.expectedBarcodes&&(this.expectedBarcodes=e.expectedBarcodes.map((e=>new C(e)))),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.sheet&&(this.sheet=new h(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new g(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new p(e.manualCountEditDialog)),void 0!==e.arOverlay&&(this.arOverlay=new i.a(e.arOverlay)),void 0!==e.partialScannedAlertDialogEnabled&&(this.partialScannedAlertDialogEnabled=e.partialScannedAlertDialogEnabled),void 0!==e.partialScannedAlertDialog&&(this.partialScannedAlertDialog=new y(e.partialScannedAlertDialog)),void 0!==e.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=e.confirmationAlertDialogEnabled),void 0!==e.confirmationAlertDialog&&(this.confirmationAlertDialog=new y(e.confirmationAlertDialog))}}var A;(A||(A={})).From=function(e){const t=e._type;switch(t){case"SingleScanningMode":return new u(e);case"MultipleScanningMode":return new v(e);case"FindAndPickScanningMode":return new b(e);default:throw`Unknown child class name: ${t}`}};class S extends o.a{constructor(e={}){super(),this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetResetButton="Reset",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",this.findAndPickSheetTitle="%d/%d scanned",this.findAndPickSheetBarcodeItemSubtitle="%d/%d added",this.findAndPickPartialAlertTitle="Incomplete scan!",this.findAndPickPartialAlertSubtitle="Some codes are yet to be scanned. Proceed with submission anyway?",this.findAndPickPartialAlertCancelButton="Cancel",this.findAndPickPartialAlertSubmitButton="Yes, Submit",this.findAndPickCompleteAlertTitle="All codes found!",this.findAndPickCompleteAlertSubtitle="You have successfully scanned all codes. Proceed with submission?",this.findAndPickCompleteAlertCancelButton="Dismiss",this.accessibilityDescriptionCancelButton="Cancel",this.accessibilityDescriptionFlashButton="Toggle flash",this.accessibilityDescriptionZoomButton="Toggle camera zoom",this.accessibilityDescriptionFlipCameraButton="Flip camera",this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionEnableCameraButton="Grant permission",this.cameraPermissionCloseButton="Close",this.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",void 0!==e.topBarCancelButton&&(this.topBarCancelButton=e.topBarCancelButton),void 0!==e.topBarTitle&&(this.topBarTitle=e.topBarTitle),void 0!==e.userGuidance&&(this.userGuidance=e.userGuidance),void 0!==e.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=e.barcodeInfoMappingLoadingMessage),void 0!==e.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=e.barcodeInfoMappingErrorStateTitle),void 0!==e.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=e.barcodeInfoMappingErrorStateSubtitle),void 0!==e.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=e.barcodeInfoMappingErrorStateRetryButton),void 0!==e.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=e.barcodeInfoMappingErrorStateCancelButton),void 0!==e.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=e.manualCountEditDialogTitle),void 0!==e.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=e.manualCountEditDialogInfo),void 0!==e.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=e.manualCountEditDialogUpdateButton),void 0!==e.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=e.manualCountEditDialogCancelButton),void 0!==e.sheetResetButton&&(this.sheetResetButton=e.sheetResetButton),void 0!==e.sheetClearAllButton&&(this.sheetClearAllButton=e.sheetClearAllButton),void 0!==e.sheetSubmitButton&&(this.sheetSubmitButton=e.sheetSubmitButton),void 0!==e.sheetStartScanningButton&&(this.sheetStartScanningButton=e.sheetStartScanningButton),void 0!==e.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=e.sheetPlaceholderTitle),void 0!==e.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=e.sheetPlaceholderSubtitle),void 0!==e.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=e.singleModeConfirmationCancelButton),void 0!==e.multipleModeSheetTitle&&(this.multipleModeSheetTitle=e.multipleModeSheetTitle),void 0!==e.findAndPickSheetTitle&&(this.findAndPickSheetTitle=e.findAndPickSheetTitle),void 0!==e.findAndPickSheetBarcodeItemSubtitle&&(this.findAndPickSheetBarcodeItemSubtitle=e.findAndPickSheetBarcodeItemSubtitle),void 0!==e.findAndPickPartialAlertTitle&&(this.findAndPickPartialAlertTitle=e.findAndPickPartialAlertTitle),void 0!==e.findAndPickPartialAlertSubtitle&&(this.findAndPickPartialAlertSubtitle=e.findAndPickPartialAlertSubtitle),void 0!==e.findAndPickPartialAlertCancelButton&&(this.findAndPickPartialAlertCancelButton=e.findAndPickPartialAlertCancelButton),void 0!==e.findAndPickPartialAlertSubmitButton&&(this.findAndPickPartialAlertSubmitButton=e.findAndPickPartialAlertSubmitButton),void 0!==e.findAndPickCompleteAlertTitle&&(this.findAndPickCompleteAlertTitle=e.findAndPickCompleteAlertTitle),void 0!==e.findAndPickCompleteAlertSubtitle&&(this.findAndPickCompleteAlertSubtitle=e.findAndPickCompleteAlertSubtitle),void 0!==e.findAndPickCompleteAlertCancelButton&&(this.findAndPickCompleteAlertCancelButton=e.findAndPickCompleteAlertCancelButton),void 0!==e.accessibilityDescriptionCancelButton&&(this.accessibilityDescriptionCancelButton=e.accessibilityDescriptionCancelButton),void 0!==e.accessibilityDescriptionFlashButton&&(this.accessibilityDescriptionFlashButton=e.accessibilityDescriptionFlashButton),void 0!==e.accessibilityDescriptionZoomButton&&(this.accessibilityDescriptionZoomButton=e.accessibilityDescriptionZoomButton),void 0!==e.accessibilityDescriptionFlipCameraButton&&(this.accessibilityDescriptionFlipCameraButton=e.accessibilityDescriptionFlipCameraButton),void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionEnableCameraButton&&(this.cameraPermissionEnableCameraButton=e.cameraPermissionEnableCameraButton),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton)}}const w=["REQUIRE_2","REQUIRE_5","REQUIRE_ANY","IGNORE","ALLOW_2","ALLOW_5","ALLOW_ANY"];class E extends o.a{constructor(e={}){super(),this.extractedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.onlyAcceptDocuments=!1,this.barcodesExtensionFilter="ALLOW_ANY",this.barcodesRegexFilter="",this.minimumSizeScore=0,this.minimumTextLength=0,this.maximumTextLength=0,this.minimum1DBarcodesQuietZone=10,this.stripCheckDigits=!1,this.useIATA2OF5Checksum=!0,this.useCode11Checksum=!0,this.barcodeFormats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],this.msiPlesseyChecksumAlgorithm="MOD_10",this.australiaPostCustomerFormat="ALPHA_NUMERIC",this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,this.returnBarcodeImage=!0,void 0!==e.extractedDocumentFormats&&(this.extractedDocumentFormats=e.extractedDocumentFormats.map((e=>e))),void 0!==e.onlyAcceptDocuments&&(this.onlyAcceptDocuments=e.onlyAcceptDocuments),void 0!==e.barcodesExtensionFilter&&(this.barcodesExtensionFilter=e.barcodesExtensionFilter),void 0!==e.barcodesRegexFilter&&(this.barcodesRegexFilter=e.barcodesRegexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.minimum1DBarcodesQuietZone&&(this.minimum1DBarcodesQuietZone=e.minimum1DBarcodesQuietZone),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=e.useIATA2OF5Checksum),void 0!==e.useCode11Checksum&&(this.useCode11Checksum=e.useCode11Checksum),void 0!==e.barcodeFormats&&(this.barcodeFormats=e.barcodeFormats.map((e=>e))),void 0!==e.msiPlesseyChecksumAlgorithm&&(this.msiPlesseyChecksumAlgorithm=e.msiPlesseyChecksumAlgorithm),void 0!==e.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=e.australiaPostCustomerFormat),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.maximumRecognizerResolution&&(this.maximumRecognizerResolution=e.maximumRecognizerResolution),void 0!==e.returnBarcodeImage&&(this.returnBarcodeImage=e.returnBarcodeImage)}}var D=n(28);class x extends o.a{constructor(e={}){if(super(),void 0===e.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new D.c(e.barcode),void 0===e.count)throw new Error("count must be present in constructor argument");this.count=e.count}}class B extends o.a{constructor(e={}){super(),this.items=[],void 0!==e.items&&(this.items=e.items.map((e=>new x(e))))}}class I extends o.a{constructor(e={}){super(),this.flashButton=new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionFlashButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionFlipCameraButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),void 0!==e.flashButton&&(this.flashButton=new r.m(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new r.m(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new r.m(e.flipCameraButton))}}var T=n(29);class O extends o.a{constructor(e={}){if(super(),void 0===e.width)throw new Error("width must be present in constructor argument");if(this.width=e.width,void 0===e.height)throw new Error("height must be present in constructor argument");this.height=e.height}}const k=["FRONT","BACK"];class P extends o.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new O({width:1920,height:1080}),void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.zoomSteps&&(this.zoomSteps=e.zoomSteps.map((e=>e))),void 0!==e.defaultZoomFactor&&(this.defaultZoomFactor=e.defaultZoomFactor),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.idealPreviewResolution&&(this.idealPreviewResolution=new O(e.idealPreviewResolution))}}class L extends o.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new r.i({color:"?sbColorOnSurface"}),this.closeButton=new r.e({text:"?cameraPermissionCloseButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary"})}),this.enableCameraTitle=new r.p({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),this.enableCameraExplanation=new r.p({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"}),void 0!==e.background&&(this.background=e.background),void 0!==e.iconBackground&&(this.iconBackground=e.iconBackground),void 0!==e.icon&&(this.icon=new r.i(e.icon)),void 0!==e.closeButton&&(this.closeButton=new r.e(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new r.p(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new r.p(e.enableCameraExplanation))}}var _,R;!function(e){e.From=function(e){const t=e._type;switch(t){case"ViewFinderConfiguration":return new M(e);case"PermanentViewFinderConfiguration":return new F(e);default:throw`Unknown child class name: ${t}`}}}(_||(_={}));class M extends o.a{constructor(e={}){super(),this._type="ViewFinderConfiguration",this.style=new N({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new T.a({width:1,height:1}),this.minimumInsets=new r.f({top:16,left:16,bottom:16,right:16}),this.preferredHeight=-1,this.visible=!0,void 0!==e.style&&(this.style=R.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new T.a(e.aspectRatio)),void 0!==e.minimumInsets&&(this.minimumInsets=new r.f(e.minimumInsets)),void 0!==e.preferredHeight&&(this.preferredHeight=e.preferredHeight),void 0!==e.visible&&(this.visible=e.visible)}}class F extends o.a{constructor(e={}){super(),this._type="PermanentViewFinderConfiguration",this.style=new N({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new T.a({width:1,height:1}),this.minimumInsets=new r.f({top:16,left:16,bottom:16,right:16}),this.preferredHeight=-1,void 0!==e.style&&(this.style=R.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new T.a(e.aspectRatio)),void 0!==e.minimumInsets&&(this.minimumInsets=new r.f(e.minimumInsets)),void 0!==e.preferredHeight&&(this.preferredHeight=e.preferredHeight)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new N(e);case"FinderStrokedStyle":return new V(e);default:throw`Unknown child class name: ${t}`}}}(R||(R={}));class N extends o.a{constructor(e={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class V extends o.a{constructor(e={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}var W=n(36),j=n(16);class z extends o.a{constructor(e={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new r.j({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new S({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new W.a({title:new r.p({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new r.e({visible:!0,text:"?topBarCancelButton",accessibilityDescription:"?accessibilityDescriptionCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new I({flashButton:new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionFlashButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new r.m({visible:!0,accessibilityDescription:"?accessibilityDescriptionFlipCameraButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"})}),this.viewFinder=new M({style:new N({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new T.a({width:1,height:1}),visible:!0}),this.userGuidance=new j.b({visible:!0,title:new r.p({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new r.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new L({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new r.i({visible:!0,color:"?sbColorOnSurface"}),closeButton:new r.e({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new r.p({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new r.p({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new P({}),this.scannerConfiguration=new E({}),this.useCase=new u({}),this.sound=new r.n({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new r.r({enabled:!0}),this.timeouts=new r.q({autoCancelTimeout:0,initialScanDelay:0}),void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.palette&&(this.palette=new r.j(e.palette)),void 0!==e.localization&&(this.localization=new S(e.localization)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.topBar&&(this.topBar=new W.a(e.topBar)),void 0!==e.actionBar&&(this.actionBar=new I(e.actionBar)),void 0!==e.viewFinder&&(this.viewFinder=new M(e.viewFinder)),void 0!==e.userGuidance&&(this.userGuidance=new j.b(e.userGuidance)),void 0!==e.cameraPermission&&(this.cameraPermission=new L(e.cameraPermission)),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new P(e.cameraConfiguration)),void 0!==e.scannerConfiguration&&(this.scannerConfiguration=new E(e.scannerConfiguration)),void 0!==e.useCase&&(this.useCase=A.From(e.useCase)),void 0!==e.sound&&(this.sound=new r.n(e.sound)),void 0!==e.vibration&&(this.vibration=new r.r(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new r.q(e.timeouts))}}const H=["BAD_QUALITY","ALWAYS","NONE"];class U extends o.a{constructor(e={}){super(),this.retakeButton=new r.d({title:new r.p({text:"?acknowledgementRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementRetakeButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.acceptWhenOkButton=new r.d({title:new r.p({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.acceptWhenNotOkButton=new r.d({title:new r.p({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),void 0!==e.retakeButton&&(this.retakeButton=new r.d(e.retakeButton)),void 0!==e.acceptWhenOkButton&&(this.acceptWhenOkButton=new r.d(e.acceptWhenOkButton)),void 0!==e.acceptWhenNotOkButton&&(this.acceptWhenNotOkButton=new r.d(e.acceptWhenNotOkButton))}}class Z extends o.a{constructor(e={}){super(),this.topBarTitle=new r.p({visible:!1,text:"?acknowledgementTitle",color:"?sbColorOnPrimary"}),this.minimumQuality="POOR",this.acknowledgementMode="ALWAYS",this.badImageHint=new j.a({visible:!0,icon:new r.i({color:"?sbColorOnPrimary"}),title:new r.p({text:"?acknowledgementScreenBadDocumentHint",color:"?sbColorOnPrimary"}),background:new r.a({strokeColor:"?sbColorNegative",fillColor:"?sbColorNegative",strokeWidth:0})}),this.backgroundColor="?sbColorOutline",this.bottomBar=new U({}),void 0!==e.topBarTitle&&(this.topBarTitle=new r.p(e.topBarTitle)),void 0!==e.minimumQuality&&(this.minimumQuality=e.minimumQuality),void 0!==e.acknowledgementMode&&(this.acknowledgementMode=e.acknowledgementMode),void 0!==e.badImageHint&&(this.badImageHint=new j.a(e.badImageHint)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new U(e.bottomBar))}}class G extends o.a{constructor(e={}){super(),this.cameraModule="BACK",this.autoCropOnManualSnap=!0,this.flashEnabled=!1,this.idealPreviewResolution=new O({width:1920,height:1080}),this.autoSnappingSensitivity=.66,this.autoSnappingDelay=200,this.autoSnappingEnabled=!0,void 0!==e.cameraModule&&(this.cameraModule=e.cameraModule),void 0!==e.autoCropOnManualSnap&&(this.autoCropOnManualSnap=e.autoCropOnManualSnap),void 0!==e.flashEnabled&&(this.flashEnabled=e.flashEnabled),void 0!==e.idealPreviewResolution&&(this.idealPreviewResolution=new O(e.idealPreviewResolution)),void 0!==e.autoSnappingSensitivity&&(this.autoSnappingSensitivity=e.autoSnappingSensitivity),void 0!==e.autoSnappingDelay&&(this.autoSnappingDelay=e.autoSnappingDelay),void 0!==e.autoSnappingEnabled&&(this.autoSnappingEnabled=e.autoSnappingEnabled)}}var Y=n(59);class Q extends o.a{constructor(e={}){super(),this.noDocumentFound="?cameraUserGuidanceNoDocumentFound",this.badAspectRatio="?cameraUserGuidanceBadAspectRatio",this.badAngles="?cameraUserGuidanceBadAngles",this.orientationMismatch="?cameraUserGuidanceOrientationMismatch",this.textHintOffCenter="?cameraUserGuidanceTextHintOffCenter",this.tooSmall="?cameraUserGuidanceTooSmall",this.tooNoisy="?cameraUserGuidanceTooNoisy",this.tooDark="?cameraUserGuidanceTooDark",this.energySaveMode="?cameraUserGuidanceEnergySaveMode",this.readyToCapture="?cameraUserGuidanceReadyToCapture",this.capturing="?cameraUserGuidanceReadyToCapture",this.captureManual="?cameraUserGuidanceReadyToCaptureManual",void 0!==e.noDocumentFound&&(this.noDocumentFound=e.noDocumentFound),void 0!==e.badAspectRatio&&(this.badAspectRatio=e.badAspectRatio),void 0!==e.badAngles&&(this.badAngles=e.badAngles),void 0!==e.orientationMismatch&&(this.orientationMismatch=e.orientationMismatch),void 0!==e.textHintOffCenter&&(this.textHintOffCenter=e.textHintOffCenter),void 0!==e.tooSmall&&(this.tooSmall=e.tooSmall),void 0!==e.tooNoisy&&(this.tooNoisy=e.tooNoisy),void 0!==e.tooDark&&(this.tooDark=e.tooDark),void 0!==e.energySaveMode&&(this.energySaveMode=e.energySaveMode),void 0!==e.readyToCapture&&(this.readyToCapture=e.readyToCapture),void 0!==e.capturing&&(this.capturing=e.capturing),void 0!==e.captureManual&&(this.captureManual=e.captureManual)}}class q extends o.a{constructor(e={}){super(),this.visibility="ENABLED",this.title=new r.p({text:"?cameraUserGuidanceStart",color:"?sbColorOnPrimary"}),this.background=new r.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceHigh"}),this.statesTitles=new Q({}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.background&&(this.background=new r.a(e.background)),void 0!==e.statesTitles&&(this.statesTitles=new Q(e.statesTitles))}}var X,K,J=n(22);class $ extends o.a{constructor(e={}){super(),this.enabledInAutoSnappingMode=!0,this.accessibilityDescription="?accessibilityDescriptionCameraShutterButton",this.outerColor="?sbColorOnPrimary",this.innerColor="?sbColorOnPrimary",void 0!==e.enabledInAutoSnappingMode&&(this.enabledInAutoSnappingMode=e.enabledInAutoSnappingMode),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.outerColor&&(this.outerColor=e.outerColor),void 0!==e.innerColor&&(this.innerColor=e.innerColor)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PagePreviewMode":return new te(e);case"TextButtonMode":return new ne(e);case"NoButtonMode":return new ie(e);default:throw`Unknown child class name: ${t}`}}}(X||(X={}));class ee extends o.a{constructor(e={}){super(),this.visible=!0,this.backgroundColor="?sbColorModalOverlay",this.foregroundColor="?sbColorSurface",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class te extends o.a{constructor(e={}){super(),this._type="PagePreviewMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.imagePlaceholderColor="?sbColorOnSurfaceVariant",this.pageCounter=new r.b({visible:!0,background:new r.a({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface"}),foregroundColor:"?sbColorPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.imagePlaceholderColor&&(this.imagePlaceholderColor=e.imagePlaceholderColor),void 0!==e.pageCounter&&(this.pageCounter=new r.b(e.pageCounter))}}class ne extends o.a{constructor(e={}){super(),this._type="TextButtonMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.style=new r.p({text:"?cameraPreviewButtonTitle",color:"?sbColorOnPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.style&&(this.style=new r.p(e.style))}}class ie extends o.a{constructor(e={}){super(),this._type="NoButtonMode",this.visible=!1,void 0!==e.visible&&(this.visible=e.visible)}}class re extends o.a{constructor(e={}){super(),this.importButton=new r.d({title:new r.p({visible:!1,text:"?cameraImportButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraImportButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.autoSnappingModeButton=new r.d({title:new r.p({visible:!1,text:"?cameraAutoSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraAutoSnapButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.manualSnappingModeButton=new r.d({title:new r.p({visible:!1,text:"?cameraManualSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraManualSnapButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.shutterButton=new $({accessibilityDescription:"?accessibilityDescriptionCameraShutterButton"}),this.torchOnButton=new r.d({title:new r.p({visible:!1,text:"?cameraTorchOnButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOnButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.torchOffButton=new r.d({title:new r.p({visible:!1,text:"?cameraTorchOffButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOffButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.previewButton=new te({}),void 0!==e.importButton&&(this.importButton=new r.d(e.importButton)),void 0!==e.autoSnappingModeButton&&(this.autoSnappingModeButton=new r.d(e.autoSnappingModeButton)),void 0!==e.manualSnappingModeButton&&(this.manualSnappingModeButton=new r.d(e.manualSnappingModeButton)),void 0!==e.shutterButton&&(this.shutterButton=new $(e.shutterButton)),void 0!==e.torchOnButton&&(this.torchOnButton=new r.d(e.torchOnButton)),void 0!==e.torchOffButton&&(this.torchOffButton=new r.d(e.torchOffButton)),void 0!==e.previewButton&&(this.previewButton=X.From(e.previewButton))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PageSnapFunnelAnimation":return new oe(e);case"PageSnapCheckMarkAnimation":return new ae(e);case"PageSnapFeedbackNone":return new se(e);default:throw`Unknown child class name: ${t}`}}}(K||(K={}));class oe extends o.a{constructor(e={}){super(),this._type="PageSnapFunnelAnimation",this.overlayColor="?sbColorModalOverlay",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor)}}class ae extends o.a{constructor(e={}){super(),this._type="PageSnapCheckMarkAnimation",this.overlayColor="?sbColorModalOverlay",this.checkMarkBackgroundColor="?sbColorOutline",this.checkMarkColor="#00000000",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.checkMarkBackgroundColor&&(this.checkMarkBackgroundColor=e.checkMarkBackgroundColor),void 0!==e.checkMarkColor&&(this.checkMarkColor=e.checkMarkColor)}}class se extends o.a{constructor(e={}){super(),this._type="PageSnapFeedbackNone"}}class ce extends o.a{constructor(e={}){super(),this.cameraBlinkEnabled=!0,this.snapFeedbackMode=new oe({}),void 0!==e.cameraBlinkEnabled&&(this.cameraBlinkEnabled=e.cameraBlinkEnabled),void 0!==e.snapFeedbackMode&&(this.snapFeedbackMode=K.From(e.snapFeedbackMode))}}class ue extends o.a{constructor(e={}){super(),this.visibility="ENABLED",this.documentOk=new r.k({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2}),this.documentNotOk=new r.k({strokeColor:"?sbColorNegative",fillColor:"#00000000",strokeWidth:2}),this.autoSnapProgress=new r.k({strokeColor:"#40A9FF",fillColor:"#00000000",strokeWidth:2}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.documentOk&&(this.documentOk=new r.k(e.documentOk)),void 0!==e.documentNotOk&&(this.documentNotOk=new r.k(e.documentNotOk)),void 0!==e.autoSnapProgress&&(this.autoSnapProgress=new r.k(e.autoSnapProgress))}}class le extends o.a{constructor(e={}){super(),this.button=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraSelectButton"}),this.backgroundColor="?sbColorSurface",this.title=new r.p({text:"?cameraSelectCameraMenuTitle",color:"?sbColorOnSurfaceVariant"}),this.dividerColor="?sbColorOutline",this.menuEntry=new r.l({title:new r.p({color:"?sbColorOnSurface"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new r.i({color:"?sbColorOnSurface"})}),this.menuEntryActive=new r.l({title:new r.p({color:"?sbColorPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new r.i({color:"?sbColorPrimary"})}),void 0!==e.button&&(this.button=new r.h(e.button)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.menuEntry&&(this.menuEntry=new r.l(e.menuEntry)),void 0!==e.menuEntryActive&&(this.menuEntryActive=new r.l(e.menuEntryActive))}}class de extends o.a{constructor(e={}){super(),this.acknowledgement=new Z({}),this.introduction=new J.h({}),this.scanAssistanceOverlay=new ee({}),this.cameraPermission=new L({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new r.i({visible:!0,color:"?sbColorOnSurface"}),closeButton:new r.e({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new r.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),enableCameraTitle:new r.p({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new r.p({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.topBarTitle=new r.p({text:"?cameraTopBarTitle",color:"?sbColorOnPrimary"}),this.topBarIntroButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraTopBarIntroButton"}),this.topBarBackButton=new r.e({visible:!0,text:"?cameraTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraTopBarCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarCameraSelect=new le({}),this.topUserGuidance=new j.b({title:new r.p({text:"?cameraTopGuidance",color:"?sbColorOnPrimary"})}),this.userGuidance=new q({}),this.backgroundColor="#000000FF",this.autoRotateImages=!1,this.cameraConfiguration=new G({}),this.scannerParameters=new Y.b({}),this.polygon=new ue({}),this.bottomBar=new re({}),this.viewFinder=new M({aspectRatio:new T.a({width:21,height:29}),visible:!1}),this.captureFeedback=new ce({}),this.vibration=new r.r({enabled:!0}),this.timeouts=new r.q({autoCancelTimeout:0,initialScanDelay:0}),this.limitReachedAlertDialog=new y({title:new r.p({text:"?cameraLimitReachedAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?cameraLimitReachedAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new r.e({text:"?cameraLimitReachedOkButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraLimitReachedOkButton",background:new r.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),cancelButton:new r.e({visible:!1})}),this.cancelAlertDialog=new y({title:new r.p({text:"?cameraCancelAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?cameraCancelAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new r.e({text:"?cameraCancelYesButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelYesButton",background:new r.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),cancelButton:new r.e({text:"?cameraCancelNoButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelNoButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorPrimary"})})}),void 0!==e.acknowledgement&&(this.acknowledgement=new Z(e.acknowledgement)),void 0!==e.introduction&&(this.introduction=new J.h(e.introduction)),void 0!==e.scanAssistanceOverlay&&(this.scanAssistanceOverlay=new ee(e.scanAssistanceOverlay)),void 0!==e.cameraPermission&&(this.cameraPermission=new L(e.cameraPermission)),void 0!==e.topBarTitle&&(this.topBarTitle=new r.p(e.topBarTitle)),void 0!==e.topBarIntroButton&&(this.topBarIntroButton=new r.h(e.topBarIntroButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new r.e(e.topBarBackButton)),void 0!==e.topBarCameraSelect&&(this.topBarCameraSelect=new le(e.topBarCameraSelect)),void 0!==e.topUserGuidance&&(this.topUserGuidance=new j.b(e.topUserGuidance)),void 0!==e.userGuidance&&(this.userGuidance=new q(e.userGuidance)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.autoRotateImages&&(this.autoRotateImages=e.autoRotateImages),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new G(e.cameraConfiguration)),void 0!==e.scannerParameters&&(this.scannerParameters=new Y.b(e.scannerParameters)),void 0!==e.polygon&&(this.polygon=new ue(e.polygon)),void 0!==e.bottomBar&&(this.bottomBar=new re(e.bottomBar)),void 0!==e.viewFinder&&(this.viewFinder=new M(e.viewFinder)),void 0!==e.captureFeedback&&(this.captureFeedback=new ce(e.captureFeedback)),void 0!==e.vibration&&(this.vibration=new r.r(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new r.q(e.timeouts)),void 0!==e.limitReachedAlertDialog&&(this.limitReachedAlertDialog=new y(e.limitReachedAlertDialog)),void 0!==e.cancelAlertDialog&&(this.cancelAlertDialog=new y(e.cancelAlertDialog))}}class me extends o.a{constructor(e={}){super(),this.detectButton=new r.d({title:new r.p({text:"?croppingDetectButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingDetectButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.rotateButton=new r.d({title:new r.p({text:"?croppingRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingRotateButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.resetButton=new r.d({title:new r.p({text:"?croppingResetButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingResetButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),void 0!==e.detectButton&&(this.detectButton=new r.d(e.detectButton)),void 0!==e.rotateButton&&(this.rotateButton=new r.d(e.rotateButton)),void 0!==e.resetButton&&(this.resetButton=new r.d(e.resetButton))}}class he extends o.a{constructor(e={}){super(),this.topBarBackButton=new r.e({visible:!0,text:"?croppingTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarTitle=new r.p({text:"?croppingScreenTitle",color:"?sbColorOnPrimary"}),this.topBarConfirmButton=new r.e({visible:!0,text:"?croppingTopBarConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarConfirmButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.backgroundColor="?sbColorOutline",this.croppingHandlerColor="?sbColorSurface",this.croppingPolygonColor="?sbColorSurface",this.croppingPolygonMagneticLineColor="?sbColorSurface",this.bottomBar=new me({}),void 0!==e.topBarBackButton&&(this.topBarBackButton=new r.e(e.topBarBackButton)),void 0!==e.topBarTitle&&(this.topBarTitle=new r.p(e.topBarTitle)),void 0!==e.topBarConfirmButton&&(this.topBarConfirmButton=new r.e(e.topBarConfirmButton)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.croppingHandlerColor&&(this.croppingHandlerColor=e.croppingHandlerColor),void 0!==e.croppingPolygonColor&&(this.croppingPolygonColor=e.croppingPolygonColor),void 0!==e.croppingPolygonMagneticLineColor&&(this.croppingPolygonMagneticLineColor=e.croppingPolygonMagneticLineColor),void 0!==e.bottomBar&&(this.bottomBar=new me(e.bottomBar))}}const fe=["ENABLED","AUTO_CAPTURE_ONLY","DISABLED"];var pe=n(81);const ge=["FILTERED_DOCUMENT","UNFILTERED_DOCUMENT"];class ve extends o.a{constructor(e={}){super(),this.pagesScanLimit=0,this.documentImageSizeLimit=0,this.documentAnalysisMode="UNFILTERED_DOCUMENT",this.defaultFilter=null,void 0!==e.pagesScanLimit&&(this.pagesScanLimit=e.pagesScanLimit),void 0!==e.documentImageSizeLimit&&(this.documentImageSizeLimit=e.documentImageSizeLimit),void 0!==e.documentAnalysisMode&&(this.documentAnalysisMode=e.documentAnalysisMode),void 0!==e.defaultFilter&&(this.defaultFilter=null!=e.defaultFilter?pe.a.From(e.defaultFilter):null)}}class ye extends o.a{constructor(e={}){super(),this.addButton=new r.d({title:new r.p({text:"?reviewScreenAddButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewAddButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.retakeButton=new r.d({title:new r.p({text:"?reviewScreenRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRetakeButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.cropButton=new r.d({title:new r.p({text:"?reviewScreenCropButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewCropButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.rotateButton=new r.d({title:new r.p({text:"?reviewScreenRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRotateButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.deleteButton=new r.d({title:new r.p({text:"?reviewScreenDeleteButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new r.i({color:"?sbColorOnPrimary"})}),this.submitButton=new r.e({text:"?reviewScreenSubmitButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewSubmitButton",background:new r.a({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnSurface"})}),void 0!==e.addButton&&(this.addButton=new r.d(e.addButton)),void 0!==e.retakeButton&&(this.retakeButton=new r.d(e.retakeButton)),void 0!==e.cropButton&&(this.cropButton=new r.d(e.cropButton)),void 0!==e.rotateButton&&(this.rotateButton=new r.d(e.rotateButton)),void 0!==e.deleteButton&&(this.deleteButton=new r.d(e.deleteButton)),void 0!==e.submitButton&&(this.submitButton=new r.e(e.submitButton))}}class Ce extends o.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.deleteAll=new r.l({title:new r.p({text:"?reviewScreenDeleteAllButtonTitle",color:"?sbColorNegative"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllButton",icon:new r.i({color:"?sbColorNegative"})}),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.deleteAll&&(this.deleteAll=new r.l(e.deleteAll))}}class be extends o.a{constructor(e={}){super(),this.overlayColor="?sbColorModalOverlay",this.closeButton=new r.e({text:"?zoomOverlayCancelButtonText",accessibilityDescription:"?accessibilityDescriptionZoomOverlayCancelButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.closeButton&&(this.closeButton=new r.e(e.closeButton))}}class Ae extends o.a{constructor(e={}){super(),this.enabled=!0,this.topBarTitle=new r.p({text:"?reviewScreenTitle",color:"?sbColorOnPrimary"}),this.topBarMoreButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewMoreButton"}),this.topBarBackButton=new r.e({visible:!0,text:"?reviewTopBarBackButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewTopBarBackButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.morePopup=new Ce({}),this.zoomButton=new r.m({accessibilityDescription:"?accessibilityDescriptionReviewZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary"}),this.zoomOverlay=new be({}),this.backgroundColor="?sbColorOnSurfaceVariant",this.bottomBar=new ye({}),this.switchNextPageButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewNextPageButton"}),this.switchPreviousPageButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewPreviousPageButton"}),this.pageCounter=new j.b({title:new r.p({text:"?reviewScreenPageCount",color:"?sbColorOnPrimary"}),background:new r.a({fillColor:"?sbColorSurfaceHigh",strokeWidth:0})}),this.deleteAllPagesAlertDialog=new y({title:new r.p({text:"?reviewDeleteAllPagesAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?reviewDeleteAllPagesAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new r.e({text:"?reviewDeleteAllPagesAlertDeleteButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton",background:new r.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),actionButton:new r.e({visible:!1}),cancelButton:new r.e({text:"?reviewDeleteAllPagesAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorPrimary"})})}),this.deletePageAlertDialog=new y({title:new r.p({text:"?reviewDeletePageAlertTitle",color:"?sbColorOnSurface"}),subtitle:new r.p({text:"?reviewDeletePageAlertSubTitle",color:"?sbColorOnSurfaceVariant"}),okButton:new r.e({text:"?reviewDeletePageAlertConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertConfirmButton",background:new r.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),actionButton:new r.e({text:"?reviewDeletePageAlertDeleteRetakeButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorPrimary"})}),cancelButton:new r.e({text:"?reviewDeletePageAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertCancelButton",background:new r.a({fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorPrimary"})})}),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.topBarTitle&&(this.topBarTitle=new r.p(e.topBarTitle)),void 0!==e.topBarMoreButton&&(this.topBarMoreButton=new r.h(e.topBarMoreButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new r.e(e.topBarBackButton)),void 0!==e.morePopup&&(this.morePopup=new Ce(e.morePopup)),void 0!==e.zoomButton&&(this.zoomButton=new r.m(e.zoomButton)),void 0!==e.zoomOverlay&&(this.zoomOverlay=new be(e.zoomOverlay)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new ye(e.bottomBar)),void 0!==e.switchNextPageButton&&(this.switchNextPageButton=new r.h(e.switchNextPageButton)),void 0!==e.switchPreviousPageButton&&(this.switchPreviousPageButton=new r.h(e.switchPreviousPageButton)),void 0!==e.pageCounter&&(this.pageCounter=new j.b(e.pageCounter)),void 0!==e.deleteAllPagesAlertDialog&&(this.deleteAllPagesAlertDialog=new y(e.deleteAllPagesAlertDialog)),void 0!==e.deletePageAlertDialog&&(this.deletePageAlertDialog=new y(e.deletePageAlertDialog))}}class Se extends o.a{constructor(e={}){super(),this.camera=new de({}),this.review=new Ae({}),this.cropping=new he({}),void 0!==e.camera&&(this.camera=new de(e.camera)),void 0!==e.review&&(this.review=new Ae(e.review)),void 0!==e.cropping&&(this.cropping=new he(e.cropping))}}class we extends o.a{constructor(e={}){super(),this.cameraTopBarCancelButtonTitle="Cancel",this.cameraTopBarTitle="Scan Document",this.cameraTopGuidance="Scan each page of your document.",this.cameraUserGuidanceStart="Please hold your device over a document.",this.cameraUserGuidanceNoDocumentFound="No document found",this.cameraUserGuidanceBadAspectRatio="Bad aspect ratio",this.cameraUserGuidanceOrientationMismatch="Orientation mismatch",this.cameraUserGuidanceBadAngles="Bad angles",this.cameraUserGuidanceTooNoisy="Its too noisy. Try another background for the document",this.cameraUserGuidanceTextHintOffCenter="Document is off center",this.cameraUserGuidanceTooSmall="Document is too small. Move camera closer.",this.cameraUserGuidanceTooDark="Its too dark. Add more light.",this.cameraUserGuidanceEnergySaveMode="Energy save mode is on",this.cameraUserGuidanceReadyToCapture="Hold still capturing...",this.cameraUserGuidanceReadyToCaptureManual="Ready to capture!",this.cameraImportButtonTitle="Import",this.cameraTorchOnButtonTitle="On",this.cameraTorchOffButtonTitle="Off",this.cameraAutoSnapButtonTitle="Auto",this.cameraManualSnapButtonTitle="Manual",this.cameraPreviewButtonTitle="%d Pages",this.cameraIntroDoneButton="Done",this.cameraIntroTitle="How to scan a document",this.cameraIntroSubtitle="Follow the steps below to create a high-quality document scan",this.cameraIntroItem1="1. Place your document on a flat surface.",this.cameraIntroItem2="2. Hold your phone above the document.",this.cameraIntroItem3="3. Follow the on-screen guidance to find the optimal position.",this.cameraIntroItem4="4. Once you reach the optimal position, you can manually scan the document or let the app scan it automatically.",this.cameraProgressOverlayTitle="Please wait...",this.cameraCancelAlertTitle="Cancel?",this.cameraCancelAlertSubtitle="Canceling will delete all the pages scanned so far. Are you sure you want to cancel?",this.cameraCancelNoButtonTitle="No",this.cameraCancelYesButtonTitle="Yes, Cancel",this.cameraLimitReachedAlertTitle="You reached the limit!",this.cameraLimitReachedAlertSubtitle="You have scanned the maximum number of pages and cannot add any more. Please delete at least one page to perform a new scan.",this.cameraLimitReachedOkButtonTitle="Ok",this.cameraSelectCameraMenuTitle="Select camera",this.acknowledgementScreenBadDocumentHint="The quality of your scan does not seem sufficient.",this.acknowledgementRetakeButtonTitle="Retake",this.acknowledgementAcceptButtonTitle="Use Scan",this.reviewScreenTitle="Review (%d)",this.reviewTopBarBackButtonTitle="Back",this.reviewScreenPageCount="Page %d/%d",this.reviewScreenAddButtonTitle="Add",this.reviewScreenRetakeButtonTitle="Retake",this.reviewScreenCropButtonTitle="Crop",this.reviewScreenRotateButtonTitle="Rotate",this.reviewScreenDeleteButtonTitle="Delete",this.reviewScreenSubmitButtonTitle="Submit",this.reviewScreenDeleteAllButtonTitle="Delete all",this.reviewScreenReorderPagesButtonTitle="Reorder pages",this.zoomOverlayCancelButtonText="Close",this.reviewDeletePageAlertTitle="Delete page?",this.reviewDeleteAllPagesAlertTitle="Delete all?",this.reviewDeletePageAlertSubTitle="Are you sure you want to delete the page?",this.reviewDeleteAllPagesAlertSubtitle="Are you sure you want to delete all pages?",this.reviewDeletePageAlertConfirmButtonTitle="Yes, Delete",this.reviewDeleteAllPagesAlertDeleteButtonTitle="Yes, Delete all",this.reviewDeletePageAlertDeleteRetakeButtonTitle="Delete and Retake",this.reviewDeletePageAlertCancelButtonTitle="Cancel",this.reviewDeleteAllPagesAlertCancelButtonTitle="Cancel",this.acknowledgementTitle="Acknowledgement",this.reorderPageTitle="Reorder Pages",this.reorderPageGuidanceTitle="Drag pages to reorder",this.reorderPageText="%d",this.reorderTopBarConfirmButtonTitle="Done",this.reorderTopBarCancelButtonTitle="Cancel",this.croppingTopBarConfirmButtonTitle="Done",this.croppingTopBarCancelButtonTitle="Cancel",this.croppingDetectButtonTitle="Detect",this.croppingRotateButtonTitle="Rotate",this.croppingResetButtonTitle="Reset",this.croppingScreenTitle="Crop",this.accessibilityDescriptionCameraTopBarIntroButton="Tap to open introduction screen",this.accessibilityDescriptionCameraTopBarCancelButton="Tap to close scanner screen",this.accessibilityDescriptionCameraImportButton="Tap to import image",this.accessibilityDescriptionCameraTorchOnButton="Tap to disable torch",this.accessibilityDescriptionCameraTorchOffButton="Tap to enable torch",this.accessibilityDescriptionCameraShutterButton="Tap to take image",this.accessibilityDescriptionCameraAutoSnapButton="Tap to enable manual snapping mode",this.accessibilityDescriptionCameraManualSnapButton="Tap to enable auto snapping mode",this.accessibilityDescriptionCameraPreviewButton="Tap to preview scanned pages",this.accessibilityDescriptionCameraIntroDoneButton="Tap to close introduction screen",this.accessibilityDescriptionCameraSelectButton="Tap to open camera selection menu",this.accessibilityDescriptionCameraSelectMenuItem="Tap to select camera",this.accessibilityDescriptionAcknowledgementRetakeButton="Tap to retake the image",this.accessibilityDescriptionAcknowledgementAcceptButton="Tap to accept the image regardless of its quality",this.accessibilityDescriptionCroppingTopBarConfirmButton="Tap to apply changes",this.accessibilityDescriptionCroppingTopBarCancelButton="Tap to close screen without applying changes",this.accessibilityDescriptionCroppingDetectButton="Tap to detect document on the image",this.accessibilityDescriptionCroppingRotateButton="Tap to rotate document",this.accessibilityDescriptionCroppingResetButton="Tap to reset document contour to whole image",this.accessibilityDescriptionReorderTopBarConfirmButton="Tap to apply changes",this.accessibilityDescriptionReorderTopBarCancelButton="Tap to close screen without applying changes",this.accessibilityDescriptionReviewNextPageButton="Tap to switch to the new page",this.accessibilityDescriptionReviewPreviousPageButton="Tap to switch to the previous page",this.accessibilityDescriptionReviewAddButton="Tap to Add new page",this.accessibilityDescriptionReviewRetakeButton="Tap to Retake current selected page",this.accessibilityDescriptionReviewCropButton="Tap to Crop selected page",this.accessibilityDescriptionReviewRotateButton="Tap to Rotate selected page clockwise",this.accessibilityDescriptionReviewDeleteButton="Tap to Delete selected page",this.accessibilityDescriptionReviewSubmitButton="Tap to Submit document",this.accessibilityDescriptionReviewMoreButton="Tap to show additional options",this.accessibilityDescriptionReviewDeleteAllButton="Tap to Delete all pages",this.accessibilityDescriptionReviewReorderPagesButton="Tap to Reorder pages",this.accessibilityDescriptionZoomOverlayCancelButton="Tap to Close zoom overlay",this.accessibilityDescriptionReviewZoomButton="Tap to open zoom overlay for selected page",this.accessibilityDescriptionReviewTopBarBackButton="Tap to Close review screen",this.accessibilityDescriptionReviewDeletePageAlertConfirmButton="Tap to Delete page",this.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton="Tap to Delete all pages",this.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton="Tap to Delete page and Retake it",this.accessibilityDescriptionReviewDeletePageAlertCancelButton="Tap to Cancel operation",this.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton="Tap to Cancel operation",this.accessibilityDescriptionCameraLimitReachedOkButton="Tap to close alert dialog",this.accessibilityDescriptionCameraCancelYesButton="Tap to cancel document",this.accessibilityDescriptionCameraCancelNoButton="Tap to close alert dialog",this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionEnableCameraButton="Grant permission",this.cameraPermissionCloseButton="Close",this.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",void 0!==e.cameraTopBarCancelButtonTitle&&(this.cameraTopBarCancelButtonTitle=e.cameraTopBarCancelButtonTitle),void 0!==e.cameraTopBarTitle&&(this.cameraTopBarTitle=e.cameraTopBarTitle),void 0!==e.cameraTopGuidance&&(this.cameraTopGuidance=e.cameraTopGuidance),void 0!==e.cameraUserGuidanceStart&&(this.cameraUserGuidanceStart=e.cameraUserGuidanceStart),void 0!==e.cameraUserGuidanceNoDocumentFound&&(this.cameraUserGuidanceNoDocumentFound=e.cameraUserGuidanceNoDocumentFound),void 0!==e.cameraUserGuidanceBadAspectRatio&&(this.cameraUserGuidanceBadAspectRatio=e.cameraUserGuidanceBadAspectRatio),void 0!==e.cameraUserGuidanceOrientationMismatch&&(this.cameraUserGuidanceOrientationMismatch=e.cameraUserGuidanceOrientationMismatch),void 0!==e.cameraUserGuidanceBadAngles&&(this.cameraUserGuidanceBadAngles=e.cameraUserGuidanceBadAngles),void 0!==e.cameraUserGuidanceTooNoisy&&(this.cameraUserGuidanceTooNoisy=e.cameraUserGuidanceTooNoisy),void 0!==e.cameraUserGuidanceTextHintOffCenter&&(this.cameraUserGuidanceTextHintOffCenter=e.cameraUserGuidanceTextHintOffCenter),void 0!==e.cameraUserGuidanceTooSmall&&(this.cameraUserGuidanceTooSmall=e.cameraUserGuidanceTooSmall),void 0!==e.cameraUserGuidanceTooDark&&(this.cameraUserGuidanceTooDark=e.cameraUserGuidanceTooDark),void 0!==e.cameraUserGuidanceEnergySaveMode&&(this.cameraUserGuidanceEnergySaveMode=e.cameraUserGuidanceEnergySaveMode),void 0!==e.cameraUserGuidanceReadyToCapture&&(this.cameraUserGuidanceReadyToCapture=e.cameraUserGuidanceReadyToCapture),void 0!==e.cameraUserGuidanceReadyToCaptureManual&&(this.cameraUserGuidanceReadyToCaptureManual=e.cameraUserGuidanceReadyToCaptureManual),void 0!==e.cameraImportButtonTitle&&(this.cameraImportButtonTitle=e.cameraImportButtonTitle),void 0!==e.cameraTorchOnButtonTitle&&(this.cameraTorchOnButtonTitle=e.cameraTorchOnButtonTitle),void 0!==e.cameraTorchOffButtonTitle&&(this.cameraTorchOffButtonTitle=e.cameraTorchOffButtonTitle),void 0!==e.cameraAutoSnapButtonTitle&&(this.cameraAutoSnapButtonTitle=e.cameraAutoSnapButtonTitle),void 0!==e.cameraManualSnapButtonTitle&&(this.cameraManualSnapButtonTitle=e.cameraManualSnapButtonTitle),void 0!==e.cameraPreviewButtonTitle&&(this.cameraPreviewButtonTitle=e.cameraPreviewButtonTitle),void 0!==e.cameraIntroDoneButton&&(this.cameraIntroDoneButton=e.cameraIntroDoneButton),void 0!==e.cameraIntroTitle&&(this.cameraIntroTitle=e.cameraIntroTitle),void 0!==e.cameraIntroSubtitle&&(this.cameraIntroSubtitle=e.cameraIntroSubtitle),void 0!==e.cameraIntroItem1&&(this.cameraIntroItem1=e.cameraIntroItem1),void 0!==e.cameraIntroItem2&&(this.cameraIntroItem2=e.cameraIntroItem2),void 0!==e.cameraIntroItem3&&(this.cameraIntroItem3=e.cameraIntroItem3),void 0!==e.cameraIntroItem4&&(this.cameraIntroItem4=e.cameraIntroItem4),void 0!==e.cameraProgressOverlayTitle&&(this.cameraProgressOverlayTitle=e.cameraProgressOverlayTitle),void 0!==e.cameraCancelAlertTitle&&(this.cameraCancelAlertTitle=e.cameraCancelAlertTitle),void 0!==e.cameraCancelAlertSubtitle&&(this.cameraCancelAlertSubtitle=e.cameraCancelAlertSubtitle),void 0!==e.cameraCancelNoButtonTitle&&(this.cameraCancelNoButtonTitle=e.cameraCancelNoButtonTitle),void 0!==e.cameraCancelYesButtonTitle&&(this.cameraCancelYesButtonTitle=e.cameraCancelYesButtonTitle),void 0!==e.cameraLimitReachedAlertTitle&&(this.cameraLimitReachedAlertTitle=e.cameraLimitReachedAlertTitle),void 0!==e.cameraLimitReachedAlertSubtitle&&(this.cameraLimitReachedAlertSubtitle=e.cameraLimitReachedAlertSubtitle),void 0!==e.cameraLimitReachedOkButtonTitle&&(this.cameraLimitReachedOkButtonTitle=e.cameraLimitReachedOkButtonTitle),void 0!==e.cameraSelectCameraMenuTitle&&(this.cameraSelectCameraMenuTitle=e.cameraSelectCameraMenuTitle),void 0!==e.acknowledgementScreenBadDocumentHint&&(this.acknowledgementScreenBadDocumentHint=e.acknowledgementScreenBadDocumentHint),void 0!==e.acknowledgementRetakeButtonTitle&&(this.acknowledgementRetakeButtonTitle=e.acknowledgementRetakeButtonTitle),void 0!==e.acknowledgementAcceptButtonTitle&&(this.acknowledgementAcceptButtonTitle=e.acknowledgementAcceptButtonTitle),void 0!==e.reviewScreenTitle&&(this.reviewScreenTitle=e.reviewScreenTitle),void 0!==e.reviewTopBarBackButtonTitle&&(this.reviewTopBarBackButtonTitle=e.reviewTopBarBackButtonTitle),void 0!==e.reviewScreenPageCount&&(this.reviewScreenPageCount=e.reviewScreenPageCount),void 0!==e.reviewScreenAddButtonTitle&&(this.reviewScreenAddButtonTitle=e.reviewScreenAddButtonTitle),void 0!==e.reviewScreenRetakeButtonTitle&&(this.reviewScreenRetakeButtonTitle=e.reviewScreenRetakeButtonTitle),void 0!==e.reviewScreenCropButtonTitle&&(this.reviewScreenCropButtonTitle=e.reviewScreenCropButtonTitle),void 0!==e.reviewScreenRotateButtonTitle&&(this.reviewScreenRotateButtonTitle=e.reviewScreenRotateButtonTitle),void 0!==e.reviewScreenDeleteButtonTitle&&(this.reviewScreenDeleteButtonTitle=e.reviewScreenDeleteButtonTitle),void 0!==e.reviewScreenSubmitButtonTitle&&(this.reviewScreenSubmitButtonTitle=e.reviewScreenSubmitButtonTitle),void 0!==e.reviewScreenDeleteAllButtonTitle&&(this.reviewScreenDeleteAllButtonTitle=e.reviewScreenDeleteAllButtonTitle),void 0!==e.reviewScreenReorderPagesButtonTitle&&(this.reviewScreenReorderPagesButtonTitle=e.reviewScreenReorderPagesButtonTitle),void 0!==e.zoomOverlayCancelButtonText&&(this.zoomOverlayCancelButtonText=e.zoomOverlayCancelButtonText),void 0!==e.reviewDeletePageAlertTitle&&(this.reviewDeletePageAlertTitle=e.reviewDeletePageAlertTitle),void 0!==e.reviewDeleteAllPagesAlertTitle&&(this.reviewDeleteAllPagesAlertTitle=e.reviewDeleteAllPagesAlertTitle),void 0!==e.reviewDeletePageAlertSubTitle&&(this.reviewDeletePageAlertSubTitle=e.reviewDeletePageAlertSubTitle),void 0!==e.reviewDeleteAllPagesAlertSubtitle&&(this.reviewDeleteAllPagesAlertSubtitle=e.reviewDeleteAllPagesAlertSubtitle),void 0!==e.reviewDeletePageAlertConfirmButtonTitle&&(this.reviewDeletePageAlertConfirmButtonTitle=e.reviewDeletePageAlertConfirmButtonTitle),void 0!==e.reviewDeleteAllPagesAlertDeleteButtonTitle&&(this.reviewDeleteAllPagesAlertDeleteButtonTitle=e.reviewDeleteAllPagesAlertDeleteButtonTitle),void 0!==e.reviewDeletePageAlertDeleteRetakeButtonTitle&&(this.reviewDeletePageAlertDeleteRetakeButtonTitle=e.reviewDeletePageAlertDeleteRetakeButtonTitle),void 0!==e.reviewDeletePageAlertCancelButtonTitle&&(this.reviewDeletePageAlertCancelButtonTitle=e.reviewDeletePageAlertCancelButtonTitle),void 0!==e.reviewDeleteAllPagesAlertCancelButtonTitle&&(this.reviewDeleteAllPagesAlertCancelButtonTitle=e.reviewDeleteAllPagesAlertCancelButtonTitle),void 0!==e.acknowledgementTitle&&(this.acknowledgementTitle=e.acknowledgementTitle),void 0!==e.reorderPageTitle&&(this.reorderPageTitle=e.reorderPageTitle),void 0!==e.reorderPageGuidanceTitle&&(this.reorderPageGuidanceTitle=e.reorderPageGuidanceTitle),void 0!==e.reorderPageText&&(this.reorderPageText=e.reorderPageText),void 0!==e.reorderTopBarConfirmButtonTitle&&(this.reorderTopBarConfirmButtonTitle=e.reorderTopBarConfirmButtonTitle),void 0!==e.reorderTopBarCancelButtonTitle&&(this.reorderTopBarCancelButtonTitle=e.reorderTopBarCancelButtonTitle),void 0!==e.croppingTopBarConfirmButtonTitle&&(this.croppingTopBarConfirmButtonTitle=e.croppingTopBarConfirmButtonTitle),void 0!==e.croppingTopBarCancelButtonTitle&&(this.croppingTopBarCancelButtonTitle=e.croppingTopBarCancelButtonTitle),void 0!==e.croppingDetectButtonTitle&&(this.croppingDetectButtonTitle=e.croppingDetectButtonTitle),void 0!==e.croppingRotateButtonTitle&&(this.croppingRotateButtonTitle=e.croppingRotateButtonTitle),void 0!==e.croppingResetButtonTitle&&(this.croppingResetButtonTitle=e.croppingResetButtonTitle),void 0!==e.croppingScreenTitle&&(this.croppingScreenTitle=e.croppingScreenTitle),void 0!==e.accessibilityDescriptionCameraTopBarIntroButton&&(this.accessibilityDescriptionCameraTopBarIntroButton=e.accessibilityDescriptionCameraTopBarIntroButton),void 0!==e.accessibilityDescriptionCameraTopBarCancelButton&&(this.accessibilityDescriptionCameraTopBarCancelButton=e.accessibilityDescriptionCameraTopBarCancelButton),void 0!==e.accessibilityDescriptionCameraImportButton&&(this.accessibilityDescriptionCameraImportButton=e.accessibilityDescriptionCameraImportButton),void 0!==e.accessibilityDescriptionCameraTorchOnButton&&(this.accessibilityDescriptionCameraTorchOnButton=e.accessibilityDescriptionCameraTorchOnButton),void 0!==e.accessibilityDescriptionCameraTorchOffButton&&(this.accessibilityDescriptionCameraTorchOffButton=e.accessibilityDescriptionCameraTorchOffButton),void 0!==e.accessibilityDescriptionCameraShutterButton&&(this.accessibilityDescriptionCameraShutterButton=e.accessibilityDescriptionCameraShutterButton),void 0!==e.accessibilityDescriptionCameraAutoSnapButton&&(this.accessibilityDescriptionCameraAutoSnapButton=e.accessibilityDescriptionCameraAutoSnapButton),void 0!==e.accessibilityDescriptionCameraManualSnapButton&&(this.accessibilityDescriptionCameraManualSnapButton=e.accessibilityDescriptionCameraManualSnapButton),void 0!==e.accessibilityDescriptionCameraPreviewButton&&(this.accessibilityDescriptionCameraPreviewButton=e.accessibilityDescriptionCameraPreviewButton),void 0!==e.accessibilityDescriptionCameraIntroDoneButton&&(this.accessibilityDescriptionCameraIntroDoneButton=e.accessibilityDescriptionCameraIntroDoneButton),void 0!==e.accessibilityDescriptionCameraSelectButton&&(this.accessibilityDescriptionCameraSelectButton=e.accessibilityDescriptionCameraSelectButton),void 0!==e.accessibilityDescriptionCameraSelectMenuItem&&(this.accessibilityDescriptionCameraSelectMenuItem=e.accessibilityDescriptionCameraSelectMenuItem),void 0!==e.accessibilityDescriptionAcknowledgementRetakeButton&&(this.accessibilityDescriptionAcknowledgementRetakeButton=e.accessibilityDescriptionAcknowledgementRetakeButton),void 0!==e.accessibilityDescriptionAcknowledgementAcceptButton&&(this.accessibilityDescriptionAcknowledgementAcceptButton=e.accessibilityDescriptionAcknowledgementAcceptButton),void 0!==e.accessibilityDescriptionCroppingTopBarConfirmButton&&(this.accessibilityDescriptionCroppingTopBarConfirmButton=e.accessibilityDescriptionCroppingTopBarConfirmButton),void 0!==e.accessibilityDescriptionCroppingTopBarCancelButton&&(this.accessibilityDescriptionCroppingTopBarCancelButton=e.accessibilityDescriptionCroppingTopBarCancelButton),void 0!==e.accessibilityDescriptionCroppingDetectButton&&(this.accessibilityDescriptionCroppingDetectButton=e.accessibilityDescriptionCroppingDetectButton),void 0!==e.accessibilityDescriptionCroppingRotateButton&&(this.accessibilityDescriptionCroppingRotateButton=e.accessibilityDescriptionCroppingRotateButton),void 0!==e.accessibilityDescriptionCroppingResetButton&&(this.accessibilityDescriptionCroppingResetButton=e.accessibilityDescriptionCroppingResetButton),void 0!==e.accessibilityDescriptionReorderTopBarConfirmButton&&(this.accessibilityDescriptionReorderTopBarConfirmButton=e.accessibilityDescriptionReorderTopBarConfirmButton),void 0!==e.accessibilityDescriptionReorderTopBarCancelButton&&(this.accessibilityDescriptionReorderTopBarCancelButton=e.accessibilityDescriptionReorderTopBarCancelButton),void 0!==e.accessibilityDescriptionReviewNextPageButton&&(this.accessibilityDescriptionReviewNextPageButton=e.accessibilityDescriptionReviewNextPageButton),void 0!==e.accessibilityDescriptionReviewPreviousPageButton&&(this.accessibilityDescriptionReviewPreviousPageButton=e.accessibilityDescriptionReviewPreviousPageButton),void 0!==e.accessibilityDescriptionReviewAddButton&&(this.accessibilityDescriptionReviewAddButton=e.accessibilityDescriptionReviewAddButton),void 0!==e.accessibilityDescriptionReviewRetakeButton&&(this.accessibilityDescriptionReviewRetakeButton=e.accessibilityDescriptionReviewRetakeButton),void 0!==e.accessibilityDescriptionReviewCropButton&&(this.accessibilityDescriptionReviewCropButton=e.accessibilityDescriptionReviewCropButton),void 0!==e.accessibilityDescriptionReviewRotateButton&&(this.accessibilityDescriptionReviewRotateButton=e.accessibilityDescriptionReviewRotateButton),void 0!==e.accessibilityDescriptionReviewDeleteButton&&(this.accessibilityDescriptionReviewDeleteButton=e.accessibilityDescriptionReviewDeleteButton),void 0!==e.accessibilityDescriptionReviewSubmitButton&&(this.accessibilityDescriptionReviewSubmitButton=e.accessibilityDescriptionReviewSubmitButton),void 0!==e.accessibilityDescriptionReviewMoreButton&&(this.accessibilityDescriptionReviewMoreButton=e.accessibilityDescriptionReviewMoreButton),void 0!==e.accessibilityDescriptionReviewDeleteAllButton&&(this.accessibilityDescriptionReviewDeleteAllButton=e.accessibilityDescriptionReviewDeleteAllButton),void 0!==e.accessibilityDescriptionReviewReorderPagesButton&&(this.accessibilityDescriptionReviewReorderPagesButton=e.accessibilityDescriptionReviewReorderPagesButton),void 0!==e.accessibilityDescriptionZoomOverlayCancelButton&&(this.accessibilityDescriptionZoomOverlayCancelButton=e.accessibilityDescriptionZoomOverlayCancelButton),void 0!==e.accessibilityDescriptionReviewZoomButton&&(this.accessibilityDescriptionReviewZoomButton=e.accessibilityDescriptionReviewZoomButton),void 0!==e.accessibilityDescriptionReviewTopBarBackButton&&(this.accessibilityDescriptionReviewTopBarBackButton=e.accessibilityDescriptionReviewTopBarBackButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertConfirmButton&&(this.accessibilityDescriptionReviewDeletePageAlertConfirmButton=e.accessibilityDescriptionReviewDeletePageAlertConfirmButton),void 0!==e.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton&&(this.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton=e.accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton&&(this.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton=e.accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton),void 0!==e.accessibilityDescriptionReviewDeletePageAlertCancelButton&&(this.accessibilityDescriptionReviewDeletePageAlertCancelButton=e.accessibilityDescriptionReviewDeletePageAlertCancelButton),void 0!==e.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton&&(this.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton=e.accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton),void 0!==e.accessibilityDescriptionCameraLimitReachedOkButton&&(this.accessibilityDescriptionCameraLimitReachedOkButton=e.accessibilityDescriptionCameraLimitReachedOkButton),void 0!==e.accessibilityDescriptionCameraCancelYesButton&&(this.accessibilityDescriptionCameraCancelYesButton=e.accessibilityDescriptionCameraCancelYesButton),void 0!==e.accessibilityDescriptionCameraCancelNoButton&&(this.accessibilityDescriptionCameraCancelNoButton=e.accessibilityDescriptionCameraCancelNoButton),void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionEnableCameraButton&&(this.cameraPermissionEnableCameraButton=e.cameraPermissionEnableCameraButton),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton)}}class Ee extends o.a{constructor(e={}){super(),this.topBarBackgroundColor="?sbColorPrimary",this.bottomBarBackgroundColor="?sbColorPrimary",void 0!==e.topBarBackgroundColor&&(this.topBarBackgroundColor=e.topBarBackgroundColor),void 0!==e.bottomBarBackgroundColor&&(this.bottomBarBackgroundColor=e.bottomBarBackgroundColor)}}class De extends o.a{constructor(e={}){super(),this.version="1.0",this.screen="DocumentScanner",this.palette=new r.j({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new we({}),this.appearance=new Ee({}),this.outputSettings=new ve({}),this.screens=new Se({}),this.documentUuid=null,this.cleanScanningSession=!0,void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.palette&&(this.palette=new r.j(e.palette)),void 0!==e.localization&&(this.localization=new we(e.localization)),void 0!==e.appearance&&(this.appearance=new Ee(e.appearance)),void 0!==e.outputSettings&&(this.outputSettings=new ve(e.outputSettings)),void 0!==e.screens&&(this.screens=new Se(e.screens)),void 0!==e.documentUuid&&(this.documentUuid=null!=e.documentUuid?e.documentUuid:null),void 0!==e.cleanScanningSession&&(this.cleanScanningSession=e.cleanScanningSession)}}var xe;!function(e){e.From=function(e){const t=e._type;switch(t){case"TwoLineMRZFinderLayoutPreset":return new Be(e);case"ThreeLineMRZFinderLayoutPreset":return new Ie(e);case"NoLayoutPreset":return new Te(e);default:throw`Unknown child class name: ${t}`}}}(xe||(xe={}));class Be extends o.a{constructor(e={}){super(),this._type="TwoLineMRZFinderLayoutPreset",this.mrzTextLine1="I<USASMITH<<JACK<<<<<<<<<<<<<<<<<<<<",this.mrzTextLine2="2342353464USA9602300M2904076<<<<<<<2",this.adjustedFinderAspectRatio=5.390625,void 0!==e.mrzTextLine1&&(this.mrzTextLine1=e.mrzTextLine1),void 0!==e.mrzTextLine2&&(this.mrzTextLine2=e.mrzTextLine2),void 0!==e.adjustedFinderAspectRatio&&(this.adjustedFinderAspectRatio=e.adjustedFinderAspectRatio)}}class Ie extends o.a{constructor(e={}){super(),this._type="ThreeLineMRZFinderLayoutPreset",this.mrzTextLine1="I<USA2342353464<<<<<<<<<<<<<<<",this.mrzTextLine2="9602300M2904076USA<<<<<<<<<<<2",this.mrzTextLine3="SMITH<<JACK<<<<<<<<<<<<<<<<<<<",this.adjustedFinderAspectRatio=4.3125,void 0!==e.mrzTextLine1&&(this.mrzTextLine1=e.mrzTextLine1),void 0!==e.mrzTextLine2&&(this.mrzTextLine2=e.mrzTextLine2),void 0!==e.mrzTextLine3&&(this.mrzTextLine3=e.mrzTextLine3),void 0!==e.adjustedFinderAspectRatio&&(this.adjustedFinderAspectRatio=e.adjustedFinderAspectRatio)}}class Te extends o.a{constructor(e={}){super(),this._type="NoLayoutPreset"}}var Oe=n(8),ke=n(40);class Pe extends o.a{constructor(e={}){super(),this.topBarTitle="MRZ Scanner",this.topBarCancelButton="Cancel",this.topUserGuidance="Scan your Identity Document",this.finderViewUserGuidance="Scan the MRZ",this.introScreenTitle="How to scan an MRZ",this.introScreenDoneButton="Start Scanning",this.introScreenText="The Machine Readable Zone (MRZ) is a special code on your ID document (such as a passport or ID card) that contains your personal information in a machine-readable format.\n\nTo scan it, simply hold your camera over the document, so that it aligns with the MRZ section. Once scanned, the data will be automatically processed, and you will be directed to the results screen.\n\nPress 'Start Scanning' to begin.",this.completionOverlaySuccessMessage="Scanned successfully",this.accessibilityDescriptionOpenIntroScreenButton="Open introduction screen.",this.accessibilityDescriptionIntroScreenDoneButton="Start scanning",this.accessibilityDescriptionCancelButton="Cancel",this.accessibilityDescriptionFlashButton="Toggle flash",this.accessibilityDescriptionZoomButton="Toggle camera zoom",this.accessibilityDescriptionFlipCameraButton="Flip camera",this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionEnableCameraButton="Grant permission",this.cameraPermissionCloseButton="Close",this.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",void 0!==e.topBarTitle&&(this.topBarTitle=e.topBarTitle),void 0!==e.topBarCancelButton&&(this.topBarCancelButton=e.topBarCancelButton),void 0!==e.topUserGuidance&&(this.topUserGuidance=e.topUserGuidance),void 0!==e.finderViewUserGuidance&&(this.finderViewUserGuidance=e.finderViewUserGuidance),void 0!==e.introScreenTitle&&(this.introScreenTitle=e.introScreenTitle),void 0!==e.introScreenDoneButton&&(this.introScreenDoneButton=e.introScreenDoneButton),void 0!==e.introScreenText&&(this.introScreenText=e.introScreenText),void 0!==e.completionOverlaySuccessMessage&&(this.completionOverlaySuccessMessage=e.completionOverlaySuccessMessage),void 0!==e.accessibilityDescriptionOpenIntroScreenButton&&(this.accessibilityDescriptionOpenIntroScreenButton=e.accessibilityDescriptionOpenIntroScreenButton),void 0!==e.accessibilityDescriptionIntroScreenDoneButton&&(this.accessibilityDescriptionIntroScreenDoneButton=e.accessibilityDescriptionIntroScreenDoneButton),void 0!==e.accessibilityDescriptionCancelButton&&(this.accessibilityDescriptionCancelButton=e.accessibilityDescriptionCancelButton),void 0!==e.accessibilityDescriptionFlashButton&&(this.accessibilityDescriptionFlashButton=e.accessibilityDescriptionFlashButton),void 0!==e.accessibilityDescriptionZoomButton&&(this.accessibilityDescriptionZoomButton=e.accessibilityDescriptionZoomButton),void 0!==e.accessibilityDescriptionFlipCameraButton&&(this.accessibilityDescriptionFlipCameraButton=e.accessibilityDescriptionFlipCameraButton),void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionEnableCameraButton&&(this.cameraPermissionEnableCameraButton=e.cameraPermissionEnableCameraButton),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),void 0!==e.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton)}}class Le extends o.a{constructor(e={}){super(),this.message=new r.p({text:"?completionOverlaySuccessMessage",color:"?sbColorOnPrimary"}),this.iconColor="?sbColorOnPrimary",this.overlayBackgroundColor="?sbColorSurfaceHigh",this.timeout=1e3,void 0!==e.message&&(this.message=new r.p(e.message)),void 0!==e.iconColor&&(this.iconColor=e.iconColor),void 0!==e.overlayBackgroundColor&&(this.overlayBackgroundColor=e.overlayBackgroundColor),void 0!==e.timeout&&(this.timeout=e.timeout)}}class _e extends o.a{constructor(e={}){super(),this.version="1.0",this.screen="MrzScanner",this.localization=new Pe({}),this.palette=new r.j({}),this.backgroundColor="?sbColorSurfaceLow",this.cameraConfiguration=new P({}),this.cameraPermission=new L({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new r.i({visible:!0,color:"?sbColorOnSurface"}),closeButton:new r.e({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new r.p({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new r.p({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.topUserGuidance=new j.b({title:new r.p({text:"?topUserGuidance"})}),this.finderViewUserGuidance=new j.b({title:new r.p({text:"?finderViewUserGuidance"})}),this.topBar=new W.a({title:new r.p({visible:!0,text:"?topBarTitle"}),cancelButton:new r.e({text:"?topBarCancelButton",accessibilityDescription:"?accessibilityDescriptionCancelButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})})}),this.topBarOpenIntroScreenButton=new r.h({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionOpenIntroScreenButton"}),this.introScreen=new ke.e({}),this.actionBar=new I({flipCameraButton:new r.m({visible:!1,accessibilityDescription:"?accessibilityDescriptionFlipCameraButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"})}),this.viewFinder=new F({style:new N({strokeColor:"?sbColorSurface",strokeWidth:2}),aspectRatio:new T.a({width:-1,height:-1}),minimumInsets:new r.f({top:24,left:24,bottom:24,right:24})}),this.scannerConfiguration=new Oe.MrzScannerConfiguration({}),this.mrzExampleOverlay=new Be({}),this.successOverlay=new Le({}),this.sound=new r.n({}),this.vibration=new r.r({}),void 0!==e.version&&(this.version=e.version),void 0!==e.screen&&(this.screen=e.screen),void 0!==e.localization&&(this.localization=new Pe(e.localization)),void 0!==e.palette&&(this.palette=new r.j(e.palette)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new P(e.cameraConfiguration)),void 0!==e.cameraPermission&&(this.cameraPermission=new L(e.cameraPermission)),void 0!==e.topUserGuidance&&(this.topUserGuidance=new j.b(e.topUserGuidance)),void 0!==e.finderViewUserGuidance&&(this.finderViewUserGuidance=new j.b(e.finderViewUserGuidance)),void 0!==e.topBar&&(this.topBar=new W.a(e.topBar)),void 0!==e.topBarOpenIntroScreenButton&&(this.topBarOpenIntroScreenButton=new r.h(e.topBarOpenIntroScreenButton)),void 0!==e.introScreen&&(this.introScreen=new ke.e(e.introScreen)),void 0!==e.actionBar&&(this.actionBar=new I(e.actionBar)),void 0!==e.viewFinder&&(this.viewFinder=new F(e.viewFinder)),void 0!==e.scannerConfiguration&&(this.scannerConfiguration=new Oe.MrzScannerConfiguration(e.scannerConfiguration)),void 0!==e.mrzExampleOverlay&&(this.mrzExampleOverlay=xe.From(e.mrzExampleOverlay)),void 0!==e.successOverlay&&(this.successOverlay=new Le(e.successOverlay)),void 0!==e.sound&&(this.sound=new r.n(e.sound)),void 0!==e.vibration&&(this.vibration=new r.r(e.vibration))}}var Re=n(78),Me=n(79);const Fe=["DARK","LIGHT","HIDDEN"]},function(e,t,n){const{render:i,hydrate:r,unmountComponentAtNode:o}=n(0);function a(e){return{render(t){i(t,e)},unmount(){o(e)}}}t.createRoot=a,t.hydrateRoot=function(e,t){return r(t,e),a(e)}},function(e,t,n){"use strict";n.d(t,"g",(function(){return a})),n.d(t,"f",(function(){return i})),n.d(t,"j",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"k",(function(){return u})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"a",(function(){return m})),n.d(t,"e",(function(){return h})),n.d(t,"b",(function(){return f})),n.d(t,"h",(function(){return p}));var i,r=n(1),o=n(5);class a extends o.a{constructor(e={}){super(),this.image=new s({}),this.text=new r.p({text:"?cameraIntroDescription",color:"?sbColorOnSurface"}),void 0!==e.image&&(this.image=i.From(e.image)),void 0!==e.text&&(this.text=new r.p(e.text))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"NoIntroImage":return new s(e);case"CustomImage":return new c(e);case"ReceiptsIntroImage":return new u(e);case"MedicalCertificateIntroImage":return new l(e);case"DocumentIntroImage":return new d(e);case"CheckIntroImage":return new m(e);case"IdCardIntroImage":return new h(e);case"CreditCardIntroImage":return new f(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class s extends o.a{constructor(e={}){super(),this._type="NoIntroImage"}}class c extends o.a{constructor(e={}){if(super(),this._type="CustomImage",void 0===e.uri)throw new Error("uri must be present in constructor argument");this.uri=e.uri}}class u extends o.a{constructor(e={}){super(),this._type="ReceiptsIntroImage"}}class l extends o.a{constructor(e={}){super(),this._type="MedicalCertificateIntroImage"}}class d extends o.a{constructor(e={}){super(),this._type="DocumentIntroImage"}}class m extends o.a{constructor(e={}){super(),this._type="CheckIntroImage"}}class h extends o.a{constructor(e={}){super(),this._type="IdCardIntroImage"}}class f extends o.a{constructor(e={}){super(),this._type="CreditCardIntroImage"}}class p extends o.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.showAutomatically=!1,this.topBarDoneButton=new r.e({visible:!0,text:"?cameraIntroDoneButton",accessibilityDescription:"?accessibilityDescriptionCameraIntroDoneButton",background:new r.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new r.g({iconVisible:!0,color:"?sbColorPrimary",useShadow:!1})}),this.title=new r.p({text:"?cameraIntroTitle",color:"?sbColorOnSurface"}),this.subtitle=new r.p({text:"?cameraIntroSubtitle",color:"?sbColorOnSurface"}),this.items=[new a({image:new d({}),text:new r.p({text:"?cameraIntroItem1",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new r.p({text:"?cameraIntroItem2",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new r.p({text:"?cameraIntroItem3",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new r.p({text:"?cameraIntroItem4",color:"?sbColorOnSurface"})})],void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.showAutomatically&&(this.showAutomatically=e.showAutomatically),void 0!==e.topBarDoneButton&&(this.topBarDoneButton=new r.e(e.topBarDoneButton)),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.subtitle&&(this.subtitle=new r.p(e.subtitle)),void 0!==e.items&&(this.items=e.items.map((e=>new a(e))))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{static initialize(e=!1){this.verbose=e}static debug(e){this.verbose&&console.log("ScanbotSDK:",e)}static debugWarn(e){this.verbose&&console.warn("ScanbotSDK:",e)}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u}));var i=n(32),r=n(19);const o=["UNKNOWN","CREW_MEMBER_CERTIFICATE","ID_CARD","PASSPORT","VISA","CH_DRIVING_LICENSE"];class a{constructor(e={}){if(this.success=!1,void 0!==e.success&&(this.success=e.success),void 0===e.rawMRZ)throw new Error("rawMRZ must be present in constructor argument");if(this.rawMRZ=e.rawMRZ,void 0===e.document)throw new Error("document must be present in constructor argument");this.document=null!=e.document?new r.f(e.document):null}}const s=["ACCEPT","REJECT"];class c{constructor(e={}){this.frameAccumulationConfiguration=new i.a({}),this.enableDetection=!0,this.incompleteResultHandling="REJECT",this.returnCrops=!1,void 0!==e.frameAccumulationConfiguration&&(this.frameAccumulationConfiguration=new i.a(e.frameAccumulationConfiguration)),void 0!==e.enableDetection&&(this.enableDetection=e.enableDetection),void 0!==e.incompleteResultHandling&&(this.incompleteResultHandling=e.incompleteResultHandling),void 0!==e.returnCrops&&(this.returnCrops=e.returnCrops)}}class u{constructor(e={}){this.incompleteResultHandling="ACCEPT",void 0!==e.incompleteResultHandling&&(this.incompleteResultHandling=e.incompleteResultHandling)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var i=n(17),r=n(20),o=n(3);function a(){const e=new r.BarcodeScannerScreenConfiguration;return e.viewFinder.overlayColor=Object(o.d)(e.viewFinder.overlayColor,e.palette),e.viewFinder.style.strokeColor=Object(o.d)(e.viewFinder.style.strokeColor,e.palette),e.viewFinder}class s extends i.a{constructor(e){super(e),this.finder=a(),this.userGuidance=function(){const e=new r.BarcodeScannerScreenConfiguration;return e.userGuidance.background.fillColor=Object(o.d)(e.userGuidance.background.fillColor,e.palette),e.userGuidance.title.color=Object(o.d)(e.userGuidance.title.color,e.palette),e.userGuidance.title.text=Object(o.e)(e.userGuidance.title.text,[],e.localization),e.userGuidance}()}static mapFinderConfiguration(e,t){var n,r;i.a.mapValuesDeep(null!==(n=t.finder)&&void 0!==n?n:{},e.finder),i.a.mapValuesDeep(null!==(r=t.userGuidance)&&void 0!==r?r:{},e.userGuidance)}}},,function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"f",(function(){return m}));var i=n(50),r=n(19),o=n(10),a=n(51);class s{constructor(e={}){if(this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,this.sizeScore=0,this.globalIndex=-1,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=e.rawBytes,void 0===e.rawBytesEncodings)throw new Error("rawBytesEncodings must be present in constructor argument");if(this.rawBytesEncodings=e.rawBytesEncodings.map((e=>new a.e(e))),void 0===e.structuredAppendInfo)throw new Error("structuredAppendInfo must be present in constructor argument");if(this.structuredAppendInfo=null!=e.structuredAppendInfo?new a.f(e.structuredAppendInfo):null,void 0!==e.format&&(this.format=e.format),void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadNormalized)throw new Error("quadNormalized must be present in constructor argument");if(this.quadNormalized=e.quadNormalized.map((e=>({x:e.x,y:e.y}))),void 0===e.extendedQuad)throw new Error("extendedQuad must be present in constructor argument");if(this.extendedQuad=e.extendedQuad.map((e=>({x:e.x,y:e.y}))),void 0===e.extendedQuadNormalized)throw new Error("extendedQuadNormalized must be present in constructor argument");if(this.extendedQuadNormalized=e.extendedQuadNormalized.map((e=>({x:e.x,y:e.y}))),void 0!==e.isUpsideDown&&(this.isUpsideDown=e.isUpsideDown),void 0!==e.sourceImage&&(this.sourceImage=null!=e.sourceImage?new o.a(e.sourceImage):null),void 0===e.upcEanExtension)throw new Error("upcEanExtension must be present in constructor argument");if(this.upcEanExtension=e.upcEanExtension,void 0!==e.isGS1Message&&(this.isGS1Message=e.isGS1Message),void 0!==e.isGS1CompositePart&&(this.isGS1CompositePart=e.isGS1CompositePart),void 0!==e.dataBarStackSize&&(this.dataBarStackSize=e.dataBarStackSize),void 0!==e.sizeScore&&(this.sizeScore=e.sizeScore),void 0===e.extractedDocument)throw new Error("extractedDocument must be present in constructor argument");this.extractedDocument=null!=e.extractedDocument?new r.f(e.extractedDocument):null,void 0!==e.globalIndex&&(this.globalIndex=e.globalIndex)}}const c=["LEGACY","NEXT_GEN_LOW_POWER","NEXT_GEN","NEXT_GEN_LOW_POWER_FAR_DISTANCE","NEXT_GEN_FAR_DISTANCE"],u=["LAST_VISIBLE","INTERPOLATE_BY_CAMERA"];class l{constructor(e={}){this.minConfirmationsStandaloneEAN=1,this.accumulationTime=500,this.removeUnconnectedResults=!0,this.method="INTERPOLATE_BY_CAMERA",void 0!==e.minConfirmationsStandaloneEAN&&(this.minConfirmationsStandaloneEAN=e.minConfirmationsStandaloneEAN),void 0!==e.accumulationTime&&(this.accumulationTime=e.accumulationTime),void 0!==e.removeUnconnectedResults&&(this.removeUnconnectedResults=e.removeUnconnectedResults),void 0!==e.method&&(this.method=e.method)}}class d{constructor(e={}){this.barcodeFormatConfigurations=[new i.j({})],this.extractedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.onlyAcceptDocuments=!1,this.returnBarcodeImage=!1,this.engineMode="NEXT_GEN_LOW_POWER",this.accumulationConfig=new l({}),this.optimizedForOverlays=!1,this.processingMode="AUTO",void 0!==e.barcodeFormatConfigurations&&(this.barcodeFormatConfigurations=e.barcodeFormatConfigurations.map((e=>i.n.From(e)))),void 0!==e.extractedDocumentFormats&&(this.extractedDocumentFormats=e.extractedDocumentFormats.map((e=>e))),void 0!==e.onlyAcceptDocuments&&(this.onlyAcceptDocuments=e.onlyAcceptDocuments),void 0!==e.returnBarcodeImage&&(this.returnBarcodeImage=e.returnBarcodeImage),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.accumulationConfig&&(this.accumulationConfig=new l(e.accumulationConfig)),void 0!==e.optimizedForOverlays&&(this.optimizedForOverlays=e.optimizedForOverlays),void 0!==e.processingMode&&(this.processingMode=e.processingMode)}}class m{constructor(e={}){if(void 0===e.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=e.barcodes.map((e=>new s(e))),void 0===e.success)throw new Error("success must be present in constructor argument");this.success=e.success}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));class i{constructor(e={}){if(void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start={x:e.start.x,y:e.start.y},void 0===e.end)throw new Error("end must be present in constructor argument");this.end={x:e.end.x,y:e.end.y}}}class r{constructor(e={}){if(void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start={x:e.start.x,y:e.start.y},void 0===e.end)throw new Error("end must be present in constructor argument");this.end={x:e.end.x,y:e.end.y}}}class o{constructor(e={}){this.width=1,this.height=1,void 0!==e.width&&(this.width=e.width),void 0!==e.height&&(this.height=e.height)}}},function(e,t,n){"use strict";n.d(t,"d",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));var i=n(10);const r=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"];class o{constructor(e={}){if(void 0===e.symbolQuality)throw new Error("symbolQuality must be present in constructor argument");if(this.symbolQuality=e.symbolQuality,void 0===e.symbolRatio)throw new Error("symbolRatio must be present in constructor argument");this.symbolRatio=e.symbolRatio}}class a{constructor(e={}){this.qualityThresholds=[new o({symbolQuality:.5,symbolRatio:.5}),new o({symbolQuality:.7,symbolRatio:.3}),new o({symbolQuality:.85,symbolRatio:.3}),new o({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.detectOrientation=!1,this.inspectSmallText=!1,this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,this.returnQualityHeatmap=!1,void 0!==e.qualityThresholds&&(this.qualityThresholds=e.qualityThresholds.map((e=>new o(e)))),void 0!==e.qualityIndices&&(this.qualityIndices=e.qualityIndices.map((e=>e))),void 0!==e.detectOrientation&&(this.detectOrientation=e.detectOrientation),void 0!==e.inspectSmallText&&(this.inspectSmallText=e.inspectSmallText),void 0!==e.maxImageSize&&(this.maxImageSize=e.maxImageSize),void 0!==e.minEstimatedNumberOfSymbolsForDocument&&(this.minEstimatedNumberOfSymbolsForDocument=e.minEstimatedNumberOfSymbolsForDocument),void 0!==e.minProcessedFraction&&(this.minProcessedFraction=e.minProcessedFraction),void 0!==e.maxProcessedFraction&&(this.maxProcessedFraction=e.maxProcessedFraction),void 0!==e.earlyStopIfNSymbolsFound&&(this.earlyStopIfNSymbolsFound=e.earlyStopIfNSymbolsFound),void 0!==e.tileSize&&(this.tileSize=e.tileSize),void 0!==e.returnQualityHeatmap&&(this.returnQualityHeatmap=e.returnQualityHeatmap)}}class s{constructor(e={}){if(this.qualityHeatmap=null,void 0===e.documentFound)throw new Error("documentFound must be present in constructor argument");if(this.documentFound=e.documentFound,void 0===e.quality)throw new Error("quality must be present in constructor argument");if(this.quality=null!=e.quality&&r.includes(e.quality)?e.quality:null,void 0===e.orientation)throw new Error("orientation must be present in constructor argument");if(this.orientation=null!=e.orientation?e.orientation:null,void 0===e.cumulativeQualityHistogram)throw new Error("cumulativeQualityHistogram must be present in constructor argument");if(this.cumulativeQualityHistogram=e.cumulativeQualityHistogram.map((e=>e)),void 0===e.cumulativeContrastHistogram)throw new Error("cumulativeContrastHistogram must be present in constructor argument");if(this.cumulativeContrastHistogram=e.cumulativeContrastHistogram.map((e=>e)),void 0===e.cumulativeTextSizeHistogram)throw new Error("cumulativeTextSizeHistogram must be present in constructor argument");this.cumulativeTextSizeHistogram=e.cumulativeTextSizeHistogram.map((e=>e)),void 0!==e.qualityHeatmap&&(this.qualityHeatmap=null!=e.qualityHeatmap?new i.a(e.qualityHeatmap):null)}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"f",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"e",(function(){return u}));class i{constructor(e={}){if(this.recognitionConfidence=0,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.boundingRect)throw new Error("boundingRect must be present in constructor argument");this.boundingRect={x:e.boundingRect.x,y:e.boundingRect.y,width:e.boundingRect.width,height:e.boundingRect.height},void 0!==e.recognitionConfidence&&(this.recognitionConfidence=e.recognitionConfidence)}}class r{constructor(e={}){if(void 0===e.symbol)throw new Error("symbol must be present in constructor argument");if(this.symbol=e.symbol,void 0===e.boundingRect)throw new Error("boundingRect must be present in constructor argument");if(this.boundingRect={x:e.boundingRect.x,y:e.boundingRect.y,width:e.boundingRect.width,height:e.boundingRect.height},void 0===e.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=e.recognitionConfidence}}class o{constructor(e={}){if(this.confidence=0,this.validationSuccessful=!1,void 0===e.rawText)throw new Error("rawText must be present in constructor argument");if(this.rawText=e.rawText,void 0===e.wordBoxes)throw new Error("wordBoxes must be present in constructor argument");if(this.wordBoxes=e.wordBoxes.map((e=>new i(e))),void 0===e.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=e.symbolBoxes.map((e=>new r(e))),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful)}}var a;!function(e){e.From=function(e){const t=e._type;switch(t){case"DefaultContentValidator":return new s(e);case"PatternContentValidator":return new c(e);default:throw`Unknown child class name: ${t}`}}}(a||(a={}));class s{constructor(e={}){this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters)}}class c{constructor(e={}){if(this._type="PatternContentValidator",this.allowedCharacters="",this.matchSubstring=!1,void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters),void 0===e.pattern)throw new Error("pattern must be present in constructor argument");this.pattern=e.pattern,void 0!==e.matchSubstring&&(this.matchSubstring=e.matchSubstring)}}class u{constructor(e={}){this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.validator=new s({}),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult),void 0!==e.validator&&(this.validator=a.From(e.validator))}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o}));const i=["EXACT","INTERPOLATE"];class r{constructor(e={}){this.confirmationMethod="EXACT",this.minConfirmations=3,this.minConfidenceForStableField=.8,this.autoClearThreshold=4,void 0!==e.confirmationMethod&&(this.confirmationMethod=e.confirmationMethod),void 0!==e.minConfirmations&&(this.minConfirmations=e.minConfirmations),void 0!==e.minConfidenceForStableField&&(this.minConfidenceForStableField=e.minConfidenceForStableField),void 0!==e.autoClearThreshold&&(this.autoClearThreshold=e.autoClearThreshold)}}class o{constructor(e={}){this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u}));var i=n(0),r=n(14),o=n(56),a=n(58),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class c extends r.a{}r.b;class u extends r.c{constructor(e){super(e),this.paused=!1,Object.assign(this.state,{isFinderVisible:!0})}componentDidMount(){super.componentDidMount(),this.resumeDetection(),this.detect()}componentWillUnmount(){super.componentWillUnmount(),this.pauseDetection()}resumeDetection(){this.paused=!1}pauseDetection(){this.paused=!0}isDetectionPaused(){return this.paused}detect(){return s(this,void 0,void 0,(function*(){throw new Error("'detect' method needs to be overridden.")}))}renderView(e){var t;return i.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null==e?void 0:e.spinnerColor),i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},i.default.createElement(a.a,{configuration:e,videoConstraints:e.videoConstraints,mirrored:e.mirrored,preferredCamera:e.preferredCamera,zoom:null!==(t=this.state.zoom)&&void 0!==t?t:e.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&i.default.createElement(o.a,{ref:e=>{this.finder=e},guidanceConfiguration:e.userGuidance,configuration:e.finder}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(11);class r{constructor(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}scaleDown(e){return new r(this.x/e,this.y/e,this.width/e,this.height/e)}bottom(){return this.y+this.height}size(){return new i.a(this.width,this.height)}static withSize(e,t){return new r(0,0,e,t)}static empty(){return new r(0,0,0,0)}static fromRect(e){return e?new r(e.x,e.y,e.width,e.height):r.empty()}static fromPoint(e,t){return new r(e.x-t/2,e.y-t/2,t,t)}static fromDOMRect(e){return new r(e.x,e.y,e.width,e.height)}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"i",(function(){return o})),n.d(t,"j",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return d})),n.d(t,"k",(function(){return m})),n.d(t,"h",(function(){return h}));const i=["BINARY","ANTIALIASED"],r=["PRESET_1","PRESET_2","PRESET_3","PRESET_4","PRESET_5"];var o;!function(e){e.From=function(e){const t=e._type;switch(t){case"ScanbotBinarizationFilter":return new a(e);case"CustomBinarizationFilter":return new s(e);case"ColorDocumentFilter":return new c(e);case"BrightnessFilter":return new u(e);case"ContrastFilter":return new l(e);case"GrayscaleFilter":return new d(e);case"WhiteBlackPointFilter":return new m(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={}));class a{constructor(e={}){this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class s{constructor(e={}){this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==e.outputMode&&(this.outputMode=e.outputMode),void 0!==e.denoise&&(this.denoise=e.denoise),void 0!==e.radius&&(this.radius=e.radius),void 0!==e.preset&&(this.preset=e.preset)}}class c{constructor(e={}){this._type="ColorDocumentFilter"}}class u{constructor(e={}){this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class l{constructor(e={}){this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class d{constructor(e={}){this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==e.borderWidthFraction&&(this.borderWidthFraction=e.borderWidthFraction),void 0!==e.blackOutliersFraction&&(this.blackOutliersFraction=e.blackOutliersFraction),void 0!==e.whiteOutliersFraction&&(this.whiteOutliersFraction=e.whiteOutliersFraction)}}class m{constructor(e={}){this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==e.blackPoint&&(this.blackPoint=e.blackPoint),void 0!==e.whitePoint&&(this.whitePoint=e.whitePoint)}}const h=["DISABLED","ENABLED","ENABLED_IF_BINARIZATION_FILTER_SET"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var i=n(1),r=n(5);class o extends r.a{constructor(e={}){super(),this.title=new i.p({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new i.e({text:"Cancel",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.g({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new i.p(e.title)),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cancelButton&&(this.cancelButton=new i.e(e.cancelButton))}}const a=["SOLID","GRADIENT","HIDDEN"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u}));var i=n(15),r=n(19),o=n(10);const a=["DISABLED","DETECT_DOCUMENT","DETECT_AND_CROP_DOCUMENT"],s=["SUCCESS","INCOMPLETE_VALIDATION","ERROR_NOTHING_FOUND"];class c{constructor(e={}){if(this.status="ERROR_NOTHING_FOUND",this.croppedImage=null,void 0!==e.status&&(this.status=e.status),void 0===e.check)throw new Error("check must be present in constructor argument");if(this.check=null!=e.check?new r.f(e.check):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");this.documentDetectionResult=null!=e.documentDetectionResult?new i.a(e.documentDetectionResult):null,void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?new o.a(e.croppedImage):null)}}class u{constructor(e={}){this.documentDetectionMode="DISABLED",this.processingMode="AUTO",void 0!==e.documentDetectionMode&&(this.documentDetectionMode=e.documentDetectionMode),void 0!==e.processingMode&&(this.processingMode=e.processingMode)}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var i=n(19),r=n(32);const o=["SUCCESS","ERROR_NOTHING_FOUND","INCOMPLETE"];class a{constructor(e={}){if(void 0===e.detectionStatus)throw new Error("detectionStatus must be present in constructor argument");if(this.detectionStatus=e.detectionStatus,void 0===e.scanningStatus)throw new Error("scanningStatus must be present in constructor argument");if(this.scanningStatus=e.scanningStatus,void 0===e.creditCard)throw new Error("creditCard must be present in constructor argument");if(this.creditCard=null!=e.creditCard?new i.f(e.creditCard):null,void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.quadNormalized)throw new Error("quadNormalized must be present in constructor argument");this.quadNormalized=e.quadNormalized.map((e=>({x:e.x,y:e.y})))}}class s{constructor(e={}){this.useDocumentDetector=!0,this.requireExpiryDate=!0,this.requireCardholderName=!0,this.resultAccumulationConfig=new r.c({}),this.returnCreditCardImage=!1,this.processingMode="AUTO",void 0!==e.useDocumentDetector&&(this.useDocumentDetector=e.useDocumentDetector),void 0!==e.requireExpiryDate&&(this.requireExpiryDate=e.requireExpiryDate),void 0!==e.requireCardholderName&&(this.requireCardholderName=e.requireCardholderName),void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new r.c(e.resultAccumulationConfig)),void 0!==e.returnCreditCardImage&&(this.returnCreditCardImage=e.returnCreditCardImage),void 0!==e.processingMode&&(this.processingMode=e.processingMode)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return s}));var i=n(31);const r=["SUCCESS","BARCODE_WITHOUT_VIN","NO_BARCODE_FOUND","BARCODE_EXTRACTION_DISABLED"];class o{constructor(e={}){if(void 0===e.extractedVIN)throw new Error("extractedVIN must be present in constructor argument");if(this.extractedVIN=e.extractedVIN,void 0===e.rectangle)throw new Error("rectangle must be present in constructor argument");if(this.rectangle=e.rectangle.map((e=>({x:e.x,y:e.y}))),void 0===e.status)throw new Error("status must be present in constructor argument");this.status=e.status}}class a{constructor(e={}){if(void 0===e.textResult)throw new Error("textResult must be present in constructor argument");if(this.textResult=new i.f(e.textResult),void 0===e.barcodeResult)throw new Error("barcodeResult must be present in constructor argument");this.barcodeResult=new o(e.barcodeResult)}}class s{constructor(e={}){this.extractVINFromBarcode=!1,this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,void 0!==e.extractVINFromBarcode&&(this.extractVINFromBarcode=e.extractVINFromBarcode),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult)}}},function(e,t,n){"use strict";n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"e",(function(){return u}));var i,r=n(1),o=n(5);!function(e){e.From=function(e){const t=e._type;switch(t){case"MrzIntroDefaultImage":return new a(e);case"MrzIntroNoImage":return new s(e);case"MrzIntroCustomImage":return new c(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class a extends o.a{constructor(e={}){super(),this._type="MrzIntroDefaultImage"}}class s extends o.a{constructor(e={}){super(),this._type="MrzIntroNoImage"}}class c extends o.a{constructor(e={}){if(super(),this._type="MrzIntroCustomImage",void 0===e.uri)throw new Error("uri must be present in constructor argument");this.uri=e.uri}}class u extends o.a{constructor(e={}){super(),this.image=new a({}),this.backgroundColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.handlerColor="?sbColorOutline",this.showAutomatically=!1,this.title=new r.p({text:"?introScreenTitle",color:"?sbColorOnSurface"}),this.text=new r.p({text:"?introScreenText",color:"?sbColorOnSurface"}),this.doneButton=new r.e({text:"?introScreenDoneButton",accessibilityDescription:"?accessibilityDescriptionIntroScreenDoneButton",background:new r.a({strokeColor:"#00000000",fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new r.g({color:"?sbColorOnPrimary"})}),void 0!==e.image&&(this.image=i.From(e.image)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.handlerColor&&(this.handlerColor=e.handlerColor),void 0!==e.showAutomatically&&(this.showAutomatically=e.showAutomatically),void 0!==e.title&&(this.title=new r.p(e.title)),void 0!==e.text&&(this.text=new r.p(e.text)),void 0!==e.doneButton&&(this.doneButton=new r.e(e.doneButton))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(18),r=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class o{static get INSTANCE(){return o._INSTANCE||(o._INSTANCE=new o),o._INSTANCE}constructor(){this.listOfCameras=[],this.strategy="FAST_DEFERRED"}initialize(e){if(e&&(this.strategy=e),"SLOW"===e||"FAST"===e){const t=e;this.load(t)}}load(e){return r(this,void 0,void 0,(function*(){if(!e)if("SLOW_DEFERRED"===this.strategy||"SLOW"===this.strategy)e="SLOW";else if("FAST_DEFERRED"===this.strategy||"FAST"===this.strategy)e="FAST";else if("NONE"===this.strategy)return this.listOfCameras;let t;if("SLOW"===e)t=this.loadSlow();else{if("FAST"!==e)throw new Error(`Unknown mode ${e}`);t=this.loadFast()}try{return this.listOfCameras=yield t,this.listOfCameras}catch(e){throw this.loadSlowResult=void 0,i.a.createFromDOMException(e)}}))}loadSlow(){return this.loadSlowResult=this.loadSlowResult||(()=>r(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){let n;try{n=yield this.getUserMedia({video:{deviceId:t.deviceId}}),e.push(o.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((e=>setTimeout(e,0)))}}return e})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>r(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){const n=o.guessparseCameraLabelFacingMode(t.label),i=o.guessparseCameraLabelMaxNumPixels(t.label);e.push({maxNumPixels:i,facingMode:n,supportsTorchControl:void 0,deviceId:t.deviceId,label:t.label})}return e})))(),this.loadFastResult}getMainCamera(e){var t,n,i,r,o,a;return null!==(a=null===(o=null===(r=null===(i=null===(n=null===(t=this.listOfCameras)||void 0===t?void 0:t.filter((t=>t.facingMode===e)))||void 0===n?void 0:n.map(((e,t)=>({camera:e,index:t}))))||void 0===i?void 0:i.sort(((e,t)=>{var n;return-(+e.camera.supportsTorchControl||0)-(+t.camera.supportsTorchControl||0)||-((e.camera.maxNumPixels||0)-(t.camera.maxNumPixels||0))||(null===(n=e.camera.label)||void 0===n?void 0:n.localeCompare(t.camera.label))||e.index-t.index})))||void 0===r?void 0:r[0])||void 0===o?void 0:o.camera)&&void 0!==a?a:null}getVideoDevices(){return r(this,void 0,void 0,(function*(){let e=yield navigator.mediaDevices.enumerateDevices();if(e=e.filter((e=>"videoinput"===e.kind)),e.some((e=>""===e.label))){let t;try{t=yield this.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1}),e=yield navigator.mediaDevices.enumerateDevices(),e=e.filter((e=>"videoinput"===e.kind))}finally{this.stopStream(t)}}return e}))}stopStream(e){null==e||e.getTracks().forEach((e=>e.stop()))}static guessparseCameraLabelFacingMode(e){return function(e){const t=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];for(const n of t)if(e.toLowerCase().includes(n.toLowerCase()))return!0;return!1}(e)?"back":"front"}static guessparseCameraLabelMaxNumPixels(e){const t=RegExp(/\b([0-9]+)mp?\b/).exec(e.toLowerCase()),n=t?1e6*parseInt(t[1],10):NaN;return Number.isNaN(n)?void 0:n}assertPermissionsAreOk(){return r(this,void 0,void 0,(function*(){if(i.a.hasCheckedPermission()||(yield i.a.tryCheckPermission()),i.a.hasDeniedPermission())throw i.a.permissionDenied();if(!navigator.mediaDevices)throw i.a.unknown()}))}static getCameraInfoFromStream(e){var t;return null===(t=e.getVideoTracks().map((e=>{var t,n,i,r,o,a;const s=null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e),c=null===(n=e.getSettings)||void 0===n?void 0:n.call(e),u=e.label;let l=function(e){if("user"===(null==e?void 0:e.toLowerCase()))return"front";if("environment"===(null==e?void 0:e.toLowerCase()))return"back";return"unknown"}(null!==(r=null===(i=null==s?void 0:s.facingMode)||void 0===i?void 0:i[0])&&void 0!==r?r:c.facingMode);"unknown"===l&&(l=this.guessparseCameraLabelFacingMode(u));let d=function(e){var t,n;let i=(null===(t=null==e?void 0:e.width)||void 0===t?void 0:t.max)*(null===(n=null==e?void 0:e.height)||void 0===n?void 0:n.max);if(!i||Number.isNaN(i))return;return i}(s);Number.isNaN(d)&&(d=this.guessparseCameraLabelMaxNumPixels(u));return{facingMode:l,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(o=null==s?void 0:s.torch)&&void 0!==o?o:"torch"in c)&&void 0!==a&&a,label:u,deviceId:c.deviceId}})).sort(((e,t)=>t.maxNumPixels-e.maxNumPixels)))||void 0===t?void 0:t[0]}getUserMedia(e){return r(this,void 0,void 0,(function*(){try{return yield navigator.mediaDevices.getUserMedia(e)}catch(e){throw i.a.mediaDeviceNotFound()}}))}}},function(e,t,n){"use strict";(function(e){function i(e,t=!1){const n=[];if(t)return n;return function e(t){if(t)if(t.constructor===ImageData)n.push(t.data.buffer);else if(t.constructor===ArrayBuffer)n.push(t);else if(ArrayBuffer.isView(t))n.push(t.buffer);else if(Array.isArray(t))for(let n=0;n<t.length;++n)e(t[n]);else if("object"==typeof t)for(const n in t)t.hasOwnProperty(n)&&e(t[n])}(e),n}function r(e){return e.startsWith("http:")||e.startsWith("https:")}function o(){if("undefined"!=typeof e&&"undefined"!=typeof e.versions&&"undefined"!=typeof e.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(e){return!1}}function a(e){const{allowSimd:t=!0,allowThreads:n=!0}=e||{};let i="";if(t&&function(){try{const e=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11])),t=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0]));return e&&t}catch(e){return!1}}()){i+="-simd";n&&o()&&(i+="-threads")}return i}n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return a}))}).call(this,n(84))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return p}));class i extends Error{constructor(){super(...arguments),this.errorType="UnknownError"}}class r extends Error{constructor(){super(...arguments),this.errorType="InvalidLicense"}}class o extends Error{constructor(){super(...arguments),this.errorType="NullPointer"}}class a extends Error{constructor(){super(...arguments),this.errorType="InvalidArgument"}}class s extends Error{constructor(){super(...arguments),this.errorType="InvalidImageRef"}}class c extends Error{constructor(){super(...arguments),this.errorType="ComponentUnavailable"}}class u extends Error{constructor(){super(...arguments),this.errorType="IllegalState"}}class l extends Error{constructor(){super(...arguments),this.errorType="IoError"}}class d extends Error{constructor(){super(...arguments),this.errorType="InvalidData"}}class m extends Error{constructor(){super(...arguments),this.errorType="OperationCanceled"}}class h extends Error{constructor(){super(...arguments),this.errorType="OutOfMemory"}}class f extends Error{constructor(){super(...arguments),this.errorType="Timeout"}}function p(e,t,n){const p=n?{cause:n}:void 0;switch(e){case"UnknownError":return new i(t,p);case"InvalidLicense":return new r("Your license is not valid to use this feature of the ScanbotSDK. This can be because of one of the following reasons: \n 1) You did not successfully initialize the SDK with your license. \n 2) Your license expired \n 3) Your license does not allow the use of this feature of the ScanbotSDK",p);case"NullPointer":return new o(t,p);case"InvalidArgument":return new a(t,p);case"InvalidImageRef":return new s(t,p);case"ComponentUnavailable":return new c(t,p);case"IllegalState":return new u(t,p);case"IoError":return new l(t,p);case"InvalidData":return new d(t,p);case"OperationCanceled":return new m(t,p);case"OutOfMemory":return new h(t,p);case"Timeout":return new f(t,p);default:throw new Error(t)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return G})),n.d(t,"c",(function(){return ee})),n.d(t,"d",(function(){return ne})),n.d(t,"e",(function(){return te})),n.d(t,"f",(function(){return J})),n.d(t,"g",(function(){return $}));var i="-ms-",r="-moz-",o="-webkit-",a="comm",s="rule",c="decl",u="@keyframes",l=Math.abs,d=String.fromCharCode,m=Object.assign;function h(e){return e.trim()}function f(e,t){return(e=t.exec(e))?e[0]:e}function p(e,t,n){return e.replace(t,n)}function g(e,t,n){return e.indexOf(t,n)}function v(e,t){return 0|e.charCodeAt(t)}function y(e,t,n){return e.slice(t,n)}function C(e){return e.length}function b(e){return e.length}function A(e,t){return t.push(e),e}function S(e,t){return e.map(t).join("")}function w(e,t){return e.filter((function(e){return!f(e,t)}))}var E=1,D=1,x=0,B=0,I=0,T="";function O(e,t,n,i,r,o,a,s){return{value:e,root:t,parent:n,type:i,props:r,children:o,line:E,column:D,length:a,return:"",siblings:s}}function k(e,t){return m(O("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function P(e){for(;e.root;)e=k(e.root,{children:[e]});A(e,e.siblings)}function L(){return I=B<x?v(T,B++):0,D++,10===I&&(D=1,E++),I}function _(){return v(T,B)}function R(){return B}function M(e,t){return y(T,e,t)}function F(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function N(e){return E=D=1,x=C(T=e),B=0,[]}function V(e){return T="",e}function W(e){return h(M(B-1,H(91===e?e+2:40===e?e+1:e)))}function j(e){for(;(I=_())&&I<33;)L();return F(e)>2||F(I)>3?"":" "}function z(e,t){for(;--t&&L()&&!(I<48||I>102||I>57&&I<65||I>70&&I<97););return M(e,R()+(t<6&&32==_()&&32==L()))}function H(e){for(;L();)switch(I){case e:return B;case 34:case 39:34!==e&&39!==e&&H(I);break;case 40:41===e&&H(e);break;case 92:L()}return B}function U(e,t){for(;L()&&e+I!==57&&(e+I!==84||47!==_()););return"/*"+M(t,B-1)+"*"+d(47===e?e:L())}function Z(e){for(;!F(_());)L();return M(e,B)}function G(e){return V(Y("",null,null,null,[""],e=N(e),0,[0],e))}function Y(e,t,n,i,r,o,a,s,c){for(var u=0,m=0,h=a,f=0,y=0,b=0,S=1,w=1,x=1,O=0,k="",P=r,M=o,F=i,N=k;w;)switch(b=O,O=L()){case 40:if(108!=b&&58==v(N,h-1)){-1!=g(N+=p(W(O),"&","&\f"),"&\f",l(u?s[u-1]:0))&&(x=-1);break}case 34:case 39:case 91:N+=W(O);break;case 9:case 10:case 13:case 32:N+=j(b);break;case 92:N+=z(R()-1,7);continue;case 47:switch(_()){case 42:case 47:A(q(U(L(),R()),t,n,c),c);break;default:N+="/"}break;case 123*S:s[u++]=C(N)*x;case 125*S:case 59:case 0:switch(O){case 0:case 125:w=0;case 59+m:-1==x&&(N=p(N,/\f/g,"")),y>0&&C(N)-h&&A(y>32?X(N+";",i,n,h-1,c):X(p(N," ","")+";",i,n,h-2,c),c);break;case 59:N+=";";default:if(A(F=Q(N,t,n,u,m,r,s,k,P=[],M=[],h,o),o),123===O)if(0===m)Y(N,t,F,F,P,o,h,s,M);else switch(99===f&&110===v(N,3)?100:f){case 100:case 108:case 109:case 115:Y(e,F,F,i&&A(Q(e,F,F,0,0,r,s,k,r,P=[],h,M),M),r,M,h,s,i?P:M);break;default:Y(N,F,F,F,[""],M,0,s,M)}}u=m=y=0,S=x=1,k=N="",h=a;break;case 58:h=1+C(N),y=b;default:if(S<1)if(123==O)--S;else if(125==O&&0==S++&&125==(I=B>0?v(T,--B):0,D--,10===I&&(D=1,E--),I))continue;switch(N+=d(O),O*S){case 38:x=m>0?1:(N+="\f",-1);break;case 44:s[u++]=(C(N)-1)*x,x=1;break;case 64:45===_()&&(N+=W(L())),f=_(),m=h=C(k=N+=Z(R())),O++;break;case 45:45===b&&2==C(N)&&(S=0)}}return o}function Q(e,t,n,i,r,o,a,c,u,d,m,f){for(var g=r-1,v=0===r?o:[""],C=b(v),A=0,S=0,w=0;A<i;++A)for(var E=0,D=y(e,g+1,g=l(S=a[A])),x=e;E<C;++E)(x=h(S>0?v[E]+" "+D:p(D,/&\f/g,v[E])))&&(u[w++]=x);return O(e,t,n,0===r?s:c,u,d,m,f)}function q(e,t,n,i){return O(e,t,n,a,d(I),y(e,2,-2),0,i)}function X(e,t,n,i,r){return O(e,t,n,c,y(e,0,i),y(e,i+1,-1),i,r)}function K(e,t,n){switch(function(e,t){return 45^v(e,0)?(((t<<2^v(e,0))<<2^v(e,1))<<2^v(e,2))<<2^v(e,3):0}(e,t)){case 5103:return o+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return o+e+e;case 4789:return r+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return o+e+r+e+i+e+e;case 5936:switch(v(e,t+11)){case 114:return o+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return o+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return o+e+i+p(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return o+e+i+e+e;case 6165:return o+e+i+"flex-"+e+e;case 5187:return o+e+p(e,/(\w+).+(:[^]+)/,o+"box-$1$2"+i+"flex-$1$2")+e;case 5443:return o+e+i+"flex-item-"+p(e,/flex-|-self/g,"")+(f(e,/flex-|baseline/)?"":i+"grid-row-"+p(e,/flex-|-self/g,""))+e;case 4675:return o+e+i+"flex-line-pack"+p(e,/align-content|flex-|-self/g,"")+e;case 5548:return o+e+i+p(e,"shrink","negative")+e;case 5292:return o+e+i+p(e,"basis","preferred-size")+e;case 6060:return o+"box-"+p(e,"-grow","")+o+e+i+p(e,"grow","positive")+e;case 4554:return o+p(e,/([^-])(transform)/g,"$1"+o+"$2")+e;case 6187:return p(p(p(e,/(zoom-|grab)/,o+"$1"),/(image-set)/,o+"$1"),e,"")+e;case 5495:case 3959:return p(e,/(image-set\([^]*)/,o+"$1$`$1");case 4968:return p(p(e,/(.+:)(flex-)?(.*)/,o+"box-pack:$3"+i+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+o+e+e;case 4200:if(!f(e,/flex-|baseline/))return i+"grid-column-align"+y(e,t)+e;break;case 2592:case 3360:return i+p(e,"template-","")+e;case 4384:case 3616:return n&&n.some((function(e,n){return t=n,f(e.props,/grid-\w+-end/)}))?~g(e+(n=n[t].value),"span",0)?e:i+p(e,"-start","")+e+i+"grid-row-span:"+(~g(n,"span",0)?f(n,/\d+/):+f(n,/\d+/)-+f(e,/\d+/))+";":i+p(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return f(e.props,/grid-\w+-start/)}))?e:i+p(p(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return p(e,/(.+)-inline(.+)/,o+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(C(e)-1-t>6)switch(v(e,t+1)){case 109:if(45!==v(e,t+4))break;case 102:return p(e,/(.+:)(.+)-([^]+)/,"$1"+o+"$2-$3$1"+r+(108==v(e,t+3)?"$3":"$2-$3"))+e;case 115:return~g(e,"stretch",0)?K(p(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return p(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(t,n,r,o,a,s,c){return i+n+":"+r+c+(o?i+n+"-span:"+(a?s:+s-+r)+c:"")+e}));case 4949:if(121===v(e,t+6))return p(e,":",":"+o)+e;break;case 6444:switch(v(e,45===v(e,14)?18:11)){case 120:return p(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+o+(45===v(e,14)?"inline-":"")+"box$3$1"+o+"$2$3$1"+i+"$2box$3")+e;case 100:return p(e,":",":"+i)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return p(e,"scroll-","scroll-snap-")+e}return e}function J(e,t){for(var n="",i=0;i<e.length;i++)n+=t(e[i],i,e,t)||"";return n}function $(e,t,n,i){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case c:return e.return=e.return||e.value;case a:return"";case u:return e.return=e.value+"{"+J(e.children,i)+"}";case s:if(!C(e.value=e.props.join(",")))return""}return C(n=J(e.children,i))?e.return=e.value+"{"+n+"}":""}function ee(e){var t=b(e);return function(n,i,r,o){for(var a="",s=0;s<t;s++)a+=e[s](n,i,r,o)||"";return a}}function te(e){return function(t){t.root||(t=t.return)&&e(t)}}function ne(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case c:return void(e.return=K(e.value,e.length,n));case u:return J([k(e,{value:p(e.value,"@","@"+o)})],r);case s:if(e.length)return S(n=e.props,(function(t){switch(f(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":P(k(e,{props:[p(t,/:(read-\w+)/,":-moz-$1")]})),P(k(e,{props:[t]})),m(e,{props:w(n,r)});break;case"::placeholder":P(k(e,{props:[p(t,/:(plac\w+)/,":"+o+"input-$1")]})),P(k(e,{props:[p(t,/:(plac\w+)/,":-moz-$1")]})),P(k(e,{props:[p(t,/:(plac\w+)/,i+"input-$1")]})),P(k(e,{props:[t]})),m(e,{props:w(n,r)})}return""}))}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var i=n(6);function r(e,t,n){return Math.min(Math.max(e,t),n)}function o(e,t,n){return new i.a(r(e.x,-t/2,n.width-t/2),r(e.y,-t/2,n.height-t/2))}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Ge})),n.d(t,"b",(function(){return Ye}));var i=n(4),r=(n(89),n(0)),o=n(85),a=n.n(o),s=n(44),c=n(86),u="undefined"!=typeof e&&void 0!==e.env&&(e.env.REACT_APP_SC_ATTR||e.env.SC_ATTR)||"data-styled",l="active",d="data-styled-version",m="6.1.8",h="/*!sc*/\n",f="undefined"!=typeof window&&"HTMLElement"in window,p=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof e&&void 0!==e.env&&void 0!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==e.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&e.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof e&&void 0!==e.env&&void 0!==e.env.SC_DISABLE_SPEEDY&&""!==e.env.SC_DISABLE_SPEEDY&&("false"!==e.env.SC_DISABLE_SPEEDY&&e.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function y(e,t,n){return void 0===n&&(n=v),e.theme!==n.theme&&e.theme||t||n.theme}var C=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),b=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,A=/(^-|-$)/g;function S(e){return e.replace(b,"-").replace(A,"")}var w=/(a)(d)/gi,E=function(e){return String.fromCharCode(e+(e>25?39:97))};function D(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=E(t%52)+n;return(E(t%52)+n).replace(w,"$1-$2")}var x,B=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},I=function(e){return B(5381,e)};function T(e){return D(I(e)>>>0)}function O(e){return e.displayName||e.name||"Component"}function k(e){return"string"==typeof e&&!0}var P="function"==typeof Symbol&&Symbol.for,L=P?Symbol.for("react.memo"):60115,_=P?Symbol.for("react.forward_ref"):60112,R={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},M={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},F={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},N=((x={})[_]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},x[L]=F,x);function V(e){return("type"in(t=e)&&t.type.$$typeof)===L?F:"$$typeof"in e?N[e.$$typeof]:R;var t}var W=Object.defineProperty,j=Object.getOwnPropertyNames,z=Object.getOwnPropertySymbols,H=Object.getOwnPropertyDescriptor,U=Object.getPrototypeOf,Z=Object.prototype;function G(e,t,n){if("string"!=typeof t){if(Z){var i=U(t);i&&i!==Z&&G(e,i,n)}var r=j(t);z&&(r=r.concat(z(t)));for(var o=V(e),a=V(t),s=0;s<r.length;++s){var c=r[s];if(!(c in M||n&&n[c]||a&&c in a||o&&c in o)){var u=H(t,c);try{W(e,c,u)}catch(e){}}}}return e}function Y(e){return"function"==typeof e}function Q(e){return"object"==typeof e&&"styledComponentId"in e}function q(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function X(e,t){if(0===e.length)return"";for(var n=e[0],i=1;i<e.length;i++)n+=t?t+e[i]:e[i];return n}function K(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function J(e,t,n){if(void 0===n&&(n=!1),!n&&!K(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var i=0;i<t.length;i++)e[i]=J(e[i],t[i]);else if(K(t))for(var i in t)e[i]=J(e[i],t[i]);return e}function $(e,t){Object.defineProperty(e,"toString",{value:t})}function ee(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):""))}var te=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,r=i;e>=r;)if((r<<=1)<0)throw ee(16,"".concat(e));this.groupSizes=new Uint32Array(r),this.groupSizes.set(n),this.length=r;for(var o=i;o<r;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(e+1),s=(o=0,t.length);o<s;o++)this.tag.insertRule(a,t[o])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),i=n+t;this.groupSizes[e]=0;for(var r=n;r<i;r++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),r=i+n,o=i;o<r;o++)t+="".concat(this.tag.getRule(o)).concat(h);return t},e}(),ne=new Map,ie=new Map,re=1,oe=function(e){if(ne.has(e))return ne.get(e);for(;ie.has(re);)re++;var t=re++;return ne.set(e,t),ie.set(t,e),t},ae=function(e,t){re=t+1,ne.set(e,t),ie.set(t,e)},se="style[".concat(u,"][").concat(d,'="').concat(m,'"]'),ce=new RegExp("^".concat(u,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ue=function(e,t,n){for(var i,r=n.split(","),o=0,a=r.length;o<a;o++)(i=r[o])&&e.registerName(t,i)},le=function(e,t){for(var n,i=(null!==(n=t.textContent)&&void 0!==n?n:"").split(h),r=[],o=0,a=i.length;o<a;o++){var s=i[o].trim();if(s){var c=s.match(ce);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(ae(l,u),ue(e,l,c[3]),e.getTag().insertRules(u,r)),r.length=0}else r.push(s)}}};function de(){return n.nc}var me=function(e){var t=document.head,n=e||t,i=document.createElement("style"),r=function(e){var t=Array.from(e.querySelectorAll("style[".concat(u,"]")));return t[t.length-1]}(n),o=void 0!==r?r.nextSibling:null;i.setAttribute(u,l),i.setAttribute(d,m);var a=de();return a&&i.setAttribute("nonce",a),n.insertBefore(i,o),i},he=function(){function e(e){this.element=me(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,i=t.length;n<i;n++){var r=t[n];if(r.ownerNode===e)return r}throw ee(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),fe=function(){function e(e){this.element=me(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),pe=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),ge=f,ve={isServer:!f,useCSSOMInjection:!p},ye=function(){function e(e,t,n){void 0===e&&(e=v),void 0===t&&(t={});var r=this;this.options=Object(i.a)(Object(i.a)({},ve),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&f&&ge&&(ge=!1,function(e){for(var t=document.querySelectorAll(se),n=0,i=t.length;n<i;n++){var r=t[n];r&&r.getAttribute(u)!==l&&(le(e,r),r.parentNode&&r.parentNode.removeChild(r))}}(this)),$(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,i="",r=function(n){var r=function(e){return ie.get(e)}(n);if(void 0===r)return"continue";var o=e.names.get(r),a=t.getGroup(n);if(void 0===o||0===a.length)return"continue";var s="".concat(u,".g").concat(n,'[id="').concat(r,'"]'),c="";void 0!==o&&o.forEach((function(e){e.length>0&&(c+="".concat(e,","))})),i+="".concat(a).concat(s,'{content:"').concat(c,'"}').concat(h)},o=0;o<n;o++)r(o);return i}(r)}))}return e.registerId=function(e){return oe(e)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(Object(i.a)(Object(i.a)({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new pe(n):t?new he(n):new fe(n)}(this.options),new te(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(oe(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(oe(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(oe(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Ce=/&/g,be=/^\s*\/\/.*$/gm;function Ae(e,t){return e.map((function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map((function(e){return"".concat(t," ").concat(e)}))),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=Ae(e.children,t)),e}))}function Se(e){var t,n,i,r=void 0===e?v:e,o=r.options,a=void 0===o?v:o,c=r.plugins,u=void 0===c?g:c,l=function(e,i,r){return r.startsWith(n)&&r.endsWith(n)&&r.replaceAll(n,"").length>0?".".concat(t):e},d=u.slice();d.push((function(e){e.type===s.a&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Ce,n).replace(i,l))})),a.prefix&&d.push(s.d),d.push(s.g);var m=function(e,r,o,c){void 0===r&&(r=""),void 0===o&&(o=""),void 0===c&&(c="&"),t=c,n=r,i=new RegExp("\\".concat(n,"\\b"),"g");var u=e.replace(be,""),l=s.b(o||r?"".concat(o," ").concat(r," { ").concat(u," }"):u);a.namespace&&(l=Ae(l,a.namespace));var m=[];return s.f(l,s.c(d.concat(s.e((function(e){return m.push(e)}))))),m};return m.hash=u.length?u.reduce((function(e,t){return t.name||ee(15),B(e,t.name)}),5381).toString():"",m}var we=new ye,Ee=Se(),De=r.default.createContext({shouldForwardProp:void 0,styleSheet:we,stylis:Ee}),xe=(De.Consumer,r.default.createContext(void 0));function Be(){return Object(r.useContext)(De)}function Ie(e){var t=Object(r.useState)(e.stylisPlugins),n=t[0],i=t[1],o=Be().styleSheet,s=Object(r.useMemo)((function(){var t=o;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target,o]),c=Object(r.useMemo)((function(){return Se({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);Object(r.useEffect)((function(){a()(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]);var u=Object(r.useMemo)((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:s,stylis:c}}),[e.shouldForwardProp,s,c]);return r.default.createElement(De.Provider,{value:u},r.default.createElement(xe.Provider,{value:c},e.children))}var Te=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ee);var i=n.name+t.hash;e.hasNameForId(n.id,i)||e.insertRules(n.id,i,t(n.rules,i,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,$(this,(function(){throw ee(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=Ee),this.name+e.hash},e}(),Oe=function(e){return e>="A"&&e<="Z"};function ke(e){for(var t="",n=0;n<e.length;n++){var i=e[n];if(1===n&&"-"===i&&"-"===e[0])return e;Oe(i)?t+="-"+i.toLowerCase():t+=i}return t.startsWith("ms-")?"-"+t:t}var Pe=function(e){return null==e||!1===e||""===e},Le=function(e){var t,n,r=[];for(var o in e){var a=e[o];e.hasOwnProperty(o)&&!Pe(a)&&(Array.isArray(a)&&a.isCss||Y(a)?r.push("".concat(ke(o),":"),a,";"):K(a)?r.push.apply(r,Object(i.e)(Object(i.e)(["".concat(o," {")],Le(a),!1),["}"],!1)):r.push("".concat(ke(o),": ").concat((t=o,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in c.a||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function _e(e,t,n,i){return Pe(e)?[]:Q(e)?[".".concat(e.styledComponentId)]:Y(e)?!Y(r=e)||r.prototype&&r.prototype.isReactComponent||!t?[e]:_e(e(t),t,n,i):e instanceof Te?n?(e.inject(n,i),[e.getName(i)]):[e]:K(e)?Le(e):Array.isArray(e)?Array.prototype.concat.apply(g,e.map((function(e){return _e(e,t,n,i)}))):[e.toString()];var r}function Re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Y(n)&&!Q(n))return!1}return!0}var Me=I(m),Fe=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Re(e),this.componentId=t,this.baseHash=B(Me,t),this.baseStyle=n,ye.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))i=q(i,this.staticRulesId);else{var r=X(_e(this.rules,e,t,n)),o=D(B(this.baseHash,r)>>>0);if(!t.hasNameForId(this.componentId,o)){var a=n(r,".".concat(o),void 0,this.componentId);t.insertRules(this.componentId,o,a)}i=q(i,o),this.staticRulesId=o}else{for(var s=B(this.baseHash,n.hash),c="",u=0;u<this.rules.length;u++){var l=this.rules[u];if("string"==typeof l)c+=l;else if(l){var d=X(_e(l,e,t,n));s=B(s,d+u),c+=d}}if(c){var m=D(s>>>0);t.hasNameForId(this.componentId,m)||t.insertRules(this.componentId,m,n(c,".".concat(m),void 0,this.componentId)),i=q(i,m)}}return i},e}(),Ne=r.default.createContext(void 0);Ne.Consumer;var Ve={};new Set;function We(e,t,n){var o=Q(e),a=e,s=!k(e),c=t.attrs,u=void 0===c?g:c,l=t.componentId,d=void 0===l?function(e,t){var n="string"!=typeof e?"sc":S(e);Ve[n]=(Ve[n]||0)+1;var i="".concat(n,"-").concat(T(m+n+Ve[n]));return t?"".concat(t,"-").concat(i):i}(t.displayName,t.parentComponentId):l,h=t.displayName,f=void 0===h?function(e){return k(e)?"styled.".concat(e):"Styled(".concat(O(e),")")}(e):h,p=t.displayName&&t.componentId?"".concat(S(t.displayName),"-").concat(t.componentId):t.componentId||d,b=o&&a.attrs?a.attrs.concat(u).filter(Boolean):u,A=t.shouldForwardProp;if(o&&a.shouldForwardProp){var w=a.shouldForwardProp;if(t.shouldForwardProp){var E=t.shouldForwardProp;A=function(e,t){return w(e,t)&&E(e,t)}}else A=w}var D=new Fe(n,p,o?a.componentStyle:void 0);function x(e,t){return function(e,t,n){var o=e.attrs,a=e.componentStyle,s=e.defaultProps,c=e.foldedComponentIds,u=e.styledComponentId,l=e.target,d=r.default.useContext(Ne),m=Be(),h=e.shouldForwardProp||m.shouldForwardProp,f=y(t,d,s)||v,p=function(e,t,n){for(var r,o=Object(i.a)(Object(i.a)({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var s=Y(r=e[a])?r(o):r;for(var c in s)o[c]="className"===c?q(o[c],s[c]):"style"===c?Object(i.a)(Object(i.a)({},o[c]),s[c]):s[c]}return t.className&&(o.className=q(o.className,t.className)),o}(o,t,f),g=p.as||l,b={};for(var A in p)void 0===p[A]||"$"===A[0]||"as"===A||"theme"===A&&p.theme===f||("forwardedAs"===A?b.as=p.forwardedAs:h&&!h(A,g)||(b[A]=p[A]));var S=function(e,t){var n=Be();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(a,p),w=q(c,u);return S&&(w+=" "+S),p.className&&(w+=" "+p.className),b[k(g)&&!C.has(g)?"class":"className"]=w,b.ref=n,Object(r.createElement)(g,b)}(B,e,t)}x.displayName=f;var B=r.default.forwardRef(x);return B.attrs=b,B.componentStyle=D,B.displayName=f,B.shouldForwardProp=A,B.foldedComponentIds=o?q(a.foldedComponentIds,a.styledComponentId):"",B.styledComponentId=p,B.target=o?a.target:e,Object.defineProperty(B,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=o?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0,r=t;i<r.length;i++)J(e,r[i],!0);return e}({},a.defaultProps,e):e}}),$(B,(function(){return".".concat(B.styledComponentId)})),s&&G(B,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),B}function je(e,t){for(var n=[e[0]],i=0,r=t.length;i<r;i+=1)n.push(t[i],e[i+1]);return n}var ze=function(e){return Object.assign(e,{isCss:!0})};function He(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Y(e)||K(e))return ze(_e(je(g,Object(i.e)([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?_e(r):ze(_e(je(r,t)))}function Ue(e,t,n){if(void 0===n&&(n=v),!t)throw ee(1,t);var r=function(r){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,He.apply(void 0,Object(i.e)([r],o,!1)))};return r.attrs=function(r){return Ue(e,t,Object(i.a)(Object(i.a)({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return Ue(e,t,Object(i.a)(Object(i.a)({},n),r))},r}var Ze=function(e){return Ue(We,e)},Ge=Ze;C.forEach((function(e){Ge[e]=Ze(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Re(e),ye.registerId(this.componentId+1)}e.prototype.createStyles=function(e,t,n,i){var r=i(X(_e(this.rules,t,n,i)),""),o=this.componentId+e;n.insertRules(o,o,r)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,i){e>2&&ye.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,i)}}();function Ye(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=X(He.apply(void 0,Object(i.e)([e],t,!1))),o=T(r);return new Te(o,r)}(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=de(),i=X([n&&'nonce="'.concat(n,'"'),"".concat(u,'="true"'),"".concat(d,'="').concat(m,'"')].filter(Boolean)," ");return"<style ".concat(i,">").concat(t,"</style>")},this.getStyleTags=function(){if(e.sealed)throw ee(2);return e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)throw ee(2);var n=((t={})[u]="",t[d]=m,t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=de();return o&&(n.nonce=o),[r.default.createElement("style",Object(i.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new ye({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw ee(2);return r.default.createElement(Ie,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw ee(3)}})(),"__sc-".concat(u,"__")}).call(this,n(84))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(42),r=n(61),o=n(43);class a{constructor(e,t){this.errorInWorker=null,this.createProxy=e=>new Proxy({},{get:(t,n,i)=>new Proxy((()=>{}),{apply:(t,i,r)=>this.post(n,r,e),get:(t,i,r)=>(...t)=>this.post(n+"."+i,t,e)})}),this.handleUnrecoverableError=e=>{this.errorInWorker=e;for(const t in this.continuations)this.continuations[t].reject(e),delete this.continuations[t]},this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),this.api=new r.a(this),a.SINGLETON=this;const{requestSuffix:n=""}=t||{},s=Object(i.c)(t),c=`${e}${e.endsWith("/")?"":"/"}ScanbotSDK.Core${s}.js${n}`;if(Object(i.d)(c)){const e=new Blob([`importScripts("${c}")`]);this.instance=new Worker(URL.createObjectURL(e))}else this.instance=new Worker(c);this.continuations={},this.nextTicketId=1,this.instance.onmessage=e=>{const{log:t,logError:n}=e.data;if(t)return void console.log(...t);if(n)return void console.error(...n);const{ticket:i,result:r,recoverableError:a,unrecoverableError:s}=e.data,c=this.continuations[i];if(!c)return;const{resolve:u,reject:l,command:d}=c;if(delete this.continuations[i],s)l(s),this.handleUnrecoverableError(s);else if(a){l("errorType"in e.data?Object(o.b)(e.data.errorType,`Error in worker while running command '${d}'`,a):a)}else u(r)},this.instance.onerror=e=>{this.handleUnrecoverableError(e.error)}}post(e,t,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((r,o)=>{const a=Object(i.b)(t,"copy"==n),s=this.nextTicketId++;this.continuations[s]={resolve:r,reject:o,command:e},this.instance.postMessage({command:e,args:t,ticket:s},a)}))}destroy(){this.instance.terminate()}}a.SINGLETON=null},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a}));var i=n(19);const r=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"];class o{constructor(e={}){}}!function(e){e.all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],e.documentBarcodeFormats={AAMVA:["PDF_417"],ID_CARD_PDF_417:["PDF_417"],SEPA:["QR_CODE"],MEDICAL_CERTIFICATE:["PDF_417"],DE_MEDICAL_PLAN:["DATA_MATRIX"],BOARDING_PASS:["PDF_417","AZTEC","QR_CODE"],VCARD:["QR_CODE","DATA_MATRIX"],SWISS_QR:["QR_CODE"],GS1:["CODE_128","AZTEC","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","ITF","MICRO_PDF_417","PDF_417","QR_CODE","UPC_A","UPC_E"],HIBC:["CODE_39","CODE_128","AZTEC","DATA_MATRIX","MICRO_PDF_417","PDF_417","QR_CODE"]}}(o||(o={}));class a{constructor(e={}){if(void 0===e.success)throw new Error("success must be present in constructor argument");if(this.success=e.success,void 0===e.parsedDocument)throw new Error("parsedDocument must be present in constructor argument");this.parsedDocument=null!=e.parsedDocument?new i.f(e.parsedDocument):null}}},function(e,t,n){"use strict";var i,r;n.d(t,"n",(function(){return i})),n.d(t,"z",(function(){return r})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"h",(function(){return s})),n.d(t,"i",(function(){return c})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return l})),n.d(t,"o",(function(){return d})),n.d(t,"p",(function(){return m})),n.d(t,"q",(function(){return h})),n.d(t,"u",(function(){return f})),n.d(t,"J",(function(){return p})),n.d(t,"y",(function(){return g})),n.d(t,"H",(function(){return v})),n.d(t,"B",(function(){return y})),n.d(t,"G",(function(){return C})),n.d(t,"c",(function(){return A})),n.d(t,"D",(function(){return S})),n.d(t,"A",(function(){return w})),n.d(t,"x",(function(){return E})),n.d(t,"r",(function(){return D})),n.d(t,"w",(function(){return x})),n.d(t,"s",(function(){return b})),n.d(t,"a",(function(){return B})),n.d(t,"b",(function(){return I})),n.d(t,"v",(function(){return T})),n.d(t,"E",(function(){return O})),n.d(t,"F",(function(){return k})),n.d(t,"I",(function(){return P})),n.d(t,"C",(function(){return L})),n.d(t,"t",(function(){return _})),n.d(t,"l",(function(){return R})),n.d(t,"m",(function(){return M})),n.d(t,"k",(function(){return F})),n.d(t,"j",(function(){return N})),function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new o(e);case"BarcodeFormatCode11Configuration":return new a(e);case"BarcodeFormatCode39Configuration":return new s(e);case"BarcodeFormatCode93Configuration":return new c(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new l(e);case"BarcodeFormatDataBarConfiguration":return new d(e);case"BarcodeFormatDataBarExpandedConfiguration":return new m(e);case"BarcodeFormatDataBarLimitedConfiguration":return new h(e);case"BarcodeFormatITFConfiguration":return new f(e);case"BarcodeFormatMSIPlesseyConfiguration":return new g(e);case"BarcodeFormatUpcEanConfiguration":return new v(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);case"BarcodeFormatAztecConfiguration":return new A(e);case"BarcodeFormatQRCodeConfiguration":return new S(e);case"BarcodeFormatPDF417Configuration":return new w(e);case"BarcodeFormatMicroPDF417Configuration":return new E(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new x(e);case"BarcodeFormatAustraliaPostConfiguration":return new I(e);case"BarcodeFormatJapanPostConfiguration":return new T(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new L(e);case"BarcodeFormatGS1CompositeConfiguration":return new _(e);case"BarcodeFormatCommonOneDConfiguration":return new R(e);case"BarcodeFormatCommonTwoDConfiguration":return new M(e);case"BarcodeFormatCommonFourStateConfiguration":return new F(e);case"BarcodeFormatCommonConfiguration":return new N(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={})),function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new o(e);case"BarcodeFormatCode11Configuration":return new a(e);case"BarcodeFormatCode39Configuration":return new s(e);case"BarcodeFormatCode93Configuration":return new c(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new l(e);case"BarcodeFormatDataBarConfiguration":return new d(e);case"BarcodeFormatDataBarExpandedConfiguration":return new m(e);case"BarcodeFormatDataBarLimitedConfiguration":return new h(e);case"BarcodeFormatITFConfiguration":return new f(e);case"BarcodeFormatMSIPlesseyConfiguration":return new g(e);case"BarcodeFormatUpcEanConfiguration":return new v(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);default:throw`Unknown child class name: ${t}`}}}(r||(r={}));class o{constructor(e={}){this._type="BarcodeFormatCodabarConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=1,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.returnStartEnd&&(this.returnStartEnd=e.returnStartEnd)}}class a{constructor(e={}){this._type="BarcodeFormatCode11Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.checksum=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksum&&(this.checksum=e.checksum)}}class s{constructor(e={}){this._type="BarcodeFormatCode39Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn7=!0,this.pzn8=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.code32&&(this.code32=e.code32),void 0!==e.code39&&(this.code39=e.code39),void 0!==e.pzn7&&(this.pzn7=e.pzn7),void 0!==e.pzn8&&(this.pzn8=e.pzn8),void 0!==e.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=e.tryCode39ExtendedMode),void 0!==e.useCode39CheckDigit&&(this.useCode39CheckDigit=e.useCode39CheckDigit)}}class c{constructor(e={}){this._type="BarcodeFormatCode93Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class u{constructor(e={}){this._type="BarcodeFormatCode128Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.minimumTextLength=1,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}class l{constructor(e={}){this._type="BarcodeFormatCode2Of5Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.iata2of5&&(this.iata2of5=e.iata2of5),void 0!==e.code25&&(this.code25=e.code25),void 0!==e.industrial2of5&&(this.industrial2of5=e.industrial2of5),void 0!==e.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=e.useIATA2OF5Checksum)}}class d{constructor(e={}){this._type="BarcodeFormatDataBarConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class m{constructor(e={}){this._type="BarcodeFormatDataBarExpandedConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class h{constructor(e={}){this._type="BarcodeFormatDataBarLimitedConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class f{constructor(e={}){this._type="BarcodeFormatITFConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=1,this.maximumTextLength=0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength)}}const p=["MOD_10","MOD_11_IBM","MOD_11_NCR","MOD_10_10","MOD_11_10_IBM","MOD_11_10_NCR"];class g{constructor(e={}){this._type="BarcodeFormatMSIPlesseyConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.checksumAlgorithms&&(this.checksumAlgorithms=e.checksumAlgorithms.map((e=>e)))}}class v{constructor(e={}){this._type="BarcodeFormatUpcEanConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="ALLOW_ANY",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.ean8&&(this.ean8=e.ean8),void 0!==e.ean13&&(this.ean13=e.ean13),void 0!==e.upca&&(this.upca=e.upca),void 0!==e.upce&&(this.upce=e.upce),void 0!==e.extensions&&(this.extensions=e.extensions)}}class y{constructor(e={}){this._type="BarcodeFormatPharmaCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue),void 0!==e.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=e.allowNarrowBarsOnly),void 0!==e.allowWideBarsOnly&&(this.allowWideBarsOnly=e.allowWideBarsOnly)}}var C,b;!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAztecConfiguration":return new A(e);case"BarcodeFormatQRCodeConfiguration":return new S(e);case"BarcodeFormatPDF417Configuration":return new w(e);case"BarcodeFormatMicroPDF417Configuration":return new E(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new x(e);default:throw`Unknown child class name: ${t}`}}}(C||(C={}));class A{constructor(e={}){this._type="BarcodeFormatAztecConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class S{constructor(e={}){this._type="BarcodeFormatQRCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.qr&&(this.qr=e.qr),void 0!==e.microQr&&(this.microQr=e.microQr),void 0!==e.rmqr&&(this.rmqr=e.rmqr)}}class w{constructor(e={}){this._type="BarcodeFormatPDF417Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class E{constructor(e={}){this._type="BarcodeFormatMicroPDF417Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class D{constructor(e={}){this._type="BarcodeFormatDataMatrixConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling)}}class x{constructor(e={}){this._type="BarcodeFormatMaxiCodeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAustraliaPostConfiguration":return new I(e);case"BarcodeFormatJapanPostConfiguration":return new T(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new L(e);default:throw`Unknown child class name: ${t}`}}}(b||(b={}));const B=["NUMERIC","ALPHA_NUMERIC"];class I{constructor(e={}){this._type="BarcodeFormatAustraliaPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=e.australiaPostCustomerFormat)}}class T{constructor(e={}){this._type="BarcodeFormatJapanPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class O{constructor(e={}){this._type="BarcodeFormatRoyalMailConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.stripCheckDigits=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits)}}class k{constructor(e={}){this._type="BarcodeFormatRoyalTNTPostConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class P{constructor(e={}){this._type="BarcodeFormatUSPSIntelligentMailConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone)}}class L{constructor(e={}){this._type="BarcodeFormatPharmaCodeTwoTrackConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimumValue=364,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimumValue&&(this.minimumValue=e.minimumValue)}}class _{constructor(e={}){this._type="BarcodeFormatGS1CompositeConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode)}}class R{constructor(e={}){this._type="BarcodeFormatCommonOneDConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.gs1Handling="PARSE",this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN_7","PZN_8","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class M{constructor(e={}){this._type="BarcodeFormatCommonTwoDConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class F{constructor(e={}){this._type="BarcodeFormatCommonFourStateConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class N{constructor(e={}){this._type="BarcodeFormatCommonConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=1,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"e",(function(){return r})),n.d(t,"f",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"g",(function(){return u}));const i=["UNKNOWN","ASCII","ISO_8859_PART1","ISO_8859_PART2","ISO_8859_PART3","ISO_8859_PART4","ISO_8859_PART5","ISO_8859_PART6","ISO_8859_PART7","ISO_8859_PART8","ISO_8859_PART9","ISO_8859_PART10","ISO_8859_PART11","ISO_8859_PART13","ISO_8859_PART14","ISO_8859_PART15","ISO_8859_PART16","CP_437","CP_1250","CP_1251","CP_1252","CP_1256","SHIFT_JIS","BIG_5","GB_2312","GB_18030","EUC_JP","EUC_KR","UTF_16_BE","UTF_8","UTF_16_LE","UTF_32_BE","UTF_32_LE","BINARY"];class r{constructor(e={}){if(void 0===e.start)throw new Error("start must be present in constructor argument");if(this.start=e.start,void 0===e.end)throw new Error("end must be present in constructor argument");if(this.end=e.end,void 0===e.encoding)throw new Error("encoding must be present in constructor argument");this.encoding=e.encoding}}class o{constructor(e={}){if(void 0===e.count)throw new Error("count must be present in constructor argument");if(this.count=e.count,void 0===e.index)throw new Error("index must be present in constructor argument");if(this.index=e.index,void 0===e.id)throw new Error("id must be present in constructor argument");this.id=e.id}}const a=["NONE","AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","EAN_8","EAN_13","ITF","MAXI_CODE","PDF_417","QR_CODE","DATABAR","DATABAR_EXPANDED","UPC_A","UPC_E","MSI_PLESSEY","IATA_2_OF_5","INDUSTRIAL_2_OF_5","CODE_25","MICRO_QR_CODE","USPS_INTELLIGENT_MAIL","ROYAL_MAIL","JAPAN_POST","ROYAL_TNT_POST","AUSTRALIA_POST","DATABAR_LIMITED","MICRO_PDF_417","GS1_COMPOSITE","RMQR_CODE","CODE_11","CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN_7","PZN_8"];class s{constructor(e={}){}}!function(e){e.oned=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN_7","PZN_8","UPC_A","UPC_E"],e.twod=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],e.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],e.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN_7","PZN_8"],e.common=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],e.all=["AUSTRALIA_POST","AZTEC","CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","GS1_COMPOSITE","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","JAPAN_POST","MAXI_CODE","MICRO_PDF_417","MICRO_QR_CODE","MSI_PLESSEY","PDF_417","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN_7","PZN_8","QR_CODE","RMQR_CODE","ROYAL_MAIL","ROYAL_TNT_POST","UPC_A","UPC_E","USPS_INTELLIGENT_MAIL"]}(s||(s={}));const c=["PARSE","VALIDATE_STRUCTURE","DECODE_STRUCTURE","VALIDATE_FULL","DECODE_FULL"],u=["REQUIRE_2","REQUIRE_5","REQUIRE_ANY","IGNORE","ALLOW_2","ALLOW_5","ALLOW_ANY"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return s}));var i=n(15);class r{constructor(e={}){this.crop=!0,void 0!==e.crop&&(this.crop=e.crop)}}const o=["SUCCESS","FAILURE_SCANNING"],a=["UNKNOWN","BILL_OF_LADING","PAY_SHEET","SCALE_TICKET","TOLL_RECEIPT","WASH_RECEIPT"];class s{constructor(e={}){if(void 0===e.documentType)throw new Error("documentType must be present in constructor argument");if(this.documentType=e.documentType,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.status)throw new Error("status must be present in constructor argument");if(this.status=e.status,void 0===e.documentScanningResult)throw new Error("documentScanningResult must be present in constructor argument");this.documentScanningResult=new i.g(e.documentScanningResult)}}},function(e,t,n){"use strict";n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"f",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"p",(function(){return m})),n.d(t,"i",(function(){return h})),n.d(t,"b",(function(){return f})),n.d(t,"q",(function(){return p})),n.d(t,"l",(function(){return g})),n.d(t,"a",(function(){return v})),n.d(t,"n",(function(){return y})),n.d(t,"k",(function(){return C})),n.d(t,"o",(function(){return b})),n.d(t,"j",(function(){return A})),n.d(t,"m",(function(){return S})),n.d(t,"h",(function(){return w})),n.d(t,"g",(function(){return E}));var i=n(69),r=n(15),o=n(19),a=n(10),s=n(32);const c=["SUCCESS","ERROR_NOTHING_FOUND","ERROR_BAD_CROP","ERROR_UNKNOWN_DOCUMENT","ERROR_UNACCEPTABLE_DOCUMENT","ERROR_STILL_FOCUSSING","INCOMPLETE_VALIDATION"];class u{constructor(e={}){if(this.croppedImage=null,void 0===e.status)throw new Error("status must be present in constructor argument");if(this.status=e.status,void 0===e.document)throw new Error("document must be present in constructor argument");if(this.document=null!=e.document?new o.f(e.document):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");this.documentDetectionResult=new r.a(e.documentDetectionResult),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?new a.a(e.croppedImage):null)}}const l=["TRUSTED","UNTRUSTED"];class d{constructor(e={}){if(this.resultAccumulationConfig=new s.c({}),this.fieldExcludeList=[],this.returnCrops=!1,this.documentTrustMode="TRUSTED",this.processingMode="AUTO",void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new s.c(e.resultAccumulationConfig)),void 0!==e.fieldExcludeList&&(this.fieldExcludeList=e.fieldExcludeList.map((e=>e))),void 0===e.configurations)throw new Error("configurations must be present in constructor argument");this.configurations=e.configurations.map((e=>i.e.From(e))),void 0!==e.returnCrops&&(this.returnCrops=e.returnCrops),void 0!==e.documentTrustMode&&(this.documentTrustMode=e.documentTrustMode),void 0!==e.processingMode&&(this.processingMode=e.processingMode)}}const m=["OK","OK_PUNCTUATION_UPPER_CASE_CLEANED","OK_DEBURRED","OK_DEBURRED_EXTENDED","OK_TRUNCATED","INCONSISTENT"];class h{constructor(e={}){if(void 0===e.fieldType)throw new Error("fieldType must be present in constructor argument");if(this.fieldType=e.fieldType,void 0===e.consistency)throw new Error("consistency must be present in constructor argument");if(this.consistency=e.consistency,void 0===e.fieldFullNames)throw new Error("fieldFullNames must be present in constructor argument");this.fieldFullNames=e.fieldFullNames.map((e=>e))}}class f{constructor(e={}){if(void 0===e.overallConsistency)throw new Error("overallConsistency must be present in constructor argument");if(this.overallConsistency=e.overallConsistency,void 0===e.fieldDetails)throw new Error("fieldDetails must be present in constructor argument");this.fieldDetails=e.fieldDetails.map((e=>new h(e)))}}const p=["SKIPPED","VALID","INVALID"];class g{constructor(e={}){if(void 0===e.fieldFullName)throw new Error("fieldFullName must be present in constructor argument");if(this.fieldFullName=e.fieldFullName,void 0===e.invalidSemantics)throw new Error("invalidSemantics must be present in constructor argument");this.invalidSemantics=e.invalidSemantics}}class v{constructor(e={}){if(void 0===e.overallFieldValueSemantics)throw new Error("overallFieldValueSemantics must be present in constructor argument");if(this.overallFieldValueSemantics=e.overallFieldValueSemantics,void 0===e.fieldDetails)throw new Error("fieldDetails must be present in constructor argument");this.fieldDetails=e.fieldDetails.map((e=>new g(e)))}}class y{constructor(e={}){if(void 0===e.overallInvalidSemantics)throw new Error("overallInvalidSemantics must be present in constructor argument");if(this.overallInvalidSemantics=e.overallInvalidSemantics,void 0===e.expiryDateSemantics)throw new Error("expiryDateSemantics must be present in constructor argument");if(this.expiryDateSemantics=new v(e.expiryDateSemantics),void 0===e.issueDateSemantics)throw new Error("issueDateSemantics must be present in constructor argument");if(this.issueDateSemantics=new v(e.issueDateSemantics),void 0===e.birthDateSemantics)throw new Error("birthDateSemantics must be present in constructor argument");if(this.birthDateSemantics=new v(e.birthDateSemantics),void 0===e.issueDateBeforeExpiryDate)throw new Error("issueDateBeforeExpiryDate must be present in constructor argument");if(this.issueDateBeforeExpiryDate=e.issueDateBeforeExpiryDate,void 0===e.birthDateBeforeIssueDate)throw new Error("birthDateBeforeIssueDate must be present in constructor argument");if(this.birthDateBeforeIssueDate=e.birthDateBeforeIssueDate,void 0===e.birthDateBeforeExpiryDate)throw new Error("birthDateBeforeExpiryDate must be present in constructor argument");this.birthDateBeforeExpiryDate=e.birthDateBeforeExpiryDate}}class C{constructor(e={}){if(void 0===e.fieldFullName)throw new Error("fieldFullName must be present in constructor argument");if(this.fieldFullName=e.fieldFullName,void 0===e.isSuspicious)throw new Error("isSuspicious must be present in constructor argument");this.isSuspicious=e.isSuspicious}}class b{constructor(e={}){if(void 0===e.overallSuspiciousData)throw new Error("overallSuspiciousData must be present in constructor argument");if(this.overallSuspiciousData=e.overallSuspiciousData,void 0===e.fieldDetails)throw new Error("fieldDetails must be present in constructor argument");this.fieldDetails=e.fieldDetails.map((e=>new C(e)))}}class A{constructor(e={}){if(void 0===e.fieldFullName)throw new Error("fieldFullName must be present in constructor argument");if(this.fieldFullName=e.fieldFullName,void 0===e.isInvalid)throw new Error("isInvalid must be present in constructor argument");this.isInvalid=e.isInvalid}}class S{constructor(e={}){if(void 0===e.overallIsInvalid)throw new Error("overallIsInvalid must be present in constructor argument");if(this.overallIsInvalid=e.overallIsInvalid,void 0===e.fieldDetails)throw new Error("fieldDetails must be present in constructor argument");this.fieldDetails=e.fieldDetails.map((e=>new A(e)))}}const w=["OK","OK_WITH_WARNINGS","INVALID"];class E{constructor(e={}){if(void 0===e.overallVerificationStatus)throw new Error("overallVerificationStatus must be present in constructor argument");if(this.overallVerificationStatus=e.overallVerificationStatus,void 0===e.consistencyVerificationReport)throw new Error("consistencyVerificationReport must be present in constructor argument");if(this.consistencyVerificationReport=new f(e.consistencyVerificationReport),void 0===e.semanticsVerificationReport)throw new Error("semanticsVerificationReport must be present in constructor argument");if(this.semanticsVerificationReport=new y(e.semanticsVerificationReport),void 0===e.suspiciousDataVerificationReport)throw new Error("suspiciousDataVerificationReport must be present in constructor argument");if(this.suspiciousDataVerificationReport=new b(e.suspiciousDataVerificationReport),void 0===e.invalidDataVerificationReport)throw new Error("invalidDataVerificationReport must be present in constructor argument");this.invalidDataVerificationReport=new S(e.invalidDataVerificationReport)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var i=n(10),r=n(25),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new r.d({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.MrzScanner.create(new r.d(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.MrzScanner.run(this.objectId,e);return{result:new r.e(o.result),originalImage:new i.a(o.originalImage)}}))}clearResult(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.MrzScanner.clearResult(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.MrzScanner.destroy(this.objectId)}))}}class s{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new r.c({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.MrzParser.create(new r.c(t));return new s(e,n)}))}parse(e){return o(this,void 0,void 0,(function*(){const t=this.workerBridge.copyArgs;return yield t.MrzParser.parse(this.objectId,e)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.MrzParser.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"i",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return h})),n.d(t,"j",(function(){return f}));var i=n(15),r=n(10);class o{constructor(e={}){this.shouldCropDocument=!0,this.recognizePatientInfoBox=!0,this.recognizeBarcode=!0,this.extractCroppedImage=!1,this.preprocessInput=!1,void 0!==e.shouldCropDocument&&(this.shouldCropDocument=e.shouldCropDocument),void 0!==e.recognizePatientInfoBox&&(this.recognizePatientInfoBox=e.recognizePatientInfoBox),void 0!==e.recognizeBarcode&&(this.recognizeBarcode=e.recognizeBarcode),void 0!==e.extractCroppedImage&&(this.extractCroppedImage=e.extractCroppedImage),void 0!==e.preprocessInput&&(this.preprocessInput=e.preprocessInput)}}const a=["UNKNOWN","WORK_ACCIDENT","ASSIGNED_TO_ACCIDENT_INSURANCE_DOCTOR","INITIAL_CERTIFICATE","RENEWED_CERTIFICATE","INSURED_PAY_CASE","FINAL_CERTIFICATE","REQUIRES_CARE_YES","REQUIRES_CARE_NO","ACCIDENT_YES","ACCIDENT_NO","OTHER_ACCIDENT","ENTITLEMENT_TO_CONTINUED_PAYMENT_YES","ENTITLEMENT_TO_CONTINUED_PAYMENT_NO","SICK_PAY_WAS_CLAIMED_NO","SICK_PAY_WAS_CLAIMED_YES","SINGLE_PARENT_NO","SINGLE_PARENT_YES"];class s{constructor(e={}){if(this.type="UNKNOWN",this.checked=!1,this.checkedConfidence=0,void 0!==e.type&&(this.type=e.type),void 0!==e.checked&&(this.checked=e.checked),void 0!==e.checkedConfidence&&(this.checkedConfidence=e.checkedConfidence),void 0===e.quad)throw new Error("quad must be present in constructor argument");this.quad=e.quad.map((e=>({x:e.x,y:e.y})))}}const c=["INCAPABLE_OF_WORK_SINCE","INCAPABLE_OF_WORK_UNTIL","DIAGNOSED_ON","DOCUMENT_DATE","BIRTH_DATE","CHILD_NEEDS_CARE_FROM","CHILD_NEEDS_CARE_UNTIL","UNDEFINED"];class u{constructor(e={}){if(this.value="",this.rawString="",this.type="UNDEFINED",this.recognitionConfidence=0,void 0===e.quad)throw new Error("quad must be present in constructor argument");this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0!==e.value&&(this.value=e.value),void 0!==e.rawString&&(this.rawString=e.rawString),void 0!==e.type&&(this.type=e.type),void 0!==e.recognitionConfidence&&(this.recognitionConfidence=e.recognitionConfidence)}}const l=["INSURANCE_PROVIDER","FIRST_NAME","LAST_NAME","ADDRESS_STRING1","ADDRESS_STRING2","DIAGNOSE","HEALTH_INSURANCE_NUMBER","INSURED_PERSON_NUMBER","STATUS","PLACE_OF_OPERATION_NUMBER","DOCTOR_NUMBER","UNDEFINED"];class d{constructor(e={}){if(void 0===e.type)throw new Error("type must be present in constructor argument");if(this.type=e.type,void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=e.value,void 0===e.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=e.recognitionConfidence}}class m{constructor(e={}){if(this.hasContents=!1,void 0===e.quad)throw new Error("quad must be present in constructor argument");if(this.quad=e.quad.map((e=>({x:e.x,y:e.y}))),void 0===e.fields)throw new Error("fields must be present in constructor argument");this.fields=e.fields.map((e=>new d(e))),void 0!==e.hasContents&&(this.hasContents=e.hasContents)}}const h=["UNKNOWN","FORM_1A","FORM_1B","FORM_1C","FORM_1D","FORM_21A","FORM_21A_BACK","FORM_1B_CUSTOM"];class f{constructor(e={}){if(this.scanningSuccessful=!1,this.formType="UNKNOWN",this.clockwiseRotations=0,this.croppedImage=null,this.scaleX=1,this.scaleY=1,void 0!==e.scanningSuccessful&&(this.scanningSuccessful=e.scanningSuccessful),void 0===e.patientInfoBox)throw new Error("patientInfoBox must be present in constructor argument");if(this.patientInfoBox=new m(e.patientInfoBox),void 0===e.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=e.checkBoxes.map((e=>new s(e))),void 0===e.dates)throw new Error("dates must be present in constructor argument");if(this.dates=e.dates.map((e=>new u(e))),void 0!==e.formType&&(this.formType=e.formType),void 0!==e.clockwiseRotations&&(this.clockwiseRotations=e.clockwiseRotations),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?new r.a(e.croppedImage):null),void 0!==e.scaleX&&(this.scaleX=e.scaleX),void 0!==e.scaleY&&(this.scaleY=e.scaleY),void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");this.documentDetectionResult=null!=e.documentDetectionResult?new i.a(e.documentDetectionResult):null}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(0),r=n(34),o=n(3),a=n(9);class s extends i.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(e){super(e),this.holePosition=r.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=e=>{var t,n,i,r;(null===(t=this.props.configuration.minimumInsets)||void 0===t?void 0:t.top)===(null===(n=e.configuration.minimumInsets)||void 0===n?void 0:n.top)&&(null===(i=this.props.configuration)||void 0===i?void 0:i.minimumInsets.bottom)===(null===(r=e.configuration)||void 0===r?void 0:r.minimumInsets.bottom)&&this.props.configuration===e.configuration&&this.props.guidanceConfiguration===e.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var e;return null!==(e=this.holeCanvas.getBoundingClientRect())&&void 0!==e?e:new DOMRect},this.scaleForRetinaDisplay=e=>{if(window.devicePixelRatio>1){const t=e.width,n=e.height;e.width=t*window.devicePixelRatio,e.height=n*window.devicePixelRatio,e.style.width=t+"px",e.style.height=n+"px",e.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var e,t,n;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const i=this.getVideoSize().width,r=this.getVideoSize().height;this.holeCanvas.width=i,this.holeCanvas.height=r,this.crosshairCanvas.width=i,this.crosshairCanvas.height=r,this.scaleForRetinaDisplay(this.crosshairCanvas);const o=this.props.configuration.minimumInsets,a=i-(2*this.props.configuration.style.strokeWidth+o.left+o.right),s=null!==(e=null==o?void 0:o.top)&&void 0!==e?e:0,c=null!==(t=null==o?void 0:o.bottom)&&void 0!==t?t:0,u=Math.min(a,i-(o.left+o.right)),l=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;if(-1!==this.props.configuration.preferredHeight){const e=this.props.configuration.preferredHeight,t=e*l;t>a?(this.holePosition.width=a,this.holePosition.height=a/l):(this.holePosition.width=t,this.holePosition.height=e)}else this.holePosition.width=u,this.holePosition.height=this.holePosition.width/l;const d=(i-this.holePosition.width)/2;o.left>d||o.right>d?(o.left>d&&(this.holePosition.x=o.left),o.right>d&&(this.holePosition.x=i-this.holePosition.width-o.right)):this.holePosition.x=d;const m=r-s-c-((null===(n=this.guidanceText)||void 0===n?void 0:n.clientHeight)+this.guidanceTextTopPadding||0);this.holePosition.height>m?(this.holePosition.height=m,this.holePosition.width=this.holePosition.height*l,this.holePosition.x=i/2-this.holePosition.width/2,this.holePosition.y=s):this.holePosition.y=s+(m-this.holePosition.height)/1.9;const h=this.holeCanvas.getContext("2d");h.save(),this.drawBackground(h),h.globalCompositeOperation="destination-out",this.drawHole();const f=this.crosshairCanvas.getContext("2d");f.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),h.restore(),f.restore()},this.drawBackground=e=>{const{width:t,height:n}=this.getVideoSize();e.clearRect(0,0,t,n),e.beginPath(),e.rect(0,0,t,n),e.fillStyle=o.b.getColorValue(this.props.configuration.overlayColor),e.fill()},this.drawHole=()=>{const e=this.holeCanvas.getContext("2d"),t=this.cornerRadius(),n=this.holePosition.x,i=this.holePosition.y,r=this.holePosition.width,o=this.holePosition.height;e.beginPath(),e.fillStyle="black",e.moveTo(n+t,i),e.arcTo(n+r,i,n+r,i+o,t),e.arcTo(n+r,i+o,n,i+o,t),e.arcTo(n,i+o,n,i,t),e.arcTo(n,i,n+r,i,t),e.closePath(),e.fill()},this.drawCrosshair=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;e.beginPath(),e.moveTo(t-10,n),e.lineTo(t+10,n),e.moveTo(t,n-10),e.lineTo(t,n+10),e.strokeStyle="white",e.fillStyle="white",e.lineWidth=1,e.stroke()},this.drawHoleCorners=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x,n=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height,a=15,s=this.style.strokeWidth,c=this.cornerRadius();e.beginPath(),e.moveTo(t,n+a),e.arcTo(t,n,t+i,n,c),e.lineTo(t+a,n),e.moveTo(t+i-a,n),e.arcTo(t+i,n,t+i,n+r,c),e.lineTo(t+i,n+a),e.moveTo(t+i,n+r-a),e.arcTo(t+i,n+r,t,n+r,c),e.lineTo(t+i-a,n+r),e.moveTo(t,n+r-a),e.arcTo(t,n+r,t+i,n+r,c),e.lineTo(t+a,n+r),e.strokeStyle=o.b.getColorValue(this.style.strokeColor),e.lineWidth=s,e.stroke()},this.drawHoleOutline=()=>{const e=this.crosshairCanvas.getContext("2d"),t=this.holePosition.x,n=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+i,n,t+i,n+r,a),e.moveTo(t+i,n+a),e.arcTo(t+i,n+r,t,n+r,a),e.moveTo(t+i-a,n+r),e.arcTo(t,n+r,t,n,a),e.moveTo(t,n+r-a),e.arcTo(t,n,t+i,n,a),e.strokeStyle=o.b.getColorValue(this.style.strokeColor),e.lineWidth=s,e.stroke()},this.guidanceTextTopPadding=20,this.render=()=>i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",textAlign:"left"},onClick:e=>{const t=this.holePosition;e.clientX>this.holePosition.x&&e.clientX<t.x+t.width&&e.clientY>t.y&&e.clientY<t.y+t.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},i.default.createElement("canvas",{ref:e=>{this.holeCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),i.default.createElement("canvas",{ref:e=>{this.crosshairCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&i.default.createElement("div",{ref:e=>{this.guidanceText=e},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},i.default.createElement(a.a,{style:{display:"inline-block",backgroundColor:o.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:o.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1,maxWidth:"94%",wordWrap:"break-word"},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var e,t;return this.holeRect.bottom()+(null!==(t=null===(e=this.guidanceText)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){const e=this.holePosition;return Math.max(0,Math.min(this.style.cornerRadius,e.width/2,e.height/2))}}},function(e,t,n){var i;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var o=typeof i;if("string"===o||"number"===o)e.push(i);else if(Array.isArray(i)){if(i.length){var a=r.apply(null,i);a&&e.push(a)}}else if("object"===o)if(i.toString===Object.prototype.toString)for(var s in i)n.call(i,s)&&i[s]&&e.push(s);else e.push(i.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(i=function(){return r}.apply(t,[]))||(e.exports=i)}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var i=n(0),r=n(18),o=n(41),a=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class s extends i.default.Component{constructor(e){super(e),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(e){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(e){var t,n;return a(this,void 0,void 0,(function*(){const i=this.props.preferredCamera;if(i)try{const t=(yield navigator.mediaDevices.enumerateDevices()).find((e=>e.deviceId===i||e.label===i));if(t)return Object.assign(Object.assign({},e),{deviceId:t.deviceId})}catch(e){throw r.a.enumerateDevicesFailed()}else{const i={user:"front",environment:"back"},r=(null===(t=null==e?void 0:e.facingMode)||void 0===t?void 0:t.ideal)||(null===(n=null==e?void 0:e.facingMode)||void 0===n?void 0:n.exact)||(null==e?void 0:e.facingMode);if("string"==typeof r&&r in i){yield o.a.INSTANCE.load();const t=o.a.INSTANCE.getMainCamera(i[r]);if(t)return Object.assign(Object.assign({},e),{deviceId:t.deviceId})}}return e}))}componentDidMount(){return a(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var e,t,n,i,o,s,c,u;return a(this,void 0,void 0,(function*(){if(r.a.hasCheckedPermission()||(yield r.a.tryCheckPermission()),r.a.hasDeniedPermission())null===(t=(e=this.props).onError)||void 0===t||t.call(e,r.a.permissionDenied());else try{const e={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};if(!navigator.mediaDevices){const e=r.a.unknown();return null===(i=(n=this.props).onError)||void 0===i||i.call(n,e),void console.log(e)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(e);this.setState({stream:t},(()=>{var e,n,i,r;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(r=(i=this.props).onReady)||void 0===r||r.call(i)}))}catch(e){const t=r.a.mediaDeviceNotFound();return null===(s=(o=this.props).onError)||void 0===s||s.call(o,t),void console.error(t)}}catch(e){const t=r.a.createFromDOMException(e);return null===(u=(c=this.props).onError)||void 0===u||u.call(c,t),void console.error(t)}}))}stopCurrentStreams(){const e=this.state.stream,t=null==e?void 0:e.getTracks();t&&t.forEach((e=>{e.stop()}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationchangeCallback),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((e=>e.stop())),this.state.stream.getAudioTracks().forEach((e=>e.stop()))),this.setState({stream:void 0}))}render(){return this.props.children}updateTorch(e){return a(this,void 0,void 0,(function*(){const t=[{torch:e}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:t})}))}getCapabilities(){if(this.state.stream.getVideoTracks){const e=this.getVideoTrack();return s.getMediaTrackCapabilities(e)}}static getMediaTrackCapabilities(e){if(e&&e.getCapabilities)return e.getCapabilities()}getVideoTrack(){const e=this.state.stream.getVideoTracks();if(e.length>0)return e[0]}}var c=n(11),u=n(34),l=n(23),d=n(60);class m{static isSupported(){return!!document.createElement("canvas").getContext("webgl")}constructor(){this._type="WebGL",this.canvas=document.createElement("canvas");const e=this.gl=this.canvas.getContext("webgl",{willReadFrequently:!0}),t=e.createTexture();e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR);const n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,"attribute vec2 p;void main(){ gl_Position = vec4(p,0,1);}"),e.compileShader(n);const i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,"precision mediump float;uniform sampler2D texture; uniform vec2 scale; uniform vec2 offset; void main() { gl_FragColor=texture2D( texture, gl_FragCoord.xy * scale + offset );}"),e.compileShader(i);const r=this.program=e.createProgram();e.attachShader(r,n),e.attachShader(r,i),e.linkProgram(r),e.useProgram(r),e.uniform1i(e.getUniformLocation(r,"texture"),0),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW),e.enableVertexAttribArray(0),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0)}getImageData(e,t,n,i,r,o,a,s){let c,u;if(o=Math.floor(o),a=Math.floor(a),t=Math.floor(t),n=Math.floor(n),i=Math.floor(i),r=Math.floor(r),e instanceof HTMLVideoElement)[u,c]=[e.videoWidth,e.videoHeight];else{if(!(e instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[u,c]=[e.width,e.height]}(u<t+i||c<n+r)&&l.a.debug("Crop region exceeds source video dimensions. This can happen when the screen is resized or rotated and the video has not yet changed its size. Most likely, the frame we analyzed now contains some garbage data. This is not a problem, unless it happens very frequently.");const m=this.gl;this.canvas.width=o,this.canvas.height=a,m.viewport(0,0,o,a);const h=[i/(o*u),r/(a*c)],f=[t/u,n/c];return m.uniform2fv(m.getUniformLocation(this.program,"scale"),h),m.uniform2fv(m.getUniformLocation(this.program,"offset"),f),m.texImage2D(m.TEXTURE_2D,0,m.RGB,m.RGB,m.UNSIGNED_BYTE,e),m.drawArrays(m.TRIANGLES,0,6),(null==s?void 0:s.byteLength)!==o*a*4&&(s=new Uint8ClampedArray(o*a*4),d.a.INSTANCE.values.set("WebGLNumBufferAllocations",(d.a.INSTANCE.values.get("WebGLNumBufferAllocations")||0)+1)),m.readPixels(0,0,o,a,m.RGBA,m.UNSIGNED_BYTE,s),new ImageData(s,o,a)}}class h{constructor(){this._type="TwoD",this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0,alpha:!1}),this.ctx.imageSmoothingEnabled=!1}getImageData(e,t,n,i,r,o,a,s){return this.canvas.width=o,this.canvas.height=a,this.ctx.drawImage(e,t,n,i,r,0,0,o,a),this.ctx.getImageData(0,0,o,a)}}var f=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class p extends i.default.Component{constructor(e){super(e),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this._reusableImageBuffer=null,this.onStreamChanged=e=>{this.video.srcObject=e,this.updateCameraInfo(e),this.video.addEventListener("resize",(e=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(e=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:e,clientVideoHeight:t}=this.calculateClientVideoConstraints();return new c.a(e,t)}saveExtractedData(){this.save=!0}zoom(){var e;return null!==(e=this.props.zoom)&&void 0!==e?e:1}imageCapture(){if(this.capture)return this.capture;const e=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(e),this.capture}set reusableImageBuffer(e){let t=e.__image_data;this._reusableImageBuffer=t.data}createImageData(e=0,t){return f(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(t){const e=yield this.imageCapture().takePhoto(),t=yield createImageBitmap(e);l.a.debug("Bitmap size: "+t.width*t.height);const i=this.windowSize(),r=t.height/(i.height+i.y),o=i.width*r,a=i.height*r,s=t.width/2-o/2,c=i.y*r,d=new u.a(s,c,o,a);return l.a.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height),n.getImageData(this.video,d.x,d.y,t.width,t.height,d.width,d.height,this._reusableImageBuffer)}let{videoWidth:i,videoHeight:r}=this.video,{clientVideoWidth:o,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const c=this.finderFrame||new u.a(0,0,o,a);if(c.width<=0||c.height<=0)return;const d=this.zoom(),m=(i-o/d)/2,h=(r-a/d)/2,f=c.x/s+m,p=c.y/s+h,g=this.finderFrame?s:d,v=c.width/g,y=c.height/g,C=this.calculateFrameSize(e,v,y);return n.getImageData(this.video,f,p,v,y,C.width,C.height,this._reusableImageBuffer)}))}windowSize(){var e;const t=this.props.configuration,n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return u.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:e,videoHeight:t}=this.video,n=this.video.getBoundingClientRect(),i=e,r=t,o=1;return n.width/n.height<=e/t?(o=n.height/t,o>0&&(i=n.width/o)):(o=n.width/e,o>0&&(r=n.height/o)),{clientVideoWidth:i,clientVideoHeight:r,coef:o}}calculateFrameSize(e,t,n){let i=t,r=n;if(e>0&&0!=t&&0!=n){const o=t/n;t>n?(i=t>e?e:t,r=i/o):(r=n>e?e:n,i=r*o)}return new c.a(i,r)}getCanvasRenderingContext(){return this.video?0===this.video.videoWidth?null:(this.canvas&&!this.reloadCanvas||(this.canvas&&this.releaseCanvas(),this.canvas=m.isSupported()?new m:new h,this.reloadCanvas=!1),this.canvas):null}releaseCanvas(){this.canvas&&(this.canvas=null)}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){var e;const t={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(e=this.props.configuration)||void 0===e?void 0:e.backgroundColor};return this.state.mirrored&&(t.transform="scaleX(-1)"),t}zoomMargin(){const e=this.zoom();return 1===e?0:(1-e)/2*100}render(){const{videoConstraints:e,onReady:t,onError:n}=this.props;return i.default.createElement(s,{videoConstraints:e,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:t,onStreamChanged:this.onStreamChanged,onError:n,ref:e=>{this.videoStream=e}},i.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:e=>{this.video=e},style:this.style()}))}setDirection(e){this.props.videoConstraints.facingMode={ideal:e},this.setState({facingModeBack:"environment"===e,mirrored:"user"===e},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}swapCameraFacing(e){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const t=!this.state.facingModeBack,n=t?"environment":"user";this.props.videoConstraints.facingMode=!0===e?{exact:n}:{ideal:n},this.setState({facingModeBack:t,mirrored:!t},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(e,t){return f(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=t?t:this.state.mirrored,deviceId:e},(()=>f(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(e){this.activeCamera=o.a.getCameraInfoFromStream(e)}getActiveCameraInfo(){return this.activeCamera}setTorchState(e){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:e}]})}return Promise.reject("Torch is not supported for current camera.")}}},function(e,t,n){"use strict";var i=n(15);n.d(t,"a",(function(){return i.c})),n.d(t,"b",(function(){return i.f}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(){this.values=new Map}}i.INSTANCE=new i},function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var i=n(49),r=n(28),o=n(37),a=n(38),s=n(30),c=n(15),u=n(25),l=n(31),d=n(39),m=n(63),h=n(64),f=n(65),p=n(66),g=n(67),v=n(68),y=n(70),C=n(71),b=n(72),A=n(54),S=n(73),w=n(74),E=n(76),D=n(77);class x{constructor(e){this.workerBridge=e,this.BarcodeDocumentParser={create:(e=i.b.all)=>m.a.create(this.workerBridge,e)},this.BarcodeScanner={create:(e=new r.d({}))=>h.a.create(this.workerBridge,e)},this.CheckScanner={create:(e=new o.c({}))=>f.a.create(this.workerBridge,e)},this.CreditCardScanner={create:(e=new a.a({}))=>p.a.create(this.workerBridge,e)},this.DocumentClassifier={create:e=>g.a.create(this.workerBridge,e)},this.DocumentDataExtractor={create:e=>v.a.create(this.workerBridge,e)},this.DocumentQualityAnalyzer={create:(e=new s.a({}))=>y.a.create(this.workerBridge,e)},this.DocumentScanner={create:(e=new c.d({}))=>C.a.create(this.workerBridge,e)},this.ImageProcessor={create:()=>b.a.create(this.workerBridge)},this.MrzScanner={create:(e=new u.d({}))=>A.b.create(this.workerBridge,e)},this.MrzParser={create:(e=new u.c({}))=>A.a.create(this.workerBridge,e)},this.MedicalCertificateScanner={create:()=>S.a.create(this.workerBridge)},this.OcrEngine={create:()=>w.a.create(this.workerBridge)},this.TextPatternScanner={create:(e=new l.e({}))=>E.a.create(this.workerBridge,e)},this.VinScanner={create:(e=new d.c({}))=>D.a.create(this.workerBridge,e)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const i=["ID","SURNAME","MAIDEN_NAME","GIVEN_NAMES","BIRTH_DATE","NATIONALITY","BIRTHPLACE","EXPIRY_DATE","EYE_COLOR","HEIGHT","ISSUE_DATE","ISSUING_AUTHORITY","ADDRESS","PSEUDONYM","MRZ","COUNTRY_CODE","GENDER","SIGNATURE","PHOTO","VALID_FROM_DATE","ROUTING_NUMBER","ACCOUNT_NUMBER","PLACE_OF_ISSUE","TITLE_TYPE","REMARKS","NAME","CARD_ACCESS_NUMBER"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(49),r=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class o{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=i.b.all){return r(this,void 0,void 0,(function*(){const n=yield e.copyArgs.BarcodeDocumentParser.create(t.map((e=>e)));return new o(e,n)}))}parse(e){return r(this,void 0,void 0,(function*(){const t=this.workerBridge.copyArgs;return yield t.BarcodeDocumentParser.parse(this.objectId,e)}))}destroy(){return r(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.BarcodeDocumentParser.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(28),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.d({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.BarcodeScanner.create(new i.d(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.BarcodeScanner.run(this.objectId,e);return{result:new i.f(o.result),originalImage:new r.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.BarcodeScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(37),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.c({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.CheckScanner.create(new i.c(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.CheckScanner.run(this.objectId,e);return{result:new i.d(o.result),originalImage:new r.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.CheckScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(38),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.a({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.CreditCardScanner.create(new i.a(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.CreditCardScanner.run(this.objectId,e);return{result:new i.b(o.result),originalImage:new r.a(o.originalImage)}}))}clearResult(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.CreditCardScanner.clearResult(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.CreditCardScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(52),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.DocumentClassifier.create(new i.a(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.DocumentClassifier.run(this.objectId,e);return{result:new i.b(o.result),originalImage:new r.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.DocumentClassifier.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(53),r=n(19),o=n(10),a=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class s{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t){return a(this,void 0,void 0,(function*(){const n=yield e.copyArgs.DocumentDataExtractor.create(new i.e(t));return new s(e,n)}))}run(e,t="COPY_IMAGE"){return a(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,r=yield n.DocumentDataExtractor.run(this.objectId,e);return{result:new i.c(r.result),originalImage:new o.a(r.originalImage)}}))}clearResult(){return a(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.DocumentDataExtractor.clearResult(this.objectId)}))}verifyDocument(e){return a(this,void 0,void 0,(function*(){const t=this.workerBridge.copyArgs;return yield t.DocumentDataExtractor.verifyDocument(this.objectId,e.map((e=>new r.f(e))))}))}destroy(){return a(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.DocumentDataExtractor.destroy(this.objectId)}))}}},function(e,t,n){"use strict";var i;n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"g",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"i",(function(){return c})),n.d(t,"a",(function(){return u})),n.d(t,"h",(function(){return l})),n.d(t,"d",(function(){return d})),function(e){e.From=function(e){const t=e._type;switch(t){case"DateValidationConfiguration":return new r(e);case"DeAddressParserConfiguration":return new o(e);case"EuropeanHealthInsuranceCardConfiguration":return new s(e);case"MRZFallbackConfiguration":return new c(e);case"AutoFocusConfiguration":return new u(e);case"GlareDetectionConfiguration":return new l(e);case"DocumentDataExtractorCommonConfiguration":return new d(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class r{constructor(e={}){if(this._type="DateValidationConfiguration",this.minYear=0,this.maxYear=2999,void 0!==e.minYear&&(this.minYear=e.minYear),void 0!==e.maxYear&&(this.maxYear=e.maxYear),void 0===e.fieldTypeName)throw new Error("fieldTypeName must be present in constructor argument");this.fieldTypeName=e.fieldTypeName}}class o{constructor(e={}){this._type="DeAddressParserConfiguration",this.documentTypes=[],this.binaryFileAddressDatabase="",void 0!==e.documentTypes&&(this.documentTypes=e.documentTypes.map((e=>e))),void 0!==e.binaryFileAddressDatabase&&(this.binaryFileAddressDatabase=e.binaryFileAddressDatabase)}}const a=["AUSTRIA","BELGIUM","BULGARIA","CROATIA","CYPRUS","CZECH_REPUBLIC","DENMARK","ESTONIA","FINLAND","FRANCE","GERMANY","GREECE","HUNGARY","IRELAND","ITALY","LATVIA","LITHUANIA","LUXEMBOURG","MALTA","NETHERLANDS","POLAND","PORTUGAL","ROMANIA","SLOVAKIA","SLOVENIA","SPAIN","SWEDEN","SWITZERLAND"];class s{constructor(e={}){this._type="EuropeanHealthInsuranceCardConfiguration",this.expectedCountry=null,void 0!==e.expectedCountry&&(this.expectedCountry=null!=e.expectedCountry&&a.includes(e.expectedCountry)?e.expectedCountry:null)}}class c{constructor(e={}){this._type="MRZFallbackConfiguration",this.acceptedCountries=[],this.acceptedMRZTypes=[],void 0!==e.acceptedCountries&&(this.acceptedCountries=e.acceptedCountries.map((e=>e))),void 0!==e.acceptedMRZTypes&&(this.acceptedMRZTypes=e.acceptedMRZTypes.map((e=>e)))}}class u{constructor(e={}){this._type="AutoFocusConfiguration",this.sensitivityThreshold=.02,void 0!==e.sensitivityThreshold&&(this.sensitivityThreshold=e.sensitivityThreshold)}}class l{constructor(e={}){this._type="GlareDetectionConfiguration",this.glareDetectionThreshold=.5,void 0!==e.glareDetectionThreshold&&(this.glareDetectionThreshold=e.glareDetectionThreshold)}}class d{constructor(e={}){if(this._type="DocumentDataExtractorCommonConfiguration",void 0===e.acceptedDocumentTypes)throw new Error("acceptedDocumentTypes must be present in constructor argument");this.acceptedDocumentTypes=e.acceptedDocumentTypes.map((e=>e))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(30),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.a({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.DocumentQualityAnalyzer.create(new i.a(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.DocumentQualityAnalyzer.run(this.objectId,e);return{result:new i.b(o.result),originalImage:new r.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.DocumentQualityAnalyzer.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(15),r=n(10),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new i.d({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.DocumentScanner.create(new i.d(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.DocumentScanner.run(this.objectId,e);return{result:new i.a(o.result),originalImage:new r.a(o.originalImage)}}))}scan(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.DocumentScanner.scan(this.objectId,e);return{result:new i.g(o.result),originalImage:new r.a(o.originalImage)}}))}clearResult(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.DocumentScanner.clearResult(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.DocumentScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(35),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e){return o(this,void 0,void 0,(function*(){const t=yield e.copyArgs.ImageProcessor.create();return new a(e,t)}))}crop(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const r="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield r.ImageProcessor.crop(this.objectId,e,t.map((e=>({x:e.x,y:e.y}))));return{result:new i.a(o.result),originalImage:new i.a(o.originalImage)}}))}resize(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const r="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield r.ImageProcessor.resize(this.objectId,e,t);return{result:new i.a(o.result),originalImage:new i.a(o.originalImage)}}))}rotate(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const r="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield r.ImageProcessor.rotate(this.objectId,e,t);return{result:new i.a(o.result),originalImage:new i.a(o.originalImage)}}))}applyFilter(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const o="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,a=yield o.ImageProcessor.applyFilter(this.objectId,e,r.i.From(t));return{result:new i.a(a.result),originalImage:new i.a(a.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.ImageProcessor.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(55),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e){return o(this,void 0,void 0,(function*(){const t=yield e.copyArgs.MedicalCertificateScanner.create();return new a(e,t)}))}run(e,t,n="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const o="COPY_IMAGE"===n?this.workerBridge.copyArgs:this.workerBridge.transferArgs,a=yield o.MedicalCertificateScanner.run(this.objectId,e,new r.i(t));return{result:new r.j(a.result),originalImage:new i.a(a.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.MedicalCertificateScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(75),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e){return o(this,void 0,void 0,(function*(){const t=yield e.copyArgs.OcrEngine.create();return new a(e,t)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.OcrEngine.run(this.objectId,e);return{result:new r.e(o.result),originalImage:new i.a(o.originalImage)}}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.OcrEngine.destroy(this.objectId)}))}}},function(e,t,n){"use strict";var i;n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"f",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return c})),function(e){e.From=function(e){const t=e._type;switch(t){case"Glyph":return new r(e);case"Word":return new o(e);case"Line":return new a(e);case"Block":return new s(e);case"Page":return new c(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class r{constructor(e={}){if(this._type="Glyph",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");this.roi=e.roi.map((e=>({x:e.x,y:e.y})))}}class o{constructor(e={}){if(this._type="Word",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.glyphs)throw new Error("glyphs must be present in constructor argument");this.glyphs=e.glyphs.map((e=>new r(e)))}}class a{constructor(e={}){if(this._type="Line",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.words)throw new Error("words must be present in constructor argument");this.words=e.words.map((e=>new o(e)))}}class s{constructor(e={}){if(this._type="Block",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.lines)throw new Error("lines must be present in constructor argument");this.lines=e.lines.map((e=>new a(e)))}}class c{constructor(e={}){if(this._type="Page",void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,void 0===e.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=e.confidence,void 0===e.roi)throw new Error("roi must be present in constructor argument");if(this.roi=e.roi.map((e=>({x:e.x,y:e.y}))),void 0===e.blocks)throw new Error("blocks must be present in constructor argument");this.blocks=e.blocks.map((e=>new s(e)))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(31),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new r.e({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.TextPatternScanner.create(new r.e(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.TextPatternScanner.run(this.objectId,e);return{result:new r.f(o.result),originalImage:new i.a(o.originalImage)}}))}cleanRecognitionQueue(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.TextPatternScanner.cleanRecognitionQueue(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.TextPatternScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(10),r=n(39),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class a{constructor(e,t){this.workerBridge=e,this.objectId=t}static create(e,t=new r.c({})){return o(this,void 0,void 0,(function*(){const n=yield e.copyArgs.VinScanner.create(new r.c(t));return new a(e,n)}))}run(e,t="COPY_IMAGE"){return o(this,void 0,void 0,(function*(){const n="COPY_IMAGE"===t?this.workerBridge.copyArgs:this.workerBridge.transferArgs,o=yield n.VinScanner.run(this.objectId,e);return{result:new r.d(o.result),originalImage:new i.a(o.originalImage)}}))}cleanRecognitionQueue(){return o(this,void 0,void 0,(function*(){const e=this.workerBridge.copyArgs;return yield e.VinScanner.cleanRecognitionQueue(this.objectId)}))}destroy(){return o(this,void 0,void 0,(function*(){return this.workerBridge.copyArgs.VinScanner.destroy(this.objectId)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(5),r=n(79);class o extends i.a{constructor(e={}){if(super(),void 0===e.rawMRZ)throw new Error("rawMRZ must be present in constructor argument");if(this.rawMRZ=e.rawMRZ,void 0===e.mrzDocument)throw new Error("mrzDocument must be present in constructor argument");this.mrzDocument=null!=e.mrzDocument?new r.f(e.mrzDocument):null}}},function(e,t,n){"use strict";var i=n(19);n.d(t,"a",(function(){return i.a})),n.d(t,"b",(function(){return i.b})),n.d(t,"c",(function(){return i.c})),n.d(t,"d",(function(){return i.d})),n.d(t,"e",(function(){return i.e})),n.d(t,"f",(function(){return i.f})),n.d(t,"g",(function(){return i.g})),n.d(t,"h",(function(){return i.h}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));class i{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(e,t,n){Object.keys(e).forEach((i=>{(null==n?void 0:n.includes(i))||(t[i]=e[i])}))}static mapValuesDeep(e,t){const n=e=>e&&"object"==typeof e&&!Array.isArray(e);Object.keys(e).forEach((r=>{r in t&&n(e[r])&&n(t[r])?i.mapValuesDeep(e[r],t[r]):t[r]=e[r]}))}static _fromJson(e,t){return this.mapValuesDeep(t,e),e}}},function(e,t,n){"use strict";var i=n(35);n.d(t,"a",(function(){return i.i}))},function(e,t,n){"use strict";class i{}i.VERSION="8.0.0-beta.5",i.BUILD_WITH_UI=!1;var r=n(48);class o extends Error{constructor(e){super("License error!",{cause:e})}}class a extends Error{constructor(){super('Error initializing the ScanbotSDK worker. Most likely, this is caused by an incorrect enginePath parameter set during the SDK initialization. Please check your browser\'s developer tools -> "Network" tab to see if any JS or WASM files failed to load. Note that you need to set up your webserver to serve these files under a certain path and then adjust the "enginePath" parameter accordingly. Please refer to the "Initialization" section in our documentation for more information.')}}class s extends Error{constructor(e,t,n){super(`Version mismatch! Version of ScanbotSDK.(ui2.)min.js is "${t}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${n}". \nThe ScanbotSDK.Core*.js file was loaded from ${e}.`)}}var c=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class u{constructor(e,t,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),this.core=new r.a(e,t),this.initializationStatus=(()=>c(this,void 0,void 0,(function*(){try{yield this.core.copyArgs.initialize(...n)}catch(e){return"InvalidLicense"===(null==e?void 0:e.errorType)?new o(e):new a}let t;try{t=yield this.core.copyArgs.version()}catch(e){t="Error"}const r=i.VERSION;return t!==r?new s(e,r,t):"OK"})))(),this.api=(()=>{const e={};for(const t in this.core.api){const n=this.core.api[t];e[t]={};for(const i in n)e[t][i]=(...e)=>c(this,void 0,void 0,(function*(){return(yield this.getCoreForCommand()).api[t][i](...e)}))}return e})()}awaitInitialized(){return c(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(e){return new Proxy({},{get:(t,n,i)=>(...t)=>c(this,void 0,void 0,(function*(){const i=yield this.getCoreForCommand(n),r="copy"===e?i.copyArgs:i.transferArgs;return yield r[n](...t)}))})}getCoreForCommand(e=""){return c(this,void 0,void 0,(function*(){const t=yield this.initializationStatus;if("OK"===t||"getLicenseInfo"===e&&t instanceof o)return this.core;throw t}))}}var l=n(42),d=n(8);class m extends d.LicenseInfo{isValid(){return"OKAY"===this.status||"TRIAL"===this.status||"OKAY_EXPIRING_SOON"===this.status}constructor(e){super(e)}}var h=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class f{constructor(e,t){this._sdk=e,this._pdfOperation=t}addPage(e,t={}){return h(this,void 0,void 0,(function*(){const{consumeImage:n="COPY_IMAGE",runOcr:i}=t,r=this._sdk.getBridge(n);i?yield r.addPageToPdfWithOcr(this._pdfOperation,e):yield r.addPageToPdf(this._pdfOperation,e)}))}addPages(e,t){return h(this,void 0,void 0,(function*(){for(const n of e.pages){const e=yield n.finalRawImage();yield this.addPage(e,{runOcr:t})}}))}complete(){return h(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var p=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class g{constructor(e,t){this._sdk=e,this._tiffOperation=t}addPage(e,t={}){return p(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:i="COPY_IMAGE"}=t,r=this._sdk.getBridge(i);yield r.addPageToTiff(this._tiffOperation,e,n)}))}addPages(e,t={}){return p(this,void 0,void 0,(function*(){for(const n of e.pages){const e=yield n.finalRawImage();yield this.addPage(e,t)}}))}complete(){return p(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var v=n(34);class y{static toPixelSize(e){return e+"px"}static containsString(e,t){return!!e&&-1!==e.indexOf(t)}static copy(e){return JSON.parse(JSON.stringify(e))}static getProperty(e,t){if(e&&e.hasOwnProperty(t))return e[t]}static uuid(){let e="";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*n));return e}}var C=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class b{static toDataUrl(e){return new Promise(((t,n)=>{const i=new Blob([e],{type:"image/jpeg"}),r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error),r.readAsDataURL(i)}))}static getObjectFitSize(e,t,n=!0){const i=t.width/t.height,r=e.width/e.height;let o=0,a=0;(n?i>r:i<r)?(o=e.width,a=o/i):(a=e.height,o=a*i);const s=(e.width-o)/2,c=(e.height-a)/2;return new v.a(s,c,o,a)}static loadFromUrl(e){return new Promise(((t,n)=>{const i=document.createElement("img");i.src=e,i.onload=()=>C(this,void 0,void 0,(function*(){const e=document.createElement("canvas");e.width=i.width,e.height=i.height;const n=e.getContext("2d");n.drawImage(i,0,0);const r=n.getImageData(0,0,i.width,i.height);t(r)})),i.onerror=n}))}static saveImageData(e){const t=this.createImageDataCanvas(e),n=" ("+e.width+"x"+e.height+")";t.toBlob((e=>this.saveBlob(e,y.uuid()+n+".png")))}static createImageDataCanvas(e){const t=document.createElement("canvas");return t.className="scanbot-sdk-canvas-element",t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t}static saveBlob(e,t){let n=document.createElement("a");n.setAttribute("download",t);let i=URL.createObjectURL(e);n.setAttribute("href",i),n.click()}static convertImageDataWrapperToImageData(e){if(e)return new ImageData(e.data,e.width,e.height)}static wrapperToBase64(e){return b.createImageDataCanvas(b.convertImageDataWrapperToImageData(e)).toDataURL("image/png")}static toBase64(e,t=!0){return C(this,void 0,void 0,(function*(){const n=yield new Promise((t=>{const n=new FileReader;n.onload=()=>t(n.result),n.readAsDataURL(new Blob([e]))}));return t?n.slice(n.indexOf(",")+1):n}))}static imageUrlToImageData(e){return C(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const i=document.createElement("canvas"),r=document.createElement("img");r.src=e,r.onload=()=>C(this,void 0,void 0,(function*(){i.width=r.width,i.height=r.height;const e=i.getContext("2d");e.drawImage(r,0,0);const n=e.getImageData(0,0,r.width,r.height);t(n)})),r.onerror=n}))}))}}class A{saveImageAsJpeg(e,t){if(!e||0===e.length)return void console.log("Data cannot be null or empty");t||(t=y.uuid()+".jpeg");let n=new Blob([e],{type:"image/jpeg"});b.saveBlob(n,t)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let e=this.findFlashElement();e.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{e.style.opacity="1.0",e.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(e,t){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=e,t()}),150)}getOrCreateElement(e,t){let n=this.getElementByClassName(e);return n||(this.createElement(e,t),n=this.getElementByClassName(e)),n}createElement(e,t){let n=document.createElement("div");n.className=e,n.style.cssText=this.cssToString(t),document.body.append(n)}cssToString(e){let t="";return Object.keys(e).forEach((n=>{t+=n+":"+e[n]+";"})),t}getElementByClassName(e){const t=document.getElementsByClassName(e);if(0!==t.length)return t[0]}}var S=n(17),w=n(26);class E extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new d.TextPatternScannerConfiguration,this.onTextDetected=function(e){},this.finder.aspectRatio=new d.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(e){const t=new E;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class D extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.detectionConfiguration=new d.VinScannerConfiguration,this.onVinDetected=function(e){},this.finder.aspectRatio=new d.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(e){const t=new D;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class x extends Error{constructor(e){super(e.licenseStatusMessage),this.name="LicenseError"}}class B{static throwIfMissingBuffer(e){B.throwIfMissing(e,"ImageBuffer may not be null")}static throwIfMissing(e,t){if(!e)throw new Error(t)}}var I=n(23),T=n(0),O=n(21),k=n(20),P=n(2),L=n.n(P),_=n(3);const R="var(--1-sb-dvh, 1vh)";function M(){const e=Object(T.useMemo)((()=>{var e,t;return null===(t=null===(e=null===window||void 0===window?void 0:window.CSS)||void 0===e?void 0:e.supports)||void 0===t?void 0:t.call(e,"height: 100dvh")}),[]),t=()=>{var t=e?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",t)};return Object(T.useEffect)((()=>{if(t(),!e)return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}})),null}var F=n(36),N=n(9),V=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function W(e){const{polygonConfig:t}=e,n=V(e,["polygonConfig"]),i=Object.assign(Object.assign({},e.style),{backgroundColor:_.b.getColorValue(t.fillColor),borderColor:_.b.getColorValue(t.strokeColor),borderWidth:t.strokeWidth,borderRadius:t.cornerRadius,borderStyle:"solid"});return T.default.createElement(P.Box,Object.assign({},n,{style:i}))}function j(e){return e=_.b.getColorValue(e),Object.assign(Object.assign({},function(e){return{color:e=_.b.getColorValue(e),"&:hover":{textDecoration:"underline !important",backgroundColor:"transparent !important"}}}(e)),z(e))}function z(e){return{"&:focus-visible":{outlineColor:`${e=_.b.getColorValue(e)} !important`,outlineWidth:"2px !important",outlineStyle:"solid !important"}}}function H(e){var t;const n=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{};return T.default.createElement(T.default.Fragment,null,e.config.visible&&T.default.createElement(P.IconButton,Object.assign({disabled:!e.enabled,component:null!==(t=e.iconButtonComponent)&&void 0!==t?t:"button","aria-label":_.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign({opacity:e.enabled?1:.5,backgroundColor:_.b.getColorValue(e.config.background.fillColor),borderWidth:e.config.background.strokeWidth,borderColor:_.b.getColorValue(e.config.background.strokeColor),borderStyle:"solid",borderRadius:"4px",visibility:e.config.visible?"visible":"hidden",flexDirection:"column"},j(e.config.title.color)),onClick:e.onClick},n),e.config.icon.visible&&T.default.createElement(e.icon,{color:_.b.getColorValue(e.config.icon.color)}),e.children,T.default.createElement(N.a,{config:e.config.title,style:{fontSize:12,marginTop:8}})))}const U=new Map;function Z(e){const t=function(e){if(!U.has(e)){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");n.clearRect(0,0,1,1),n.fillStyle="#000",n.fillStyle=e;const i=n.fillStyle;if(n.fillStyle="#fff",n.fillStyle=e,i!==n.fillStyle)return U.set(e,null),null;n.fillRect(0,0,1,1);const r=[...n.getImageData(0,0,1,1).data];U.set(e,{r:r[0],g:r[1],b:r[2],a:r[3]})}return U.get(e)}(e);return 0===(null==t?void 0:t.a)}function G(e){var t,n;if(!e.visible)return T.default.createElement("div",{style:{display:"flex",flex:1}});const i=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{},r="right"===(null!==(t=e.iconPosition)&&void 0!==t?t:"left");let o={};Z(_.b.getColorValue(e.background.fillColor))&&(o={textDecoration:"underline"});return T.default.createElement(P.Button,Object.assign({id:e.id,"aria-label":e.ariaLabel,disabled:null!==(n=e.disabled)&&void 0!==n&&n,variant:"text",onClick:e.onClick,style:Object(N.b)(e.foreground),sx:Object.assign({opacity:e.disabled?.5:1,flex:1,textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},"&:hover":o,"&:focus-visible > div":{outlineColor:_.b.getColorValue(e.foreground.color),outlineWidth:2,outlineStyle:"solid"},px:0,alignItems:"center"},e.buttonWidth?{width:(()=>{if(e.buttonWidth)return"string"==typeof e.buttonWidth?e.buttonWidth:`${e.buttonWidth}px`})(),minWidth:0}:{}),disableRipple:!0},i),T.default.createElement(W,{polygonConfig:Object.assign(Object.assign({},e.background),{cornerRadius:4}),sx:Object.assign({borderStyle:"solid",mx:"4px",px:"4px",display:"flex",alignItems:"center"},e.styleOverrides)},e.foreground.iconVisible&&!r&&e.icon,_.b.getLocalizedText(e.text),e.foreground.iconVisible&&r&&e.icon))}F.a;const Y=T.default.createContext(null);function Q(e){const t=e.mode,n="HIDDEN"===t?0:48;Object(T.useEffect)((()=>{if("HIDDEN"===t)return;const n=document.createElement("meta");return n.name="theme-color",n.content=_.b.getColorValue(e.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[t]);const i="SOLID"===t?0:n,r={height:n,remainingVisibleBodyHeight:"SOLID"===t?`calc(100 * ${R} - ${n}px)`:`calc(100 * ${R})`,minTopPaddingForContent:i,minTopPaddingForViewFinder:10+i},o="SOLID"===t?{backgroundColor:_.b.getColorValue(e.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${_.b.getColorValue(e.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"},a=T.default.createElement(L.a,{sx:{fontSize:24}}),s=e.cancelButton.visible&&!e.cameraPermissionDenied;return T.default.createElement(T.default.Fragment,null,"HIDDEN"!==t&&T.default.createElement(P.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},o)},T.default.createElement(P.Toolbar,{variant:"dense",sx:{height:n,minHeight:n,padding:0}},T.default.createElement(P.Box,{sx:{flex:1}},s&&T.default.createElement(T.default.Fragment,null,T.default.createElement(G,Object.assign({onClick:e.onBackPress,icon:e.cancelButton.foreground.iconVisible&&a},e.cancelButton)))),T.default.createElement(P.Box,null,T.default.createElement(P.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},T.default.createElement(N.a,{config:e.title}))),T.default.createElement(P.Box,{sx:{flex:1,alignItems:"right"}},!e.cameraPermissionDenied&&e.rightItem))),T.default.createElement(Y.Provider,{value:r},e.children))}function q(e){return{textOverflow:"ellipsis",WebkitBoxOrient:"vertical",WebkitLineClamp:`${e}`,overflow:"hidden",whiteSpace:e>1?"normal":"nowrap",display:e>1?"-webkit-box":"block"}}function X(e){if(e.loading)return T.default.createElement(P.Skeleton,{variant:"rounded",width:e.imageSize,height:e.imageSize,style:{borderRadius:8}});if(null===e.data.barcodeImage){const t={width:e.imageSize,height:e.imageSize,backgroundColor:"#E0E0E0",borderRadius:3};return T.default.createElement(P.Box,{sx:t})}const t={width:e.imageSize,height:e.imageSize,borderRadius:8};return T.default.createElement("img",{src:e.data.barcodeImage,alt:e.data.title,style:t})}function K(e){var t,n;const i=(null===(t=e.barcodeMappedData)||void 0===t?void 0:t.state)||"LOADING",r=(null===(n=e.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},o=!e||"LOADED"!==i,a=e.imageSize,s=e.barcodeTitle.visible||e.barcodeSubtitle.visible||e.counterForm,c=e.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:_.b.getColorValue(e.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}},u=Object(T.useRef)(),[l,d]=Object(T.useState)("100%");return Object(T.useEffect)((()=>{var t;const n=e.readonlyCount?.87:.97,i=null===(t=u.current)||void 0===t?void 0:t.parentNode,r=i&&i.clientWidth>0?i.clientWidth*n:"100%";d(r)})),T.default.createElement(P.Box,{ref:u,sx:{display:"flex",maxWidth:l},"data-sb-barcode-info":"1"},e.barcodeImageVisible&&T.default.createElement(P.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},T.default.createElement(X,{data:r,imageSize:a,loading:o})),s&&T.default.createElement(P.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},e.barcodeTitle.visible&&T.default.createElement(P.Box,{display:o?"block":"flex",sx:{alignItems:"center"}},T.default.createElement(P.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign(Object.assign({},q(e.maxNumberOfTitleLines)),Object(N.b)(e.barcodeTitle)),{textOverflow:"ellipsis",overflow:"hidden",display:"inline-block"})},o?T.default.createElement(P.Skeleton,{variant:"text"}):r.title),e.displayRightArrow&&!o&&T.default.createElement(L.a,{sx:{fontSize:16,fontWeight:"bold",color:_.b.getColorValue(e.barcodeTitle.color)}})),e.barcodeSubtitle.visible&&T.default.createElement(P.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},q(e.maxNumberOfSubtitleLines)),Object(N.b)(e.barcodeSubtitle))},o?T.default.createElement(P.Skeleton,{variant:"text"}):r.subtitle),e.counterForm&&T.default.createElement(P.ButtonGroup,{variant:"outlined"},T.default.createElement(P.Button,{disabled:!e.counterForm.removeButtonEnabled,sx:c,style:{opacity:e.counterForm.removeButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter-1),disableRipple:!0},T.default.createElement(L.a,{sx:{color:_.b.getColorValue(e.counterForm.manualCountChangeColor)}})),T.default.createElement(P.Button,{sx:Object.assign(Object.assign({},c),{color:_.b.getColorValue(e.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:e.counterForm.onNumberClick,disableRipple:!0},e.counterForm.counter),T.default.createElement(P.Button,{disabled:!e.counterForm.addButtonEnabled,sx:c,style:{opacity:e.counterForm.addButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter+1),disableRipple:!0},T.default.createElement(L.a,{sx:{color:_.b.getColorValue(e.counterForm.manualCountChangeColor)}})))))}k.ButtonConfiguration;function J(e){var t;if(!e.visible)return null;const n={["data-sb-button-"+e.debugName]:!0};return T.default.createElement(P.Button,Object.assign({disabled:null!==(t=e.disabled)&&void 0!==t&&t,onClick:e.onClick,type:e.type,"aria-label":e.accessibilityDescription,sx:Object.assign(Object.assign({},e.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:_.b.getColorValue(e.background.strokeColor),borderWidth:e.background.strokeWidth,backgroundColor:_.b.getColorValue(e.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},n),e.foreground.iconVisible&&e.icon&&T.default.createElement(e.icon,{sx:{color:_.b.getColorValue(e.foreground.color),pr:2}}),T.default.createElement(N.a,{config:{visible:!0,text:e.text,color:e.foreground.color,useShadow:e.foreground.useShadow}}))}var $=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function ee(e){var t,{modalOverlayColor:n}=e,i=$(e,["modalOverlayColor"]);const r={backdrop:{style:{backgroundColor:_.b.getColorValue(n)}}},o=Object.assign(Object.assign({},i.PaperProps),{sx:Object.assign(Object.assign({},null===(t=i.PaperProps)||void 0===t?void 0:t.sx),i.width?{width:i.width}:{maxWidth:400})});return T.default.createElement(P.Dialog,Object.assign({},i,{componentsProps:r,PaperProps:o}))}function te(e){const t=Object(T.useContext)(_.a).getColorValue,n=!e.barcodeMappedData||"LOADED"!==e.barcodeMappedData.state,i={backgroundColor:t(n?e.sheetColorLoading:e.sheetColorLoaded)},[r,o]=T.default.useState(),a=Object(T.useRef)((()=>{}));Object(T.useEffect)((()=>{e.open&&o(!1)}),[e.open]);const s=()=>{a.current=e.handleCancel,o(!0)};return T.default.createElement(ee,{modalOverlayColor:e.modalOverlayColor,open:e.open&&!r,fullWidth:!0,TransitionProps:{onExited:()=>{r&&a.current()}},onClose:()=>{n||s()}},T.default.createElement(P.DialogContent,{style:i},T.default.createElement(K,Object.assign({},e,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),T.default.createElement(P.DialogActions,{style:i},T.default.createElement(L.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},T.default.createElement(L.a,{item:!0,xs:12},T.default.createElement(L.a,{color:t(e.dividerColor)})),n?T.default.createElement(L.a,{item:!0,xs:12,sx:{textAlign:"center"}},T.default.createElement(P.Box,null,T.default.createElement(P.CircularProgress,{sx:{color:t(e.loadingMessage.color),verticalAlign:"middle",mr:2}}),T.default.createElement(N.a,{config:e.loadingMessage}))):T.default.createElement(T.default.Fragment,null,T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},onClick:s},e.cancelButton))),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},onClick:()=>{a.current=e.handleSubmit,o(!0)}},e.submitButton)))))))}var ne=n(1);ne.m;function ie(e){if(!1===e.visible)return null;const t={backgroundColor:e.active?_.b.getColorValue(e.activeBackgroundColor):_.b.getColorValue(e.backgroundColor),color:e.active?_.b.getColorValue(e.activeForegroundColor):_.b.getColorValue(e.foregroundColor)};return T.default.createElement(P.IconButton,{sx:Object.assign(Object.assign({},t),{"&:hover, &:focus":Object.assign({outline:"none"},t),width:48,height:48}),onClick:e.onClick},e.text&&T.default.createElement("span",{style:{fontSize:15}},_.b.getLocalizedText(e.text)),e.icon&&T.default.createElement(e.icon,{style:{padding:7}}))}var re=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class oe{constructor(){this.audioFile=new Audio}initialize(e){return re(this,void 0,void 0,(function*(){e.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===e.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===e.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(e){e.successBeepEnabled&&this.play()}play(){return re(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(e){}}))}}oe.INSTANCE=new oe;var ae=oe;class se{constructor(){this.DURATION=200}vibrate(e){e.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}se.INSTANCE=new se;var ce=se,ue=n(14),le=n(58),de=n(56),me=n(4),he=function(e){return{isEnabled:function(t){return e.some((function(e){return!!t[e]}))}}},fe={measureLayout:he(["layout","layoutId","drag","_layoutResetTransform"]),animation:he(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:he(["exit"]),drag:he(["drag","dragControls"]),focus:he(["whileFocus"]),hover:he(["whileHover","onHoverStart","onHoverEnd"]),tap:he(["whileTap","onTap","onTapStart","onTapCancel"]),pan:he(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:he(["layout","layoutId"])};var pe=Object(T.createContext)({strict:!1}),ge=Object.keys(fe),ve=ge.length;var ye=Object(T.createContext)({transformPagePoint:function(e){return e},isStatic:!1}),Ce=Object(T.createContext)({});var be=Object(T.createContext)(null);function Ae(e){var t=Object(T.useRef)(null);return null===t.current&&(t.current=e()),t.current}function Se(){var e=Object(T.useContext)(be);if(null===e)return[!0,null];var t=e.isPresent,n=e.onExitComplete,i=e.register,r=xe();Object(T.useEffect)((function(){return i(r)}),[]);return!t&&n?[!1,function(){return null==n?void 0:n(r)}]:[!0]}function we(e){return null===e||e.isPresent}var Ee=0,De=function(){return Ee++},xe=function(){return Ae(De)},Be=Object(T.createContext)(null),Ie="undefined"!=typeof window,Te=Ie?T.useLayoutEffect:T.useEffect;function Oe(e,t,n,i){var r=Object(T.useContext)(ye),o=Object(T.useContext)(pe),a=Object(T.useContext)(Ce).visualElement,s=Object(T.useContext)(be),c=function(e){var t=e.layoutId,n=Object(T.useContext)(Be);return n&&void 0!==t?n+"-"+t:t}(n),u=Object(T.useRef)(void 0);i||(i=o.renderer),!u.current&&i&&(u.current=i(e,{visualState:t,parent:a,props:Object(me.a)(Object(me.a)({},n),{layoutId:c}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var l=u.current;return Te((function(){l&&(l.setProps(Object(me.a)(Object(me.a)(Object(me.a)({},r),n),{layoutId:c})),l.isPresent=we(s),l.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),l.syncRender())})),Object(T.useEffect)((function(){var e;l&&(null===(e=l.animationState)||void 0===e||e.animateChanges())})),Te((function(){return function(){return null==l?void 0:l.notifyUnmount()}}),[]),l}function ke(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Pe(e){return Array.isArray(e)}function Le(e){return"string"==typeof e||Pe(e)}function _e(e,t,n,i,r){var o;return void 0===i&&(i={}),void 0===r&&(r={}),"string"==typeof t&&(t=null===(o=e.variants)||void 0===o?void 0:o[t]),"function"==typeof t?t(null!=n?n:e.custom,i,r):t}function Re(e,t,n){var i=e.getProps();return _e(i,t,null!=n?n:i.custom,function(e){var t={};return e.forEachValue((function(e,n){return t[n]=e.get()})),t}(e),function(e){var t={};return e.forEachValue((function(e,n){return t[n]=e.getVelocity()})),t}(e))}function Me(e){var t;return"function"==typeof(null===(t=e.animate)||void 0===t?void 0:t.start)||Le(e.initial)||Le(e.animate)||Le(e.whileHover)||Le(e.whileDrag)||Le(e.whileTap)||Le(e.whileFocus)||Le(e.exit)}function Fe(e){return Boolean(Me(e)||e.variants)}function Ne(e,t){var n=function(e,t){if(Me(e)){var n=e.initial,i=e.animate;return{initial:!1===n||Le(n)?n:void 0,animate:Le(i)?i:void 0}}return!1!==e.inherit?t:{}}(e,Object(T.useContext)(Ce)),i=n.initial,r=n.animate;return Object(T.useMemo)((function(){return{initial:i,animate:r}}),t?[Ve(i),Ve(r)]:[])}function Ve(e){return Array.isArray(e)?e.join(" "):e}function We(e){var t=e.preloadedFeatures,n=e.createVisualElement,i=e.useRender,r=e.useVisualState,o=e.Component;return t&&function(e){for(var t in e){var n=e[t];null!==n&&(fe[t].Component=n)}}(t),Object(T.forwardRef)((function(e,t){var a=Object(T.useContext)(ye).isStatic,s=null,c=Ne(e,a),u=r(e,a);return!a&&Ie&&(c.visualElement=Oe(o,u,e,n),s=function(e,t,n){var i=[];if(Object(T.useContext)(pe),!t)return null;for(var r=0;r<ve;r++){var o=ge[r],a=fe[o],s=a.isEnabled,c=a.Component;s(e)&&c&&i.push(T.createElement(c,Object(me.a)({key:o},e,{visualElement:t})))}return i}(e,c.visualElement)),T.createElement(T.Fragment,null,T.createElement(Ce.Provider,{value:c},i(o,e,function(e,t,n){return Object(T.useCallback)((function(i){var r;i&&(null===(r=e.mount)||void 0===r||r.call(e,i)),t&&(i?t.mount(i):t.unmount()),n&&("function"==typeof n?n(i):ke(n)&&(n.current=i))}),[t])}(u,c.visualElement,t),u,a)),s)}))}function je(e){function t(t,n){return void 0===n&&(n={}),We(e(t,n))}var n=new Map;return new Proxy(t,{get:function(e,i){return n.has(i)||n.set(i,t(i)),n.get(i)}})}var ze=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function He(e){return"string"==typeof e&&!e.includes("-")&&!!(ze.indexOf(e)>-1||/[A-Z]/.test(e))}var Ue={};var Ze=["","X","Y","Z"],Ge=["transformPerspective","x","y","z"];function Ye(e,t){return Ge.indexOf(e)-Ge.indexOf(t)}["translate","scale","rotate","skew"].forEach((function(e){return Ze.forEach((function(t){return Ge.push(e+t)}))}));var Qe=new Set(Ge);function qe(e){return Qe.has(e)}var Xe=new Set(["originX","originY","originZ"]);function Ke(e){return Xe.has(e)}function Je(e,t){var n=t.layout,i=t.layoutId;return qe(e)||Ke(e)||(n||void 0!==i)&&(!!Ue[e]||"opacity"===e)}var $e=function(e){return null!==e&&"object"==typeof e&&e.getVelocity},et={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function tt(e){return e.startsWith("--")}var nt=function(e,t){return t&&"number"==typeof e?t.transform(e):e},it=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},rt=function(e){return e%1?Number(e.toFixed(5)):e},ot=/(-)?([\d]*\.?[\d])+/g,at=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,st=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function ct(e){return"string"==typeof e}var ut=function(e){return{test:function(t){return ct(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},lt=ut("deg"),dt=ut("%"),mt=ut("px"),ht=ut("vh"),ft=ut("vw"),pt=Object(me.a)(Object(me.a)({},dt),{parse:function(e){return dt.parse(e)/100},transform:function(e){return dt.transform(100*e)}}),gt={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},vt=Object(me.a)(Object(me.a)({},gt),{transform:it(0,1)}),yt=Object(me.a)(Object(me.a)({},gt),{default:1}),Ct=Object(me.a)(Object(me.a)({},gt),{transform:Math.round}),bt={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,radius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,size:mt,top:mt,right:mt,bottom:mt,left:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,rotate:lt,rotateX:lt,rotateY:lt,rotateZ:lt,scale:yt,scaleX:yt,scaleY:yt,scaleZ:yt,skew:lt,skewX:lt,skewY:lt,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:vt,originX:pt,originY:pt,originZ:mt,zIndex:Ct,fillOpacity:vt,strokeOpacity:vt,numOctaves:Ct};function At(e,t,n,i,r,o,a,s){var c,u=e.style,l=e.vars,d=e.transform,m=e.transformKeys,h=e.transformOrigin;m.length=0;var f=!1,p=!1,g=!0;for(var v in t){var y=t[v];if(tt(v))l[v]=y;else{var C=bt[v],b=nt(y,C);if(qe(v)){if(f=!0,d[v]=b,m.push(v),!g)continue;y!==(null!==(c=C.default)&&void 0!==c?c:0)&&(g=!1)}else if(Ke(v))h[v]=b,p=!0;else if((null==n?void 0:n.isHydrated)&&(null==i?void 0:i.isHydrated)&&Ue[v]){var A=Ue[v].process(y,i,n),S=Ue[v].applyTo;if(S)for(var w=S.length,E=0;E<w;E++)u[S[E]]=A;else u[v]=A}else u[v]=b}}i&&n&&a&&s?(u.transform=a(i.deltaFinal,i.treeScale,f?d:void 0),o&&(u.transform=o(d,u.transform)),u.transformOrigin=s(i)):(f&&(u.transform=function(e,t,n,i){var r=e.transform,o=e.transformKeys,a=t.enableHardwareAcceleration,s=void 0===a||a,c=t.allowTransformNone,u=void 0===c||c,l="";o.sort(Ye);for(var d=!1,m=o.length,h=0;h<m;h++){var f=o[h];l+=(et[f]||f)+"("+r[f]+") ","z"===f&&(d=!0)}return!d&&s?l+="translateZ(0)":l=l.trim(),i?l=i(r,n?"":l):u&&n&&(l="none"),l}(e,r,g,o)),p&&(u.transformOrigin=function(e){var t=e.originX,n=void 0===t?"50%":t,i=e.originY,r=void 0===i?"50%":i,o=e.originZ;return n+" "+r+" "+(void 0===o?0:o)}(h)))}var St=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function wt(e,t,n){for(var i in t)$e(t[i])||Je(i,n)||(e[i]=t[i])}function Et(e,t,n){var i={};return wt(i,e.style||{},e),Object.assign(i,function(e,t,n){var i=e.transformTemplate;return Object(T.useMemo)((function(){var e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};At(e,t,void 0,void 0,{enableHardwareAcceleration:!n},i);var r=e.vars,o=e.style;return Object(me.a)(Object(me.a)({},r),o)}),[t])}(e,t,n)),e.transformValues&&(i=e.transformValues(i)),i}function Dt(e,t,n){var i={},r=Et(e,t,n);return Boolean(e.drag)&&(i.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),i.style=r,i}var xt=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function Bt(e){return xt.has(e)}var It=function(e){return!Bt(e)};try{var Tt=n(93).default;It=function(e){return e.startsWith("on")?!Bt(e):Tt(e)}}catch(e){}function Ot(e,t,n){return"string"==typeof e?e:mt.transform(t+n*e)}var kt=function(e,t){return mt.transform(e*t)},Pt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Lt={offset:"strokeDashoffset",array:"strokeDasharray"};function _t(e,t,n,i,r,o,a,s){var c=t.attrX,u=t.attrY,l=t.originX,d=t.originY,m=t.pathLength,h=t.pathSpacing,f=void 0===h?1:h,p=t.pathOffset,g=void 0===p?0:p;At(e,Object(me.d)(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,i,r,o,a,s),e.attrs=e.style,e.style={};var v=e.attrs,y=e.style,C=e.dimensions,b=e.totalPathLength;v.transform&&(C&&(y.transform=v.transform),delete v.transform),C&&(void 0!==l||void 0!==d||y.transform)&&(y.transformOrigin=function(e,t,n){return Ot(t,e.x,e.width)+" "+Ot(n,e.y,e.height)}(C,void 0!==l?l:.5,void 0!==d?d:.5)),void 0!==c&&(v.x=c),void 0!==u&&(v.y=u),void 0!==b&&void 0!==m&&function(e,t,n,i,r,o){void 0===i&&(i=1),void 0===r&&(r=0),void 0===o&&(o=!0);var a=o?Pt:Lt;e[a.offset]=kt(-r,t);var s=kt(n,t),c=kt(i,t);e[a.array]=s+" "+c}(v,b,m,f,g,!1)}var Rt=function(){return Object(me.a)(Object(me.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Mt(e,t){var n=Object(T.useMemo)((function(){var n=Rt();return _t(n,t,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Object(me.a)(Object(me.a)({},n.attrs),{style:Object(me.a)({},n.style)})}),[t]);if(e.style){var i={};wt(i,e.style,e),n.style=Object(me.a)(Object(me.a)({},i),n.style)}return n}function Ft(e){void 0===e&&(e=!1);return function(t,n,i,r,o){var a=r.latestValues,s=(He(t)?Mt:Dt)(n,a,o),c=function(e,t,n){var i={};for(var r in e)(It(r)||!0===n&&Bt(r)||!t&&!Bt(r))&&(i[r]=e[r]);return i}(n,"string"==typeof t,e),u=Object(me.a)(Object(me.a)(Object(me.a)({},c),s),{ref:i});return Object(T.createElement)(t,u)}}var Nt=/([a-z])([A-Z])/g,Vt=function(e){return e.replace(Nt,"$1-$2").toLowerCase()};function Wt(e,t){var n=t.style,i=t.vars;for(var r in Object.assign(e.style,n),i)e.style.setProperty(r,i[r])}var jt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function zt(e,t){for(var n in Wt(e,t),t.attrs)e.setAttribute(jt.has(n)?n:Vt(n),t.attrs[n])}function Ht(e){var t=e.style,n={};for(var i in t)($e(t[i])||Je(i,e))&&(n[i]=t[i]);return n}function Ut(e){var t=Ht(e);for(var n in e){if($e(e[n]))t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function Zt(e){return"object"==typeof e&&"function"==typeof e.start}var Gt=function(e){return Array.isArray(e)};function Yt(e){var t,n=$e(e)?e.get():e;return t=n,Boolean(t&&"object"==typeof t&&t.mix&&t.toValue)?n.toValue():n}function Qt(e,t,n,i){var r=e.scrapeMotionValuesFromProps,o=e.createRenderState,a=e.onMount,s={latestValues:Xt(t,n,i,r),renderState:o()};return a&&(s.mount=function(e){return a(t,e,s)}),s}var qt=function(e){return function(t,n){var i=Object(T.useContext)(Ce),r=Object(T.useContext)(be);return n?Qt(e,t,i,r):Ae((function(){return Qt(e,t,i,r)}))}};function Xt(e,t,n,i){var r={},o=!1===(null==n?void 0:n.initial),a=i(e);for(var s in a)r[s]=Yt(a[s]);var c=e.initial,u=e.animate,l=Me(e),d=Fe(e);t&&d&&!l&&!1!==e.inherit&&(null!=c||(c=t.initial),null!=u||(u=t.animate));var m=o||!1===c?u:c;m&&"boolean"!=typeof m&&!Zt(m)&&(Array.isArray(m)?m:[m]).forEach((function(t){var n=_e(e,t);if(n){var i=n.transitionEnd;n.transition;var o=Object(me.d)(n,["transitionEnd","transition"]);for(var a in o)r[a]=o[a];for(var a in i)r[a]=i[a]}}));return r}var Kt={useVisualState:qt({scrapeMotionValuesFromProps:Ut,createRenderState:Rt,onMount:function(e,t,n){var i=n.renderState,r=n.latestValues;try{i.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){i.dimensions={x:0,y:0,width:0,height:0}}"path"===t.tagName&&(i.totalPathLength=t.getTotalLength()),_t(i,r,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),zt(t,i)}})};var Jt,$t={useVisualState:qt({scrapeMotionValuesFromProps:Ht,createRenderState:St})};function en(e,t,n,i){var r=t.forwardMotionProps,o=void 0!==r&&r,a=He(e)?Kt:$t;return Object(me.a)(Object(me.a)({},a),{preloadedFeatures:n,useRender:Ft(o),createVisualElement:i,Component:e})}function tn(e,t,n,i){return e.addEventListener(t,n,i),function(){return e.removeEventListener(t,n,i)}}function nn(e,t,n,i){Object(T.useEffect)((function(){var r=e.current;if(n&&r)return tn(r,t,n,i)}),[e,t,n,i])}function rn(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function on(e){return!!e.touches}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.Exit="exit"}(Jt||(Jt={}));var an={pageX:0,pageY:0};function sn(e,t){void 0===t&&(t="page");var n=e.touches[0]||e.changedTouches[0]||an;return{x:n[t+"X"],y:n[t+"Y"]}}function cn(e,t){return void 0===t&&(t="page"),{x:e[t+"X"],y:e[t+"Y"]}}function un(e,t){return void 0===t&&(t="page"),{point:on(e)?sn(e,t):cn(e,t)}}var ln=function(e,t){void 0===t&&(t=!1);var n,i=function(t){return e(t,un(t))};return t?(n=i,function(e){var t=e instanceof MouseEvent;(!t||t&&0===e.button)&&n(e)}):i},dn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},mn={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function hn(e){return Ie&&null===window.onpointerdown?e:Ie&&null===window.ontouchstart?mn[e]:Ie&&null===window.onmousedown?dn[e]:e}function fn(e,t,n,i){return tn(e,hn(t),ln(n,"pointerdown"===t),i)}function pn(e,t,n,i){return nn(e,hn(t),n&&ln(n,"pointerdown"===t),i)}function gn(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var vn=gn("dragHorizontal"),yn=gn("dragVertical");function Cn(e){var t=!1;if("y"===e)t=yn();else if("x"===e)t=vn();else{var n=vn(),i=yn();n&&i?t=function(){n(),i()}:(n&&n(),i&&i())}return t}function bn(){var e=Cn(!0);return!e||(e(),!1)}function An(e,t,n){return function(i,r){var o;rn(i)&&!bn()&&(null==n||n(i,r),null===(o=e.animationState)||void 0===o||o.setActive(Jt.Hover,t))}}var Sn=function(e,t){return!!t&&(e===t||Sn(e,t.parentElement))};function wn(e){return Object(T.useEffect)((function(){return function(){return e()}}),[])}var En=function(e,t){return function(n){return t(e(n))}},Dn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(En)};var xn=function(e){return function(t){return e(t),null}},Bn={tap:xn((function(e){var t=e.onTap,n=e.onTapStart,i=e.onTapCancel,r=e.whileTap,o=e.visualElement,a=t||n||i||r,s=Object(T.useRef)(!1),c=Object(T.useRef)(null);function u(){var e;null===(e=c.current)||void 0===e||e.call(c),c.current=null}function l(){var e;return u(),s.current=!1,null===(e=o.animationState)||void 0===e||e.setActive(Jt.Tap,!1),!bn()}function d(e,n){l()&&(Sn(o.getInstance(),e.target)?null==t||t(e,n):null==i||i(e,n))}function m(e,t){l()&&(null==i||i(e,t))}pn(o,"pointerdown",a?function(e,t){var i;u(),s.current||(s.current=!0,c.current=Dn(fn(window,"pointerup",d),fn(window,"pointercancel",m)),null==n||n(e,t),null===(i=o.animationState)||void 0===i||i.setActive(Jt.Tap,!0))}:void 0),wn(u)})),focus:xn((function(e){var t=e.whileFocus,n=e.visualElement;nn(n,"focus",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Jt.Focus,!0)}:void 0),nn(n,"blur",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Jt.Focus,!1)}:void 0)})),hover:xn((function(e){var t=e.onHoverStart,n=e.onHoverEnd,i=e.whileHover,r=e.visualElement;pn(r,"pointerenter",t||i?An(r,!0,t):void 0),pn(r,"pointerleave",n||i?An(r,!1,n):void 0)}))};function In(e,t){if(!Array.isArray(t))return!1;var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}var Tn=function(e,t,n){return Math.min(Math.max(n,e),t)},On=.001;function kn(e){var t,n,i=e.duration,r=void 0===i?800:i,o=e.bounce,a=void 0===o?.25:o,s=e.velocity,c=void 0===s?0:s,u=e.mass,l=void 0===u?1:u,d=1-a;d=Tn(.05,1,d),r=Tn(.01,10,r/1e3),d<1?(t=function(e){var t=e*d,n=t*r,i=t-c,o=Pn(e,d),a=Math.exp(-n);return On-i/o*a},n=function(e){var n=e*d*r,i=n*c+c,o=Math.pow(d,2)*Math.pow(e,2)*r,a=Math.exp(-n),s=Pn(Math.pow(e,2),d);return(-t(e)+On>0?-1:1)*((i-o)*a)/s}):(t=function(e){return Math.exp(-e*r)*((e-c)*r+1)-.001},n=function(e){return Math.exp(-e*r)*(r*r*(c-e))});var m=function(e,t,n){for(var i=n,r=1;r<12;r++)i-=e(i)/t(i);return i}(t,n,5/r);if(r*=1e3,isNaN(m))return{stiffness:100,damping:10,duration:r};var h=Math.pow(m,2)*l;return{stiffness:h,damping:2*d*Math.sqrt(l*h),duration:r}}function Pn(e,t){return e*Math.sqrt(1-t*t)}var Ln=["duration","bounce"],_n=["stiffness","damping","mass"];function Rn(e,t){return t.some((function(t){return void 0!==e[t]}))}function Mn(e){var t=e.from,n=void 0===t?0:t,i=e.to,r=void 0===i?1:i,o=e.restSpeed,a=void 0===o?2:o,s=e.restDelta,c=Object(me.d)(e,["from","to","restSpeed","restDelta"]),u={done:!1,value:n},l=function(e){var t=Object(me.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Rn(e,_n)&&Rn(e,Ln)){var n=kn(e);(t=Object(me.a)(Object(me.a)(Object(me.a)({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(c),d=l.stiffness,m=l.damping,h=l.mass,f=l.velocity,p=l.duration,g=l.isResolvedFromDuration,v=Fn,y=Fn;function C(){var e=f?-f/1e3:0,t=r-n,i=m/(2*Math.sqrt(d*h)),o=Math.sqrt(d/h)/1e3;if(null!=s||(s=Math.abs(r-n)<=1?.01:.4),i<1){var a=Pn(o,i);v=function(n){var s=Math.exp(-i*o*n);return r-s*((e+i*o*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},y=function(n){var r=Math.exp(-i*o*n);return i*o*r*(Math.sin(a*n)*(e+i*o*t)/a+t*Math.cos(a*n))-r*(Math.cos(a*n)*(e+i*o*t)-a*t*Math.sin(a*n))}}else if(1===i)v=function(n){return r-Math.exp(-o*n)*(t+(e+o*t)*n)};else{var c=o*Math.sqrt(i*i-1);v=function(n){var a=Math.exp(-i*o*n),s=Math.min(c*n,300);return r-a*((e+i*o*t)*Math.sinh(s)+c*t*Math.cosh(s))/c}}}return C(),{next:function(e){var t=v(e);if(g)u.done=e>=p;else{var n=1e3*y(e),i=Math.abs(n)<=a,o=Math.abs(r-t)<=s;u.done=i&&o}return u.value=u.done?r:t,u},flipTarget:function(){var e;f=-f,n=(e=[r,n])[0],r=e[1],C()}}}Mn.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var Fn=function(e){return 0},Nn=function(e,t,n){var i=t-e;return 0===i?1:(n-e)/i},Vn=function(e,t,n){return-n*e+n*t+e},Wn=function(e,t){return function(n){return Boolean(ct(n)&&st.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},jn=function(e,t,n){return function(i){var r;if(!ct(i))return i;var o=i.match(ot),a=o[0],s=o[1],c=o[2],u=o[3];return(r={})[e]=parseFloat(a),r[t]=parseFloat(s),r[n]=parseFloat(c),r.alpha=void 0!==u?parseFloat(u):1,r}},zn=it(0,255),Hn=Object(me.a)(Object(me.a)({},gt),{transform:function(e){return Math.round(zn(e))}}),Un={test:Wn("rgb","red"),parse:jn("red","green","blue"),transform:function(e){var t=e.red,n=e.green,i=e.blue,r=e.alpha,o=void 0===r?1:r;return"rgba("+Hn.transform(t)+", "+Hn.transform(n)+", "+Hn.transform(i)+", "+rt(vt.transform(o))+")"}};var Zn={test:Wn("#"),parse:function(e){var t="",n="",i="",r="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),i=e.substr(5,2),r=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),i=e.substr(3,1),r=e.substr(4,1),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:Un.transform},Gn={test:Wn("hsl","hue"),parse:jn("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,i=e.lightness,r=e.alpha,o=void 0===r?1:r;return"hsla("+Math.round(t)+", "+dt.transform(rt(n))+", "+dt.transform(rt(i))+", "+rt(vt.transform(o))+")"}},Yn=function(e,t,n){var i=e*e,r=t*t;return Math.sqrt(Math.max(0,n*(r-i)+i))},Qn=[Zn,Un,Gn],qn=function(e){return Qn.find((function(t){return t.test(e)}))},Xn=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},Kn=function(e,t){var n=qn(e),i=qn(t);Xn(e),Xn(t),n.transform,i.transform;var r=n.parse(e),o=i.parse(t),a=Object(me.a)({},r),s=n===Gn?Vn:Yn;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(r[t],o[t],e));return a.alpha=Vn(r.alpha,o.alpha,e),n.transform(a)}},Jn={test:function(e){return Un.test(e)||Zn.test(e)||Gn.test(e)},parse:function(e){return Un.test(e)?Un.parse(e):Gn.test(e)?Gn.parse(e):Zn.parse(e)},transform:function(e){return ct(e)?e:e.hasOwnProperty("red")?Un.transform(e):Gn.transform(e)}},$n="${c}",ei="${n}";function ti(e){var t=[],n=0,i=e.match(at);i&&(n=i.length,e=e.replace(at,$n),t.push.apply(t,i.map(Jn.parse)));var r=e.match(ot);return r&&(e=e.replace(ot,ei),t.push.apply(t,r.map(gt.parse))),{values:t,numColors:n,tokenised:e}}function ni(e){return ti(e).values}function ii(e){var t=ti(e),n=t.values,i=t.numColors,r=t.tokenised,o=n.length;return function(e){for(var t=r,n=0;n<o;n++)t=t.replace(n<i?$n:ei,n<i?Jn.transform(e[n]):rt(e[n]));return t}}var ri=function(e){return"number"==typeof e?0:e};var oi={test:function(e){var t,n,i,r;return isNaN(e)&&ct(e)&&(null!==(n=null===(t=e.match(ot))||void 0===t?void 0:t.length)&&void 0!==n?n:0)+(null!==(r=null===(i=e.match(at))||void 0===i?void 0:i.length)&&void 0!==r?r:0)>0},parse:ni,createTransformer:ii,getAnimatableNone:function(e){var t=ni(e);return ii(e)(t.map(ri))}},ai=function(e){return"number"==typeof e};function si(e,t){return ai(e)?function(n){return Vn(e,t,n)}:Jn.test(e)?Kn(e,t):di(e,t)}var ci=function(e,t){var n=Object(me.e)([],e),i=n.length,r=e.map((function(e,n){return si(e,t[n])}));return function(e){for(var t=0;t<i;t++)n[t]=r[t](e);return n}},ui=function(e,t){var n=Object(me.a)(Object(me.a)({},e),t),i={};for(var r in n)void 0!==e[r]&&void 0!==t[r]&&(i[r]=si(e[r],t[r]));return function(e){for(var t in i)n[t]=i[t](e);return n}};function li(e){for(var t=oi.parse(e),n=t.length,i=0,r=0,o=0,a=0;a<n;a++)i||"number"==typeof t[a]?i++:void 0!==t[a].hue?o++:r++;return{parsed:t,numNumbers:i,numRGB:r,numHSL:o}}var di=function(e,t){var n=oi.createTransformer(t),i=li(e),r=li(t);return i.numHSL===r.numHSL&&i.numRGB===r.numRGB&&(i.numNumbers,r.numNumbers),Dn(ci(i.parsed,r.parsed),n)},mi=function(e,t){return function(n){return Vn(e,t,n)}};function hi(e,t,n){for(var i,r=[],o=n||("number"==typeof(i=e[0])?mi:"string"==typeof i?Jn.test(i)?Kn:di:Array.isArray(i)?ci:"object"==typeof i?ui:void 0),a=e.length-1,s=0;s<a;s++){var c=o(e[s],e[s+1]);if(t){var u=Array.isArray(t)?t[s]:t;c=Dn(u,c)}r.push(c)}return r}function fi(e,t,n){var i=void 0===n?{}:n,r=i.clamp,o=void 0===r||r,a=i.ease,s=i.mixer,c=e.length;t.length,!a||!Array.isArray(a)||a.length,e[0]>e[c-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var u=hi(t,a,s),l=2===c?function(e,t){var n=e[0],i=e[1],r=t[0];return function(e){return r(Nn(n,i,e))}}(e,u):function(e,t){var n=e.length,i=n-1;return function(r){var o=0,a=!1;if(r<=e[0]?a=!0:r>=e[i]&&(o=i-1,a=!0),!a){for(var s=1;s<n&&!(e[s]>r||s===i);s++);o=s-1}var c=Nn(e[o],e[o+1],r);return t[o](c)}}(e,u);return o?function(t){return l(Tn(e[0],e[c-1],t))}:l}var pi,gi=function(e){return function(t){return 1-e(1-t)}},vi=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},yi=function(e){return function(t){return t*t*((e+1)*t-e)}},Ci=function(e){return e},bi=(pi=2,function(e){return Math.pow(e,pi)}),Ai=gi(bi),Si=vi(bi),wi=function(e){return 1-Math.sin(Math.acos(e))},Ei=gi(wi),Di=vi(Ei),xi=yi(1.525),Bi=gi(xi),Ii=vi(xi),Ti=function(e){var t=yi(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),Oi=function(e){if(1===e||0===e)return e;var t=e*e;return e<.36363636363636365?7.5625*t:e<.7272727272727273?9.075*t-9.9*e+3.4:e<.9?12.066481994459833*t-19.63545706371191*e+8.898060941828255:10.8*e*e-20.52*e+10.72},ki=gi(Oi);function Pi(e,t){return e.map((function(){return t||Si})).splice(0,e.length-1)}function Li(e){var t=e.from,n=void 0===t?0:t,i=e.to,r=void 0===i?1:i,o=e.ease,a=e.offset,s=e.duration,c=void 0===s?300:s,u={done:!1,value:n},l=Array.isArray(r)?r:[n,r],d=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===l.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(l),c);function m(){return fi(d,l,{ease:Array.isArray(o)?o:Pi(l,o)})}var h=m();return{next:function(e){return u.value=h(e),u.done=e>=c,u},flipTarget:function(){l.reverse(),h=m()}}}var _i={keyframes:Li,spring:Mn,decay:function(e){var t=e.velocity,n=void 0===t?0:t,i=e.from,r=void 0===i?0:i,o=e.power,a=void 0===o?.8:o,s=e.timeConstant,c=void 0===s?350:s,u=e.restDelta,l=void 0===u?.5:u,d=e.modifyTarget,m={done:!1,value:r},h=a*n,f=r+h,p=void 0===d?f:d(f);return p!==f&&(h=p-r),{next:function(e){var t=-h*Math.exp(-e/c);return m.done=!(t>l||t<-l),m.value=m.done?p:p+t,m},flipTarget:function(){}}}};var Ri=1/60*1e3,Mi="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Fi="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(Mi())}),Ri)};var Ni=!0,Vi=!1,Wi=!1,ji={delta:0,timestamp:0},zi=["read","update","preRender","render","postRender"],Hi=zi.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],i=0,r=!1,o=new WeakSet,a={schedule:function(e,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var c=s&&r,u=c?t:n;return a&&o.add(e),-1===u.indexOf(e)&&(u.push(e),c&&r&&(i=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),o.delete(e)},process:function(s){var c;if(r=!0,t=(c=[n,t])[0],(n=c[1]).length=0,i=t.length)for(var u=0;u<i;u++){var l=t[u];l(s),o.has(l)&&(a.schedule(l),e())}r=!1}};return a}((function(){return Vi=!0})),e}),{}),Ui=zi.reduce((function(e,t){var n=Hi[t];return e[t]=function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!1),Vi||qi(),n.schedule(e,t,i)},e}),{}),Zi=zi.reduce((function(e,t){return e[t]=Hi[t].cancel,e}),{}),Gi=zi.reduce((function(e,t){return e[t]=function(){return Hi[t].process(ji)},e}),{}),Yi=function(e){return Hi[e].process(ji)},Qi=function(e){Vi=!1,ji.delta=Ni?Ri:Math.max(Math.min(e-ji.timestamp,40),1),ji.timestamp=e,Wi=!0,zi.forEach(Yi),Wi=!1,Vi&&(Ni=!1,Fi(Qi))},qi=function(){Vi=!0,Ni=!0,Wi||Fi(Qi)},Xi=function(){return ji},Ki=Ui;function Ji(e,t,n){return void 0===n&&(n=0),e-t-n}var $i=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return Ki.update(t,!0)},stop:function(){return Zi.update(t)}}};function er(e){var t,n,i,r,o,a=e.from,s=e.autoplay,c=void 0===s||s,u=e.driver,l=void 0===u?$i:u,d=e.elapsed,m=void 0===d?0:d,h=e.repeat,f=void 0===h?0:h,p=e.repeatType,g=void 0===p?"loop":p,v=e.repeatDelay,y=void 0===v?0:v,C=e.onPlay,b=e.onStop,A=e.onComplete,S=e.onRepeat,w=e.onUpdate,E=Object(me.d)(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),D=E.to,x=0,B=E.duration,I=!1,T=!0,O=function(e){if(Array.isArray(e.to))return Li;if(_i[e.type])return _i[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Li:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Mn:Li}(E);(null===(n=(t=O).needsInterpolation)||void 0===n?void 0:n.call(t,a,D))&&(o=fi([0,100],[a,D],{clamp:!1}),a=0,D=100);var k=O(Object(me.a)(Object(me.a)({},E),{from:a,to:D}));function P(){x++,"reverse"===g?m=function(e,t,n,i){return void 0===n&&(n=0),void 0===i&&(i=!0),i?Ji(t+-e,t,n):t-(e-t)+n}(m,B,y,T=x%2==0):(m=Ji(m,B,y),"mirror"===g&&k.flipTarget()),I=!1,S&&S()}function L(e){if(T||(e=-e),m+=e,!I){var t=k.next(Math.max(0,m));r=t.value,o&&(r=o(r)),I=T?t.done:m<=0}null==w||w(r),I&&(0===x&&(null!=B||(B=m)),x<f?function(e,t,n,i){return i?e>=t+n:e<=-n}(m,B,y,T)&&P():(i.stop(),A&&A()))}return c&&(null==C||C(),(i=l(L)).start()),{stop:function(){null==b||b(),i.stop()}}}function tr(e,t){return t?e*(1e3/t):0}var nr=function(e){return 1e3*e},ir=function(e,t){return 1-3*t+3*e},rr=function(e,t){return 3*t-6*e},or=function(e){return 3*e},ar=function(e,t,n){return((ir(t,n)*e+rr(t,n))*e+or(t))*e},sr=function(e,t,n){return 3*ir(t,n)*e*e+2*rr(t,n)*e+or(t)};var cr=.1;function ur(e,t,n,i){if(e===t&&n===i)return Ci;for(var r=new Float32Array(11),o=0;o<11;++o)r[o]=ar(o*cr,e,n);function a(t){for(var i=0,o=1;10!==o&&r[o]<=t;++o)i+=cr;--o;var a=i+(t-r[o])/(r[o+1]-r[o])*cr,s=sr(a,e,n);return s>=.001?function(e,t,n,i){for(var r=0;r<8;++r){var o=sr(t,n,i);if(0===o)return t;t-=(ar(t,n,i)-e)/o}return t}(t,a,e,n):0===s?a:function(e,t,n,i,r){var o,a,s=0;do{(o=ar(a=t+(n-t)/2,i,r)-e)>0?n=a:t=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,i,i+cr,e,n)}return function(e){return 0===e||1===e?e:ar(a(e),t,i)}}var lr={linear:Ci,easeIn:bi,easeInOut:Si,easeOut:Ai,circIn:wi,circInOut:Di,circOut:Ei,backIn:xi,backInOut:Ii,backOut:Bi,anticipate:Ti,bounceIn:ki,bounceInOut:function(e){return e<.5?.5*(1-Oi(1-2*e)):.5*Oi(2*e-1)+.5},bounceOut:Oi},dr=function(e){if(Array.isArray(e)){e.length;var t=Object(me.c)(e,4);return ur(t[0],t[1],t[2],t[3])}return"string"==typeof e?lr[e]:e},mr=function(e,t){return"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!oi.test(t)||t.startsWith("url(")))},hr=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},fr=function(e){return{type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},pr=function(){return{type:"keyframes",ease:"linear",duration:.3}},gr=function(e){return{type:"keyframes",duration:.8,values:e}},vr={x:hr,y:hr,z:hr,rotate:hr,rotateX:hr,rotateY:hr,rotateZ:hr,scaleX:fr,scaleY:fr,scale:fr,opacity:pr,backgroundColor:pr,color:pr,default:fr},yr=new Set(["brightness","contrast","saturate","opacity"]);function Cr(e){var t=e.slice(0,-1).split("("),n=t[0],i=t[1];if("drop-shadow"===n)return e;var r=(i.match(ot)||[])[0];if(!r)return e;var o=i.replace(r,""),a=yr.has(n)?1:0;return r!==i&&(a*=100),n+"("+a+o+")"}var br=/([a-z-]*)\(.*?\)/g,Ar=Object(me.a)(Object(me.a)({},oi),{getAnimatableNone:function(e){var t=e.match(br);return t?t.map(Cr).join(" "):e}}),Sr=Object(me.a)(Object(me.a)({},bt),{color:Jn,backgroundColor:Jn,outlineColor:Jn,fill:Jn,stroke:Jn,borderColor:Jn,borderTopColor:Jn,borderRightColor:Jn,borderBottomColor:Jn,borderLeftColor:Jn,filter:Ar,WebkitFilter:Ar}),wr=function(e){return Sr[e]};function Er(e,t){var n,i=wr(e);return i!==Ar&&(i=oi),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,t)}function Dr(e){var t=e.ease,n=e.times,i=e.yoyo,r=e.flip,o=e.loop,a=Object(me.d)(e,["ease","times","yoyo","flip","loop"]),s=Object(me.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=nr(a.duration)),a.repeatDelay&&(s.repeatDelay=nr(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!=typeof e[0]}(t)?t.map(dr):dr(t)),"tween"===a.type&&(s.type="keyframes"),(i||o||r)&&(!0,i?s.repeatType="reverse":o?s.repeatType="loop":r&&(s.repeatType="mirror"),s.repeat=o||i||r||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function xr(e,t,n){var i,r,o,a;return Array.isArray(t.to)&&(null!==(i=e.duration)&&void 0!==i||(e.duration=.8)),function(e){Array.isArray(e.to)&&null===e.to[0]&&(e.to=Object(me.e)([],Object(me.c)(e.to)),e.to[0]=e.from)}(t),function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=Object(me.d)(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}(e)||(e=Object(me.a)(Object(me.a)({},e),(r=n,o=t.to,a=Gt(o)?gr:vr[r]||vr.default,Object(me.a)({to:o},a(o))))),Object(me.a)(Object(me.a)({},t),Dr(e))}function Br(e,t,n,i,r){var o,a=Or(i,e),s=null!==(o=a.from)&&void 0!==o?o:t.get(),c=mr(e,n);"none"===s&&c&&"string"==typeof n?s=Er(e,n):Ir(s)&&"string"==typeof n?s=Tr(n):!Array.isArray(n)&&Ir(n)&&"string"==typeof s&&(n=Tr(s));var u=mr(e,s);return u&&c&&!1!==a.type?function(){var i={from:s,to:n,velocity:t.getVelocity(),onComplete:r,onUpdate:function(e){return t.set(e)}};return"inertia"===a.type||"decay"===a.type?function(e){var t,n=e.from,i=void 0===n?0:n,r=e.velocity,o=void 0===r?0:r,a=e.min,s=e.max,c=e.power,u=void 0===c?.8:c,l=e.timeConstant,d=void 0===l?750:l,m=e.bounceStiffness,h=void 0===m?500:m,f=e.bounceDamping,p=void 0===f?10:f,g=e.restDelta,v=void 0===g?1:g,y=e.modifyTarget,C=e.driver,b=e.onUpdate,A=e.onComplete;function S(e){return void 0!==a&&e<a||void 0!==s&&e>s}function w(e){return void 0===a?s:void 0===s||Math.abs(a-e)<Math.abs(s-e)?a:s}function E(e){null==t||t.stop(),t=er(Object(me.a)(Object(me.a)({},e),{driver:C,onUpdate:function(t){var n;null==b||b(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:A}))}function D(e){E(Object(me.a)({type:"spring",stiffness:h,damping:p,restDelta:v},e))}if(S(i))D({from:i,velocity:o,to:w(i)});else{var x=u*o+i;"undefined"!=typeof y&&(x=y(x));var B,I,T=w(x),O=T===a?-1:1;E({type:"decay",from:i,velocity:o,timeConstant:d,power:u,restDelta:v,modifyTarget:y,onUpdate:S(x)?function(e){B=I,I=e,o=tr(e-B,Xi().delta),(1===O&&e>T||-1===O&&e<T)&&D({from:e,to:T,velocity:o})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}}(Object(me.a)(Object(me.a)({},i),a)):er(Object(me.a)(Object(me.a)({},xr(a,i,e)),{onUpdate:function(e){var t;i.onUpdate(e),null===(t=a.onUpdate)||void 0===t||t.call(a,e)},onComplete:function(){var e;i.onComplete(),null===(e=a.onComplete)||void 0===e||e.call(a)}}))}:function(){var e;return t.set(n),r(),null===(e=null==a?void 0:a.onComplete)||void 0===e||e.call(a),{stop:function(){}}}}function Ir(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function Tr(e){return"number"==typeof e?0:Er("",e)}function Or(e,t){return e[t]||e.default||e}function kr(e,t,n,i){return void 0===i&&(i={}),t.start((function(r){var o,a,s=Br(e,t,n,i,r),c=function(e,t){var n;return null!==(n=(Or(e,t)||{}).delay)&&void 0!==n?n:0}(i,e),u=function(){return a=s()};return c?o=setTimeout(u,nr(c)):u(),function(){clearTimeout(o),null==a||a.stop()}}))}function Pr(e,t){-1===e.indexOf(t)&&e.push(t)}function Lr(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var _r=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return Pr(this.subscriptions,e),function(){return Lr(t.subscriptions,e)}},e.prototype.notify=function(e,t,n){var i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(var r=0;r<i;r++){var o=this.subscriptions[r];o&&o(e,t,n)}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),Rr=function(){function e(e){var t,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new _r,this.velocityUpdateSubscribers=new _r,this.renderSubscribers=new _r,this.canTrackVelocity=!1,this.updateAndNotify=function(e,t){void 0===t&&(t=!0),n.prev=n.current,n.current=e;var i=Xi(),r=i.delta,o=i.timestamp;n.lastUpdated!==o&&(n.timeDelta=r,n.lastUpdated=o,Ki.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),t&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return Ki.postRender(n.velocityCheck)},this.velocityCheck=function(e){e.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t)))}return e.prototype.onChange=function(e){return this.updateSubscribers.add(e)},e.prototype.clearListeners=function(){this.updateSubscribers.clear()},e.prototype.onRenderRequest=function(e){return e(this.get()),this.renderSubscribers.add(e)},e.prototype.attach=function(e){this.passiveEffect=e},e.prototype.set=function(e,t){void 0===t&&(t=!0),t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)},e.prototype.get=function(){return this.current},e.prototype.getPrevious=function(){return this.prev},e.prototype.getVelocity=function(){return this.canTrackVelocity?tr(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(e){var t=this;return this.stop(),new Promise((function(n){t.hasAnimated=!0,t.stopAnimation=e(n)})).then((function(){return t.clearAnimation()}))},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},e}();function Mr(e){return new Rr(e)}var Fr=function(e){return function(t){return t.test(e)}},Nr=[gt,mt,dt,lt,ft,ht,{test:function(e){return"auto"===e},parse:function(e){return e}}],Vr=function(e){return Nr.find(Fr(e))},Wr=Object(me.e)(Object(me.e)([],Object(me.c)(Nr)),[Jn,oi]),jr=function(e){return Wr.find(Fr(e))};function zr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Mr(n))}function Hr(e,t){var n=Re(e,t),i=n?e.makeTargetAnimatable(n,!1):{},r=i.transitionEnd,o=void 0===r?{}:r;i.transition;var a,s=Object(me.d)(i,["transitionEnd","transition"]);for(var c in s=Object(me.a)(Object(me.a)({},s),o)){zr(e,c,(a=s[c],Gt(a)?a[a.length-1]||0:a))}}function Ur(e,t){if(t)return(t[e]||t.default||t).from}function Zr(e,t,n){var i;void 0===n&&(n={});var r=Re(e,t,n.custom),o=(r||{}).transition,a=void 0===o?e.getDefaultTransition()||{}:o;n.transitionOverride&&(a=n.transitionOverride);var s=r?function(){return Gr(e,r,n)}:function(){return Promise.resolve()},c=(null===(i=e.variantChildren)||void 0===i?void 0:i.size)?function(i){void 0===i&&(i=0);var r=a.delayChildren,o=void 0===r?0:r,s=a.staggerChildren,c=a.staggerDirection;return function(e,t,n,i,r,o){void 0===n&&(n=0);void 0===i&&(i=0);void 0===r&&(r=1);var a=[],s=(e.variantChildren.size-1)*i,c=1===r?function(e){return void 0===e&&(e=0),e*i}:function(e){return void 0===e&&(e=0),s-e*i};return Array.from(e.variantChildren).sort(Yr).forEach((function(e,i){a.push(Zr(e,t,Object(me.a)(Object(me.a)({},o),{delay:n+c(i)})).then((function(){return e.notifyAnimationComplete(t)})))})),Promise.all(a)}(e,t,o+i,s,c,n)}:function(){return Promise.resolve()},u=a.when;if(u){var l=Object(me.c)("beforeChildren"===u?[s,c]:[c,s],2),d=l[0],m=l[1];return d().then(m)}return Promise.all([s(),c(n.delay)])}function Gr(e,t,n){var i,r=void 0===n?{}:n,o=r.delay,a=void 0===o?0:o,s=r.transitionOverride,c=r.type,u=e.makeTargetAnimatable(t),l=u.transition,d=void 0===l?e.getDefaultTransition():l,m=u.transitionEnd,h=Object(me.d)(u,["transition","transitionEnd"]);s&&(d=s);var f=[],p=c&&(null===(i=e.animationState)||void 0===i?void 0:i.getState()[c]);for(var g in h){var v=e.getValue(g),y=h[g];if(!(!v||void 0===y||p&&Qr(p,g))){var C=kr(g,v,y,Object(me.a)({delay:a},d));f.push(C)}}return Promise.all(f).then((function(){m&&Hr(e,m)}))}function Yr(e,t){return e.sortNodePosition(t)}function Qr(e,t){var n=e.protectedKeys,i=e.needsAnimating,r=n.hasOwnProperty(t)&&!0!==i[t];return i[t]=!1,r}var qr=[Jt.Animate,Jt.Hover,Jt.Tap,Jt.Drag,Jt.Focus,Jt.Exit],Xr=Object(me.e)([],Object(me.c)(qr)).reverse(),Kr=qr.length;function Jr(e){return function(t){return Promise.all(t.map((function(t){var n=t.animation,i=t.options;return function(e,t,n){var i;if(void 0===n&&(n={}),e.notifyAnimationStart(),Array.isArray(t)){var r=t.map((function(t){return Zr(e,t,n)}));i=Promise.all(r)}else if("string"==typeof t)i=Zr(e,t,n);else{var o="function"==typeof t?Re(e,t,n.custom):t;i=Gr(e,o,n)}return i.then((function(){return e.notifyAnimationComplete(t)}))}(e,n,i)})))}}function $r(e){var t,n=Jr(e),i=((t={})[Jt.Animate]=eo(!0),t[Jt.Hover]=eo(),t[Jt.Tap]=eo(),t[Jt.Drag]=eo(),t[Jt.Focus]=eo(),t[Jt.Exit]=eo(),t),r={},o=!0,a=function(t,n){var i=Re(e,n);if(i){i.transition;var r=i.transitionEnd,o=Object(me.d)(i,["transition","transitionEnd"]);t=Object(me.a)(Object(me.a)(Object(me.a)({},t),o),r)}return t};function s(t,s){for(var c,u=e.getProps(),l=e.getVariantContext(!0)||{},d=[],m=new Set,h={},f=1/0,p=function(n){var r=Xr[n],p=i[r],g=null!==(c=u[r])&&void 0!==c?c:l[r],v=Le(g),y=r===s?p.isActive:null;!1===y&&(f=n);var C=g===l[r]&&g!==u[r]&&v;if(C&&o&&e.manuallyAnimateOnMount&&(C=!1),p.protectedKeys=Object(me.a)({},h),!p.isActive&&null===y||!g&&!p.prevProp||Zt(g)||"boolean"==typeof g)return"continue";var b=function(e,t){if("string"==typeof t)return t!==e;if(Pe(t))return!In(t,e);return!1}(p.prevProp,g)||r===s&&p.isActive&&!C&&v||n>f&&v,A=Array.isArray(g)?g:[g],S=A.reduce(a,{});!1===y&&(S={});var w=p.prevResolvedValues,E=void 0===w?{}:w,D=Object(me.a)(Object(me.a)({},E),S),x=function(e){b=!0,m.delete(e),p.needsAnimating[e]=!0};for(var B in D){var I=S[B],T=E[B];h.hasOwnProperty(B)||(I!==T?Gt(I)&&Gt(T)?In(I,T)?p.protectedKeys[B]=!0:x(B):void 0!==I?x(B):m.add(B):void 0!==I&&m.has(B)?x(B):p.protectedKeys[B]=!0)}p.prevProp=g,p.prevResolvedValues=S,p.isActive&&(h=Object(me.a)(Object(me.a)({},h),S)),o&&e.blockInitialAnimation&&(b=!1),b&&!C&&d.push.apply(d,Object(me.e)([],Object(me.c)(A.map((function(e){return{animation:e,options:Object(me.a)({type:r},t)}})))))},g=0;g<Kr;g++)p(g);if(r=Object(me.a)({},h),m.size){var v={};m.forEach((function(t){var n=e.getBaseTarget(t);void 0!==n&&(v[t]=n)})),d.push({animation:v})}var y=Boolean(d.length);return o&&!1===u.initial&&!e.manuallyAnimateOnMount&&(y=!1),o=!1,y?n(d):Promise.resolve()}return{isAnimated:function(e){return void 0!==r[e]},animateChanges:s,setActive:function(t,n,r){var o;return i[t].isActive===n?Promise.resolve():(null===(o=e.variantChildren)||void 0===o||o.forEach((function(e){var i;return null===(i=e.animationState)||void 0===i?void 0:i.setActive(t,n)})),i[t].isActive=n,s(r,t))},setAnimateFunction:function(t){n=t(e)},getState:function(){return i}}}function eo(e){return void 0===e&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var to={animation:xn((function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=$r(t)),Zt(n)&&Object(T.useEffect)((function(){return n.subscribe(t)}),[n])})),exit:xn((function(e){var t=e.custom,n=e.visualElement,i=Object(me.c)(Se(),2),r=i[0],o=i[1],a=Object(T.useContext)(be);Object(T.useEffect)((function(){var e,i,s=null===(e=n.animationState)||void 0===e?void 0:e.setActive(Jt.Exit,!r,{custom:null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:t});!r&&(null==s||s.then(o))}),[r])}))},no=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},io=function(e){return no(e)&&e.hasOwnProperty("z")},ro=function(e,t){return Math.abs(e-t)};function oo(e,t){if(ai(e)&&ai(t))return ro(e,t);if(no(e)&&no(t)){var n=ro(e.x,t.x),i=ro(e.y,t.y),r=io(e)&&io(t)?ro(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(r,2))}}var ao=function(){function e(e,t,n){var i=this,r=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(i.lastMoveEvent&&i.lastMoveEventInfo){var e=uo(i.lastMoveEventInfo,i.history),t=null!==i.startEvent,n=oo(e.offset,{x:0,y:0})>=3;if(t||n){var r=e.point,o=Xi().timestamp;i.history.push(Object(me.a)(Object(me.a)({},r),{timestamp:o}));var a=i.handlers,s=a.onStart,c=a.onMove;t||(s&&s(i.lastMoveEvent,e),i.startEvent=i.lastMoveEvent),c&&c(i.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){i.lastMoveEvent=e,i.lastMoveEventInfo=so(t,i.transformPagePoint),rn(e)&&0===e.buttons?i.handlePointerUp(e,t):Ki.update(i.updatePoint,!0)},this.handlePointerUp=function(e,t){i.end();var n=i.handlers,r=n.onEnd,o=n.onSessionEnd,a=uo(so(t,i.transformPagePoint),i.history);i.startEvent&&r&&r(e,a),o&&o(e,a)},!(on(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=r;var o=so(un(e),this.transformPagePoint),a=o.point,s=Xi().timestamp;this.history=[Object(me.a)(Object(me.a)({},a),{timestamp:s})];var c=t.onSessionStart;c&&c(e,uo(o,this.history)),this.removeListeners=Dn(fn(window,"pointermove",this.handlePointerMove),fn(window,"pointerup",this.handlePointerUp),fn(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),Zi.update(this.updatePoint)},e}();function so(e,t){return t?{point:t(e.point)}:e}function co(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uo(e,t){var n=e.point;return{point:n,delta:co(n,mo(t)),offset:co(n,lo(t)),velocity:ho(t,.1)}}function lo(e){return e[0]}function mo(e){return e[e.length-1]}function ho(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,i=null,r=mo(e);n>=0&&(i=e[n],!(r.timestamp-i.timestamp>nr(t)));)n--;if(!i)return{x:0,y:0};var o=(r.timestamp-i.timestamp)/1e3;if(0===o)return{x:0,y:0};var a={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function fo(e){return e}function po(e){var t=e.top;return{x:{min:e.left,max:e.right},y:{min:t,max:e.bottom}}}var go={translate:0,scale:1,origin:0,originPoint:0};function vo(){return{x:Object(me.a)({},go),y:Object(me.a)({},go)}}function yo(e){return[e("x"),e("y")]}function Co(e,t,n){var i=t.min,r=t.max;return void 0!==i&&e<i?e=n?Vn(i,e,n.min):Math.max(e,i):void 0!==r&&e>r&&(e=n?Vn(r,e,n.max):Math.min(e,r)),e}function bo(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ao(e,t){var n,i=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&(i=(n=Object(me.c)([r,i],2))[0],r=n[1]),{min:e.min+i,max:e.min+r}}function So(e,t,n){return{min:wo(e,t),max:wo(e,n)}}function wo(e,t){var n;return"number"==typeof e?e:null!==(n=e[t])&&void 0!==n?n:0}function Eo(e,t){return po(function(e,t){var n=e.top,i=e.left,r=e.bottom,o=e.right;void 0===t&&(t=fo);var a=t({x:i,y:n}),s=t({x:o,y:r});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(e.getBoundingClientRect(),t))}function Do(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=.01),oo(e,t)<n}function xo(e){return e.max-e.min}function Bo(e,t){var n=.5,i=xo(e),r=xo(t);return r>i?n=Nn(t.min,t.max-i,e.min):i>r&&(n=Nn(e.min,e.max-r,t.min)),Tn(0,1,n)}function Io(e,t,n,i){void 0===i&&(i=.5),e.origin=i,e.originPoint=Vn(t.min,t.max,e.origin),e.scale=xo(n)/xo(t),Do(e.scale,1,1e-4)&&(e.scale=1),e.translate=Vn(n.min,n.max,e.origin)-e.originPoint,Do(e.translate)&&(e.translate=0)}function To(e,t,n,i){Io(e.x,t.x,n.x,Oo(i.originX)),Io(e.y,t.y,n.y,Oo(i.originY))}function Oo(e){return"number"==typeof e?e:.5}function ko(e,t,n){e.min=n.min+t.min,e.max=e.min+xo(t)}var Po=function(e,t){return e.depth-t.depth};function Lo(e){return e.projection.isEnabled||e.shouldResetTransform()}function _o(e,t){void 0===t&&(t=[]);var n=e.parent;return n&&_o(n,t),Lo(e)&&t.push(e),t}function Ro(e){if(!e.shouldResetTransform()){var t,n=e.getLayoutState();e.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=e.measureViewportBox(),n.layoutCorrected=(t=n.layout,{x:Object(me.a)({},t.x),y:Object(me.a)({},t.y)}),e.notifyLayoutMeasure(n.layout,e.prevViewportBox||n.layout),Ki.update((function(){return e.rebaseProjectionTarget()}))}}function Mo(e,t){return{min:t.min-e.min,max:t.max-e.min}}function Fo(e,t){return{x:Mo(e.x,t.x),y:Mo(e.y,t.y)}}function No(e,t){var n=e.getLayoutId(),i=t.getLayoutId();return n!==i||void 0===i&&e!==t}function Vo(e){var t=e.getProps(),n=t.drag,i=t._dragX;return n&&!i}function Wo(e,t){e.min=t.min,e.max=t.max}function jo(e,t,n){return n+t*(e-n)}function zo(e,t,n,i,r){return void 0!==r&&(e=jo(e,r,i)),jo(e,n,i)+t}function Ho(e,t,n,i,r){void 0===t&&(t=0),void 0===n&&(n=1),e.min=zo(e.min,t,n,i,r),e.max=zo(e.max,t,n,i,r)}function Uo(e,t){var n=t.x,i=t.y;Ho(e.x,n.translate,n.scale,n.originPoint),Ho(e.y,i.translate,i.scale,i.originPoint)}function Zo(e,t,n,i){var r=Object(me.c)(i,3),o=r[0],a=r[1],s=r[2];e.min=t.min,e.max=t.max;var c=void 0!==n[s]?n[s]:.5,u=Vn(t.min,t.max,c);Ho(e,n[o],n[a],u,n.scale)}var Go=["x","scaleX","originX"],Yo=["y","scaleY","originY"];function Qo(e,t,n){Zo(e.x,t.x,n,Go),Zo(e.y,t.y,n,Yo)}function qo(e,t,n,i,r){return e=jo(e-=t,1/n,i),void 0!==r&&(e=jo(e,1/r,i)),e}function Xo(e,t,n){var i=Object(me.c)(n,3),r=i[0],o=i[1],a=i[2];!function(e,t,n,i,r){void 0===t&&(t=0),void 0===n&&(n=1),void 0===i&&(i=.5);var o=Vn(e.min,e.max,i)-t;e.min=qo(e.min,t,n,o,r),e.max=qo(e.max,t,n,o,r)}(e,t[r],t[o],t[a],t.scale)}function Ko(e,t){Xo(e.x,t,Go),Xo(e.y,t,Yo)}var Jo=new Set;function $o(e,t,n){e[n]||(e[n]=[]),e[n].push(t)}function ea(e){return Jo.add(e),function(){return Jo.delete(e)}}function ta(){if(Jo.size){var e=0,t=[[]],n=[],i=function(n){return $o(t,n,e)},r=function(t){$o(n,t,e),e++};Jo.forEach((function(t){t(i,r),e=0})),Jo.clear();for(var o=n.length,a=0;a<=o;a++)t[a]&&t[a].forEach(ia),n[a]&&n[a].forEach(ia)}}var na,ia=function(e){return e()},ra=new WeakMap,oa=function(){function e(e){var t=e.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=t,this.visualElement.enableLayoutProjection(),ra.set(t,this)}return e.prototype.start=function(e,t){var n=this,i=void 0===t?{}:t,r=i.snapToCursor,o=void 0!==r&&r,a=i.cursorProgress,s=this.props.transformPagePoint;this.panSession=new ao(e,{onSessionStart:function(e){var t;n.stopMotion();var i=function(e){return un(e,"client")}(e).point;null===(t=n.cancelLayout)||void 0===t||t.call(n),n.cancelLayout=ea((function(e,t){var r=_o(n.visualElement),s=function(e){var t=[],n=function(e){Lo(e)&&t.push(e),e.children.forEach(n)};return e.children.forEach(n),t.sort(Po)}(n.visualElement),c=Object(me.e)(Object(me.e)([],Object(me.c)(r)),Object(me.c)(s)),u=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),t((function(){c.forEach((function(e){return e.resetTransform()}))})),e((function(){Ro(n.visualElement),s.forEach(Ro)})),t((function(){c.forEach((function(e){return e.restoreTransform()})),o&&(u=n.snapToCursor(i))})),e((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var e=n.visualElement.projection;yo((function(t){if(!u){var r=e.target[t],o=r.min,s=r.max;n.cursorProgress[t]=a?a[t]:Nn(o,s,i[t])}var c=n.getAxisMotionValue(t);c&&(n.originPoint[t]=c.get())}))})),t((function(){Gi.update(),Gi.preRender(),Gi.render(),Gi.postRender()})),e((function(){return n.resolveDragConstraints()}))}))},onStart:function(e,t){var i,r,o,a=n.props,s=a.drag,c=a.dragPropagation;(!s||c||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Cn(s),n.openGlobalLock))&&(ta(),n.isDragging=!0,n.currentDirection=null,null===(r=(i=n.props).onDragStart)||void 0===r||r.call(i,e,t),null===(o=n.visualElement.animationState)||void 0===o||o.setActive(Jt.Drag,!0))},onMove:function(e,t){var i,r,o,a,s=n.props,c=s.dragPropagation,u=s.dragDirectionLock;if(c||n.openGlobalLock){var l=t.offset;if(u&&null===n.currentDirection)return n.currentDirection=function(e,t){void 0===t&&(t=10);var n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(l),void(null!==n.currentDirection&&(null===(r=(i=n.props).onDirectionLock)||void 0===r||r.call(i,n.currentDirection)));n.updateAxis("x",t.point,l),n.updateAxis("y",t.point,l),null===(a=(o=n.props).onDrag)||void 0===a||a.call(o,e,t),na=e}},onSessionEnd:function(e,t){return n.stop(e,t)}},{transformPagePoint:s})},e.prototype.resolveDragConstraints=function(){var e=this,t=this.props,n=t.dragConstraints,i=t.dragElastic,r=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(ke(n)?this.resolveRefConstraints(r,n):function(e,t){var n=t.top,i=t.left,r=t.bottom,o=t.right;return{x:bo(e.x,i,o),y:bo(e.y,n,r)}}(r,n)),this.elastic=function(e){return!1===e?e=0:!0===e&&(e=.35),{x:So(e,"left","right"),y:So(e,"top","bottom")}}(i),this.constraints&&!this.hasMutatedConstraints&&yo((function(t){e.getAxisMotionValue(t)&&(e.constraints[t]=function(e,t){var n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r[t],e.constraints[t]))}))},e.prototype.resolveRefConstraints=function(e,t){var n=this.props,i=n.onMeasureDragConstraints,r=n.transformPagePoint,o=t.current;this.constraintsBox=Eo(o,r);var a=function(e,t){return{x:Ao(e.x,t.x),y:Ao(e.y,t.y)}}(e,this.constraintsBox);if(i){var s=i(function(e){var t=e.x,n=e.y;return{top:n.min,bottom:n.max,left:t.min,right:t.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=po(s))}return a},e.prototype.cancelDrag=function(){var e,t;this.visualElement.unlockProjectionTarget(),null===(e=this.cancelLayout)||void 0===e||e.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(Jt.Drag,!1)},e.prototype.stop=function(e,t){var n,i,r;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var o=this.isDragging;if(this.cancelDrag(),o){var a=t.velocity;this.animateDragEnd(a),null===(r=(i=this.props).onDragEnd)||void 0===r||r.call(i,e,t)}},e.prototype.snapToCursor=function(e){var t=this;return yo((function(n){if(aa(n,t.props.drag,t.currentDirection)){var i=t.getAxisMotionValue(n);if(!i)return t.cursorProgress[n]=.5,!0;var r=t.visualElement.getLayoutState().layout,o=r[n].max-r[n].min,a=r[n].min+o/2,s=e[n]-a;t.originPoint[n]=e[n],i.set(s)}})).includes(!0)},e.prototype.updateAxis=function(e,t,n){if(aa(e,this.props.drag,this.currentDirection))return this.getAxisMotionValue(e)?this.updateAxisMotionValue(e,n):this.updateVisualElementAxis(e,t)},e.prototype.updateAxisMotionValue=function(e,t){var n=this.getAxisMotionValue(e);if(t&&n){var i=this.originPoint[e]+t[e],r=this.constraints?Co(i,this.constraints[e],this.elastic[e]):i;n.set(r)}},e.prototype.updateVisualElementAxis=function(e,t){var n,i=this.visualElement.getLayoutState().layout[e],r=i.max-i.min,o=this.cursorProgress[e],a=function(e,t,n,i,r){var o=e-t*n;return i?Co(o,i,r):o}(t[e],r,o,null===(n=this.constraints)||void 0===n?void 0:n[e],this.elastic[e]);this.visualElement.setProjectionTargetAxis(e,a,a+r)},e.prototype.setProps=function(e){var t=e.drag,n=void 0!==t&&t,i=e.dragDirectionLock,r=void 0!==i&&i,o=e.dragPropagation,a=void 0!==o&&o,s=e.dragConstraints,c=void 0!==s&&s,u=e.dragElastic,l=void 0===u?.35:u,d=e.dragMomentum,m=void 0===d||d,h=Object(me.d)(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(me.a)({drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:c,dragElastic:l,dragMomentum:m},h)},e.prototype.getAxisMotionValue=function(e){var t=this.props,n=t.layout,i=t.layoutId,r="_drag"+e.toUpperCase();return this.props[r]?this.props[r]:n||void 0!==i?void 0:this.visualElement.getValue(e,0)},e.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},e.prototype.isExternalDrag=function(){var e=this.props,t=e._dragX,n=e._dragY;return t||n},e.prototype.animateDragEnd=function(e){var t=this,n=this.props,i=n.drag,r=n.dragMomentum,o=n.dragElastic,a=n.dragTransition,s=function(e,t){void 0===t&&(t=!0);var n,i=e.getProjectionParent();return!!i&&(t?Ko(n=Fo(i.projection.target,e.projection.target),i.getLatestValues()):n=Fo(i.getLayoutState().layout,e.getLayoutState().layout),yo((function(t){return e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),c=this.constraints||{};if(s&&Object.keys(c).length&&this.isLayoutDrag()){var u=this.visualElement.getProjectionParent();if(u){var l=Fo(u.projection.targetFinal,c);yo((function(e){var t=l[e],n=t.min,i=t.max;c[e]={min:isNaN(n)?void 0:n,max:isNaN(i)?void 0:i}}))}}var d=yo((function(n){var u;if(aa(n,i,t.currentDirection)){var l=null!==(u=null==c?void 0:c[n])&&void 0!==u?u:{},d=o?200:1e6,m=o?40:1e7,h=Object(me.a)(Object(me.a)({type:"inertia",velocity:r?e[n]:0,bounceStiffness:d,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10},a),l);return t.getAxisMotionValue(n)?t.startAxisValueAnimation(n,h):t.visualElement.startLayoutAnimation(n,h,s)}}));return Promise.all(d).then((function(){var e,n;null===(n=(e=t.props).onDragTransitionEnd)||void 0===n||n.call(e)}))},e.prototype.stopMotion=function(){var e=this;yo((function(t){var n=e.getAxisMotionValue(t);n?n.stop():e.visualElement.stopLayoutAnimation()}))},e.prototype.startAxisValueAnimation=function(e,t){var n=this.getAxisMotionValue(e);if(n){var i=n.get();return n.set(i),n.set(i),kr(e,n,0,t)}},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.drag;if(ke(t.dragConstraints)&&this.constraintsBox){this.stopMotion();var i={x:0,y:0};yo((function(t){i[t]=Bo(e.visualElement.projection.target[t],e.constraintsBox[t])})),this.updateConstraints((function(){yo((function(t){if(aa(t,n,null)){var r=function(e,t,n){var i=e.max-e.min,r=Vn(t.min,t.max-i,n);return{min:r,max:r+i}}(e.visualElement.projection.target[t],e.constraintsBox[t],i[t]),o=r.min,a=r.max;e.visualElement.setProjectionTargetAxis(t,o,a)}}))})),setTimeout(ta,1)}},e.prototype.updateConstraints=function(e){var t=this;this.cancelLayout=ea((function(n,i){var r=_o(t.visualElement);i((function(){return r.forEach((function(e){return e.resetTransform()}))})),n((function(){return Ro(t.visualElement)})),i((function(){return r.forEach((function(e){return e.restoreTransform()}))})),n((function(){t.resolveDragConstraints()})),e&&i(e)}))},e.prototype.mount=function(e){var t=this,n=fn(e.getInstance(),"pointerdown",(function(e){var n=t.props,i=n.drag,r=n.dragListener;i&&(void 0===r||r)&&t.start(e)})),i=tn(window,"resize",(function(){t.scalePoint()})),r=e.onLayoutUpdate((function(){t.isDragging&&t.resolveDragConstraints()})),o=e.prevDragCursor;return o&&this.start(na,{cursorProgress:o}),function(){null==n||n(),null==i||i(),null==r||r(),t.cancelDrag()}},e}();function aa(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}var sa,ca,ua={pan:xn((function(e){var t=e.onPan,n=e.onPanStart,i=e.onPanEnd,r=e.onPanSessionStart,o=e.visualElement,a=t||n||i||r,s=Object(T.useRef)(null),c=Object(T.useContext)(ye).transformPagePoint,u={onSessionStart:r,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,i&&i(e,t)}};Object(T.useEffect)((function(){null!==s.current&&s.current.updateHandlers(u)})),pn(o,"pointerdown",a&&function(e){s.current=new ao(e,u,{transformPagePoint:c})}),wn((function(){return s.current&&s.current.end()}))})),drag:xn((function(e){var t=e.dragControls,n=e.visualElement,i=Object(T.useContext)(ye).transformPagePoint,r=Ae((function(){return new oa({visualElement:n})}));r.setProps(Object(me.a)(Object(me.a)({},e),{transformPagePoint:i})),Object(T.useEffect)((function(){return t&&t.subscribe(r)}),[r]),Object(T.useEffect)((function(){return r.mount(n)}),[])}))};function la(e){return"string"==typeof e&&e.startsWith("var(--")}!function(e){e[e.Entering=0]="Entering",e[e.Present=1]="Present",e[e.Exiting=2]="Exiting"}(sa||(sa={})),function(e){e[e.Hide=0]="Hide",e[e.Show=1]="Show"}(ca||(ca={}));var da=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function ma(e,t,n){void 0===n&&(n=1);var i=Object(me.c)(function(e){var t=da.exec(e);if(!t)return[,];var n=Object(me.c)(t,3);return[n[1],n[2]]}(e),2),r=i[0],o=i[1];if(r){var a=window.getComputedStyle(t).getPropertyValue(r);return a?a.trim():la(o)?ma(o,t,n+1):o}}function ha(e,t){return e/(t.max-t.min)*100}var fa="_$css";var pa={process:function(e,t,n){var i=n.target;if("string"==typeof e){if(!mt.test(e))return e;e=parseFloat(e)}return ha(e,i.x)+"% "+ha(e,i.y)+"%"}},ga={borderRadius:Object(me.a)(Object(me.a)({},pa),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:pa,borderTopRightRadius:pa,borderBottomLeftRadius:pa,borderBottomRightRadius:pa,boxShadow:{process:function(e,t){var n=t.delta,i=t.treeScale,r=e,o=e.includes("var("),a=[];o&&(e=e.replace(da,(function(e){return a.push(e),fa})));var s=oi.parse(e);if(s.length>5)return r;var c=oi.createTransformer(e),u="number"!=typeof s[0]?1:0,l=n.x.scale*i.x,d=n.y.scale*i.y;s[0+u]/=l,s[1+u]/=d;var m=Vn(l,d,.5);"number"==typeof s[2+u]&&(s[2+u]/=m),"number"==typeof s[3+u]&&(s[3+u]/=m);var h=c(s);if(o){var f=0;h=h.replace(fa,(function(){var e=a[f];return f++,e}))}return h}}},va=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},t.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},t.isAnimating={x:!1,y:!1},t.stopAxisAnimation={x:void 0,y:void 0},t.isAnimatingTree=!1,t.animate=function(e,n,i){void 0===i&&(i={});var r=i.originBox,o=i.targetBox,a=i.visibilityAction,s=i.shouldStackAnimate,c=i.onComplete,u=i.prevParent,l=Object(me.d)(i,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=t.props,m=d.visualElement,h=d.layout;if(!1===s)return t.isAnimatingTree=!1,t.safeToRemove();if(!t.isAnimatingTree||!0===s){s&&(t.isAnimatingTree=!0),n=r||n,e=o||e;var f=!1,p=m.getProjectionParent();if(p){var g=p.prevViewportBox,v=p.getLayoutState().layout;u&&(o&&(v=u.getLayoutState().layout),r&&!No(u,p)&&u.prevViewportBox&&(g=u.prevViewportBox)),g&&wa(u,r,o)&&(f=!0,n=Fo(g,n),e=Fo(v,e))}var y=ya(n,e),C=yo((function(i){var r,o;if("position"===h){var s=e[i].max-e[i].min;n[i].max=n[i].min+s}if(!m.projection.isTargetLocked)return void 0===a?y?t.animateAxis(i,e[i],n[i],Object(me.a)(Object(me.a)({},l),{isRelative:f})):(null===(o=(r=t.stopAxisAnimation)[i])||void 0===o||o.call(r),m.setProjectionTargetAxis(i,e[i].min,e[i].max,f)):void m.setVisibility(a===ca.Show)}));return m.syncRender(),Promise.all(C).then((function(){t.isAnimatingTree=!1,c&&c(),m.notifyLayoutAnimationComplete()}))}},t}return Object(me.b)(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.visualElement;t.animateMotionValue=kr,t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate),t.layoutSafeToRemove=function(){return e.safeToRemove()},function(e){for(var t in e)Ue[t]=e[t]}(ga)},t.prototype.componentWillUnmount=function(){var e=this;this.unsubLayoutReady(),yo((function(t){var n,i;return null===(i=(n=e.stopAxisAnimation)[t])||void 0===i?void 0:i.call(n)}))},t.prototype.animateAxis=function(e,t,n,i){var r,o,a=this,s=void 0===i?{}:i,c=s.transition,u=s.isRelative;if(!this.isAnimating[e]||!Aa(t,this.currentAnimationTarget[e])){null===(o=(r=this.stopAxisAnimation)[e])||void 0===o||o.call(r),this.isAnimating[e]=!0;var l=this.props.visualElement,d=this.frameTarget[e],m=l.getProjectionAnimationProgress()[e];m.clearListeners(),m.set(0),m.set(0);var h=function(){var i=m.get()/1e3;!function(e,t,n,i){e.min=Vn(t.min,n.min,i),e.max=Vn(t.max,n.max,i)}(d,n,t,i),l.setProjectionTargetAxis(e,d.min,d.max,u)};h();var f=m.onChange(h);this.stopAxisAnimation[e]=function(){a.isAnimating[e]=!1,m.stop(),f()},this.currentAnimationTarget[e]=t;var p=c||l.getDefaultTransition()||Sa;return kr("x"===e?"layoutX":"layoutY",m,1e3,p&&Or(p,"layout")).then(this.stopAxisAnimation[e])}},t.prototype.safeToRemove=function(){var e,t;null===(t=(e=this.props).safeToRemove)||void 0===t||t.call(e)},t.prototype.render=function(){return null},t}(T.Component);function ya(e,t){return!(ba(e)||ba(t)||Aa(e.x,t.x)&&Aa(e.y,t.y))}var Ca={min:0,max:0};function ba(e){return Aa(e.x,Ca)&&Aa(e.y,Ca)}function Aa(e,t){return e.min===t.min&&e.max===t.max}var Sa={duration:.45,ease:[.4,0,.1,1]};function wa(e,t,n){return e||!e&&!(t||n)}var Ea={layoutReady:function(e){return e.notifyLayoutReady()}};function Da(){var e=new Set;return{add:function(t){return e.add(t)},flush:function(t){var n=void 0===t?Ea:t,i=n.layoutReady,r=n.parent;ea((function(t,n){var o=Array.from(e).sort(Po),a=r?_o(r):[];n((function(){Object(me.e)(Object(me.e)([],Object(me.c)(a)),Object(me.c)(o)).forEach((function(e){return e.resetTransform()}))})),t((function(){o.forEach(Ro)})),n((function(){a.forEach((function(e){return e.restoreTransform()})),o.forEach(i)})),t((function(){o.forEach((function(e){e.isPresent&&(e.presence=sa.Present)}))})),n((function(){Gi.preRender(),Gi.render()})),t((function(){Ki.postRender((function(){return o.forEach(xa)})),e.clear()}))})),ta()}}}function xa(e){e.prevViewportBox=e.projection.target}var Ba=Object(T.createContext)(Da()),Ia=Object(T.createContext)(Da());function Ta(e){return!!e.forceUpdate}var Oa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(me.b)(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.syncLayout,n=e.framerSyncLayout,i=e.visualElement;Ta(t)&&t.register(i),Ta(n)&&n.register(i),i.onUnmount((function(){Ta(t)&&t.remove(i),Ta(n)&&n.remove(i)}))},t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.syncLayout,n=e.visualElement;return Ta(t)?t.syncUpdate():(!function(e){e.shouldResetTransform()||(e.prevViewportBox=e.measureViewportBox(!1),e.rebaseProjectionTarget(!1,e.prevViewportBox))}(n),t.add(n)),null},t.prototype.componentDidUpdate=function(){var e=this.props.syncLayout;Ta(e)||e.flush()},t.prototype.render=function(){return null},t}(T.default.Component);var ka={measureLayout:function(e){var t=Object(T.useContext)(Ba),n=Object(T.useContext)(Ia);return T.default.createElement(Oa,Object(me.a)({},e,{syncLayout:t,framerSyncLayout:n}))},layoutAnimation:function(e){var t=Object(me.c)(Se(),2)[1];return T.createElement(va,Object(me.a)({},e,{safeToRemove:t}))}};function Pa(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:vo(),deltaFinal:vo(),deltaTransform:""}}var La=Pa();function _a(e,t,n){var i=e.x,r=e.y,o="translate3d("+i.translate/t.x+"px, "+r.translate/t.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,c=n.rotateY;a&&(o+="rotate("+a+") "),s&&(o+="rotateX("+s+") "),c&&(o+="rotateY("+c+") ")}return o+="scale("+i.scale+", "+r.scale+")",n||o!==Ma?o:""}function Ra(e){var t=e.deltaFinal;return 100*t.x.origin+"% "+100*t.y.origin+"% 0"}var Ma=_a(La.delta,La.treeScale,{x:1,y:1}),Fa=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Na(e,t,n,i){var r,o,a=e.delta,s=e.layout,c=e.layoutCorrected,u=e.treeScale,l=t.target;o=s,Wo((r=c).x,o.x),Wo(r.y,o.y),function(e,t,n){var i=n.length;if(i){var r,o;t.x=t.y=1;for(var a=0;a<i;a++)o=(r=n[a]).getLayoutState().delta,t.x*=o.x.scale,t.y*=o.y.scale,Uo(e,o),Vo(r)&&Qo(e,e,r.getLatestValues())}}(c,u,n),To(a,c,l,i)}var Va=function(){function e(){this.children=[],this.isDirty=!1}return e.prototype.add=function(e){Pr(this.children,e),this.isDirty=!0},e.prototype.remove=function(e){Lr(this.children,e),this.isDirty=!0},e.prototype.forEach=function(e){this.isDirty&&this.children.sort(Po),this.isDirty=!1,this.children.forEach(e)},e}();var Wa=function(e){var t=e.treeType,n=void 0===t?"":t,i=e.build,r=e.getBaseTarget,o=e.makeTargetAnimatable,a=e.measureViewportBox,s=e.render,c=e.readValueFromInstance,u=e.resetTransform,l=e.restoreTransform,d=e.removeValueFromRenderState,m=e.sortNodePosition,h=e.scrapeMotionValuesFromProps;return function(e,t){var f=e.parent,p=e.props,g=e.presenceId,v=e.blockInitialAnimation,y=e.visualState;void 0===t&&(t={});var C,b,A,S,w,E,D=y.latestValues,x=y.renderState,B=function(){var e=Fa.map((function(){return new _r})),t={},n={clearAllListeners:function(){return e.forEach((function(e){return e.clear()}))},updatePropListeners:function(e){return Fa.forEach((function(i){var r;null===(r=t[i])||void 0===r||r.call(t);var o="on"+i,a=e[o];a&&(t[i]=n[o](a))}))}};return e.forEach((function(e,t){n["on"+Fa[t]]=function(t){return e.add(t)},n["notify"+Fa[t]]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.notify.apply(e,Object(me.e)([],Object(me.c)(t)))}})),n}(),I={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},T=I,O=D,k=Pa(),P=!1,L=new Map,_=new Map,R={},M=Object(me.a)({},D);function F(){C&&(G.isProjectionReady()&&(Qo(T.targetFinal,T.target,O),To(k.deltaFinal,k.layoutCorrected,T.targetFinal,D)),N(),s(C,x))}function N(){var e=D;if(S&&S.isActive()){var n=S.getCrossfadeState(G);n&&(e=n)}i(G,x,e,T,k,t,p)}function V(){B.notifyUpdate(D)}function W(){G.layoutTree.forEach(za)}var j=h(p);for(var z in j){var H=j[z];void 0!==D[z]&&$e(H)&&H.set(D[z],!1)}var U=Me(p),Z=Fe(p),G=Object(me.a)(Object(me.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(me.e)(Object(me.e)([],Object(me.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new Va,presenceId:g,projection:I,variantChildren:Z?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(C)},mount:function(e){C=G.current=e,G.pointTo(G),Z&&f&&!U&&(E=null==f?void 0:f.addVariantChild(G)),null==f||f.children.add(G)},unmount:function(){Zi.update(V),Zi.render(F),Zi.preRender(G.updateLayoutProjection),_.forEach((function(e){return e()})),G.stopLayoutAnimation(),G.layoutTree.remove(G),null==E||E(),null==f||f.children.delete(G),null==A||A(),B.clearAllListeners()},addVariantChild:function(e){var t,n=G.getClosestVariantNode();if(n)return null===(t=n.variantChildren)||void 0===t||t.add(e),function(){return n.variantChildren.delete(e)}},sortNodePosition:function(e){return m&&n===e.treeType?m(G.getInstance(),e.getInstance()):0},getClosestVariantNode:function(){return Z?G:null==f?void 0:f.getClosestVariantNode()},scheduleUpdateLayoutProjection:f?f.scheduleUpdateLayoutProjection:function(){return Ki.preRender(G.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return p.layoutId},getInstance:function(){return C},getStaticValue:function(e){return D[e]},setStaticValue:function(e,t){return D[e]=t},getLatestValues:function(){return D},setVisibility:function(e){G.isVisible!==e&&(G.isVisible=e,G.scheduleRender())},makeTargetAnimatable:function(e,t){return void 0===t&&(t=!0),o(G,e,p,t)},addValue:function(e,t){G.hasValue(e)&&G.removeValue(e),L.set(e,t),D[e]=t.get(),function(e,t){var n=t.onChange((function(t){D[e]=t,p.onUpdate&&Ki.update(V,!1,!0)})),i=t.onRenderRequest(G.scheduleRender);_.set(e,(function(){n(),i()}))}(e,t)},removeValue:function(e){var t;L.delete(e),null===(t=_.get(e))||void 0===t||t(),_.delete(e),delete D[e],d(e,x)},hasValue:function(e){return L.has(e)},getValue:function(e,t){var n=L.get(e);return void 0===n&&void 0!==t&&(n=Mr(t),G.addValue(e,n)),n},forEachValue:function(e){return L.forEach(e)},readValue:function(e){var n;return null!==(n=D[e])&&void 0!==n?n:c(C,e,t)},setBaseTarget:function(e,t){M[e]=t},getBaseTarget:function(e){if(r){var t=r(p,e);if(void 0!==t&&!$e(t))return t}return M[e]}},B),{build:function(){return N(),x},scheduleRender:function(){Ki.render(F,!1,!0)},syncRender:F,setProps:function(e){p=e,B.updatePropListeners(e),R=function(e,t,n){var i;for(var r in t){var o=t[r],a=n[r];if($e(o))e.addValue(r,o);else if($e(a))e.addValue(r,Mr(o));else if(a!==o)if(e.hasValue(r)){var s=e.getValue(r);!s.hasAnimated&&s.set(o)}else e.addValue(r,Mr(null!==(i=e.getStaticValue(r))&&void 0!==i?i:o))}for(var r in n)void 0===t[r]&&e.removeValue(r);return t}(G,h(p),R)},getProps:function(){return p},getVariant:function(e){var t;return null===(t=p.variants)||void 0===t?void 0:t[e]},getDefaultTransition:function(){return p.transition},getVariantContext:function(e){if(void 0===e&&(e=!1),e)return null==f?void 0:f.getVariantContext();if(!U){var t=(null==f?void 0:f.getVariantContext())||{};return void 0!==p.initial&&(t.initial=p.initial),t}for(var n={},i=0;i<Za;i++){var r=Ua[i],o=p[r];(Le(o)||!1===o)&&(n[r]=o)}return n},enableLayoutProjection:function(){I.isEnabled=!0,G.layoutTree.add(G)},lockProjectionTarget:function(){I.isTargetLocked=!0},unlockProjectionTarget:function(){G.stopLayoutAnimation(),I.isTargetLocked=!1},getLayoutState:function(){return k},setCrossfader:function(e){S=e},isProjectionReady:function(){return I.isEnabled&&I.isHydrated&&k.isHydrated},startLayoutAnimation:function(e,t,n){void 0===n&&(n=!1);var i=G.getProjectionAnimationProgress()[e],r=n?I.relativeTarget[e]:I.target[e],o=r.min,a=r.max-o;return i.clearListeners(),i.set(o),i.set(o),i.onChange((function(t){G.setProjectionTargetAxis(e,t,t+a,n)})),G.animateMotionValue(e,i,0,t)},stopLayoutAnimation:function(){yo((function(e){return G.getProjectionAnimationProgress()[e].stop()}))},measureViewportBox:function(e){void 0===e&&(e=!0);var n=a(C,t);return e||Ko(n,D),n},getProjectionAnimationProgress:function(){return w||(w={x:Mr(0),y:Mr(0)}),w},setProjectionTargetAxis:function(e,t,n,i){var r;void 0===i&&(i=!1),i?(I.relativeTarget||(I.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),r=I.relativeTarget[e]):(I.relativeTarget=void 0,r=I.target[e]),I.isHydrated=!0,r.min=t,r.max=n,P=!0,B.notifySetAxisTarget()},rebaseProjectionTarget:function(e,t){void 0===t&&(t=k.layout);var n=G.getProjectionAnimationProgress(),i=n.x,r=n.y,o=!(I.relativeTarget||I.isTargetLocked||i.isAnimating()||r.isAnimating());(e||o)&&yo((function(e){var n=t[e],i=n.min,r=n.max;G.setProjectionTargetAxis(e,i,r)}))},notifyLayoutReady:function(e){!function(e){var t=e.getProjectionParent();if(t){var n=Fo(t.getLayoutState().layout,e.getLayoutState().layout);yo((function(t){e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)}))}else e.rebaseProjectionTarget()}(G),G.notifyLayoutUpdate(k.layout,G.prevViewportBox||k.layout,e)},resetTransform:function(){return u(G,C,p)},restoreTransform:function(){return l(C,x)},updateLayoutProjection:function(){if(G.isProjectionReady()){var e=k.delta,t=k.treeScale,n=t.x,i=t.y,r=k.deltaTransform;Na(k,T,G.path,D),P&&G.notifyViewportBoxUpdate(T.target,e),P=!1;var o=_a(e,t);o===r&&n===t.x&&i===t.y||G.scheduleRender(),k.deltaTransform=o}},updateTreeLayoutProjection:function(){G.layoutTree.forEach(ja),Ki.preRender(W,!1,!0)},getProjectionParent:function(){if(void 0===b){for(var e=!1,t=G.path.length-1;t>=0;t--){var n=G.path[t];if(n.projection.isEnabled){e=n;break}}b=e}return b},resolveRelativeTargetBox:function(){var e=G.getProjectionParent();if(I.relativeTarget&&e&&(function(e,t){ko(e.target.x,e.relativeTarget.x,t.target.x),ko(e.target.y,e.relativeTarget.y,t.target.y)}(I,e.projection),Vo(e))){var t=I.target;Qo(t,t,e.getLatestValues())}},shouldResetTransform:function(){return Boolean(p._layoutResetTransform)},pointTo:function(e){T=e.projection,O=e.getLatestValues(),null==A||A(),A=Dn(e.onSetAxisTarget(G.scheduleUpdateLayoutProjection),e.onLayoutAnimationComplete((function(){var e;G.isPresent?G.presence=sa.Present:null===(e=G.layoutSafeToRemove)||void 0===e||e.call(G)})))},isPresent:!0,presence:sa.Entering});return G}};function ja(e){e.resolveRelativeTargetBox()}function za(e){e.updateLayoutProjection()}var Ha,Ua=Object(me.e)(["initial"],Object(me.c)(qr)),Za=Ua.length,Ga=new Set(["width","height","top","left","right","bottom","x","y"]),Ya=function(e){return Ga.has(e)},Qa=function(e,t){e.set(t,!1),e.set(t)},qa=function(e){return e===gt||e===mt};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(Ha||(Ha={}));var Xa=function(e,t){return parseFloat(e.split(", ")[t])},Ka=function(e,t){return function(n,i){var r=i.transform;if("none"===r||!r)return 0;var o=r.match(/^matrix3d\((.+)\)$/);if(o)return Xa(o[1],t);var a=r.match(/^matrix\((.+)\)$/);return a?Xa(a[1],e):0}},Ja=new Set(["x","y","z"]),$a=Ge.filter((function(e){return!Ja.has(e)}));var es={width:function(e){var t=e.x;return t.max-t.min},height:function(e){var t=e.y;return t.max-t.min},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,i=t.top;return parseFloat(i)+(n.max-n.min)},right:function(e,t){var n=e.x,i=t.left;return parseFloat(i)+(n.max-n.min)},x:Ka(4,13),y:Ka(5,14)},ts=function(e,t,n,i){void 0===n&&(n={}),void 0===i&&(i={}),t=Object(me.a)({},t),i=Object(me.a)({},i);var r=Object.keys(t).filter(Ya),o=[],a=!1,s=[];if(r.forEach((function(r){var c=e.getValue(r);if(e.hasValue(r)){var u,l=n[r],d=t[r],m=Vr(l);if(Gt(d))for(var h=d.length,f=null===d[0]?1:0;f<h;f++)u?Vr(d[f]):(u=Vr(d[f]))===m||qa(m)&&qa(u);else u=Vr(d);if(m!==u)if(qa(m)&&qa(u)){var p=c.get();"string"==typeof p&&c.set(parseFloat(p)),"string"==typeof d?t[r]=parseFloat(d):Array.isArray(d)&&u===mt&&(t[r]=d.map(parseFloat))}else(null==m?void 0:m.transform)&&(null==u?void 0:u.transform)&&(0===l||0===d)?0===l?c.set(u.transform(l)):t[r]=m.transform(d):(a||(o=function(e){var t=[];return $a.forEach((function(n){var i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))})),t.length&&e.syncRender(),t}(e),a=!0),s.push(r),i[r]=void 0!==i[r]?i[r]:t[r],Qa(c,d))}})),s.length){var c=function(e,t,n){var i=t.measureViewportBox(),r=t.getInstance(),o=getComputedStyle(r),a=o.display,s={top:o.top,left:o.left,bottom:o.bottom,right:o.right,transform:o.transform};"none"===a&&t.setStaticValue("display",e.display||"block"),t.syncRender();var c=t.measureViewportBox();return n.forEach((function(n){var r=t.getValue(n);Qa(r,es[n](i,s)),e[n]=es[n](c,o)})),e}(t,e,s);return o.length&&o.forEach((function(t){var n=Object(me.c)(t,2),i=n[0],r=n[1];e.getValue(i).set(r)})),e.syncRender(),{target:c,transitionEnd:i}}return{target:t,transitionEnd:i}};function ns(e,t,n,i){return function(e){return Object.keys(e).some(Ya)}(t)?ts(e,t,n,i):{target:t,transitionEnd:i}}var is=function(e,t,n,i){var r=function(e,t,n){var i,r=Object(me.d)(t,[]),o=e.getInstance();if(!(o instanceof HTMLElement))return{target:r,transitionEnd:n};for(var a in n&&(n=Object(me.a)({},n)),e.forEachValue((function(e){var t=e.get();if(la(t)){var n=ma(t,o);n&&e.set(n)}})),r){var s=r[a];if(la(s)){var c=ma(s,o);c&&(r[a]=c,n&&(null!==(i=n[a])&&void 0!==i||(n[a]=s)))}}return{target:r,transitionEnd:n}}(e,t,i);return ns(e,t=r.target,n,i=r.transitionEnd)};var rs={treeType:"dom",readValueFromInstance:function(e,t){if(qe(t)){var n=wr(t);return n&&n.default||0}var i,r=(i=e,window.getComputedStyle(i));return(tt(t)?r.getPropertyValue(t):r[t])||0},sortNodePosition:function(e,t){return 2&e.compareDocumentPosition(t)?1:-1},getBaseTarget:function(e,t){var n;return null===(n=e.style)||void 0===n?void 0:n[t]},measureViewportBox:function(e,t){return Eo(e,t.transformPagePoint)},resetTransform:function(e,t,n){var i=n.transformTemplate;t.style.transform=i?i({},""):"none",e.scheduleRender()},restoreTransform:function(e,t){e.style.transform=t.style.transform},removeValueFromRenderState:function(e,t){var n=t.vars,i=t.style;delete n[e],delete i[e]},makeTargetAnimatable:function(e,t,n,i){var r=n.transformValues;void 0===i&&(i=!0);var o=t.transition,a=t.transitionEnd,s=Object(me.d)(t,["transition","transitionEnd"]),c=function(e,t,n){var i,r,o={};for(var a in e)o[a]=null!==(i=Ur(a,t))&&void 0!==i?i:null===(r=n.getValue(a))||void 0===r?void 0:r.get();return o}(s,o||{},e);if(r&&(a&&(a=r(a)),s&&(s=r(s)),c&&(c=r(c))),i){!function(e,t,n){var i,r,o,a,s=Object.keys(t).filter((function(t){return!e.hasValue(t)})),c=s.length;if(c)for(var u=0;u<c;u++){var l=s[u],d=t[l],m=null;Array.isArray(d)&&(m=d[0]),null===m&&(m=null!==(r=null!==(i=n[l])&&void 0!==i?i:e.readValue(l))&&void 0!==r?r:t[l]),null!=m&&("string"==typeof m&&/^\-?\d*\.?\d+$/.test(m)?m=parseFloat(m):!jr(m)&&oi.test(d)&&(m=Er(l,d)),e.addValue(l,Mr(m)),null!==(o=(a=n)[l])&&void 0!==o||(a[l]=m),e.setBaseTarget(l,m))}}(e,s,c);var u=is(e,s,c,a);a=u.transitionEnd,s=u.target}return Object(me.a)({transition:o,transitionEnd:a},s)},scrapeMotionValuesFromProps:Ht,build:function(e,t,n,i,r,o,a){void 0!==e.isVisible&&(t.style.visibility=e.isVisible?"visible":"hidden");var s=i.isEnabled&&r.isHydrated;At(t,n,i,r,o,a.transformTemplate,s?_a:void 0,s?Ra:void 0)},render:Wt},os=Wa(rs),as=Wa(Object(me.a)(Object(me.a)({},rs),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var n;return qe(t)?(null===(n=wr(t))||void 0===n?void 0:n.default)||0:(t=jt.has(t)?t:Vt(t),e.getAttribute(t))},scrapeMotionValuesFromProps:Ut,build:function(e,t,n,i,r,o,a){var s=i.isEnabled&&r.isHydrated;_t(t,n,i,r,o,a.transformTemplate,s?_a:void 0,s?Ra:void 0)},render:zt})),ss=function(e,t){return He(e)?as(t,{enableHardwareAcceleration:!1}):os(t,{enableHardwareAcceleration:!0})},cs=Object(me.a)(Object(me.a)(Object(me.a)(Object(me.a)({},to),Bn),ua),ka),us=je((function(e,t){return en(e,t,cs,ss)}));function ls(e,t){return e.format===t.format&&e.text===t.text}function ds(e){return e.text+e.format}class ms{constructor(e){this.highlighted=!1,this.code=e,this.points=[]}}var hs=n(6);class fs{static now(){return Date.now()}}function ps(e){var t=Ae((function(){return Mr(e)}));if(Object(T.useContext)(ye).isStatic){var n=Object(me.c)(Object(T.useState)(e),2)[1];Object(T.useEffect)((function(){return t.onChange(n)}),[])}return t}var gs=function(e){return function(e){return"object"==typeof e&&e.mix}(e)?e.mix:void 0};function vs(e,t){var n=ps(t()),i=function(){return n.set(t())};return i(),function(e,t){Object(T.useEffect)((function(){var n=e.map((function(e){return e.onChange(t)}));return function(){return n.forEach((function(e){return e()}))}}))}(e,(function(){return Ki.update(i,!1,!0)})),n}function ys(e,t,n,i){var r="function"==typeof t?t:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!Array.isArray(e[0]),i=n?0:-1,r=e[0+i],o=e[1+i],a=e[2+i],s=e[3+i],c=fi(o,a,Object(me.a)({mixer:gs(a[0])},s));return n?c(r):c}(t,n,i);return Array.isArray(e)?Cs(e,r):Cs([e],(function(e){var t=Object(me.c)(e,1)[0];return r(t)}))}function Cs(e,t){var n=Ae((function(){return[]}));return vs(e,(function(){n.length=0;for(var i=e.length,r=0;r<i;r++)n[r]=e[r].get();return t(n)}))}function bs(e,t,n){void 0===n&&(n={});var i=$e(e)?e:Mr(e);return kr("",i,t,n),{stop:function(){return i.stop()}}}var As=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};class Ss extends T.default.Component{constructor(e){super(e),this.state={element:e.element}}update(e){this.setState({element:e})}style(e){this.customStyle=e,this.forceUpdate()}render(){var e,t,n,i,r,o,a,s,c;const u=this.state.element,l=this.props.configuration.style;!u.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(u);const d=null!==(t=null===(e=this.customStyle)||void 0===e?void 0:e.fillColor)&&void 0!==t?t:u.highlighted?l.highlightedPolygonFillColor:l.polygonFillColor,m=null!==(i=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==i?i:u.highlighted?l.highlightedPolygonStrokeColor:l.polygonStrokeColor,h=null!==(o=null===(r=this.customStyle)||void 0===r?void 0:r.strokeWidth)&&void 0!==o?o:u.highlighted?l.highlightedPolygonStrokeWidth:l.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:u.highlighted?l.highlightedPolygonCornerRadius:l.polygonCornerRadius,p=null!==(c=this.props.animateToPoints)&&void 0!==c?c:u.points;return T.default.createElement(ws,{points:p,onClick:()=>{this.props.onClick&&this.props.onClick(u)},fill:d,stroke:m,strokeWidth:h,cornerRadius:f})}}function ws(e){var{points:t,cornerRadius:n}=e,i=As(e,["points","cornerRadius"]);const r=[t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y],o=r.map(ps),a=ys(o,(([e,t,i,r,o,a,s,c])=>{const u=[{x:e,y:t},{x:i,y:r},{x:o,y:a},{x:s,y:c}];return hs.a.toSvgPathStringWithRoundedCorners(u,n)}));return Object(T.useEffect)((()=>{const e=[];for(let t=0;t<r.length;t++)e.push(bs(o[t],r[t]));return()=>{e.forEach((e=>e.stop()))}}),[t]),T.default.createElement(us.path,Object.assign({d:a},i))}class Es{constructor(){this.detectedAt=0}update(e,t,n,i,r,o){this.polygon=e,this.polygonRef=t,this.label=n,this.labelRef=i,this.element=r,this.updatedAt=o}}class Ds extends T.default.Component{constructor(e){super(e),this.state={polygonElements:[]}}update(e,t,n,i){const r=[];(class{static keepOnlyCenterMostDuplicate(e,t){const n=new Map;e.forEach((e=>{const t=ds(e),i=n.get(t);i?i.push(e):n.set(t,[e])})),n.forEach(((t,i)=>{t.length<2?n.delete(i):t.forEach(((t,n)=>{e.splice(e.indexOf(t),1)}))})),n.forEach(((n,i)=>{const r=e=>{let t={x:0,y:0};return e.forEach((e=>{t.x+=e.x,t.y+=e.y})),t.x/=e.length,t.y/=e.length,t},o=t.width/2,a=n.reduce(((e,t)=>{const n=r(e.quad),i=r(t.quad);return Math.abs(o-n.x)<Math.abs(o-i.x)?e:t}));e.push(a)}))}}).keepOnlyCenterMostDuplicate(i,n),i.forEach((i=>{const o=new ms(i);o.points=void 0===e?hs.a.scaleListToHtmlElement(i.quad,n,t.video):i.quad.map((t=>{const i=new hs.a(t.x,t.y);return i.x*=e.width/n.width,i.y*=e.height/n.height,i.y+=e.y,i.x+=e.x,i})),o.points.forEach((e=>{t.state.mirrored&&this.container&&(e.x=this.container.clientWidth-e.x)})),r.push(o)}));const o=[];this.state.polygonElements.forEach((e=>{const t=r.find((t=>ls(t.code,e.element.code)));let n=!1;const i=fs.now();void 0===t?e.updatedAt+1e3<i&&(n=!0):(e.element=t,e.polygon=T.default.createElement(Ss,{key:ds(e.element.code),ref:t=>e.polygonRef=t,configuration:this.props.configuration,element:e.element,animateToPoints:t.points,onClick:this.onPolygonClick.bind(this)}),e.label=T.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:ds(e.element.code),ref:t=>e.labelRef=t,configuration:this.props.configuration,element:e.element,animateToPoints:t.points,onClick:this.onPolygonClick.bind(this)})),this.props.configuration.automaticSelectionEnabled&&this.props.configuration.countingRepeatDelay>-1&&e.detectedAt>0&&i>this.props.configuration.countingRepeatDelay+e.detectedAt&&(this.props.onPolygonSelected(t.code),e.detectedAt=i),e.updatedAt=i),n||o.push(e)})),r.forEach((e=>{if(void 0===this.state.polygonElements.find((t=>ls(t.element.code,e.code)))){let t,n;const i=new Es,r=T.default.createElement(Ss,{key:ds(e.code),ref:i=>{t=i,void 0!==n&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}),a=T.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:ds(e.code),ref:i=>{n=i,void 0!==t&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}));i.update(r,t,a,n,e,fs.now()),o.push(i)}})),this.setState({polygonElements:o})}onPolygonClick(e){var t,n,i,r;let o;e.highlighted=!e.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((t=>{var n;const i=t.labelRef,r=t.label.props.element;ls(r.code,e.code)&&(o=t),i&&ls(r.code,e.code)&&(i.update(e),null===(n=t.polygonRef)||void 0===n||n.update(e))})),e.highlighted&&(null===(n=(t=this.props).onPolygonSelected)||void 0===n||n.call(t,e.code),o&&(o.detectedAt=fs.now())),null===(r=(i=this.props).onPolygonClick)||void 0===r||r.call(i,e.code)}render(){var e,t;return T.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:e=>this.container=e},T.default.createElement(us.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((e=>e.polygon))),null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((e=>e.label)))}}var xs=n(47);class Bs extends T.default.Component{render(){if(!this.props.visible)return null;const e=xs.a.svg`
|
|
32
32
|
animation: rotate 2s linear infinite;
|
|
33
33
|
@keyframes rotate { 100% { transform: rotate(360deg); } }
|
|
34
|
-
`;return T.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},T.default.createElement(e,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),T.default.createElement("path",{d:"M90.5153 49.6094C91.715 49.6094 92.6933 50.5827 92.6321 51.7808C92.1218 61.7815 88.0988 71.3096 81.2342 78.6635C73.8743 86.548 63.7963 91.3454 53.036 92.0868C42.2757 92.8282 31.6351 89.4582 23.2634 82.6576C15.455 76.3147 10.1633 67.4283 8.28624 57.5922C8.06135 56.4138 8.89694 55.3155 10.0853 55.1509C11.2737 54.9864 12.3642 55.8183 12.5959 56.9954C14.3176 65.7412 19.0487 73.6367 26.0026 79.2856C33.5201 85.3922 43.0751 88.4183 52.7374 87.7526C62.3998 87.0869 71.4494 82.7789 78.0584 75.699C84.1719 69.1497 87.7754 60.68 88.2814 51.7807C88.3495 50.5829 89.3156 49.6094 90.5153 49.6094Z",fill:"white"}),T.default.createElement("path",{d:"M40.7013 23.4514C40.2751 22.2667 40.8885 20.9518 42.1022 20.6166C45.5928 19.6526 49.2351 19.3251 52.8537 19.6567C57.2305 20.0577 61.4662 21.4131 65.2628 23.6273C69.0594 25.8416 72.3246 28.861 74.8286 32.4731C77.3326 36.0851 79.0146 40.2021 79.7562 44.5341C80.4978 48.8662 80.281 53.3082 79.121 57.5475C77.9611 61.7868 75.8862 65.7204 73.0423 69.0714C70.1985 72.4225 66.6548 75.1095 62.6606 76.9436C59.3583 78.4599 55.8145 79.3627 52.202 79.6146C50.9459 79.7022 49.9301 78.6662 49.9379 77.4072C49.9457 76.1481 50.9746 75.1443 52.2293 75.0398C55.1749 74.7942 58.0613 74.0382 60.758 72.8C64.1467 71.244 67.1532 68.9642 69.5659 66.1212C71.9787 63.2781 73.7391 59.9408 74.7232 56.3442C75.7073 52.7475 75.8912 48.9789 75.262 45.3035C74.6328 41.6281 73.2058 38.1353 71.0814 35.0708C68.957 32.0062 66.1867 29.4445 62.9657 27.5659C59.7446 25.6873 56.151 24.5374 52.4377 24.1972C49.4828 23.9265 46.5092 24.1737 43.6497 24.9219C42.4316 25.2406 41.1274 24.6362 40.7013 23.4514Z",fill:"white"}),T.default.createElement("path",{d:"M39.9232 61.6554C39.1643 62.5529 37.8105 62.673 37.0094 61.813C35.7171 60.4259 34.6502 58.8388 33.8523 57.1092C32.7564 54.7336 32.1944 52.1468 32.206 49.5307C32.2175 46.9146 32.8022 44.3328 33.9189 41.967C35.0356 39.6011 36.6573 37.5088 38.6697 35.8372C40.6822 34.1656 43.0365 32.9554 45.567 32.2916C48.0975 31.6279 50.7428 31.5268 53.3166 31.9954C55.8904 32.464 58.3303 33.4911 60.4644 35.0042C62.0183 36.1059 63.3827 37.4458 64.5093 38.9707C65.2077 39.916 64.8412 41.2247 63.8197 41.8061C62.7982 42.3875 61.5108 42.0174 60.7778 41.0986C59.9824 40.1015 59.0489 39.2181 58.0027 38.4763C56.3759 37.3229 54.5161 36.5401 52.5541 36.1828C50.5922 35.8256 48.5758 35.9027 46.6469 36.4086C44.7179 36.9146 42.9233 37.8371 41.3893 39.1113C39.8553 40.3855 38.6192 41.9804 37.7679 43.7838C36.9167 45.5872 36.471 47.5552 36.4622 49.5494C36.4534 51.5436 36.8818 53.5154 37.7172 55.3262C38.2544 56.4908 38.9515 57.5705 39.7858 58.5353C40.5545 59.4244 40.6821 60.7579 39.9232 61.6554Z",fill:"white"})))}}class Is extends T.default.Component{constructor(e){super(e),this.state={element:e.element}}style(e){this.customStyle=e,this.forceUpdate()}update(e){this.setState({element:e})}formatText(e,t){if("None"!==t)return"Text"===t?e.text:e.format+" ("+e.text+")"}render(){var e,t,n,i,r;const o=this.state.element,a=this.props.configuration.style,s=this.formatText(o.code,this.props.configuration.textFormat),c=hs.a.width(null!==(e=this.props.animateToPoints)&&void 0!==e?e:o.points);if(!s)return null;if(!o.points)return null;const u=null!==(n=null===(t=this.customStyle)||void 0===t?void 0:t.backgroundColor)&&void 0!==n?n:o.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,l=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.textColor)&&void 0!==r?r:o.highlighted?a.highlightedTextColor:a.textColor;return T.default.createElement(us.div,{ref:e=>this.label=e,onClick:()=>{this.props.onClick&&this.props.onClick(o)},style:{x:hs.a.lowestX(o.points),y:hs.a.highestY(o.points)+3,backgroundColor:u,fontSize:12,width:c,overflow:"hidden",color:l,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px",WebkitLineClamp:2,display:"-webkit-box",WebkitBoxOrient:"vertical"},animate:this.props.animateToPoints?{x:hs.a.lowestX(this.props.animateToPoints),y:hs.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class Ts{constructor(){this.defaultFillColor="rgba(255, 0, 0, 0.3)",this.defaultHighlightedFillColor="rgba(0, 255, 0, 0.3)",this.polygonStrokeColor="rgba(255, 0, 0, 1)",this.polygonFillColor=this.defaultFillColor,this.polygonStrokeWidth=1,this.polygonCornerRadius=0,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.highlightedPolygonStrokeWidth=2,this.highlightedPolygonCornerRadius=0,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}class Os{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.countingRepeatDelay=-1,this.style=new Ts}}class ks extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new Os,this.detectionParameters=new d.BarcodeScannerConfiguration,this.onBarcodesDetected=function(e){}}static fromJson(e){var t;const n=new ks;return this.mapValues(e,n,["style","videoConstraints","overlay","finder","userGuidance"]),this.mapFinderConfiguration(n,e),e.overlay&&(this.mapValues(e.overlay,n.overlay,["style"]),e.overlay.style&&this.mapValues(e.overlay.style,n.overlay.style)),this.mapVideoConstraints(e,n),n.detectionParameters=new d.BarcodeScannerConfiguration(null!==(t=e.detectionParameters)&&void 0!==t?t:{}),n}}var Ps=n(11);class Ls{constructor(e){var t;if(this.barcodes=[],this.originalImageSize=null,this.barcodes=(null===(t=null==e?void 0:e.result)||void 0===t?void 0:t.barcodes)||[],null==e?void 0:e.originalImage){const t=e.originalImage.__image_data;this.originalImageSize=new Ps.a(t.width,t.height)}}isEmpty(){return 0===this.barcodes.length}static fromBarcode(e){const t=new Ls(void 0);return t.barcodes=[e],t}}var _s=n(13),Rs=n(33),Ms=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};ue.a;ue.b;class Fs extends Rs.b{constructor(e){var t;super(e),this.shouldComputeSize=!0,this.barcodeScannerHandle=null,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.desiredRecognitionResolution=void 0,this.desiredRecognitionResolution=this.configuration.desiredRecognitionResolution,Object.assign(this.state,{isFinderVisible:null===(t=this.configuration.finder.visible)||void 0===t||t,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0})}get configuration(){return this._configuration||(this._configuration=ks.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e){return Ms(this,void 0,void 0,(function*(){const t=_s.a.findContainerOrThrow(e);return new Promise(((n,i)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(t),this.root.render(T.default.createElement(Fs,{root:this.root,container:t,configuration:e,onSuccess:n,onFailure:i}))}))}))}onSdkReady(){return Ms(this,void 0,void 0,(function*(){const e=this.configuration.detectionParameters;this.barcodeScannerHandle=yield this.bridge.api.BarcodeScanner.create(e)}))}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Ms(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback)}))}componentDidUpdate(e,t,n){e.configuration!==this.props.configuration&&(this._configuration=ks.fromJson(this.props.configuration))}componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeScannerHandle&&this.barcodeScannerHandle.destroy()}updateDimensions(){return Ms(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}detect(){var e,t,n,i;return Ms(this,void 0,void 0,(function*(){let r=!1;try{if(!this.enabled)return;if(this.paused)return;if(this.detectionRunning)return;this.detectionRunning=!0;const o=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!o)return;const a=new Ls(o);a.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(o.originalImage)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(t=this.overlay)||void 0===t||t.update(null===(n=this.finder)||void 0===n?void 0:n.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(e){console.log(e)}finally{this.detectionRunning=!1;const e=()=>requestAnimationFrame((()=>this.detect())),t=(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)?0:this.configuration.captureDelay;r&&0!=t?setTimeout(e,t):e()}}))}recognizeBarcodes(e,t){var n,i,r,o,a,s,c,u;return Ms(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(e=!1);const c=e?ue.c.DEFAULT_DETECTION_RESOLUTION:ue.c.DETECTION_RESOLUTION_4K,u=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:c;this.camera.finderFrame=null===(i=this.finder)||void 0===i?void 0:i.holeRect;const l=yield null===(r=this.camera)||void 0===r?void 0:r.createImageData(u,!1);if(!l||!this.barcodeScannerHandle)return;t&&this.forceUpdate();const m=d.Image.fromImageData(l),h=yield null===(o=this.barcodeScannerHandle)||void 0===o?void 0:o.run(m);if(!this.enabled)return;return null===h||null===h.result?void(null===(s=(a=this.props).onLicenseError)||void 0===s||s.call(a)):(this.camera.reusableImageBuffer=h.originalImage,h)}catch(e){return void(null===(u=(c=this.props.configuration).onError)||void 0===u||u.call(c,e))}}))}setRecognitionResolution(e){this.desiredRecognitionResolution=e}getResolution(){return Ms(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?e(Ps.a.fromJson(n)):this.camera.didLoadVideo=()=>{const t=this.camera.videoSize();e(Ps.a.fromJson(t))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}updateTorch(e){this.camera.videoStream.updateTorch(e)}render(){var e,t,n;return T.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),T.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},T.default.createElement(le.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(t=this.state.zoom)&&void 0!==t?t:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&T.default.createElement(de.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),T.default.createElement(Bs,{visible:"processing"===this.state.action}),(null===(n=this.configuration.overlay)||void 0===n?void 0:n.visible)&&T.default.createElement(Ds,{ref:e=>{e&&(this.overlay=e)},configuration:this.configuration.overlay,onPolygonSelected:e=>{const t=Ls.fromBarcode(e);this.configuration.onBarcodesDetected(t)},onBarcodeFound:(e,t,n)=>{var i;(null===(i=this.configuration.overlay)||void 0===i?void 0:i.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(e,t,n)},LabelComponent:Is,labelComponentConfig:{}}))}}Fs.root=null;var Ns=Fs;class Vs{static isConvex(e){if(e.length<4)return!0;let t=!1,n=e.length;for(let i=0;i<n;i++){const r=e[(i+2)%n].x-e[(i+1)%n].x,o=e[(i+2)%n].y-e[(i+1)%n].y,a=e[i].x-e[(i+1)%n].x,s=r*(e[i].y-e[(i+1)%n].y)-o*a;if(0==i)t=s>0;else if(t!=s>0)return!1}return!0}static distanceBetweenPoints(e,t){return Math.pow(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2),.5)}static intersection(e,t){const n=e[0],i=hs.a.subtract(e[1],n),r=t[0],o=hs.a.subtract(t[1],r);if(0===hs.a.cross(i,o))return;const a=hs.a.cross(hs.a.subtract(r,n),i)/hs.a.cross(i,o);return hs.a.add(r,hs.a.multiply(o,a))}static closest(e,t){let n=t[0],i=Math.abs(e-n);for(let r=0;r<t.length;r++){const o=Math.abs(e-t[r]);o<i&&(i=o,n=t[r])}return n}}class Ws{static setFromScanner(e,t){var n;if(!e.current)return;const i=e.current.getCapabilities();t({hasFacingOptions:(null==i?void 0:i.facingMode)&&i.facingMode.length>0,isTorchAvailable:null!==(n=e.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}function js(e,t){return e&&(e.hasFacingOptions&&t.flipCameraButton.visible||e.isTorchAvailable&&t.flashButton.visible)||t.zoomButton.visible}function zs(e){const t=Vs.closest(e.defaultZoomFactor,e.zoomSteps),n=e.zoomSteps.findIndex((e=>e==t)),[i,r]=Object(T.useState)(e.torchEnabledInitially),[o,a]=Object(T.useState)(n),s=e.zoomSteps[o],[c,u]=Object(T.useState)("BACK"==e.initialCameraModule?"environment":"user"),l=function(e){var t,n;const i=null===(n=null===(t=null==e?void 0:e.camera)||void 0===t?void 0:t.video)||void 0===n?void 0:n.parentElement,r=()=>i?i.getBoundingClientRect():null,[o,a]=Object(T.useState)(r());return Object(T.useEffect)((()=>{if(i){const e=()=>a(r());e();const t=new ResizeObserver(e);return t.observe(i),()=>{t.disconnect()}}}),[i]),o}(e.scanner),d=!!l;if(Object(T.useEffect)((()=>{var t;(null===(t=e.capabilities)||void 0===t?void 0:t.isTorchAvailable)&&d&&e.scanner.setTorchState(i)}),[e.capabilities,d,i]),Object(T.useEffect)((()=>{var t;d&&(null===(t=e.scanner)||void 0===t||t.setZoom(s))}),[d,s]),!e.capabilities||!l)return null;if(!js(e.capabilities,e.config))return null;const m=l.height-e.bottomPadding-48;return T.default.createElement(P.Box,{style:{position:"absolute",marginTop:m,marginLeft:l.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},T.default.createElement(ie,Object.assign({},e.config.flashButton,{visible:e.capabilities.isTorchAvailable&&e.config.flashButton.visible,icon:i?P.FlashlightOn:P.FlashlightOff,active:i,onClick:()=>r(!i)})),T.default.createElement("div",{style:{width:20}}),T.default.createElement(ie,Object.assign({},e.config.zoomButton,{text:`${s.toFixed(1)}x`,active:o!==n,onClick:()=>a((o+1)%e.zoomSteps.length)})),T.default.createElement("div",{style:{width:20}}),T.default.createElement(ie,Object.assign({},e.config.flipCameraButton,{visible:e.capabilities.hasFacingOptions&&e.config.flipCameraButton.visible,active:"user"===c,icon:P.FlipCameraIos,onClick:()=>{var t;const n="environment"===c?"user":"environment";u(n),null===(t=e.scanner)||void 0===t||t.setCameraDirection(n)}})))}const Hs=Object(T.createContext)(null);class Us{static compute(e,t,n){const i=(hs.a.lowestY(e)+hs.a.highestY(e))/2,r={badgeY:i,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},r),{labelY:Math.max(hs.a.highestY(e)+Us.LABEL_AND_BADGE_PADDING,t?i-Us.AR_BADGE_SIZE/2-Us.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},r),{labelY:Math.min(hs.a.lowestY(e)-Us.LABEL_AND_BADGE_PADDING,t.visible?i+Us.AR_BADGE_SIZE/2+Us.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:i,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${Us.LABEL_AND_BADGE_PADDING/2}px))`},labelY:i,labelStyle:{transform:t.visible?`translateX(-50%) translateY(${Us.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},r),{labelY:0,labelStyle:{display:"none"}}):void 0}}Us.AR_BADGE_SIZE=48,Us.LABEL_AND_BADGE_PADDING=10;var Zs=Us;function Gs(e){return e.style.visible?""==e.content?null:T.default.createElement(us.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},e.positionBadge),animate:e.animateToPoints?e.positionBadge:{},transition:e.transition},T.default.createElement(W,{polygonConfig:Object.assign(Object.assign({},e.style.background),{cornerRadius:Zs.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},e.verticalPositions.badgeStyle),{width:Zs.AR_BADGE_SIZE,height:Zs.AR_BADGE_SIZE,color:_.b.getColorValue(e.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==e?void 0:e.onClick()},T.default.createElement(P.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e.content))):null}var Ys=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};class Qs extends Is{constructor(){super(...arguments),this.count=0,this.setCount=e=>{this.count=e,this.forceUpdate()}}styleBadge(e,t){this.customBadgeStyle=e,this.customBadgeContent=t,this.forceUpdate()}badgeContent(){return this.customBadgeContent?this.customBadgeContent:0===this.count?"":"x"+this.count}render(){var e,t;let{barcodeItemConfiguration:n,barcodeItemInfoPosition:i,counterBadge:r}=this.props;const o=n,a=this.state.element,s=null!==(e=this.props.animateToPoints)&&void 0!==e?e:a.points,c=a.code,u=a.highlighted,l=(hs.a.lowestX(s)+hs.a.highestX(s))/2;void 0===i&&(i="BELOW");const d=Zs.compute(s,r,i),m=void 0===o||!1===o.titleDeselected.visible&&!1===o.subtitleDeselected.visible,h={x:l,y:Math.round(d.labelY)},f={x:l,y:Math.round(d.badgeY)},p={duration:.25,easing:"linear"};return T.default.createElement(T.default.Fragment,null,o&&T.default.createElement(us.div,{ref:e=>this.label=e,style:Object.assign(Object.assign({},h),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?h:{},transition:p},T.default.createElement(W,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:m?"inline-block":"block",zIndex:1500},d.labelStyle),polygonConfig:u?o.backgroundSelected:o.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)}},T.default.createElement(qs,{barcode:c,barcodeImageVisible:o.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:u?o.titleSelected:o.titleDeselected,barcodeSubtitle:u?o.subtitleSelected:o.subtitleDeselected}))),T.default.createElement(Gs,{onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)},style:null!==(t=this.customBadgeStyle)&&void 0!==t?t:r,positionBadge:f,content:this.badgeContent(),verticalPositions:d,transition:p,animateToPoints:this.props.animateToPoints}))}}function qs(e){var{barcode:t}=e,n=Ys(e,["barcode"]);const i=Object(T.useContext)(Hs).useBarcodeMappedData(t);return T.default.createElement(K,Object.assign({barcodeMappedData:i},n))}var Xs=n(12);function Ks(e){const t=Object(T.useRef)(),n=Object(T.useRef)(null),[i,r]=(Object(T.useContext)(Y),Object(T.useState)(void 0)),[o,a]=Object(T.useState)(!1);Object(T.useEffect)((()=>{var n,i;e.scanningPaused?null===(n=t.current)||void 0===n||n.pauseDetection():null===(i=t.current)||void 0===i||i.resumeDetection()}),[e.scanningPaused]);const s=function(e){const t=new Os;t.visible=e.visible;const n=e.polygon instanceof Xs.c,i=e.polygon,r=e,o=n?i.selected:r.polygon.partiallyScanned,a=n?i.deselected:r.polygon.partiallyScanned;return e.polygon.visible?(t.style.highlightedPolygonFillColor=_.b.getColorValue(o.fillColor),t.style.highlightedPolygonStrokeColor=_.b.getColorValue(o.strokeColor),t.style.highlightedPolygonStrokeWidth=o.strokeWidth,t.style.highlightedPolygonCornerRadius=o.cornerRadius,t.style.polygonFillColor=_.b.getColorValue(a.fillColor),t.style.polygonStrokeColor=_.b.getColorValue(a.strokeColor),t.style.polygonStrokeWidth=a.strokeWidth,t.style.polygonCornerRadius=a.cornerRadius):(t.style.highlightedPolygonFillColor="transparent",t.style.highlightedPolygonStrokeColor="transparent",t.style.polygonFillColor="transparent",t.style.polygonStrokeColor="transparent"),t.automaticSelectionEnabled=!1,t}(e.arOverlay),c=Object.assign(Object.assign({},e.barcodeScannerViewConfig),{onBarcodesDetected:i=>{var r,o,a,s,c,u;null===(r=n.current)||void 0===r||r.update(null===(a=null===(o=t.current)||void 0===o?void 0:o.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,i.originalImageSize,i.barcodes),null===(u=(c=e.barcodeScannerViewConfig).onBarcodesDetected)||void 0===u||u.call(c,i)},_onDetectionFailed:i=>{var r,o,a,s,c,u;null===(r=n.current)||void 0===r||r.update(null===(a=null===(o=t.current)||void 0===o?void 0:o.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,new Ps.a(i.__image_data.width,i.__image_data.height),[]),null===(u=(c=e.barcodeScannerViewConfig)._onDetectionFailed)||void 0===u||u.call(c,i)}});return Object(T.useEffect)((()=>{const t=js(i,e.actionBarConfig);e.setActionButtonsVisible(t),a(t)}),[i,e.actionBarConfig]),T.default.createElement(T.default.Fragment,null,e.arOverlay.visible&&T.default.createElement(Ds,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:Qs,labelComponentConfig:e.arOverlay,onBarcodeFound:e.arOnBarcodeEnter,onPolygonClick:e.arOnBarcodeClick,configuration:s}),T.default.createElement(zs,{config:e.actionBarConfig,scanner:t.current,capabilities:i,bottomPadding:e.actionBarBottomPadding,torchEnabledInitially:e.cameraConfiguration.flashEnabled,zoomSteps:e.cameraConfiguration.zoomSteps,defaultZoomFactor:e.cameraConfiguration.defaultZoomFactor,initialCameraModule:e.cameraConfiguration.cameraModule}),T.default.createElement(Ns,{root:e.root,ref:t,configuration:c,onSuccess:()=>Ws.setFromScanner(t,r),onFailure:e.onCameraPermissionDenied,onLicenseError:e.onLicenseError}))}function Js(e){return Object(T.useMemo)((()=>{const t=(new ks).videoConstraints;t.width.ideal=e.cameraConfiguration.idealPreviewResolution.width,t.height.ideal=e.cameraConfiguration.idealPreviewResolution.height,t.facingMode="FRONT"===e.cameraConfiguration.cameraModule?"user":"environment";const n=e.scannerConfiguration,i=[],r={regexFilter:n.barcodesRegexFilter,minimum1DQuietZoneSize:n.minimum1DBarcodesQuietZone,minimumSizeScore:n.minimumSizeScore,minimumTextLength:n.minimumTextLength,maximumTextLength:n.maximumTextLength,stripCheckDigits:n.stripCheckDigits,gs1Handling:n.gs1Handling};i.push(new d.BarcodeFormatCommonConfiguration(Object.assign({formats:n.barcodeFormats.length>0?n.barcodeFormats:void 0},r))),n.barcodeFormats.includes("MSI_PLESSEY")&&i.push(new d.BarcodeFormatMsiPlesseyConfiguration(Object.assign({checksumAlgorithms:[n.msiPlesseyChecksumAlgorithm]},r))),n.barcodeFormats.includes("IATA_2_OF_5")&&i.push(new d.BarcodeFormatCode2Of5Configuration(Object.assign({useIATA2OF5Checksum:n.useIATA2OF5Checksum},r))),n.barcodeFormats.includes("CODE_11")&&i.push(new d.BarcodeFormatCode11Configuration(Object.assign({checksum:n.useCode11Checksum,stripCheckDigits:n.stripCheckDigits},r))),n.barcodeFormats.includes("AUSTRALIA_POST")&&i.push(new d.BarcodeFormatAustraliaPostConfiguration(Object.assign({australiaPostCustomerFormat:n.australiaPostCustomerFormat},r)));const o=n.barcodeFormats.includes("UPC_E"),a=n.barcodeFormats.includes("UPC_A"),s=n.barcodeFormats.includes("EAN_13"),c=n.barcodeFormats.includes("EAN_8");return(c||s||a||o)&&i.push(new d.BarcodeFormatUpcEanConfiguration(Object.assign(Object.assign({extensions:n.barcodesExtensionFilter},r),{ean8:c,ean13:s,upca:a,upce:o}))),{videoConstraints:t,backgroundColor:_.b.getColorValue(e.backgroundColor),userGuidance:e.userGuidance,finder:e.viewFinder,desiredRecognitionResolution:n.maximumRecognizerResolution,detectionParameters:new d.BarcodeScannerConfiguration({returnBarcodeImage:!0,engineMode:n.engineMode,barcodeFormatConfigurations:i,extractedDocumentFormats:n.extractedDocumentFormats})}}),[e])}var $s=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function ec(e){const[t,n]=Object(T.useState)(null),[i,r]=Object(T.useState)(!0),o=Object(T.useMemo)((()=>"__sb_"+Math.random()),[]),a=e.barcodeMapper,s=e.configuration.useCase,c=Object.assign(Object.assign({},Js(e.configuration)),{onBarcodesDetected:t=>{t.barcodes.length>0&&!s.arOverlay.visible&&e.scanningEnabled.current&&n(t.barcodes[0])},onError:e.onError,containerId:o,captureDelay:0}),u=n=>$s(this,void 0,void 0,(function*(){let i;i=null===t?[]:[new k.BarcodeScannerUiItem({count:1,barcode:n})];const r={items:i};e.onSubmit(r)}));Object(T.useEffect)((()=>{t&&(ae.INSTANCE.beep(e.configuration.sound),ce.INSTANCE.vibrate(e.configuration.vibration))}),[t]),Object(T.useEffect)((()=>{null===t||s.confirmationSheetEnabled||u(t)}),[t,s.confirmationSheetEnabled]);const l=a.useBarcodeMappedData(t);Object(T.useEffect)((()=>{"FAILED"===(null==l?void 0:l.state)&&n(null)}),[null==l?void 0:l.state]),Object(T.useEffect)((()=>{const t=e.configuration.viewFinder.minimumInsets;t.top+=d.minTopPaddingForViewFinder,t.bottom+=i?80:0}),[]);const d=Object(T.useContext)(Y);return T.default.createElement(T.default.Fragment,null,T.default.createElement(Hs.Provider,{value:e.barcodeMapper},T.default.createElement(te,Object.assign({open:!!l&&["LOADED","LOADING"].includes(l.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{u(t)},barcodeMappedData:l},{sheetColorLoaded:(m=s).sheetColor,sheetColorLoading:m.barcodeInfoMapping.sheetColor,barcodeImageVisible:m.barcodeImageVisible,barcodeTitle:m.barcodeTitle,barcodeSubtitle:m.barcodeSubtitle,cancelButton:m.cancelButton,submitButton:m.submitButton,dividerColor:m.dividerColor,loadingMessage:m.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),T.default.createElement(P.Box,{id:o,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},T.default.createElement(Ks,{root:e.root,cameraConfiguration:e.configuration.cameraConfiguration,scanningPaused:null!==t,setActionButtonsVisible:r,barcodeScannerViewConfig:c,arOnBarcodeClick:e=>n(e),arOnBarcodeEnter:t=>{s.arOverlay.automaticSelectionEnabled&&e.scanningEnabled.current&&n(t)},arOverlay:Object.assign(Object.assign({},s.arOverlay),{counterBadge:Object.assign(Object.assign({},s.arOverlay.counterBadge),{visible:!1})}),containerId:o,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:e.onCameraPermissionDenied,onLicenseError:e.onError}))));var m}function tc(e){const t=Object.assign(Object.assign({},e.title),{text:_.b.getLocalizedText(e.title.text,e.textReplacementArgs)});return T.default.createElement(T.default.Fragment,null,T.default.createElement(G,Object.assign({},e.leftButton)),T.default.createElement(P.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},T.default.createElement(N.a,{config:t})),T.default.createElement(G,Object.assign({},e.rightButton)))}function nc(){return T.default.createElement("div",{style:{width:30,height:6,backgroundColor:P.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function ic(e){return T.default.createElement(P.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:e.innerRef},e.dragProps),T.default.createElement(nc,null),T.default.createElement(tc,Object.assign({},e.drawerHeaderContentProps)))}function rc(e){return T.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},T.default.createElement("path",{d:"M4.09514 37.0902V10.6304L0.019043 1.87823L3.18969 0.348877L7.76144 10.6304H32.6886L37.2484 0.348877L40.419 1.87823L36.3549 10.6304V37.0902H4.09514ZM15.994 22.013H24.494C24.9461 22.013 25.3211 21.8632 25.619 21.5637C25.9169 21.2641 26.0658 20.8871 26.0658 20.4325C26.0658 19.9779 25.9169 19.6038 25.619 19.3101C25.3211 19.0164 24.9461 18.8695 24.494 18.8695H15.994C15.5419 18.8695 15.167 19.0193 14.8691 19.3189C14.5712 19.6184 14.4223 19.9955 14.4223 20.45C14.4223 20.9046 14.5712 21.2788 14.8691 21.5725C15.167 21.8662 15.5419 22.013 15.994 22.013ZM7.50164 33.6837H32.9364V14.0489H7.50164V33.6837Z",fill:e.color}))}function oc(e){return e.isVisible?T.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},e.style.placeholderIcon.visible&&T.default.createElement(P.Avatar,{style:{backgroundColor:_.b.getColorValue(e.style.placeholderIconBackground),width:100,height:100}},T.default.createElement(rc,{color:_.b.getColorValue(e.style.placeholderIcon.color)})),T.default.createElement(P.Typography,{style:{marginTop:20},variant:"h6"},T.default.createElement(N.a,{config:e.style.placeholderTitle})),T.default.createElement(P.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},T.default.createElement(N.a,{config:e.style.placeholderSubtitle})),e.onStartClick&&e.style.startScanningButton.visible&&T.default.createElement(J,Object.assign({style:{width:"60%",marginTop:20}},e.style.startScanningButton,{visible:!0,onClick:e.onStartClick}))):null}function ac(e,t,n){const i=Object(T.useRef)(),r=Object(T.useRef)(null),[o,a]=Object(T.useState)(),[s,c]=Object(T.useState)(!1),u=Object(T.useRef)([]),l=e=>{let n="none";if(u.current.length>0){const t=200,i=((e,t)=>{let n=e[0],i=Math.abs(n.time-t);for(let r=1;r<e.length;r++){const o=Math.abs(e[r].time-t);o<i&&(n=e[r],i=o)}return n})(u.current,e.timeStamp-t),r=i.y-e.clientY,o=100;r>o?n="up":r<-o&&(n="down")}u.current.splice(0,u.current.length),t(new hs.a(e.clientX,e.clientY),n)},d={onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),c(!0),r.current=new hs.a(e.clientX,e.clientY),a(hs.a.empty()),e.stopPropagation()},onPointerMove:t=>{if(!s)return;const n=new hs.a(t.clientX,t.clientY);i.current=t,a(n),e(n),u.current.push({x:t.clientX,y:t.clientY,time:t.timeStamp})},onPointerUp:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),l(e)},onPointerCancel:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),n()}};return{startPoint:r,currentPoint:o,props:d,stop:()=>{i.current.stopPropagation()},dragOngoing:s}}var sc=n(46);function cc(e){const[t,n]=Object(T.useState)(0),[i,r]=Object(T.useState)(!1),o=Object(T.useRef)(null),a=Object(T.useContext)(Y).height,s=e=>{n(e),r(!0),setTimeout((()=>{r(!1)}),500)},c=t=>{const n=t-u.startPoint.current.y;return Object(sc.a)((e.isOpen?100:0)-100*n/(window.innerHeight-a-e.closedSheetVisibleHeight),0,100)},u=ac((e=>{n(c(e.y))}),((t,n)=>{if(t.y===u.startPoint.current.y)return;let i;i=c(t.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(i="swipe-to-open"),"down"===n&&(i="swipe-to-close"),e.onSwipe(i)}),(()=>{}));return Object(T.useEffect)((()=>{i||u.dragOngoing||!o||(e.isOpen||0===t?e.isOpen&&100!==t&&s(100):s(0))}),[e.isOpen,t,u.dragOngoing]),T.createElement("div",null,T.createElement(L.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${R} - ${a}px - ${e.closedSheetVisibleHeight}px) * ${t} / 100 + ${e.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:i?"height 500ms":void 0,backgroundColor:_.b.getColorValue(e.contentStyle.sheetColor)},elevation:24}},T.createElement(ic,{innerRef:e=>{o.current=e},drawerHeaderContentProps:e.drawerHeaderContentProps,dragProps:u.props}),e.children,T.createElement(oc,{isVisible:e.isPlaceholderVisible,style:e.contentStyle,onStartClick:()=>e.onSwipe("swipe-to-close")})))}var uc=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function lc(e){var{inputRef:t}=e,n=uc(e,["inputRef"]);const i=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return T.default.createElement("input",Object.assign({},i,{ref:t}))}function dc(e){const t=!!e.barcode,[n,i]=T.default.useState(""),r=T.default.useRef(null),o={backgroundColor:_.b.getColorValue(e.dialogStyling.sheetColor)};return Object(T.useEffect)((()=>{t&&i(String(e.barcode.count))}),[t]),T.default.createElement(T.default.Fragment,null,T.default.createElement(ee,{open:t,modalOverlayColor:e.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.focus()}},onClose:e.onCancel,PaperProps:{component:"form",onSubmit:t=>{t.preventDefault(),e.setCounter(e.barcode.barcode,parseInt(n)||0)}}},T.default.createElement(P.DialogContent,{style:o},T.default.createElement(P.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},T.default.createElement(N.a,{config:e.dialogStyling.title})),T.default.createElement(P.Typography,{fontSize:14,textAlign:"center"},T.default.createElement(N.a,{config:e.dialogStyling.info})),T.default.createElement(P.Box,{sx:{display:"flex",border:"2px solid",borderColor:_.b.getColorValue(e.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},T.default.createElement(lc,{inputRef:r,value:n,onChange:e=>{const t=parseInt(e.target.value.replaceAll(/[^0-9]/g,""));i(t>=0?t.toString():"")},type:"text",pattern:"[0-9]*"}),e.dialogStyling.clearTextButton.visible&&T.default.createElement(L.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>i(""),htmlColor:_.b.getColorValue(e.dialogStyling.clearTextButton.color)}))),T.default.createElement(P.DialogActions,{sx:Object.assign(Object.assign({},o),{pt:0})},T.default.createElement(L.a,{container:!0,spacing:2},T.default.createElement(L.a,{item:!0,xs:12},T.default.createElement(L.a,{color:_.b.getColorValue(e.dialogStyling.dividerColor)})),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},onClick:e.onCancel},e.dialogStyling.cancelButton))),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({icon:P.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},e.dialogStyling.updateButton)))))))}function mc(e){return T.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:_.b.getColorValue(e.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},T.default.createElement(L.a,{style:{height:"100%",color:_.b.getColorValue(e.config.iconColor),paddingRight:e.visibleOffset/2,cursor:"pointer"}}))}class hc{}hc.ScanbotPrimary="#c8193c",hc.LightGray="#F5F5F5",hc.Gray="#808080",hc.DarkGray="#333333",hc.Orange="#FF5533",hc.White="#FFFFFF",hc.TransparentGreen="rgba(0, 255, 0, 0.5)",hc.TransparentGray="rgba(50, 50, 50, 0.5)",hc.TransparentBlack="rgba(0, 0, 0, 0.3)",hc.SBNegative="#FF3737";var fc=hc;const pc=0,gc=800,vc=1200;function yc(e){switch(e){case"mobile":return Object(P.useMediaQuery)("(min-width:"+pc+"px) and (max-width:"+(gc-1)+"px)");case"tablet":return Object(P.useMediaQuery)("(min-width:"+gc+"px) and (max-width:"+(vc-1)+"px)");case"desktop":return Object(P.useMediaQuery)("(min-width:"+vc+"px)")}}function Cc(e){switch(e){case"mobile":return Object(P.useMediaQuery)("(min-width:"+pc+"px)");case"tablet":return Object(P.useMediaQuery)("(min-width:"+gc+"px)");case"desktop":return Object(P.useMediaQuery)("(min-width:"+vc+"px)")}}const bc=150;function Ac(e){const[t,n]=Object(T.useState)(0),[i,r]=Object(T.useState)(!1);let o;const a=ac((e=>{let t=a.startPoint.current.x-e.x;t<0?a.stop():n(-t)}),(t=>{if(t.x===a.startPoint.current.x)return;if(a.startPoint.current.x-t.x>75){const t=e.animateBackAfterDelete?()=>{u(0)}:void 0;u(bc,t)}else u(0)}),(()=>{u(0)})),s=Object(T.useContext)(Hs),c=s.useBarcodeMappedData(e.barcode);Object(T.useEffect)((()=>{const t={barcode:e.barcode,callback:()=>e.onDelete(e.barcode)};return s.addOnEvictionListener(t),()=>{s.removeOnEvictionListener(t)}}),[]);const u=(t,i)=>{const a=t>=bc,s=-o.getBoundingClientRect().width;n(a?s:0),r(!0),setTimeout((()=>{r(!1),a&&e.onDelete(e.barcode),i&&i()}),200)},l=yc("desktop")&&e.swipeToDeleteConfig.enabled,d=!l&&e.swipeToDeleteConfig.enabled;return Object(T.useEffect)((()=>{d||u(0)}),[d]),T.default.createElement(P.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:e=>{e&&(o=e)}},T.default.createElement(mc,{config:e.swipeToDeleteConfig,visibleOffset:bc}),T.default.createElement(P.Box,Object.assign({sx:{width:"100%",backgroundColor:_.b.getColorValue(e.sheetColor),transform:`translateX(${t}px)`,transition:i?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px"}},d?a.props:{}),T.default.createElement(K,Object.assign({barcodeMappedData:c},e,{readonlyCount:e.readonlyCount})),null!==e.readonlyCount&&T.default.createElement(P.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",paddingRight:"16px",color:_.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",e.readonlyCount),l&&T.default.createElement(L.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",paddingRight:"16px",color:_.b.getColorValue("?sbColorOnSurface")},onClick:()=>e.onDelete(e.barcode)}),T.default.createElement(P.Box,{sx:{width:"0px"}})))}function Sc(e){const t=_.b.getColorValue(e.sheetContent.dividerColor),n=e.sheetContent.manualCountChangeEnabled&&"COUNTING"===e.mode,i=(t,n)=>{let i=e.indicatorColor.partial;return n===t.count?i=e.indicatorColor.complete:0===n&&(i=e.indicatorColor.notScanned),_.b.getColorValue(i)};return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Divider,{style:{borderColor:t}}),e.barcodes.length>0&&T.default.createElement(L.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},T.default.createElement(L.a,{sx:{p:0}},e.barcodes.map((({barcode:r,count:o})=>{const a=e.expectedBarcodes.find((e=>e.barcodeValue===r.text)),s=r.text+r.format+o;return T.default.createElement(L.a,{key:s,sx:{padding:0,borderBottom:`1px solid ${t}`}},e.indicatorColor&&T.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:i(a,o),position:"absolute"}}),T.default.createElement(Ac,{barcode:r,animateBackAfterDelete:e.animateBackAfterDelete,onDelete:()=>e.onBarcodeChange({type:"remove",barcode:r}),counterForm:n&&{counter:o,manualCountChangeColor:e.sheetContent.manualCountChangeColor,manualCountOutlineColor:e.sheetContent.manualCountOutlineColor,addButtonEnabled:void 0===a||a.count>o,removeButtonEnabled:void 0===a||o>0,setCounter:t=>{e.onBarcodeChange({type:"setCount",barcodes:[r],computeNewCount:()=>t})},onNumberClick:()=>e.onNumberClick({barcode:r,count:o})},readonlyCount:"COUNTING"!==e.mode||e.sheetContent.manualCountChangeEnabled?null:o,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,displayRightArrow:!1,imageSize:n?84:40,barcodeImageVisible:e.sheetContent.barcodeItemImageVisible,barcodeTitle:e.sheetContent.barcodeItemTitle,barcodeSubtitle:e.sheetContent.barcodeItemSubtitle,swipeToDeleteConfig:e.sheetContent.swipeToDelete,sheetColor:e.sheetContent.sheetColor}))})))))}function wc(e){const t=e.badgeStyle||{},n=e.overlap||"circular";return T.default.createElement(P.Badge,{anchorOrigin:{vertical:"top",horizontal:"left"},badgeContent:e.text,showZero:!0,color:"primary",overlap:n,slotProps:{badge:{style:Object.assign(Object.assign({},t),{backgroundColor:e.backgroundColor,color:e.foregroundColor,fontWeight:"bold"})}}},e.children)}function Ec(e){if(!e.buttonStyling.visible)return null;return T.default.createElement(P.Box,{style:e.style},T.default.createElement(wc,{text:e.text,backgroundColor:_.b.getColorValue(e.buttonStyling.badgeBackgroundColor),foregroundColor:_.b.getColorValue(e.buttonStyling.badgeForegroundColor)},T.default.createElement(P.IconButton,{sx:{backgroundColor:_.b.getColorValue(e.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:_.b.getColorValue(e.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:e.onClick,disableRipple:!0,disableFocusRipple:!0},T.default.createElement(L.a,{sx:{color:_.b.getColorValue(e.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:_.b.getColorValue(e.buttonStyling.activeForegroundColor)}}}))))}const Dc=(e,t)=>(null===e.format||null===t.format||e.format===t.format)&&e.text===t.text,xc=(e,t)=>e.find((e=>((e,t)=>e.barcodeValue===t.text)(e,t)));class Bc{constructor(e,t){this.expectedCount=e,this.foundCount=t}isFulFilled(){return void 0!==this.expectedCount&&void 0!==this.foundCount&&this.expectedCount===this.foundCount}toString(){return`${this.foundCount}/${this.expectedCount}`}}function Ic(e){const t=Object(T.useContext)(_.a).getColorValue,n={backgroundColor:t(e.sheetColor)};return T.default.createElement(ee,{modalOverlayColor:e.modalOverlayColor,open:e.open},T.default.createElement(P.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},T.default.createElement(P.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},T.default.createElement(N.a,{config:e.title})),T.default.createElement(P.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},T.default.createElement(N.a,{config:e.subtitle}))),T.default.createElement(P.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},T.default.createElement(L.a,{container:!0,spacing:2},T.default.createElement(L.a,{item:!0,xs:12},T.default.createElement(L.a,{color:t(e.dividerColor)})),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},icon:e.cancelButton.icon,onClick:e.cancelButton.onClick},e.cancelButton.style))),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},icon:e.okButton.icon,onClick:e.okButton.onClick},e.okButton.style))))))}function Tc(e){return e.open?T.default.createElement(Ic,{open:e.open,dividerColor:e.style.dividerColor,modalOverlayColor:e.style.modalOverlayColor,sheetColor:e.style.sheetColor,title:e.style.title,subtitle:e.style.subtitle,cancelButton:{style:e.style.cancelButton,onClick:e.onDismiss},okButton:{style:e.style.okButton,onClick:e.onSubmit}}):null}class Oc{constructor(e,t,n){this.barcodeItemSubtitleText=e,this.foundBarcodes=t,this.expectedBarcodes=n}useBarcodeMappedData(e){var t,n,i;const r=null!==(n=null===(t=this.foundBarcodes.find((t=>Dc(t.barcode,e))))||void 0===t?void 0:t.count.toString())&&void 0!==n?n:"0",o=xc(this.expectedBarcodes,e);return{state:"LOADED",value:{title:`${null!==(i=o.title)&&void 0!==i?i:e.text}`,subtitle:_.b.getLocalizedText(this.barcodeItemSubtitleText,[r,null==o?void 0:o.count.toString()]),barcodeImage:o.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function kc(e){const t=Object(T.useContext)(Y);return T.default.createElement(L.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:t.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:_.b.getColorValue(e.sheetContent.sheetColor)}},T.default.createElement(L.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},T.default.createElement(tc,Object.assign({},e.headerProps))),e.barcodeList,T.default.createElement(oc,{isVisible:e.isEmptyStateVisible,style:e.sheetContent}))}var Pc=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function Lc(e){const t=Object(T.useRef)(),n=Object(T.useRef)(new Date("2001-01-01")),[i,r]=Object(T.useReducer)(function(e,t,n,i){return(r,o)=>{const a=e.useCase,s="FindAndPickScanningMode"===a._type,c=s?"COUNTING":a.mode,u=s?a.expectedBarcodes:[],l=e=>{let t=[...r];const n=o.barcodes||[o.barcode];for(const i of n){const n=t.findIndex((e=>Dc(e.barcode,i)));if(-1===n)t.push({barcode:i,count:e(0)});else{const i=t[n];t[n]=Object.assign(Object.assign({},i),{count:e(i.count,i)})}}return t},d=(e,n)=>{var r;if(t.current=new Date,!n)return e;const o=null===(r=xc(u,n.barcode))||void 0===r?void 0:r.count;return void 0===o||o===e?e:(i(),e+1)};switch(o.type){case"onBarcodesDetected":{if((new Date).getTime()-t.current.getTime()<a.countingRepeatDelay||!n.current)return[...r];if(s)return a.arOverlay.automaticSelectionEnabled?l(d):[...r];const e=a.arOverlay;if(!e.visible||e.automaticSelectionEnabled){let e=!1;return l((n=>{let r="COUNTING"===c?n+1:1;return r===n||e||(t.current=new Date,i()),r}))}return l((e=>e))}case"onARCodeClick":return l(((e,t)=>{if(s)return d(e,t);const n="UNIQUE"===c?1-e:e+1;return n>0&&i(),n}));case"onCountEditDialogChange":{let e=()=>o.count||0;if(s){const t=xc(u,o.barcode);o.count>t.count&&(e=()=>t.count)}return l(e)}case"setCount":return l(o.computeNewCount);case"remove":return r.map((e=>Object.assign(Object.assign({},e),{count:Dc(e.barcode,o.barcode)?0:e.count})));case"clear":return r.map((e=>Object.assign(Object.assign({},e),{count:0})));case"setHtmlElements":let e=!1;const m=r.map((t=>Dc(t.barcode,o.barcode)?(e=!0,Object.assign(Object.assign({},t),{polygonElement:o.polygonElement,labelElement:o.labelElement})):t));return e||m.push({barcode:o.barcode,count:0,labelElement:o.labelElement,polygonElement:o.polygonElement}),m}}}(e.configuration,n,e.scanningEnabled,(()=>{ae.INSTANCE.beep(e.configuration.sound),ce.INSTANCE.vibrate(e.configuration.vibration)})),[]),[o,a]=T.default.useState(null),[s,c]=Object(T.useState)(!1),u=Object(T.useMemo)((()=>"__sb_"+Math.random()),[]),[l,m]=Object(T.useState)(!0),h=e.barcodeMapper,[f,p]=Object(T.useState)(null),g="FindAndPickScanningMode"===e.configuration.useCase._type,v=e.configuration.useCase,y=g?"COUNTING":v.mode,C=Object(T.useRef)(Object.assign(Object.assign({},Js(e.configuration)),{onBarcodesDetected:e=>{r({type:"onBarcodesDetected",barcodes:e.barcodes})},_onDetectionFailed(e){},onError:e.onError,captureDelay:1e3/60}));Object(T.useEffect)((()=>{if(g){const e=S();for(const n of e){const e=[(t=n.barcodeValue,new d.BarcodeItem({format:null,sourceImage:null,text:t,rawBytes:null,rawBytesEncodings:[],structuredAppendInfo:null,quad:[],quadNormalized:[],upcEanExtension:null,extractedDocument:null}))];r({type:"setCount",barcodes:e,computeNewCount:()=>0})}}var t;const n=e.configuration.viewFinder.minimumInsets;n.top+=V.minTopPaddingForContent,n.bottom+=N}),[]),Object(T.useEffect)((()=>{C.current.container=t.current}),[t]),Object(T.useEffect)((()=>{if(g)for(const e of i){const t=v.arOverlay,n=e.polygonElement,i=e.labelElement;if(E(e.barcode)){const r=W(e.barcode);let o=e.count+"/"+r.expectedCount;v.arOverlay.automaticSelectionEnabled||0!==e.count||(o=T.default.createElement(P.TouchApp,null)),r.isFulFilled()?(null==n||n.style(_.b.getPolygonColorValues(t.polygon.completed,t.polygon.visible)),null==i||i.styleBadge(t.badge.completed,T.default.createElement(P.Check,null))):(null==n||n.style(_.b.getPolygonColorValues(t.polygon.partiallyScanned,t.polygon.visible)),null==i||i.styleBadge(t.badge.partiallyScanned,o))}else null==n||n.style(_.b.getPolygonColorValues(t.polygon.rejected,t.polygon.visible)),null==i||i.styleBadge(t.badge.rejected,T.default.createElement(P.Close,null))}else for(const e of i){if(e.polygonElement){const t=v.arOverlay.polygon,n=e.count>0?t.selected:t.deselected;e.polygonElement.style(_.b.getPolygonColorValues(n,t.visible))}e.labelElement&&(e.labelElement.update(Object.assign(Object.assign({},e.labelElement.state.element),{highlighted:e.count>0})),e.labelElement.setCount(e.count))}}),[i]);const b=i.reduce(((e,t)=>e+t.count),0),A=()=>S().every((e=>i.some((t=>t.barcode.text===e.barcodeValue&&t.count===e.count)))),S=()=>g?v.expectedBarcodes:[],w=e=>xc(S(),e),E=e=>!!w(e),D=()=>g?i.filter((e=>E(e.barcode))):i.filter((e=>e.count>0)),x=()=>Pc(this,void 0,void 0,(function*(){const t=D().map((e=>new k.BarcodeScannerUiItem({count:"COUNTING"===y?e.count:1,barcode:e.barcode})));e.onSubmit({items:t})})),B=T.default.createElement(Sc,{expectedBarcodes:S(),barcodes:D(),animateBackAfterDelete:g,onBarcodeChange:r,sheetContent:v.sheetContent,onNumberClick:e=>a(e),mode:y,indicatorColor:g&&{partial:v.scanningPartiallyColor,complete:v.scanningCompletedColor,notScanned:v.scanningNotScannedColor}}),I={textReplacementArgs:[b.toString()],leftButton:Object.assign(Object.assign({},v.sheetContent.clearAllButton),{onClick:()=>r({type:"clear"}),disabled:0===b}),rightButton:Object.assign(Object.assign({},v.sheetContent.submitButton),{onClick:()=>Pc(this,void 0,void 0,(function*(){if(g){const e=v;let t=null;e.partialScannedAlertDialogEnabled&&!A()&&(t=e.partialScannedAlertDialog),e.confirmationAlertDialogEnabled&&A()&&(t=e.confirmationAlertDialog),t?p(t):yield x()}else yield x()})),disabled:!g&&!v.allowEmptySubmission&&0===b}),title:v.sheetContent.title},O=yc("mobile"),R="BUTTON"!==v.sheet.mode&&O?"SMALL"===v.sheet.collapsedVisibleHeight?69:128:0,M=O&&"BUTTON"===v.sheet.mode,F=M?76:0,N=(l?80:0)+F,V=Object(T.useContext)(Y),W=e=>{const t=i.find((t=>t.barcode.text===e.text)),n=w(e);return new Bc(null==n?void 0:n.count,null==t?void 0:t.count)},j=S().reduce(((e,t)=>e+t.count),0);g&&I.textReplacementArgs.push(j.toString());const z=g?new Oc(v.sheetContent.barcodeItemSubtitle.text,i,S()):h,H=!g&&0===b;return T.default.createElement(T.default.Fragment,null,T.default.createElement(Hs.Provider,{value:z},T.default.createElement(L.a,{container:!0,sx:{display:"flex",flexDirection:O?"column":"row",height:`calc(${V.remainingVisibleBodyHeight} - ${R}px)`},alignItems:"stretch"},T.default.createElement(L.a,{id:u,item:!0,ref:t,component:"div",xs:O?12:7,zIndex:100},M&&T.default.createElement(Ec,{style:{position:"absolute",marginTop:`calc(${V.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:g?`${b}/${j}`:b.toString(),onClick:()=>c(!s),buttonStyling:v.sheet.listButton}),T.default.createElement(Ks,{root:e.root,arOverlay:(()=>{if(g){const e=v.arOverlay;return Object.assign(Object.assign({},e),{counterBadge:Object.assign({},e.badge.partiallyScanned)})}const e=v.arOverlay,t=e.counterBadge;return Object.assign(Object.assign({},e),{counterBadge:Object.assign(Object.assign({},t),{visible:t.visible&&"COUNTING"===y})})})(),containerId:u,barcodeScannerViewConfig:C.current,onCameraPermissionDenied:e.onCameraPermissionDenied,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16+F,setActionButtonsVisible:m,arOnBarcodeClick:e=>{r({type:"onARCodeClick",barcode:e})},arOnBarcodeEnter:(e,t,n)=>{if(!n||!t)return;r({type:"setHtmlElements",barcode:e,labelElement:n,polygonElement:t})},scanningPaused:s&&O,cameraConfiguration:e.configuration.cameraConfiguration,onLicenseError:e.onError}),O&&T.default.createElement(cc,{closedSheetVisibleHeight:R,sheetStyle:v.sheet,contentStyle:v.sheetContent,manualCountEditDialog:v.manualCountEditDialog,isPlaceholderVisible:H,onBarcodeChange:e=>r(e),drawerHeaderContentProps:I,isOpen:s,onSwipe:e=>{c("swipe-to-open"===e)}},B)),Cc("tablet")&&T.default.createElement(kc,{headerProps:I,sheetContent:v.sheetContent,isEmptyStateVisible:H,barcodeList:B})),T.default.createElement(dc,{barcode:o,dialogStyling:v.manualCountEditDialog,onCancel:()=>a(null),setCounter:(e,t)=>{r({type:"onCountEditDialogChange",barcode:e,count:t}),a(null)}}),T.default.createElement(Tc,{open:null!==f,style:f,onDismiss:()=>p(null),onSubmit:x})))}const _c=Object(T.createContext)(null),Rc={didCatch:!1,error:null};class Mc extends T.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Rc}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:r,reason:"imperative-api"}),this.setState(Rc)}}componentDidCatch(e,t){var n,i;null===(n=(i=this.props).onError)||void 0===n||n.call(i,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:i}=this.props;var r,o;n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some(((e,n)=>!Object.is(e,t[n])))}(e.resetKeys,i)&&(null===(r=(o=this.props).onReset)||void 0===r||r.call(o,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Rc))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:r,error:o}=this.state;let a=e;if(r){const e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)a=t(e);else if(n)a=Object(T.createElement)(n,e);else{if(null!==i&&!Object(T.isValidElement)(i))throw o;a=i}}return Object(T.createElement)(_c.Provider,{value:{didCatch:r,error:o,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Fc(){const e=Object(T.useRef)(!0);return Object(T.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function Nc(e){const t=Fc(),[,n]=Object(T.useReducer)((e=>e+1),0),i=Object(T.useRef)();return Object(T.useMemo)((()=>{i.current={loading:!0,value:void 0,error:null}}),[e]),function(e,t){Object(T.useMemo)((()=>{e&&e.then((e=>{t({loading:!1,error:null,value:e})})).catch((e=>{t({loading:!1,error:{reason:e},value:void 0})}))}),[e])}(e,(e=>{i.current=e,t.current&&n()})),e?i.current:null}var Vc=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Wc{constructor(e,t){this.barcodeItemMapper=e,this.onError=t,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=e=>ds(e),this.onEvictionListeners=new Set}getBarcodeMappedData(e){const t=this.hash(e);if(!this.cache.has(t)){const n=(()=>Vc(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const t=new k.BarcodeScannerUiItem({count:1,barcode:e});return this.barcodeItemMapper(t)}{const t=yield b.toDataUrl(yield Jh.instance.imageToJpeg(e.sourceImage)),n=e.upcEanExtension?` ${e.upcEanExtension}`:"";return{title:e.text+n,subtitle:e.format,barcodeImage:t}}})))();this.cache.set(t,n)}return this.cache.get(t)}useBarcodeMappedData(e){const t=Object(T.useRef)(!1),n=Nc(e&&this.getBarcodeMappedData(e));if(Object(T.useEffect)((()=>{n&&n.error&&(t.current=!1,this.cacheEntryPendingRetries.push({barcode:e,retry:()=>{this.cache.delete(this.hash(e)),t.current=!0}}),this.onError((()=>{for(const e of this.cacheEntryPendingRetries)e.retry();this.cacheEntryPendingRetries.length=0}),(()=>{t.current=!0;for(const e of this.cacheEntryPendingRetries)for(const t of this.onEvictionListeners)this.hash(t.barcode)==this.hash(e.barcode)&&t.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let i;return i=n.value?"LOADED":n.error&&!t.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:i}}addOnEvictionListener(e){this.onEvictionListeners.add(e)}removeOnEvictionListener(e){this.onEvictionListeners.delete(e)}}k.BarcodeItemErrorState;function jc(e){return T.default.createElement(Ic,{open:e.open,dividerColor:e.dividerColor,modalOverlayColor:e.modalOverlayColor,sheetColor:e.sheetColor,title:e.title,subtitle:e.subtitle,cancelButton:{style:e.cancelButton,onClick:e.handleCancel},okButton:{style:e.retryButton,icon:P.Replay,onClick:e.handleRetry}})}function zc(e){const t=Object(T.useContext)(Y);if(!e.visible)return null;const n={textAlign:"center",maxWidth:"94%",wordWrap:"break-word"};return T.default.createElement(P.Box,{sx:{paddingTop:t.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:_.b.getColorValue(e.config.background)}},T.default.createElement(P.Box,{sx:{height:t.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},e.config.icon.visible&&T.default.createElement(P.Box,null,T.default.createElement(P.Avatar,{sx:{width:100,height:100,backgroundColor:_.b.getColorValue(e.config.iconBackground),margin:"24px"}},T.default.createElement(L.a,{sx:{fontSize:50,color:_.b.getColorValue(e.config.icon.color)}}))),T.default.createElement(P.Typography,{sx:Object.assign({fontSize:20},n)},T.default.createElement(N.a,{config:e.config.enableCameraTitle})),T.default.createElement(P.Typography,{sx:Object.assign({fontSize:16,paddingTop:"12px"},n)},T.default.createElement(N.a,{config:e.config.enableCameraExplanation,asHtml:!0})),T.default.createElement(P.Box,{sx:{paddingTop:"16px"}},T.default.createElement(G,Object.assign({},e.config.closeButton,{styleOverrides:{fontSize:14},onClick:e.onCloseClick})))))}function Hc(e){const t=Object(T.useRef)(Object(P.createTheme)({palette:{primary:{main:fc.ScanbotPrimary},secondary:{main:fc.DarkGray}}})),[n,i]=Object(T.useState)(!1),[r,o]=Object(T.useState)(!1),[a,s]=Object(T.useState)(e.configuration.timeouts.initialScanDelay<=0),c=Object(T.useRef)(!1),u=Object(T.useRef)(),l=Object(T.useRef)(),d=e.configuration.useCase,m="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,h=Object(T.useMemo)((()=>new Wc(null==m?void 0:m.barcodeItemMapper,((e,t)=>{i(!0),u.current=()=>{i(!1),e()},l.current=()=>{i(!1),t()}}))),[]);let f;if(Object(T.useMemo)((()=>{_.b.setPalette(e.configuration.palette),_.b.setLocalization(e.configuration.localization)}),[e.configuration]),Object(T.useEffect)((()=>{if(e.configuration.timeouts.autoCancelTimeout>0){const t=setTimeout((()=>{e.onClose()}),e.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(t)}}}),[]),Object(T.useEffect)((()=>{if(e.configuration.timeouts.initialScanDelay>0){const t=setTimeout((()=>{s(!0)}),e.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(t)}}}),[]),Object(T.useEffect)((()=>{c.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)f=T.default.createElement(ec,{root:e.root,configuration:e.configuration,barcodeMapper:h,onClose:e.onClose,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>o(!0),scanningEnabled:c});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");f=T.default.createElement(Lc,{root:e.root,configuration:e.configuration,barcodeMapper:h,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>o(!0),scanningEnabled:c})}return T.default.createElement(T.default.Fragment,null,T.default.createElement(M,null),T.default.createElement(Mc,{onError:e.onError,fallback:T.default.createElement("div",null,"Error")},T.default.createElement(_.a.Provider,{value:Object(_.c)(e.configuration.palette)},T.default.createElement(P.ThemeProvider,{theme:t.current},m&&T.default.createElement(jc,Object.assign({open:n,handleCancel:l.current,handleRetry:u.current,modalOverlayColor:m.modalOverlayColor,dividerColor:m.dividerColor,sheetColor:m.sheetColor},m.errorState)),T.default.createElement(L.a,{sx:{height:`100 * ${R}`,width:"100vw",backgroundColor:_.b.getColorValue(e.configuration.backgroundColor)}},T.default.createElement(Q,Object.assign({cameraPermissionDenied:r,onBackPress:e.onClose},e.configuration.topBar),!r&&f,T.default.createElement(zc,{visible:r,onCloseClick:e.onClose,config:e.configuration.cameraPermission})))))))}class Uc{constructor(e){this.document=e}}var Zc=n(22),Gc=n(40);function Yc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.489746)",fill:"transparent"}),T.default.createElement("path",{d:"M173.211 205.398H94.7913C93.9699 205.398 93.3054 204.733 93.3054 203.912V80.0909C93.3054 79.2695 93.9699 78.605 94.7913 78.605H173.211C174.033 78.605 174.697 79.2695 174.697 80.0909V203.912C174.697 204.733 174.033 205.398 173.211 205.398ZM96.2771 202.426H171.726V81.5767H96.2771V202.426ZM160.829 184.761H152.575V181.789H160.829V184.761ZM160.829 168.252H107.173V165.28H160.829V168.252ZM160.829 151.742H152.575V148.77H160.829V151.742ZM136.065 151.742H107.173V148.77H136.065V151.742ZM160.829 135.233H152.575V132.261H160.829V135.233ZM136.065 135.233H107.173V132.261H136.065V135.233ZM160.829 118.723H152.575V115.751H160.829V118.723ZM136.065 118.723H107.173V115.751H136.065V118.723ZM160.829 102.214H152.575V99.2419H160.829V102.214ZM136.065 102.214H107.173V99.2419H136.065V102.214Z",fill:t}),T.default.createElement("path",{d:"M178.826 66.5525H170.571V63.5808H178.826V66.5525ZM154.062 66.5525H125.17V63.5808H154.062V66.5525ZM178.826 50.043H170.571V47.0713H178.826V50.043ZM154.062 50.043H125.17V47.0713H154.062V50.043Z",fill:t}),T.default.createElement("path",{d:"M111.302 35.8152C111.302 34.9939 111.967 34.3293 112.788 34.3293H191.208C192.03 34.3293 192.694 34.9939 192.694 35.8152V135.232C192.694 136.053 192.03 136.718 191.208 136.718H173.213V133.746H189.722V37.3011H114.274V80.0903H111.302V35.8152Z",fill:t}),T.default.createElement("path",{d:"M174.46 79.6618C174.202 78.8819 173.363 78.4596 172.583 78.7174L172.105 82.0053L188.88 134.381L191.134 136.258C191.134 136.258 191.134 134.195 192.079 134.381L174.46 79.6618Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M172.051 142.95V124.876L96.3274 152.397V170.471L172.051 142.95Z",fill:t})))}function Qc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.237671)",fill:"transparent"}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.3575 73.6228C84.5124 73.6228 83.8287 74.3065 83.8287 75.1516V189.81C83.8287 190.655 84.5124 191.339 85.3575 191.339H174.536C175.381 191.339 176.065 190.655 176.065 189.81V100.631C176.065 100.224 175.904 99.8371 175.619 99.5526L150.139 74.073C149.851 73.7842 149.464 73.6228 149.057 73.6228H85.3575ZM86.8863 76.6804V188.281H173.007V102.16H149.057C148.212 102.16 147.528 101.476 147.528 100.631V76.6804H86.8863ZM170.846 99.1025L150.585 78.8419V99.1025H170.846Z",fill:t}),T.default.createElement("path",{d:"M147.528 177.665H96.5686V174.607H147.528V177.665ZM164.514 167.048H96.5686V163.991H164.514V167.048ZM164.514 156.432H96.5686V153.374H164.514V156.432ZM133.149 105.956L130.987 103.795L119.33 115.456L109.767 105.893C113.742 104.559 116.613 100.801 116.613 96.3846C116.613 90.8598 112.115 86.3626 106.591 86.3626H96.5686V121.864H99.6261V106.407H105.958L117.169 117.618L105.508 129.279L107.669 131.44L119.33 119.779L130.992 131.44L133.153 129.279L121.492 117.618L133.149 105.956ZM99.6261 103.349V89.4202H106.591C110.429 89.4202 113.555 92.5457 113.555 96.3846C113.555 100.224 110.429 103.349 106.591 103.349H99.6261Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M98.0973 60.883C97.2523 60.883 96.5686 61.5667 96.5686 62.4118V73.6228H99.6261V63.9406H160.268V87.8914C160.268 88.7365 160.951 89.4202 161.796 89.4202H185.747V175.541H176.076V178.599H187.276C188.121 178.599 188.805 177.915 188.805 177.07V87.8914C188.805 87.4838 188.643 87.0973 188.359 86.8128L162.879 61.3331C162.591 61.0444 162.204 60.883 161.796 60.883H98.0973ZM183.586 86.3626L163.325 66.1021V86.3626H183.586Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M110.837 48.1432C109.992 48.1432 109.308 48.8269 109.308 49.672V60.883H112.366V51.2007H173.007V75.1516C173.007 75.9967 173.691 76.6804 174.536 76.6804H198.487V162.802H188.816V165.859H200.016C200.861 165.859 201.545 165.175 201.545 164.33V75.1516C201.545 74.7439 201.383 74.3575 201.099 74.073L175.619 48.5933C175.33 48.3046 174.944 48.1432 174.536 48.1432H110.837ZM196.326 73.6228L176.065 53.3623V73.6228H196.326Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M172.844 188.832H86.629V113.394L172.844 148.212V188.832Z",fill:"url(#paint0_linear_557_1465)"})),T.default.createElement("defs",null,T.default.createElement("linearGradient",{id:"paint0_linear_557_1465",x1:"130.151",y1:"118.368",x2:"129.736",y2:"188.832",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),T.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function qc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",fill:"transparent"}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.2563 72.9183C84.4112 72.9183 83.7275 73.607 83.7275 74.4583V189.956C83.7275 190.807 84.4112 191.496 85.2563 191.496H174.435C175.28 191.496 175.964 190.807 175.964 189.956V100.124C175.964 99.7137 175.802 99.3244 175.518 99.0378L150.038 73.3717C149.75 73.0808 149.363 72.9183 148.955 72.9183H85.2563ZM86.7851 75.9982V188.416H172.906V101.664H148.955C148.11 101.664 147.427 100.976 147.427 100.124V75.9982H86.7851ZM170.745 98.5844L150.484 78.1756V98.5844H170.745Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M161.695 124.25H97.9961V127.33H161.695V124.25ZM161.695 137.084H97.9961V140.168H161.695V137.084ZM161.695 149.917H97.9961V153.001H161.695V149.917ZM161.695 162.75H97.9961V165.834H161.695V162.75Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M97.9961 60.0852C97.1511 60.0852 96.4674 60.774 96.4674 61.6252V72.9183H99.5249V63.1652H160.166V87.2913C160.166 88.1426 160.85 88.8313 161.695 88.8313H185.646V175.583H175.975V178.663H187.175C188.02 178.663 188.704 177.974 188.704 177.123V87.2913C188.704 86.8807 188.542 86.4914 188.258 86.2048L162.778 60.5387C162.489 60.2478 162.103 60.0852 161.695 60.0852H97.9961ZM183.485 85.7513L163.224 65.3425V85.7513H183.485Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M110.736 47.2522C109.891 47.2522 109.207 47.9409 109.207 48.7922V60.0852H112.265V50.3321H172.906V74.4583C172.906 75.3095 173.59 75.9982 174.435 75.9982H198.386V162.75H188.715V165.83H199.915C200.76 165.83 201.443 165.141 201.443 164.29V74.4583C201.443 74.0476 201.282 73.6583 200.998 73.3717L175.518 47.7056C175.229 47.4147 174.843 47.2522 174.435 47.2522H110.736ZM196.224 72.9183L175.964 52.5095V72.9183H196.224Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M172.844 188.594H86.629V113.156L172.844 147.974V188.594Z",fill:"url(#paint0_linear_557_1462)"})),T.default.createElement("defs",null,T.default.createElement("linearGradient",{id:"paint0_linear_557_1462",x1:"130.151",y1:"118.13",x2:"129.736",y2:"188.594",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),T.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function Xc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.252197)",fill:"transparent"}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8858 67.2461H206.331C207.315 67.2461 208.112 68.0427 208.112 69.0274V148.198C208.112 149.183 207.315 149.979 206.331 149.979H57.8858C56.9011 149.979 56.1045 149.183 56.1045 148.198V69.0274C56.1045 68.0427 56.9011 67.2461 57.8858 67.2461ZM204.549 70.8088H188.502L184.935 70.8038H79.2767L75.719 70.8088H59.6672V146.417H204.549V70.8088Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.232 131.072H70.4609V134.579H192.232V131.072Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.023 124.445H70.4609V127.951H137.023V124.445Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M154.834 91.8126C156.378 91.2748 157.875 91.8812 159.135 93.0581C159.912 93.7836 160.383 94.9148 160.697 96.2223C161.89 101.192 158.931 105.086 155.401 107.747C154.487 108.436 153.507 109.065 152.504 109.634C152.629 111.883 152.971 113.886 153.518 115.307C153.958 116.449 154.414 116.91 154.695 117.045C154.824 117.106 155.197 117.245 156.082 116.593C157.154 115.804 158.48 114.339 160.054 111.889C162.325 108.353 163.811 105.745 164.733 103.853C164.871 103.57 164.994 103.305 165.105 103.06C164.618 101.743 165.065 100.362 165.498 99.625C165.624 99.4115 165.788 99.1797 165.997 98.9797C166.151 98.8316 166.576 98.4573 167.217 98.4428C167.593 98.4343 167.97 98.5556 168.278 98.8062C168.562 99.0368 168.712 99.3145 168.792 99.5191C168.942 99.9021 168.95 100.295 168.937 100.573C168.909 101.173 168.741 101.894 168.437 102.749C168.829 103.064 169.379 103.266 170.06 103.302C171.173 103.362 172.298 102.941 172.954 102.213C174.863 100.095 177.418 98.185 180.536 97.8253C181.365 97.7297 182.224 97.6408 183.098 97.5504C186.089 97.241 189.256 96.9135 191.961 96.2372C193.699 95.8027 195.099 95.2557 196.067 94.5713C196.998 93.9135 197.455 93.1906 197.539 92.3236L200.494 92.6118C200.305 94.546 199.225 95.9753 197.781 96.9957C196.375 97.9894 194.564 98.6466 192.681 99.1174C189.748 99.8507 186.282 100.208 183.263 100.519C182.426 100.606 181.624 100.688 180.876 100.775C178.776 101.017 176.834 102.343 175.159 104.201C173.808 105.699 171.758 106.366 169.903 106.267C168.995 106.219 168.054 105.978 167.227 105.507C166.23 107.501 164.725 110.11 162.552 113.493C160.889 116.083 159.331 117.887 157.843 118.984C156.448 120.011 154.889 120.429 153.414 119.723C152.091 119.09 151.273 117.738 150.747 116.374C150.182 114.907 149.821 113.068 149.634 111.082C147.662 111.967 145.746 112.619 144.193 113.033L143.427 110.165C145.145 109.706 147.328 108.933 149.482 107.874C149.478 107.086 149.496 106.294 149.536 105.509C149.738 101.57 150.496 97.4995 151.843 94.8477C152.501 93.5543 153.451 92.2939 154.834 91.8126ZM152.479 106.174C152.868 105.918 153.248 105.652 153.614 105.376C156.807 102.969 158.585 100.145 157.81 96.9152C157.538 95.781 157.238 95.349 157.108 95.2275C156.299 94.4715 155.923 94.577 155.81 94.6164C155.534 94.7123 155.042 95.107 154.49 96.1927C153.42 98.2992 152.695 101.883 152.501 105.661C152.493 105.832 152.485 106.003 152.479 106.174ZM165.971 100.375C165.971 100.375 165.972 100.379 165.972 100.388L165.971 100.375Z",fill:t}),T.default.createElement("path",{d:"M74.5812 93.19H81.7632C84.4565 93.19 86.647 95.3805 86.647 98.0737C86.647 100.767 84.4565 102.957 81.7632 102.957H79.4686V107.051H76.8794V102.957H70.9902V100.372H81.7632C83.0308 100.372 84.0615 99.3413 84.0615 98.0737C84.0615 96.8061 83.0308 95.7755 81.7632 95.7755H74.5812C71.888 95.7755 69.6974 93.585 69.6974 90.8917C69.6974 88.1985 71.888 86.0079 74.5812 86.0079H76.8794V81.9142H79.465V86.0079H85.3542V88.5935H74.5812C73.3136 88.5935 72.283 89.6241 72.283 90.8917C72.283 92.1593 73.3136 93.19 74.5812 93.19Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.851 89.0878H74.5831C73.5888 89.0878 72.7797 89.8969 72.7797 90.8912C72.7797 91.8856 73.5888 92.6947 74.5831 92.6947H81.7651C84.7317 92.6947 87.1437 95.1067 87.1437 98.0732C87.1437 101.04 84.7317 103.452 81.7651 103.452H79.9653V107.546H76.3866V103.452H70.4973V99.8767H81.7651C82.7595 99.8767 83.5686 99.0676 83.5686 98.0732C83.5686 97.0789 82.7595 96.2698 81.7651 96.2698H74.5831C71.6166 96.2698 69.2046 93.8578 69.2046 90.8912C69.2046 87.9247 71.6166 85.5126 74.5831 85.5126H76.3866V81.4189H79.9617V85.5126H85.851V89.0878ZM85.3542 86.0079V88.5935H74.5812C73.3136 88.5935 72.283 89.6241 72.283 90.8917C72.283 92.1593 73.3136 93.19 74.5812 93.19H81.7632C84.4565 93.19 86.647 95.3805 86.647 98.0737C86.647 100.767 84.4565 102.957 81.7632 102.957H79.4686V107.051H76.8794V102.957H70.9902V100.372H81.7632C83.0308 100.372 84.0615 99.3413 84.0615 98.0737C84.0615 96.8061 83.0308 95.7755 81.7632 95.7755H74.5812C71.888 95.7755 69.6974 93.585 69.6974 90.8917C69.6974 88.1985 71.888 86.0079 74.5812 86.0079H76.8794V81.9142H79.465V86.0079H85.3542Z",fill:t}),T.default.createElement("path",{d:"M77.888 170.225C77.888 171.209 78.6847 172.006 79.6694 172.006H228.114C229.099 172.006 229.895 171.209 229.895 170.225V91.0542C229.895 90.0696 229.099 89.2729 228.114 89.2729H206.718V92.8306L210.286 92.8356H226.333V168.443H81.4507V148.197H77.888V170.225Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M124.937 70.8245H143.011L115.49 146.438H97.4164L124.937 70.8245Z",fill:t})),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M157.336 70.8245H162.725L134.954 146.438H129.565L157.336 70.8245Z",fill:t})))}function Kc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.371094)",fill:"transparent"}),T.default.createElement("path",{d:"M130.218 153.186H68.4406C63.9202 153.186 60.516 149.782 60.516 145.272V72.9456C60.516 68.4316 63.9202 65.0322 68.4406 65.0322H183.475C187.996 65.0322 191.4 68.4316 191.4 72.9456V126.127H188.332V72.9456C188.332 70.1334 186.291 68.0955 183.475 68.0955H68.4406C65.6244 68.0955 63.5836 70.1334 63.5836 72.9456V145.272C63.5836 148.08 65.6244 150.122 68.4406 150.122H130.218V153.186ZM167.041 114.518H128.493V111.455H167.041V114.518Z",fill:t}),T.default.createElement("path",{d:"M121.698 153.186H183.476C187.997 153.186 191.401 149.782 191.401 145.272L191.4 72.9456C191.4 68.4316 187.996 65.0322 183.475 65.0322H68.4406C63.9202 65.0322 60.516 68.4316 60.516 72.9456L60.5169 126.127H63.5845L63.5836 72.9456C63.5836 70.1334 65.6244 68.0955 68.4406 68.0955H183.475C186.291 68.0955 188.332 70.1334 188.332 72.9456L188.333 145.272C188.333 148.08 186.292 150.122 183.476 150.122H121.698V153.186Z",fill:t}),T.default.createElement("path",{d:"M215.429 174.458H104.655C99.1122 174.458 94.6003 169.953 94.6003 164.418V152.25H97.6679V164.418C97.6679 168.264 100.804 171.395 104.655 171.395H215.429C219.281 171.395 222.417 168.268 222.417 164.418V96.3454C222.417 92.4994 219.285 89.368 215.429 89.368H190.462V86.3048H215.429C220.976 86.3048 225.484 90.8103 225.484 96.3454V164.418C225.484 169.957 220.976 174.458 215.429 174.458Z",fill:t}),T.default.createElement("path",{d:"M166.838 91.7213H128.493V88.658H166.838V91.7213Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M167.041 103.232H128.696V100.169H167.041V103.232Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M177.817 140.631H74.0316V137.568H177.817V140.631Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M208.701 108.301H191.401V105.238H208.701V108.301Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M208.904 119.812H191.603V116.748H208.904V119.812Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M191.401 128.035V131.098H208.904V128.035H191.401Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M112.159 121.403H115.229V119.282C115.229 111.233 110.38 103.947 103.123 100.631C106.044 98.1624 107.766 94.5534 107.766 90.656C107.766 83.3827 101.818 77.4666 94.5044 77.4666C87.1911 77.4666 81.2423 83.3827 81.2423 90.656C81.2423 94.5534 82.9651 98.1624 85.8862 100.631C78.6283 103.947 73.7798 111.233 73.7798 119.282V121.403H76.8501V119.282C76.8501 111.551 82.1165 104.643 89.6559 102.488C90.2614 102.314 90.7006 101.788 90.7603 101.165C90.82 100.542 90.4917 99.9436 89.9288 99.6595C86.4619 97.908 84.3127 94.4601 84.3127 90.656C84.3127 85.0664 88.884 80.5201 94.5044 80.5201C100.125 80.5201 104.696 85.0664 104.696 90.656C104.696 94.4601 102.543 97.908 99.08 99.6595C98.5171 99.9436 98.1888 100.542 98.2485 101.165C98.3082 101.788 98.7474 102.314 99.3529 102.488C106.892 104.643 112.159 111.551 112.159 119.282V121.403Z",fill:"#A5A5A5"}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M126.999 68.3479H145.072L117.552 150.417H99.4783L126.999 68.3479Z",fill:t})),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M164.554 68.3479H169.942L142.171 150.417H136.783L164.554 68.3479Z",fill:t})))}function Jc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.118896)",fill:"transparent"}),T.default.createElement("path",{d:"M130.218 152.933H68.4406C63.9202 152.933 60.516 149.53 60.516 145.02V72.6932C60.516 68.1791 63.9202 64.7798 68.4406 64.7798H183.475C187.996 64.7798 191.4 68.1791 191.4 72.6932V125.875H188.332V72.6932C188.332 69.8809 186.291 67.843 183.475 67.843H68.4406C65.6244 67.843 63.5836 69.8809 63.5836 72.6932V145.02C63.5836 147.828 65.6244 149.87 68.4406 149.87H130.218V152.933ZM113.176 135.915H74.8314V132.852H113.176V135.915ZM100.395 101.879H74.8314C73.9836 101.879 73.2976 101.194 73.2976 100.348V79.075C73.2976 78.2283 73.9836 77.5433 74.8314 77.5433H100.395C101.242 77.5433 101.928 78.2283 101.928 79.075V100.348C101.928 101.194 101.242 101.879 100.395 101.879ZM93.4074 98.8159H98.8609V89.1156H93.4074V98.8159ZM84.8863 98.8159H90.344V87.584C90.344 86.7373 91.03 86.0524 91.8778 86.0524H98.8651V80.6066H84.8863V98.8159ZM76.3652 98.8159H81.8187V93.3701H76.3652V98.8159ZM76.3652 90.3069H81.8187V80.6066H76.3652V90.3069Z",fill:t}),T.default.createElement("path",{d:"M121.698 152.933H183.476C187.997 152.933 191.401 149.53 191.401 145.02L191.4 72.6932C191.4 68.1791 187.996 64.7798 183.475 64.7798H68.4406C63.9202 64.7798 60.516 68.1791 60.516 72.6932L60.5169 125.875H63.5845L63.5836 72.6932C63.5836 69.8809 65.6244 67.843 68.4406 67.843H183.475C186.291 67.843 188.332 69.8809 188.332 72.6932L188.333 145.02C188.333 147.828 186.292 149.87 183.476 149.87H121.698V152.933Z",fill:t}),T.default.createElement("path",{d:"M215.429 174.206H104.655C99.1122 174.206 94.6003 169.7 94.6003 164.165V151.997H97.6679V164.165C97.6679 168.011 100.804 171.143 104.655 171.143H215.429C219.281 171.143 222.417 168.016 222.417 164.165V118.897H190.462V115.834H222.417V106.134H190.462V103.07H222.417V96.093C222.417 92.2469 219.285 89.1156 215.429 89.1156H190.462V86.0524H215.429C220.976 86.0524 225.484 90.5579 225.484 96.093V164.165C225.484 169.705 220.976 174.206 215.429 174.206Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M111.248 68.0957H129.322L101.801 150.165H83.7275L111.248 68.0957Z",fill:t})),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M154.606 68.0957H159.994L132.223 150.165H126.835L154.606 68.0957Z",fill:t})))}function $c(e){const{color:t}=e;return T.default.createElement("svg",{width:"337",height:"239",viewBox:"0 0 337 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("g",{clipPath:"url(#clip0_1905_44505)"},T.default.createElement("g",{clipPath:"url(#clip1_1905_44505)"},T.default.createElement("rect",{x:"123.533",y:"171.794",width:"141.309",height:"98.298",rx:"4.5",transform:"rotate(-75 123.533 171.794)",fill:"#CCCCCC"}),T.default.createElement("rect",{x:"141.935",y:"103.117",width:"70.2",height:"98.3382",transform:"rotate(-75 141.935 103.117)",fill:"#707070"}),T.default.createElement("path",{d:"M186.43 78.0454C185.241 82.4824 180.658 85.123 176.213 83.9321C171.768 82.7411 169.12 78.1626 170.308 73.7256C171.497 69.2887 176.081 66.6478 180.525 67.8387C184.97 69.0297 187.619 73.6084 186.43 78.0454Z",fill:"#979696"}),T.default.createElement("path",{d:"M208.798 70.2396L201.899 95.989C201.454 97.6486 199.746 98.6329 198.083 98.1874C189.312 95.8371 184.085 86.8014 186.431 78.0452C188.777 69.2891 197.822 64.0775 206.593 66.4278C208.256 66.8735 209.243 68.5801 208.798 70.2396Z",fill:"#979696"}),T.default.createElement("rect",{x:"193.097",y:"176.458",width:"114.3",height:"5.4",rx:"2.7",transform:"rotate(-75 193.097 176.458)",fill:"black",fillOpacity:"0.48"}),T.default.createElement("rect",{x:"200.052",y:"178.321",width:"114.3",height:"5.4",rx:"2.7",transform:"rotate(-75 200.052 178.321)",fill:"black",fillOpacity:"0.48"}),T.default.createElement("rect",{x:"207.006",y:"180.184",width:"114.3",height:"5.4",rx:"2.7",transform:"rotate(-75 207.006 180.184)",fill:"black",fillOpacity:"0.48"}),T.default.createElement("rect",{x:"123.533",y:"171.794",width:"141.3",height:"12.6",transform:"rotate(-75 123.533 171.794)",fill:"black",fillOpacity:"0.15"})),T.default.createElement("rect",{x:"83.5",y:"60.7505",width:"98.2995",height:"141.306",rx:"4.5",fill:"#2D2D2D"}),T.default.createElement("path",{d:"M132.49 82.3113C112.132 82.3113 95.6279 98.8152 95.6279 119.174C95.6279 139.532 112.132 156.036 132.49 156.036C152.849 156.036 169.353 139.532 169.353 119.174C169.353 98.8152 152.849 82.3113 132.49 82.3113ZM159.771 105.35H146.486C145.215 98.9838 143.231 93.838 141.205 89.868C149.322 92.2906 155.987 97.9198 159.771 105.35ZM141.706 119.174C141.706 121.916 141.5 124.435 141.218 126.853H123.763C123.48 124.435 123.274 121.916 123.274 119.174C123.274 116.43 123.477 113.911 123.757 111.494H141.224C141.503 113.911 141.706 116.43 141.706 119.174ZM124.782 105.35C126.488 97.6518 129.302 92.0591 131.596 88.5448C131.899 88.536 132.184 88.455 132.49 88.455C132.799 88.455 133.085 88.5376 133.393 88.5464C135.698 92.0832 138.502 97.6783 140.199 105.35H124.782ZM123.776 89.868C121.757 93.8296 119.771 98.9811 118.499 105.35H105.209C108.994 97.9198 115.658 92.2921 123.776 89.868ZM102.862 111.494H117.566C117.309 113.927 117.131 116.457 117.131 119.174C117.131 121.891 117.314 124.419 117.575 126.853H102.862C102.22 124.384 101.771 121.841 101.771 119.174C101.772 116.507 102.22 113.963 102.862 111.494ZM105.209 132.997H118.514C119.798 139.378 121.785 144.567 123.767 148.476C115.654 146.052 108.992 140.425 105.209 132.997ZM131.596 149.802C129.395 146.416 126.527 140.808 124.79 132.997H140.191C138.457 140.803 135.592 146.408 133.383 149.802C133.08 149.811 132.797 149.892 132.491 149.892C132.185 149.892 131.901 149.812 131.596 149.802ZM141.217 148.476C143.201 144.564 145.187 139.378 146.468 132.997H159.771C155.988 140.424 149.329 146.051 141.217 148.476ZM162.119 126.853H147.407C147.667 124.419 147.85 121.891 147.85 119.174C147.85 116.457 147.673 113.927 147.416 111.494H162.118C162.76 113.963 163.209 116.506 163.209 119.174C163.209 121.841 162.76 124.385 162.119 126.853Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M99.6611 180.618V171.822H102.979C103.563 171.822 104.009 171.85 104.317 171.906C104.749 171.979 105.111 172.116 105.403 172.317C105.695 172.519 105.93 172.803 106.108 173.166C106.286 173.53 106.375 173.93 106.375 174.366C106.375 175.114 106.137 175.747 105.661 176.265C105.185 176.783 104.325 177.042 103.081 177.042H100.825V180.618H99.6611ZM100.825 176.004H103.099C103.851 176.004 104.385 175.864 104.701 175.584C105.017 175.304 105.175 174.91 105.175 174.402C105.175 174.034 105.082 173.719 104.896 173.457C104.71 173.195 104.464 173.022 104.161 172.938C103.964 172.886 103.603 172.86 103.075 172.86H100.825V176.004Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M105.979 180.618L109.357 171.822H110.611L114.211 180.618H112.885L111.859 177.954H108.182L107.216 180.618H105.979ZM108.517 177.006H111.499L110.581 174.57C110.301 173.83 110.093 173.222 109.957 172.746C109.845 173.31 109.687 173.87 109.483 174.426L108.517 177.006Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M114.746 177.791L115.844 177.695C115.896 178.135 116.017 178.496 116.207 178.778C116.397 179.06 116.692 179.288 117.092 179.462C117.492 179.636 117.942 179.723 118.442 179.723C118.886 179.723 119.278 179.657 119.618 179.525C119.958 179.393 120.211 179.213 120.377 178.982C120.543 178.752 120.626 178.501 120.626 178.229C120.626 177.953 120.546 177.712 120.386 177.506C120.226 177.3 119.962 177.128 119.594 176.987C119.358 176.895 118.836 176.752 118.028 176.558C117.22 176.364 116.654 176.181 116.33 176.009C115.91 175.789 115.597 175.516 115.391 175.19C115.185 174.864 115.082 174.499 115.082 174.095C115.082 173.651 115.208 173.236 115.46 172.85C115.712 172.464 116.08 172.171 116.564 171.971C117.048 171.771 117.586 171.671 118.178 171.671C118.83 171.671 119.405 171.776 119.903 171.986C120.401 172.196 120.783 172.505 121.051 172.913C121.319 173.321 121.463 173.783 121.483 174.299L120.368 174.383C120.308 173.827 120.105 173.407 119.759 173.123C119.413 172.839 118.902 172.697 118.226 172.697C117.522 172.697 117.009 172.826 116.687 173.084C116.365 173.342 116.204 173.653 116.204 174.017C116.204 174.333 116.318 174.593 116.546 174.797C116.77 175.001 117.354 175.21 118.301 175.424C119.246 175.638 119.895 175.825 120.247 175.985C120.759 176.221 121.137 176.52 121.381 176.882C121.625 177.244 121.747 177.661 121.747 178.133C121.747 178.601 121.613 179.042 121.345 179.456C121.077 179.87 120.692 180.192 120.19 180.422C119.688 180.652 119.123 180.767 118.495 180.767C117.699 180.767 117.032 180.651 116.494 180.419C115.956 180.187 115.534 179.838 115.228 179.372C114.923 178.907 114.762 178.379 114.746 177.791Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M122.939 177.791L124.037 177.695C124.089 178.135 124.21 178.496 124.4 178.778C124.59 179.06 124.885 179.288 125.285 179.462C125.685 179.636 126.135 179.723 126.635 179.723C127.079 179.723 127.471 179.657 127.811 179.525C128.151 179.393 128.404 179.213 128.571 178.982C128.736 178.752 128.819 178.501 128.819 178.229C128.819 177.953 128.74 177.712 128.579 177.506C128.419 177.3 128.155 177.128 127.787 176.987C127.551 176.895 127.029 176.752 126.221 176.558C125.413 176.364 124.847 176.181 124.523 176.009C124.103 175.789 123.79 175.516 123.585 175.19C123.378 174.864 123.275 174.499 123.275 174.095C123.275 173.651 123.401 173.236 123.653 172.85C123.905 172.464 124.273 172.171 124.757 171.971C125.241 171.771 125.779 171.671 126.371 171.671C127.023 171.671 127.598 171.776 128.096 171.986C128.594 172.196 128.977 172.505 129.245 172.913C129.513 173.321 129.657 173.783 129.677 174.299L128.561 174.383C128.501 173.827 128.298 173.407 127.952 173.123C127.606 172.839 127.095 172.697 126.419 172.697C125.715 172.697 125.202 172.826 124.88 173.084C124.558 173.342 124.397 173.653 124.397 174.017C124.397 174.333 124.511 174.593 124.739 174.797C124.963 175.001 125.548 175.21 126.494 175.424C127.44 175.638 128.089 175.825 128.441 175.985C128.953 176.221 129.33 176.52 129.575 176.882C129.818 177.244 129.941 177.661 129.941 178.133C129.941 178.601 129.807 179.042 129.539 179.456C129.271 179.87 128.885 180.192 128.384 180.422C127.881 180.652 127.316 180.767 126.689 180.767C125.893 180.767 125.226 180.651 124.688 180.419C124.15 180.187 123.728 179.838 123.422 179.372C123.116 178.907 122.955 178.379 122.939 177.791Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M131.533 180.618V171.822H134.851C135.435 171.822 135.881 171.85 136.189 171.906C136.621 171.979 136.983 172.116 137.275 172.317C137.567 172.519 137.802 172.803 137.98 173.166C138.158 173.53 138.247 173.93 138.247 174.366C138.247 175.114 138.009 175.747 137.533 176.265C137.057 176.783 136.197 177.042 134.953 177.042H132.697V180.618H131.533ZM132.697 176.004H134.971C135.723 176.004 136.257 175.864 136.573 175.584C136.889 175.304 137.047 174.91 137.047 174.402C137.047 174.034 136.954 173.719 136.768 173.457C136.582 173.195 136.336 173.022 136.033 172.938C135.836 172.886 135.475 172.86 134.947 172.86H132.697V176.004Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M139.374 176.334C139.374 174.874 139.766 173.731 140.55 172.905C141.334 172.079 142.346 171.666 143.586 171.666C144.398 171.666 145.13 171.86 145.782 172.248C146.434 172.636 146.931 173.177 147.273 173.871C147.615 174.565 147.786 175.352 147.786 176.231C147.786 177.123 147.606 177.921 147.246 178.625C146.886 179.329 146.376 179.862 145.716 180.224C145.056 180.586 144.344 180.767 143.58 180.767C142.752 180.767 142.012 180.567 141.36 180.167C140.708 179.767 140.215 179.221 139.879 178.529C139.542 177.838 139.374 177.106 139.374 176.334ZM140.574 176.352C140.574 177.412 140.859 178.247 141.429 178.856C141.999 179.467 142.714 179.771 143.574 179.771C144.45 179.771 145.171 179.463 145.737 178.848C146.303 178.232 146.586 177.358 146.586 176.226C146.586 175.51 146.465 174.885 146.223 174.351C145.981 173.817 145.627 173.403 145.161 173.109C144.695 172.815 144.172 172.668 143.592 172.668C142.768 172.668 142.059 172.951 141.465 173.517C140.871 174.083 140.574 175.028 140.574 176.352Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M149.304 180.618V171.822H153.203C153.988 171.822 154.583 171.901 154.991 172.059C155.399 172.217 155.725 172.497 155.969 172.896C156.213 173.296 156.335 173.738 156.335 174.222C156.335 174.846 156.133 175.372 155.729 175.8C155.325 176.228 154.701 176.5 153.857 176.616C154.165 176.764 154.399 176.91 154.559 177.054C154.899 177.366 155.221 177.756 155.525 178.224L157.055 180.618H155.591L154.427 178.788C154.087 178.26 153.807 177.856 153.587 177.576C153.367 177.296 153.17 177.1 152.996 176.988C152.822 176.876 152.645 176.798 152.465 176.754C152.333 176.726 152.117 176.712 151.817 176.712H150.467V180.618H149.304V180.618ZM150.468 175.704H152.97C153.501 175.704 153.918 175.649 154.218 175.539C154.517 175.429 154.746 175.253 154.901 175.011C155.057 174.769 155.135 174.506 155.135 174.222C155.135 173.806 154.984 173.464 154.682 173.196C154.38 172.928 153.903 172.794 153.251 172.794H150.467L150.468 175.704Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M160.174 180.618V172.86H157.276V171.822H164.248V172.86H161.338V180.618H160.174Z",fill:"#CCCCCC"})),T.default.createElement("defs",null,T.default.createElement("clipPath",{id:"clip0_1905_44505"},T.default.createElement("rect",{width:"337",height:"238.748",fill:"white"})),T.default.createElement("clipPath",{id:"clip1_1905_44505"},T.default.createElement("rect",{x:"123.533",y:"171.794",width:"141.309",height:"98.298",rx:"4.5",transform:"rotate(-75 123.533 171.794)",fill:"white"}))))}function eu(e){if(e.source instanceof Zc.j||e.source instanceof Gc.c)return null;const t="#FFFFFF";return T.default.createElement(P.Box,{sx:{backgroundColor:e.fill,borderRadius:1,width:"100%",height:250}},T.default.createElement(P.Box,{sx:{padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - 20px)"}},(()=>{if(e.source instanceof Zc.k)return T.default.createElement(Yc,{color:t});if(e.source instanceof Zc.i)return T.default.createElement(Qc,{color:t});if(e.source instanceof Zc.d)return T.default.createElement(qc,{color:t});if(e.source instanceof Zc.a)return T.default.createElement(Xc,{color:t});if(e.source instanceof Zc.e)return T.default.createElement(Kc,{color:t});if(e.source instanceof Zc.b)return T.default.createElement(Jc,{color:t});if(e.source instanceof Gc.b)return T.default.createElement($c,{color:t});if(e.source instanceof Zc.c||e.source instanceof Gc.a){const n=e.source;return T.default.createElement("img",{src:n.uri,style:{color:t,backgroundColor:e.fill,maxHeight:"100%",maxWidth:"100%"},alt:""})}throw new Error("Unknown intro image type")})()))}function tu(e){return T.default.createElement(T.default.Fragment,null,T.default.createElement(ee,{modalOverlayColor:"rgba(0, 0, 0, 0.64)",open:e.isOpen,onClose:e.onClose,width:"min(calc(100% - 2 * 24px), 500px)",PaperProps:{sx:{m:"10px",p:"10px",maxHeight:`calc(100 * ${R} - 2 * 24px)`,backgroundColor:_.b.getColorValue(e.backgroundColor)}}},T.default.createElement(P.Typography,{component:"div"},e.children)))}function nu(e){return T.default.createElement(tu,{isOpen:e.isOpen,onClose:e.onClose,backgroundColor:e.config.backgroundColor},T.default.createElement(P.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},T.default.createElement(N.a,{style:Object.assign({fontWeight:600,fontSize:16},q(1)),config:e.config.title}),T.default.createElement(P.Box,null,T.default.createElement(G,{onClick:e.onClose,visible:e.config.topBarDoneButton.visible,text:e.config.topBarDoneButton.text,background:e.config.topBarDoneButton.background,foreground:e.config.topBarDoneButton.foreground,icon:T.default.createElement(L.a,{sx:{fontSize:24}}),debugName:"close-introduction"}))),T.default.createElement(P.Box,{sx:{width:"100%",border:`1px solid ${_.b.getColorValue(e.config.dividerColor)}`,marginBottom:"12px"}}),T.default.createElement(N.a,{config:e.config.subtitle,style:{fontSize:16,paddingBottom:"10px"}}),e.config.items.map(((e,t)=>{const n=e.image instanceof Zc.j;return T.default.createElement(P.Box,{key:t,sx:{display:"flex",flexDirection:"column"}},T.default.createElement(P.Box,{sx:{pt:n?0:"10px",pb:n?0:"10px",backgroundColor:"rgb(191, 191, 191)"}},T.default.createElement(eu,{source:e.image})),T.default.createElement(N.a,{style:{fontWeight:500,fontSize:14,padding:1,paddingLeft:15,textIndent:-15},config:e.text}))})))}function iu(e){return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{sx:{backgroundColor:_.b.getColorValue(e.backgroundColor),display:"flex",justifyContent:"space-between",alignItems:"center",height:50,width:"100vw"}},T.default.createElement(P.Box,{style:{flexBasis:0,flexGrow:1}},e.leftContent),T.default.createElement(P.Box,null,T.default.createElement("h1",{style:{fontSize:18,fontWeight:500,textAlign:"center"}},T.default.createElement(N.a,{config:e.centerTitle,replacementArgs:e.centerTitleReplacementArgs}))),T.default.createElement(P.Box,{style:{flexBasis:0,flexGrow:1,textAlign:"right",whiteSpace:"nowrap"}},e.rightContent)))}function ru(e){return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Menu,{anchorEl:e.anchor,open:null!==e.anchor,onClose:e.onClose,MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:_.b.getColorValue(e.backgroundColor),minWidth:e.minWidth}}}},e.children))}function ou(e){const t=_.b.getColorValue(e.textColor);return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.MenuItem,{tabIndex:0,disabled:e.disabled,autoFocus:e.autoFocus,"aria-label":_.b.getLocalizedText(e.ariaLabel),onClick:e.onClick,sx:Object.assign(Object.assign({"&, &:hover, &:focus":{backgroundColor:"transparent"}},j(t)),{paddingX:"8px",marginX:"8px"})},e.children))}function au(e){const[t,n]=T.default.useState(!1),[i,r]=T.default.useState(null),o=Boolean(i),a=e.config.screens.camera.topBarCameraSelect;return T.default.createElement(T.default.Fragment,null,T.default.createElement(G,{id:"sb-button-camera-select",ariaLabel:_.b.getLocalizedText(a.button.accessibilityDescription),onClick:e=>r(e.currentTarget),visible:a.button.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:a.button.color,iconVisible:!0,useShadow:!1},icon:T.default.createElement(T.default.Fragment,null,T.default.createElement(L.a,null),!o&&T.default.createElement(L.a,{sx:{marginX:"-4px"}}),o&&T.default.createElement(L.a,{sx:{marginX:"-4px"}})),buttonWidth:48}),T.default.createElement(ru,{anchor:i,ariaLabelledBy:"sb-button-camera-select",backgroundColor:a.backgroundColor,onClose:()=>r(null),minWidth:"calc(min(100% - 40px, 323px))"},T.default.createElement(P.MenuItem,{disabled:!0,sx:{borderBottomColor:_.b.getColorValue(a.dividerColor),borderBottomStyle:"solid",borderBottomWidth:"1px",fontSize:14,marginTop:"-4px",marginBottom:"4px",marginX:"4px",width:"calc(100% - 8px)",opacity:"1 !important"}},T.default.createElement(N.a,{config:a.title})),e.cameraSelectConfig.availableCameras.map((i=>{const o=i.deviceId===e.cameraSelectConfig.activeCamera.deviceId,s=o?a.menuEntryActive:a.menuEntry;return T.default.createElement(ou,{disabled:t,key:i.deviceId,autoFocus:o,ariaLabel:s.accessibilityDescription,textColor:s.title.color,onClick:()=>{r(null),n(!0),e.cameraSelectConfig.onSelect(i).finally((()=>n(!1)))}},s.icon.visible&&T.default.createElement(L.a,{style:{color:_.b.getColorValue(s.icon.color),marginRight:"8px"}}),T.default.createElement(P.Typography,{variant:"inherit",noWrap:!0},T.default.createElement(N.a,{config:Object.assign(Object.assign({},s.title),{text:i.label})})),o&&T.default.createElement(L.a,{style:{color:_.b.getColorValue(s.icon.color),marginLeft:"auto",paddingLeft:15,fontSize:16}}))}))))}function su(e){const t=e.config.screens.camera;return T.default.createElement(T.default.Fragment,null,T.default.createElement(iu,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:T.default.createElement(G,{ariaLabel:_.b.getLocalizedText(t.topBarBackButton.accessibilityDescription),onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:T.default.createElement(L.a,{sx:{fontSize:24}}),debugName:"close-camera-screen"}),centerTitle:t.topBarTitle,rightContent:T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{style:{display:"flex",justifyContent:"space-around",alignItems:"center",whiteSpace:"nowrap",maxWidth:120,marginLeft:"auto"}},T.default.createElement(au,{config:e.config,cameraSelectConfig:e.cameraSelectConfig}),T.default.createElement(G,{ariaLabel:_.b.getLocalizedText(t.topBarIntroButton.accessibilityDescription),visible:t.topBarIntroButton.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:t.topBarIntroButton.color,iconVisible:!0,useShadow:!1},debugName:"show-introduction",icon:T.default.createElement(L.a,{sx:{fontSize:24}}),onClick:e.onShowIntroButtonClick,buttonWidth:20})))}))}function cu(e){const t=_.b.getColorValue(e.color);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L9 3H15L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4ZM4 19H20V7H15.95L14.125 5H9.875L8.05 7H4V19Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.80078 16.5L11.0008 7.5H13.0008L16.2008 16.5H14.3008L13.6008 14.5H10.4008L9.70078 16.5H7.80078ZM13.1508 13.15H10.8508L12.0008 9.5L13.1508 13.15Z",fill:t})))}function uu(e){const t=_.b.getColorValue(e.color);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"23",height:"22",viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{paddingTop:2,paddingRight:1}},T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.018 15.145L22.018 17.145V5.01997C22.018 4.46997 21.8222 3.99914 21.4305 3.60747C21.0388 3.2158 20.568 3.01997 20.018 3.01997H16.868L15.018 1.01997H9.01799L7.51799 2.64497L8.94299 4.06997L9.89299 3.01997H14.143L15.968 5.01997H20.018V15.145ZM2.60549 18.4325C2.99716 18.8241 3.46799 19.02 4.01799 19.02H18.193L20.493 21.32L21.918 19.895L21.043 19.02L19.043 17.02L15.668 13.645L14.218 12.195L10.843 8.81997L9.39299 7.36997L7.04299 5.01997L5.04299 3.01997L2.11799 0.0949707L0.692993 1.51997L2.69533 3.52231C2.66494 3.54959 2.63499 3.57797 2.60549 3.60747C2.21383 3.99914 2.01799 4.46997 2.01799 5.01997V17.02C2.01799 17.57 2.21383 18.0408 2.60549 18.4325ZM4.19299 5.01997H4.01799V17.02H16.193L14.1538 14.9807L12.6236 13.4506L11.7055 12.5325H13.618L13.726 12.841C13.9158 12.6605 14.0761 12.4519 14.2069 12.2153L13.1654 11.1741L13.168 11.1825H10.868L11.4203 9.42965L10.8219 8.83152C10.4317 9.04725 10.1179 9.3434 9.88049 9.71997C9.74455 9.93561 9.64684 10.1671 9.58737 10.4143L11.7055 12.5325H10.418L9.71799 14.5325H7.81799L9.36226 10.1892L8.05722 8.8842L4.19299 5.01997ZM14.4768 9.63538L10.8494 6.00662L11.018 5.53247H13.018L14.4768 9.63538Z",fill:t}),T.default.createElement("path",{d:"M9.88049 9.71997C9.74455 9.93561 9.64684 10.1671 9.58737 10.4143L11.7055 12.5325H13.618L13.726 12.841C13.9158 12.6605 14.0761 12.4519 14.2069 12.2153L13.1654 11.1741L13.168 11.1825H10.868L11.4203 9.42965L10.8219 8.83152C10.4317 9.04725 10.1179 9.3434 9.88049 9.71997Z",fill:t})))}function lu(e){return"NoButtonMode"===e.config._type?T.default.createElement(T.default.Fragment,null):"PagePreviewMode"===e.config._type?T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Button,{"data-sb-button-preview":!0,"arial-label":_.b.getLocalizedText(e.config.accessibilityDescription),disabled:!e.enabled,sx:Object.assign({paddingY:"11px"},j(e.config.pageCounter.background.fillColor)),onClick:e.onClick},T.default.createElement(wc,{text:`${e.count}`,backgroundColor:_.b.getColorValue(e.config.pageCounter.background.fillColor),badgeStyle:{borderColor:_.b.getColorValue(e.config.pageCounter.background.strokeColor),borderWidth:e.config.pageCounter.background.strokeWidth,borderStyle:"solid"},overlap:"rectangular",foregroundColor:_.b.getColorValue(e.config.pageCounter.foregroundColor)},e.previewImageUrl&&T.default.createElement("img",{style:{maxWidth:40,maxHeight:56},src:e.previewImageUrl,alt:"Preview image of the last page"}),!e.previewImageUrl&&T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(e.config.imagePlaceholderColor),width:40,height:56}})))):"TextButtonMode"===e.config._type?T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Button,{"data-sb-button-preview":!0,disabled:!e.enabled,onClick:e.onClick,"aria-label":_.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign(Object.assign({},j(e.config.style.color)),{textTransform:"none"})},T.default.createElement(N.a,{config:e.config.style,replacementArgs:[`${e.count}`]}))):void 0}function du(e){const t=_.b.getColorValue(e.color);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"65",height:"65",viewBox:"0 0 65 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M6.72501 49.1933C6.13188 49.5779 5.33687 49.4102 4.97627 48.8021C1.72147 43.3141 0.176561 36.9684 0.556438 30.5796C0.96168 23.7643 3.53609 17.2572 7.90342 12.0093C12.2708 6.76151 18.202 3.04806 24.8305 1.41171C31.4589 -0.224643 38.4369 0.301896 44.7447 2.91437C51.0525 5.52685 56.3594 10.0883 59.8898 15.9321C63.4202 21.7758 64.989 28.5956 64.3669 35.3946C63.7449 42.1936 60.9646 48.6154 56.4323 53.7215C52.1838 58.508 46.6046 61.9032 40.4226 63.4828C39.7377 63.6578 39.0569 63.2143 38.9094 62.523C38.7619 61.8316 39.2037 61.1543 39.888 60.9769C45.5359 59.5128 50.6318 56.4001 54.5177 52.0221C58.6874 47.3245 61.2453 41.4164 61.8176 35.1613C62.3899 28.9063 60.9466 22.6321 57.6986 17.2558C54.4506 11.8796 49.5683 7.68302 43.7651 5.27954C37.9619 2.87607 31.5422 2.39165 25.444 3.89709C19.3459 5.40253 13.8891 8.81891 9.87115 13.6469C5.8532 18.4749 3.48475 24.4615 3.11192 30.7316C2.76447 36.5751 4.16728 42.3794 7.12605 47.4081C7.48454 48.0173 7.31814 48.8087 6.72501 49.1933Z",fill:"url(#paint0_linear_779_506)"},T.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 32.5 32.5",from:"360 32.5 32.5",dur:"2s",begin:"0s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M6.72501 49.1933C6.13188 49.5779 5.33687 49.4102 4.97627 48.8021C1.72147 43.3141 0.176561 36.9684 0.556438 30.5796C0.96168 23.7643 3.53609 17.2572 7.90342 12.0093C12.2708 6.76151 18.202 3.04806 24.8305 1.41171C31.4589 -0.224643 38.4369 0.301896 44.7447 2.91437C51.0525 5.52685 56.3594 10.0883 59.8898 15.9321C63.4202 21.7758 64.989 28.5956 64.3669 35.3946C63.7449 42.1936 60.9646 48.6154 56.4323 53.7215C52.1838 58.508 46.6046 61.9032 40.4226 63.4828C39.7377 63.6578 39.0569 63.2143 38.9094 62.523C38.7619 61.8316 39.2037 61.1543 39.888 60.9769C45.5359 59.5128 50.6318 56.4001 54.5177 52.0221C58.6874 47.3245 61.2453 41.4164 61.8176 35.1613C62.3899 28.9063 60.9466 22.6321 57.6986 17.2558C54.4506 11.8796 49.5683 7.68302 43.7651 5.27954C37.9619 2.87607 31.5422 2.39165 25.444 3.89709C19.3459 5.40253 13.8891 8.81891 9.87115 13.6469C5.8532 18.4749 3.48475 24.4615 3.11192 30.7316C2.76447 36.5751 4.16728 42.3794 7.12605 47.4081C7.48454 48.0173 7.31814 48.8087 6.72501 49.1933Z",fill:"url(#paint1_linear_779_506)"},T.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 32.5 32.5",from:"360 32.5 32.5",dur:"2s",begin:"0s",repeatCount:"indefinite"})),T.default.createElement("defs",null,T.default.createElement("linearGradient",{id:"paint0_linear_779_506",x1:"60.3614",y1:"33.7149",x2:"37.0173",y2:"64.479",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{stopColor:t}),T.default.createElement("stop",{offset:"0.847585",stopColor:t,stopOpacity:"0"})),T.default.createElement("linearGradient",{id:"paint1_linear_779_506",x1:"8.69831",y1:"51.1273",x2:"20.179",y2:"68.157",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{stopColor:t}),T.default.createElement("stop",{offset:"0.370714",stopColor:t,stopOpacity:"0"})))))}function mu(e){const t=_.b.getColorValue(e.color);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("g",{clipPath:"url(#clip0_780_4723)"},T.default.createElement("path",{d:"M22.5127 8.09418C24.6704 8.09418 26.4195 6.34504 26.4195 4.18735C26.4195 2.02967 24.6704 0.280518 22.5127 0.280518C20.355 0.280518 18.6058 2.02967 18.6058 4.18735C18.6058 6.34504 20.355 8.09418 22.5127 8.09418Z",fill:t,fillOpacity:"0.2"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.4s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M9.93003 13.2714C12.0877 13.2714 13.8369 11.5223 13.8369 9.3646C13.8369 7.20691 12.0877 5.45776 9.93003 5.45776C7.77234 5.45776 6.02319 7.20691 6.02319 9.3646C6.02319 11.5223 7.77234 13.2714 9.93003 13.2714Z",fill:t,fillOpacity:"0.4"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.2s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M4.80063 25.8922C6.95832 25.8922 8.70747 24.143 8.70747 21.9853C8.70747 19.8276 6.95832 18.0785 4.80063 18.0785C2.64295 18.0785 0.893799 19.8276 0.893799 21.9853C0.893799 24.143 2.64295 25.8922 4.80063 25.8922Z",fill:t,fillOpacity:"0.6"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.0s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M9.9282 38.4743C12.0859 38.4743 13.835 36.7252 13.835 34.5675C13.835 32.4098 12.0859 30.6606 9.9282 30.6606C7.77051 30.6606 6.02136 32.4098 6.02136 34.5675C6.02136 36.7252 7.77051 38.4743 9.9282 38.4743Z",fill:t,fillOpacity:"0.8"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.8s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M22.5127 43.7196C24.6704 43.7196 26.4195 41.9704 26.4195 39.8127C26.4195 37.655 24.6704 35.9059 22.5127 35.9059C20.355 35.9059 18.6058 37.655 18.6058 39.8127C18.6058 41.9704 20.355 43.7196 22.5127 43.7196Z",fill:t,fillOpacity:"1"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.6s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M35.0819 38.4743C37.2396 38.4743 38.9887 36.7252 38.9887 34.5675C38.9887 32.4098 37.2396 30.6606 35.0819 30.6606C32.9242 30.6606 31.175 32.4098 31.175 34.5675C31.175 36.7252 32.9242 38.4743 35.0819 38.4743Z",fill:t,fillOpacity:"0.7"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.4s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M40.1988 25.8922C42.3565 25.8922 44.1057 24.143 44.1057 21.9853C44.1057 19.8276 42.3565 18.0785 40.1988 18.0785C38.0411 18.0785 36.292 19.8276 36.292 21.9853C36.292 24.143 38.0411 25.8922 40.1988 25.8922Z",fill:t,fillOpacity:"0.5"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.2s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M35.0819 13.31C37.2396 13.31 38.9887 11.5609 38.9887 9.40317C38.9887 7.24549 37.2396 5.49634 35.0819 5.49634C32.9242 5.49634 31.175 7.24549 31.175 9.40317C31.175 11.5609 32.9242 13.31 35.0819 13.31Z",fill:t,fillOpacity:"0.3"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"0s",repeatCount:"indefinite"}))),T.default.createElement("defs",null,T.default.createElement("clipPath",{id:"clip0_780_4723"},T.default.createElement("rect",{width:"44",height:"44",fill:t,transform:"translate(0.5)"})))))}function hu(e){const t=_.b.getColorValue(e.innerColor),n=_.b.getColorValue(e.outerColor);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"65",height:"64",viewBox:"0 0 65 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.5 2.66666C16.2996 2.66666 3.16666 15.7996 3.16666 32C3.16666 48.2004 16.2996 61.3333 32.5 61.3333C48.7004 61.3333 61.8333 48.2004 61.8333 32C61.8333 15.7996 48.7004 2.66666 32.5 2.66666ZM0.5 32C0.5 14.3269 14.8269 0 32.5 0C50.1731 0 64.5 14.3269 64.5 32C64.5 49.6731 50.1731 64 32.5 64C14.8269 64 0.5 49.6731 0.5 32Z",fill:n}),T.default.createElement("path",{d:"M56.7425 32C56.7425 45.3885 45.8889 56.242 32.5004 56.242C19.1119 56.242 8.2584 45.3885 8.2584 32C8.2584 18.6115 19.1119 7.75793 32.5004 7.75793C45.8889 7.75793 56.7425 18.6115 56.7425 32Z",fill:t})))}function fu(e){const t="manual"===e.state||"auto"===e.state&&e.config.enabledInAutoSnappingMode;return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Button,{disabled:!t,onClick:e.onClick,"aria-label":_.b.getLocalizedText(e.config.accessibilityDescription),"data-sb-button-shutter":!0,sx:Object.assign({width:56,margin:0,padding:0},j(e.config.innerColor))},"auto"===e.state&&T.default.createElement(du,{key:"auto",color:e.config.outerColor}),"loading"===e.state&&T.default.createElement(mu,{key:"loading",color:e.config.outerColor}),"manual"===e.state&&T.default.createElement(hu,{key:"manual",innerColor:e.config.innerColor,outerColor:e.config.outerColor})))}function pu(e){const t={backgroundColor:_.b.getColorValue(e.config.sheetColor)};let n=[{config:e.config.okButton,onClick:e.onOkClick,debugName:"ok"},{config:e.config.actionButton,onClick:e.onActionClick,debugName:"action"},{config:e.config.cancelButton,onClick:e.onCancelClick,debugName:"cancel"}].filter((e=>e.config.visible));2===n.length&&(n=n.reverse());const i=2===n.length?6:12,[r,o]=T.default.useState(!0);Object(T.useEffect)((()=>{o(e.open)}),[e.open]);const a=r?1:.5;return T.default.createElement(T.default.Fragment,null,T.default.createElement(ee,{modalOverlayColor:e.config.modalOverlayColor,open:e.open,PaperProps:{style:{borderRadius:"8px"}},onClose:e.onCancelClick},T.default.createElement(P.DialogContent,{sx:Object.assign(Object.assign({},t),{p:2,pb:1,textAlign:"center"})},T.default.createElement(P.Typography,{sx:{fontSize:"16px",fontWeight:"bold"}},T.default.createElement(N.a,{config:e.config.title})),T.default.createElement(P.Typography,{sx:{fontSize:"14px",lineHeight:"16pt",pt:1}},T.default.createElement(N.a,{config:e.config.subtitle}))),T.default.createElement(P.DialogActions,{sx:Object.assign(Object.assign({},t),{pt:1})},T.default.createElement(L.a,{container:!0,spacing:2},T.default.createElement(L.a,{item:!0,xs:12},T.default.createElement(L.a,{color:_.b.getColorValue(e.config.dividerColor)})),n.map(((e,t)=>{return T.default.createElement(L.a,{item:!0,xs:i,key:t},T.default.createElement(J,{disabled:!r,style:Object.assign({width:"100%",opacity:a},(n=e.config,Z(_.b.getColorValue(n.background.fillColor))?j(n.foreground.color):Object.assign(Object.assign({},z(n.background.fillColor)),{"& span":{transition:"transform 0.3s !important"},"&:hover span":{transform:"translateX(6px) !important"},"& > div, &":{transition:"border-radius 0.3s !important"},"&:hover > div, &:hover":{borderRadius:"0px !important"}}))),onClick:()=>{o(!1),e.onClick()},visible:e.config.visible,text:e.config.text,foreground:e.config.foreground,background:e.config.background,debugName:e.debugName,accessibilityDescription:_.b.getLocalizedText(e.config.accessibilityDescription)}));var n}))))))}const gu=["image/jpeg","image/jpg","image/png","image/bmp","image/dib","image/tiff"];var vu=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function yu(e){const t=e.config.screens.camera.bottomBar,n="auto"===e.buttonStates.snappingModeState?t.autoSnappingModeButton:t.manualSnappingModeButton,i="auto"===e.buttonStates.snappingModeState?cu:uu,r="on"===e.buttonStates.torchState?t.torchOnButton:t.torchOffButton,o=T.default.createRef();Object(T.useEffect)((()=>{o.current&&(o.current.oncancel=e.onFileSelectDialogClosed)}),[o.current]);const[a,s]=T.default.useState(!1),c=()=>s(!0);return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{"data-sb-bottom-bar":!0,sx:{backgroundColor:_.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:112,display:"flex",alignItems:"center",justifyContent:"center"}},T.default.createElement(P.Box,{sx:{maxWidth:400,display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)"}},T.default.createElement("div",null,T.default.createElement(H,{onClick:e.scanLimitReached?c:e.onFileSelectDialogOpened,enabled:e.buttonStates.importButtonEnabled,config:t.importButton,iconButtonComponent:e.scanLimitReached?"button":"label",icon:({color:e})=>T.default.createElement(L.a,{sx:{color:e}}),debugName:"import"},!e.scanLimitReached&&T.default.createElement("input",{hidden:!0,type:"file",accept:gu.join(", "),ref:o,onChange:t=>{var n,i;e.onFileSelectDialogClosed();const r=null===(i=null===(n=null==t?void 0:t.target)||void 0===n?void 0:n.files)||void 0===i?void 0:i[0];r&&(()=>{vu(this,void 0,void 0,(function*(){const t=e.sdk.detectAndCropDocument(d.Image.fromEncodedBinaryData(yield r.arrayBuffer()),"CONSUME_IMAGE");e.onFileUploaded(t)}))})()},value:""}))),T.default.createElement("div",null,T.default.createElement(H,{enabled:e.buttonStates.snappingModeButtonEnabled,config:n,icon:i,onClick:e.snappingModeButtonClick,debugName:"snapping-mode"})),T.default.createElement(fu,{state:e.buttonStates.shutterButtonState,onClick:e.scanLimitReached?c:e.onShutterButtonClick,config:e.config.screens.camera.bottomBar.shutterButton}),T.default.createElement("div",null,T.default.createElement(H,{enabled:e.buttonStates.torchButtonEnabled,config:r,icon:t=>(e.buttonStates.torchState,T.default.createElement(L.a,{sx:t})),onClick:e.onTorchButtonClick,debugName:"torch"})),T.default.createElement("div",null,T.default.createElement(lu,{enabled:e.buttonStates.reviewButtonEnabled,config:t.previewButton,count:e.buttonStates.reviewButtonCount,previewImageUrl:e.buttonStates.reviewButtonPreviewImageUrl,onClick:e.onReviewButtonClick})))),T.default.createElement(pu,{open:a,config:e.config.screens.camera.limitReachedAlertDialog,onCancelClick:()=>{},onActionClick:()=>{},onOkClick:()=>{s(!1)}}))}function Cu(e){const t=_.b.getColorValue(e.color),n=221/376,i=`calc(${e.maxHeight} - ${e.paddingTop}px - ${e.paddingBottom}px)`,r=e.maxWidth,o=`min(${`calc(${i} * ${n})`}, ${r})`,a=`min(${i}, ${`calc(${r} / ${n})`})`;return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{style:{width:o,height:a,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom},viewBox:"0 0 221 376",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M25.2696 149.527V20.2272C25.2696 9.60794 33.8814 1 44.5006 1H147.398C158.018 1 166.629 9.60794 166.629 20.2272V267.036C166.629 277.655 158.018 286.263 147.398 286.263H44.5006C33.8814 286.263 25.2696 277.655 25.2696 267.036V262.47M25.2696 200.917V183.453M27.5913 182.88V202.205M27.5913 224.958V239.567M27.5913 259.894V267.036C27.5913 267.902 27.6573 268.757 27.781 269.593L27.7889 269.64C27.8213 269.83 27.8538 270.021 27.8898 270.208C28.0875 271.246 28.3818 272.25 28.7617 273.212C28.8353 273.411 28.9166 273.609 29.0021 273.8C29.5369 275.014 30.211 276.159 31.0016 277.209C31.0791 277.304 31.157 277.411 31.2345 277.506C31.7807 278.205 32.3892 278.85 33.0366 279.457C33.3 279.701 33.5714 279.934 33.8505 280.159C33.9474 280.243 34.0482 280.32 34.149 280.392C34.4471 280.625 34.7532 280.847 35.0674 281.06L35.0712 281.063C35.0891 281.077 35.1074 281.092 35.1254 281.102C35.3193 281.228 35.5129 281.35 35.7068 281.473C35.924 281.602 36.1446 281.732 36.3656 281.854C36.5905 281.976 36.8153 282.095 37.044 282.209C37.1562 282.263 37.2726 282.32 37.3848 282.37L37.3905 282.372C37.5049 282.429 37.6194 282.485 37.7337 282.53C38.0865 282.683 38.443 282.824 38.8072 282.958C39.0477 283.045 39.2916 283.125 39.5359 283.202C39.6599 283.24 39.784 283.278 39.9081 283.313C40.2841 283.412 40.6639 283.511 41.0475 283.587C41.1716 283.614 41.2995 283.641 41.4311 283.664C41.5628 283.687 41.6907 283.713 41.8186 283.732C42.0782 283.774 42.3419 283.813 42.6053 283.839C42.7912 283.866 42.9775 283.877 43.1634 283.893C43.3184 283.904 43.4734 283.912 43.6284 283.919C43.9192 283.935 44.2059 283.942 44.5006 283.942H147.395C147.693 283.942 147.984 283.935 148.274 283.919C148.43 283.912 148.584 283.904 148.739 283.893C149.042 283.87 149.34 283.843 149.642 283.809C149.526 283.82 149.414 283.828 149.298 283.839C157.731 282.889 164.308 275.716 164.308 267.036V20.2272C164.308 11.2009 157.196 3.80228 148.274 3.34114H148.263C147.976 3.32548 147.689 3.31784 147.395 3.31784H44.5006C44.2059 3.31784 43.9231 3.32548 43.6326 3.34114H43.6284C43.4734 3.34878 43.3184 3.3568 43.1634 3.36825C43.0161 3.37969 42.8611 3.39535 42.7099 3.40679C34.2265 4.30614 27.5913 11.507 27.5913 20.2272V151.388M25.2696 238.278V226.254M34.1941 158.545V20.2306C34.1941 14.7975 38.4134 10.2996 43.8178 9.94611H43.9106L44.0499 9.93198C44.2141 9.92475 44.3641 9.92472 44.5034 9.92472H59.3495C60.1993 9.96748 60.8848 10.6244 60.9704 11.4631L60.9713 11.4779C60.9744 11.5301 60.9776 11.5829 60.9776 11.6383V11.6597C61.1811 16.011 64.772 19.4736 69.1698 19.4736H122.73C127.127 19.4736 130.718 16.011 130.922 11.6597V11.6383C130.922 11.5829 130.925 11.5304 130.928 11.4782L130.929 11.4631C131.015 10.6244 131.7 9.96748 132.549 9.92472H147.396C147.535 9.92472 147.685 9.92475 147.849 9.93198L147.988 9.94611H148.082C153.486 10.2996 157.705 14.7975 157.705 20.2306V267.036C157.705 272.376 153.536 276.892 148.217 277.308C148.165 277.312 148.123 277.315 148.081 277.319L148.078 277.319H148.042L148.014 277.323H147.953L147.932 277.327L147.93 277.327L147.929 277.327C147.751 277.335 147.574 277.342 147.396 277.342H44.5034C44.3255 277.342 44.148 277.335 43.9701 277.327L43.969 277.327L43.9679 277.327L43.9465 277.323H43.8858L43.8572 277.319H43.8217L43.8187 277.319C43.7769 277.315 43.7345 277.312 43.6823 277.308C38.3633 276.892 34.1941 272.376 34.1941 267.036V178.586M23.6521 148.301C23.6147 148.268 23.5193 148.222 23.3693 148.163C23.0612 148.043 22.636 148.008 22.2253 147.974C22.0313 147.958 21.8432 147.942 21.6714 147.919L20.8934 147.811C17.5128 147.337 13.6811 146.802 10.5597 147.83C10.3058 147.914 9.97642 148.033 9.68745 148.214C7.45931 149.607 2.80262 154.442 1.61011 159.826C0.977204 162.683 1.41084 165.294 2.89957 167.585C5.96789 172.306 10.5074 175.841 14.5438 178.676C15.524 179.364 16.6101 180.101 17.9614 180.995C18.1866 181.144 18.3939 181.293 18.5924 181.434C19.294 181.936 19.8482 182.332 20.7503 182.431C23.522 182.735 26.401 182.373 29.0765 181.383L29.3048 181.299C30.427 180.886 31.8238 180.373 32.4861 179.432C34.1031 177.136 36.2369 173.538 37.2172 169.433C37.6402 167.662 37.7405 166.251 37.5325 164.993C37.0481 162.071 34.9474 159.796 32.4452 157.346C32.1406 157.237 31.7749 156.862 31.0886 156.066C30.9542 155.91 30.8446 155.781 30.782 155.72L25.3035 150.365C24.763 149.837 24.3217 149.364 23.9259 148.769C23.8278 148.623 23.7709 148.512 23.7247 148.422M23.6521 148.301C23.6682 148.314 23.6819 148.338 23.7247 148.422M23.6521 148.301L23.6529 148.301C23.669 148.315 23.6819 148.338 23.7247 148.422M166.63 213.913L173.334 220.343M173.334 220.343L173.38 220.386C172.942 224.452 172.916 225.028 173.235 230.114M173.334 220.343C173.026 223.089 172.754 226.806 173.072 229.253M173.334 220.343C173.495 218.899 173.667 217.723 173.767 217.141M173.235 230.114C173.252 230.386 173.27 230.67 173.289 230.969L173.289 230.971M173.235 230.114L173.294 230.423C173.335 230.581 173.322 230.772 173.289 230.971M173.235 230.114L173.073 229.263M173.289 230.971L173.172 232.02M173.289 230.971C173.252 231.196 173.191 231.431 173.157 231.641M173.172 232.02L173.163 232.103M173.172 232.02C173.168 231.93 173.163 231.799 173.157 231.641M173.172 232.02C173.176 232.096 173.179 232.142 173.182 232.146M173.163 232.103L172.448 238.511M173.163 232.103C173.168 232.118 173.175 232.132 173.182 232.146M173.163 232.103C173.119 231.984 173.128 231.822 173.157 231.641M172.448 238.511L172.388 238.594C172.361 238.632 170.173 241.232 166.854 246.152M172.448 238.511L173.072 229.253M173.072 229.253C173.072 229.253 173.073 229.257 173.073 229.263M173.072 229.253L173.073 229.263M173.073 229.263C173.089 229.397 173.129 230.85 173.157 231.641M173.182 232.146C173.687 232.904 174.584 233.798 175.666 234.725M173.182 232.146C173.535 232.81 174.468 233.726 175.666 234.725M175.666 234.725C179.226 237.776 184.8 241.195 185.104 241.381C185.033 241.338 179.198 237.671 175.666 234.725ZM173.767 217.141C174.564 217.463 176.281 218.113 178.633 218.417M173.767 217.141C174.18 217.329 175.973 218.088 178.633 218.417M173.767 217.141L166.558 206.5M178.633 218.417C181.548 218.793 185.438 218.636 189.756 216.658M178.633 218.417C181.534 218.776 185.465 218.623 189.756 216.658M189.756 216.658C189.827 216.626 189.898 216.593 189.969 216.559M67.4683 323.631C70.4328 329.189 74.192 335.823 77.6768 341.522C92.8799 366.399 95.2 373.141 95.5527 374.664V375.7M67.4683 323.631C72.9296 307.707 97.7699 290.507 98.2854 290.15L98.2916 290.146C98.04 290.321 73.495 307.571 67.4683 323.631ZM67.4683 323.631C62.152 313.572 58.8077 305.831 56.9292 301.071C55.0301 296.265 52.4092 291.749 49.1397 287.657L47.9153 286.137M28.8505 204.209C31.3841 207.632 32.9003 212.464 31.6452 217.3C30.4889 221.756 27.8489 225.222 24.3855 226.861V237.921C27.7065 239.088 29.7911 241.302 30.5828 244.508C31.9643 250.084 29.9423 257.645 25.9796 261.726C24.1702 263.585 22.1669 264.543 20.1136 264.543C19.8662 264.543 19.6185 264.528 19.37 264.501L24.9855 268.636M34.147 152.964L26.212 149.313C25.8452 149.145 25.5564 149.529 25.8452 149.811L31.3237 155.166C31.3955 155.236 31.5222 155.382 31.6757 155.56L31.6786 155.563C31.9222 155.846 32.4736 156.485 32.6873 156.606H32.7968L32.9098 156.716C34.9429 158.703 37.7268 161.424 38.2968 164.867C38.5227 166.23 38.4193 167.738 37.9711 169.614C36.9622 173.838 34.7761 177.527 33.1198 179.879C32.3187 181.017 30.7957 181.577 29.5724 182.027L29.3457 182.11C27.1996 182.905 24.9271 183.312 22.6761 183.312C22.3249 183.312 21.9749 183.301 21.6252 183.281C22.2994 184.192 23.7392 186.664 25.2718 190.467M211.09 375.7V374.664L213.502 342.095L215.94 316.496L219.792 274.632C220.431 267.696 219.597 260.833 217.316 254.235C214.986 247.501 213.473 241.094 212.817 235.192C212.268 230.25 212.46 225.348 212.646 220.608C212.995 211.71 213.297 204.026 208.158 200.602C200.156 195.267 175.98 167.503 173.151 161.277C172.263 159.324 171 158.464 169.497 158.79C168.553 158.994 167.372 159.481 166.702 160.263M146.375 286.09C145.308 288.615 143.615 292.089 142.556 294.787M130.056 113.003H63.0631M130.056 84.3738H100.854M130.056 147.359H63.0631M130.056 181.714H63.0631M130.056 121.592H63.0631M130.056 92.9627H100.854M130.056 155.948H63.0631M130.056 190.303H63.0631M130.056 130.181H63.0631M130.056 164.537H63.0631M130.056 198.892H63.0631M130.056 138.77H63.0631M130.056 173.125H63.0631M130.056 207.481H63.0631M30.8954 217.105C29.7728 221.431 27.2014 224.769 23.8407 226.264C22.4226 226.896 20.8755 227.194 19.2463 227.145C13.854 226.987 9.84776 225.057 7.66123 221.564C5.3411 217.859 5.23957 212.578 7.39594 207.783C10.7883 200.246 23.0215 200.651 23.9228 200.691C25.9616 201.409 27.6374 202.632 28.9043 204.325C31.3378 207.564 32.1005 212.461 30.8954 217.105ZM23.8772 238.567C27.0829 239.619 29.0858 241.68 29.8306 244.695C31.154 250.036 29.2183 257.279 25.4236 261.184C24.0047 262.646 21.7086 264.253 18.833 263.627C16.7477 263.173 14.7108 261.619 12.78 259.001C5.82762 249.577 5.68905 247.795 8.07293 242.887C10.5545 237.78 14.2157 237.19 20.5306 237.867C21.6693 237.988 22.7263 238.2 23.6764 238.498L23.8772 238.567ZM135.782 224.965H56.7644C52.4952 224.965 49.0344 221.505 49.0344 217.235V79.8139C49.0344 75.5447 52.4952 72.0839 56.7644 72.0839H135.782C140.051 72.0839 143.512 75.5447 143.512 79.8139V217.235C143.512 221.505 140.051 224.965 135.782 224.965Z",stroke:t,strokeWidth:"1.75936"}),T.default.createElement("defs",null,T.default.createElement("linearGradient",{id:"paint0_linear_441_9693",x1:"110.664",y1:"375.7",x2:"110.664",y2:"1",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{offset:"0.029183",stopColor:t,stopOpacity:"0"}),T.default.createElement("stop",{offset:"0.204626",stopColor:t})))))}function bu(e){return e.config.visible?T.default.createElement("div",{style:e.style},T.default.createElement(W,{polygonConfig:{strokeColor:e.config.background.strokeColor,fillColor:e.config.background.fillColor,cornerRadius:0,strokeWidth:0},sx:{minHeight:40,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",width:"100%"}},T.default.createElement(N.a,{config:e.config.title,style:{textAlign:"center",maxWidth:"94%",wordWrap:"break-word"},debugName:"top-user-guidance"}))):null}function Au(e){const t=e.config.screens.camera.userGuidance.statesTitles,n="auto"===e.snappingMode?t.readyToCapture:t.captureManual,i={NOT_ACQUIRED:t.noDocumentFound,OK:n,OK_BUT_TOO_SMALL:t.tooSmall,OK_BUT_BAD_ANGLES:t.badAngles,OK_BUT_BAD_ASPECT_RATIO:t.badAspectRatio,OK_BUT_OFF_CENTER:t.textHintOffCenter,OK_BUT_ORIENTATION_MISMATCH:t.orientationMismatch,OK_BUT_TOO_DARK:t.tooDark,ERROR_NOTHING_DETECTED:t.noDocumentFound,ERROR_TOO_DARK:t.tooDark,ERROR_TOO_NOISY:t.tooNoisy,START:e.config.screens.camera.userGuidance.title.text};return T.default.createElement(N.a,{config:Object.assign(Object.assign({},e.config.screens.camera.userGuidance.title),{text:_.b.getLocalizedText(i[e.text])})})}const Su=`calc(100 * ${R} - 50px - 112px)`,wu="0.5s";function Eu(e){const t=e.config.screens.camera,n=e.bottomUserGuidanceVisible?56:0;return T.default.createElement(T.default.Fragment,null,T.default.createElement("div",{style:{position:"absolute",width:"100%",height:Su}},e.documentScannerView),T.default.createElement("div",{style:{position:"absolute",width:"100%",height:Su,backgroundColor:"white",opacity:e.showCameraBlink?1:0,transition:e.showCameraBlink?"":"opacity 0.5s ease-in"}}),T.default.createElement(P.Box,{sx:{height:Su,position:"relative"}},T.default.createElement(bu,{config:t.topUserGuidance}),e.bottomUserGuidanceVisible&&T.default.createElement(P.Box,{key:"bottomUserGuidance",sx:{position:"absolute",marginTop:`calc(${Su} - ${n}px)`,width:"100%",display:"flex",justifyContent:"center"}},T.default.createElement(W,{polygonConfig:{fillColor:t.userGuidance.background.fillColor,strokeColor:t.userGuidance.background.strokeColor,strokeWidth:t.userGuidance.background.strokeWidth,cornerRadius:4},sx:{padding:"6px 10px"}},T.default.createElement(Au,{config:e.config,text:e.userGuidanceText,snappingMode:e.snappingMode}))),t.scanAssistanceOverlay.visible&&!t.viewFinder.visible&&T.default.createElement(P.Box,{key:"scanAssistanceOverlay",sx:{backgroundColor:_.b.getColorValue(t.scanAssistanceOverlay.backgroundColor),height:"100%",display:"flex",justifyContent:"center",alignItems:"center",opacity:e.showHand?1:0,transition:"opacity 0.5s"}},T.default.createElement(Cu,{color:t.scanAssistanceOverlay.foregroundColor,maxWidth:"80%",maxHeight:`min(calc(${Su} * 0.85), 600px)`,paddingTop:40,paddingBottom:n}))))}const Du={OK:"Capturing your document... Please do not move the camera.",OK_BUT_TOO_SMALL:"The document is too small. Try moving closer.",OK_BUT_BAD_ANGLES:"This is a bad camera angle. Hold the device straight over the document.",OK_BUT_BAD_ASPECT_RATIO:"Rotate the device sideways, so that the document fits better into the screen.",OK_BUT_OFF_CENTER:"Try holding the device at the center of the document.",OK_BUT_TOO_DARK:"A document was detected, but it is too dark. Try turning on a light.",OK_BUT_ORIENTATION_MISMATCH:"The document seems to be upside down. Please rotate the device or document",ERROR_NOTHING_DETECTED:"Please hold the device over a document to start scanning.",ERROR_TOO_DARK:"It is too dark. Try turning on a light.",ERROR_TOO_NOISY:"Please move the document to a clear surface.",NOT_ACQUIRED:"Scanning failed."};class xu{constructor(e){this.initializing={enabled:!0,value:"Initializing..."},this.hint=e}}class Bu{constructor(){this.outline=new Iu,this.captureButton=new Pu}}class Iu{constructor(){this.polygon=new Tu,this.path=new Ou,this.label=new ku}}class Tu{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent",this.strokeWidthCapturing=2,this.strokeWidthSearching=2}}class Ou{constructor(){this.stroke="green",this.strokeWidth=4}}class ku{}class Pu{constructor(){this.color="#FFF"}}class Lu extends S.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new d.DocumentScannerParameters,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new xu(Du),this.style=new Bu,this.onDocumentDetected=function(e){},this.finder=Object(w.b)(),this.finder.visible=!1}static fromJson(e){var t,n;const i=new Lu;if(S.a.mapValuesDeep(null!==(t=e.finder)&&void 0!==t?t:{},i.finder),this.mapValues(e,i,["text","style","videoConstraints","detectionParameters","finder"]),e.text&&e.text&&(e.text.hint&&this.mapValues(e.text.hint,i.text.hint),e.text.initializing&&this.mapValues(e.text.initializing,i.text.initializing)),e.style){this.mapValues(e.style,i.style,["outline","captureButton"]);const t=e.style.outline;if(t){this.mapValues(t,i.style.outline,["polygon","path","label"]);const e=t.polygon;e&&this.mapValues(e,i.style.outline.polygon);const n=t.path;n&&this.mapValues(n,i.style.outline.path);const r=t.label;r&&this.mapValues(r,i.style.outline.label)}const n=e.style.captureButton;n&&this.mapValues(n,i.style.captureButton)}return this.mapVideoConstraints(e,i),i.detectionParameters=new d.DocumentScannerParameters(null!==(n=e.detectionParameters)&&void 0!==n?n:{}),i}}var _u=n(87),Ru=n.n(_u),Mu=n(83),Fu={insert:"head",singleton:!1},Nu=(Ru()(Mu.a,Fu),Mu.a.locals,n(57)),Vu=n.n(Nu);class Wu{constructor(e){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=e}setDuration(e){const t=Date.now()/1e3,n=t-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const i=-e*this.t;this.element&&(this.element.style.animationDuration=`${e}s`,this.element.style.animationDelay=`${i}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=t,this.lastDuration=e}}class ju extends T.default.Component{constructor(){super(...arguments),this.inner1=new Wu("scanbot-shutter-rotate"),this.inner2=new Wu("scanbot-shutter-rotate")}render(){return T.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(e){"searching"==e?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,T.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==e||"manual"==e,"scanbot-shutter-fade-out":"searching"==e||"capturing"==e,"scanbot-shutter-pulse-fast":"processing"==e},T.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},T.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==e||"capturing"==e,"scanbot-shutter-fade-out":"processing"==e||"manual"==e},T.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(e=>{this.inner1.element=e}))}captureSearchingInner2(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==e||"capturing"==e,"scanbot-shutter-fade-out":"processing"==e||"manual"==e},T.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(e=>{this.inner2.element=e}))}path(e){return T.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:e})}svgBase(e,t,n){return T.default.createElement("div",{className:Vu()(e),ref:n},T.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},t))}}class zu extends T.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return T.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible",fill:this.props.polygonStyle.fill}},this.fill())}fill(){if(!this.props.points||0===this.props.points.length)return null;const e=[];for(let t=0;t<this.LINE_COUNT;t++){const n=this.props.points[t],i=this.props.points[(t+1)%this.LINE_COUNT];e.push(T.default.createElement("line",{key:t,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:i.x,y2:i.y}))}return e}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}zu.CLASSNAME="scanbot-document-outline";class Hu extends T.default.Component{constructor(e){super(e),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(e,t,n,i){if(t&&t.some((e=>Number.isNaN(e.x)||Number.isNaN(e.y))))return;const r={points:e,animatedPoints:t,isOk:n,isVisible:i};this.setState(r)}pointStringOrLatestValidPoints(e){return e&&e.length>0?hs.a.toSvgString(e):hs.a.toSvgString(this.latestValidPoints)}render(){var e;this.state.points&&(this.latestValidPoints=this.state.points);const t=null!==(e=this.props.style)&&void 0!==e?e:{},n=Vu()(zu.CLASSNAME,{[`${zu.CLASSNAME}-ok`]:this.state.isOk},{[`${zu.CLASSNAME}-visible`]:this.state.isVisible},{[`${zu.CLASSNAME}-hidden`]:!this.state.isVisible});return T.default.createElement(us.polygon,{ref:e=>this.polygon=e,transition:{duration:.1},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?t.strokeCapturing:t.strokeSearching,fill:this.state.isOk?t.fillCapturing:t.fillSearching,strokeWidth:this.state.isOk?t.strokeWidthCapturing:t.strokeWidthSearching},onClick:()=>{},className:n})}}var Uu=Hu;class Zu extends T.default.Component{constructor(e){super(e),this.state={path:void 0}}render(){var e,t;return this.state.path?T.default.createElement(us.path,{pathLength:"1",strokeDasharray:"1 1",initial:{strokeDashoffset:1},animate:{strokeDashoffset:0,d:this.state.path},transition:{strokeDashoffset:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:0,repeatType:"loop",repeatDelay:1},d:{duration:.1}},stroke:(null===(e=this.props.style)||void 0===e?void 0:e.stroke)||"white",strokeWidth:(null===(t=this.props.style)||void 0===t?void 0:t.strokeWidth)||2,fill:"none",d:this.state.path,className:`${zu.CLASSNAME}-path`}):null}animate(e){const t="M"+hs.a.toSvgString(e)+"z";this.setState({path:t})}clear(){this.setState({path:void 0})}}class Gu extends T.default.Component{render(){return T.default.createElement(us.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},T.default.createElement(Uu,{ref:e=>this.polygon=e,style:this.props.polygonStyle}),T.default.createElement(Zu,{ref:e=>this.path=e,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(e,t,n){var i;const r="processing"!==n&&!!e,o=null!==(i=this.previous)&&void 0!==i?i:e,a=this.previous?e:void 0;this.polygon.update(o,a,t,r),this.previous=e,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class Yu extends T.default.Component{constructor(){super(...arguments),this.state={text:this.props.initializationText,ok:!1,validPoints:!1}}render(){const{ok:e,text:t,validPoints:n}=this.state,i="processing"!==this.props.action&&n;return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},T.default.createElement(Gu,{ref:e=>{this.polygon=e},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:e,isVisible:i,autoCaptureSensitivity:this.props.autoCaptureSensitivity}),T.default.createElement("label",{ref:e=>this.label=e,style:Object.assign({position:"absolute",display:t.enabled?"inline":"none",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",backgroundColor:"rgba(0, 0, 0, 0.4)",color:"white",borderRadius:"0.25em",padding:"0.05em 0.3em 0.05em 0.3em",fontFamily:"sans-serif",fontSize:"0.9em",fontWeight:"300"},this.props.style.label),dangerouslySetInnerHTML:{__html:t.value}}))}update(e,t,n){this.polygon.update(t,e,this.props.action),"searching"===this.props.action||"capturing"===this.props.action?(this.label.innerHTML=n,this.label.style.display="inline"):(this.label.innerHTML="",this.label.style.display="none")}}class Qu{constructor(e,t=Qu.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(e),this.sensitivity=t}check(e){let t=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(e[n],this.lastPolygon[n])){t=!0;break}}else t=!0;return t}reset(){this.lastPolygon=void 0}update(e){this.lastPolygon=e}isPointMoved(e,t){return Vs.distanceBetweenPoints(e,t)/this.maxDistance>this.sensitivity}calculateMaxDistance(e){let t=new hs.a(0,0),n=new hs.a(e.width,e.height);return Vs.distanceBetweenPoints(t,n)}}Qu.DEFAULT_SENSITIVITY=.5;var qu=n(16),Xu=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};ue.b;ue.a;class Ku extends ue.c{constructor(e){if(super(e),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>Xu(this,void 0,void 0,(function*(){const e=yield this.detectAndCrop();this.configuration.onDocumentDetected(e)})),Object.assign(this.state,{action:this.defaultAction}),!this.isSupported()){throw Error("Camera can only be accessed if the content is served via HTTPS, or on localhost. Check DocumentScannerView.isSupported() before creating the scanner.")}if(!e.sdk)throw Error("Initialize the SDK by calling ScanbotSDK.initialize() before using the document scanner.")}get defaultAction(){return this.isAutoCaptureEnabled()?"searching":"manual"}get enabled(){return!("searching"!=this.state.action&&"capturing"!=this.state.action&&"manual"!=this.state.action||this.disposed||this.props.pauseAR)}get configuration(){return this._configuration||(this._configuration=Lu.fromJson(this.props.configuration)),this._configuration}componentDidUpdate(e){e.configuration!==this.props.configuration&&(this._configuration=void 0)}get autoCaptureSensitivity(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}static create(e,t){return Xu(this,void 0,void 0,(function*(){const n=_s.a.findContainerOrThrow(e);return new Promise(((i,r)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(n),this.root.render(T.default.createElement(Ku,{root:this.root,container:n,configuration:e,onSuccess:i,onFailure:r,sdk:t}))}))}))}detectAndCrop(){var e,t,n,i,r;return Xu(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"}),this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const i=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Ku.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);return i?(I.a.debug("Detect & Crop document of size: "+i.height*i.width),this.handle||(yield this.createHandle()),yield null===(n=this.handle)||void 0===n?void 0:n.scan(new d.Image(i))):null}}catch(e){return null===(r=(i=this.configuration).onError)||void 0===r||r.call(i,e),null}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(e){this._configuration?this._configuration.autoCaptureEnabled=e:this.props.configuration.autoCaptureEnabled=e,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}onSdkReady(){return Xu(this,void 0,void 0,(function*(){this.createHandle()}))}createHandle(){return Xu(this,void 0,void 0,(function*(){const e=new d.DocumentScannerConfiguration({parameters:this.configuration.detectionParameters});this.handle=yield this.bridge.api.DocumentScanner.create(e)}))}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Xu(this,void 0,void 0,(function*(){e.componentDidMount.call(this),this.detect()}))}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});var t;return Xu(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield null===(t=this.handle)||void 0===t?void 0:t.destroy()}))}detect(){var e,t,n,i;return Xu(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const n=yield this.detectInWebWorker();if(!n||!this.enabled)return;if(!this.outline)return;this.camera.reusableImageBuffer=n.originalImage;const i=n.result,r=this.getStatusString(i),o="OK"===r,a=r.startsWith("OK")?this.scalePolygonPointsToPixels(i.pointsNormalized):void 0;this.outline.update(o,a,y.getProperty(this.configuration.text.hint,r)),null===(t=(e=this.props).onStatusStringUpdate)||void 0===t||t.call(e,r),yield this.handleAutoCapture(o,a)}catch(e){null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(e){return this.configuration.ignoreBadAspectRatio&&"OK_BUT_BAD_ASPECT_RATIO"===e.status?"OK":e.status}detectInWebWorker(){var e,t,n,i,r;return Xu(this,void 0,void 0,(function*(){try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const i=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(ue.c.DEFAULT_DETECTION_RESOLUTION,!1);return i&&this.enabled?yield null===(n=this.handle)||void 0===n?void 0:n.run(new d.Image(i)):null}catch(e){return null===(r=(i=this.configuration).onError)||void 0===r||r.call(i,e),null}}))}handleAutoCapture(e,t){return Xu(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled&&!this.preventAutoCapture)if(e&&!this.autoCaptureToken&&t){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const e=this.getCameraFrameSize();this.polygonMovementPredicate=new Qu(e)}if(this.runMovementPredicate(t))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>Xu(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const e=yield this.detectAndCrop(),t=e.result.detectionResult;if(null==t?void 0:t.pointsNormalized){const e=this.scalePolygonPointsToPixels(t.pointsNormalized);if(this.runMovementPredicate(e))return}(null==t?void 0:t.status.startsWith("OK"))&&this.configuration.onDocumentDetected&&(this.configuration.onDocumentDetected(e),this.preventAutoCapture=!0,setTimeout((()=>{this.preventAutoCapture=!1}),this.configuration.autoCaptureDelay))}))),this.autoCaptureSensitivity)}else!e&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(e){this.setState({action:e})}render(){var e,t,n,i;const{action:r}=this.state,{configuration:o}=this,a=null===(e=o.style)||void 0===e?void 0:e.captureButton,s=!(null!==(t=this.props.hideShutterButton)&&void 0!==t&&t);return T.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(n=this.configuration)||void 0===n?void 0:n.spinnerColor),T.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},T.default.createElement(le.a,{configuration:this.configuration,videoConstraints:o.videoConstraints,mirrored:o.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}}),s&&T.default.createElement(ju,{color:(null==a?void 0:a.color)?a.color:"FFF",action:r,onClick:this.enabled?o.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}})),this.configuration.finder.visible&&T.default.createElement(de.a,{ref:e=>{this.finder=e},guidanceConfiguration:new qu.b({visible:!1}),configuration:o.finder}),T.default.createElement(Yu,{ref:e=>{this.outline=e},style:null===(i=o.style)||void 0===i?void 0:i.outline,initializationText:o.text.initializing,action:r,autoCaptureSensitivity:this.autoCaptureSensitivity}))}scalePolygonPointsToPixels(e){var t;if(e){const n=this.getCameraFrameSize(),i=Ps.a.fromHtmlElement(this.camera.video),r=_s.a.findScale(i,n);(null===(t=this.finder)||void 0===t?void 0:t.holeRect)&&(e=e.map((e=>new hs.a((e.x*this.finder.holeRect.width+this.finder.holeRect.x)/i.width,(e.y*this.finder.holeRect.height+this.finder.holeRect.y)/i.height)))),e=null==(e=_s.a.convertToViewportPointsFromParentSize(n,e))?void 0:e.map((e=>hs.a.scaleToPoint(e,r.x,r.y,r.scale)))}return e}runMovementPredicate(e){const t=this.polygonMovementPredicate.check(e);return this.polygonMovementPredicate.update(e),t}getCameraFrameSize(){return this.camera.calculateFrameSize(ue.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}Ku.DETECT_AND_CROP_RESOLUTION=0,Ku.root=null;var Ju=Ku;function $u(e){const[t,n]=Object(T.useState)(!1);return Object(T.useEffect)((()=>{const t=setTimeout((()=>{n(!0)}),e);return()=>clearTimeout(t)}),[]),t}var el=n(18);function tl(e){if(!e.visible)return null;const t=e.config.screens.camera.cameraPermission;return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Dialog,{fullScreen:!0,open:e.visible,transitionDuration:0},T.default.createElement(iu,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:null,rightContent:null,centerTitle:e.config.screens.camera.topBarTitle}),T.default.createElement(P.Box,{style:{height:`calc(100 * ${R} - 50px)`,backgroundColor:_.b.getColorValue(t.background),display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(t.iconBackground),borderRadius:40,width:80,height:80,display:"flex",justifyContent:"center",alignItems:"center"}},T.default.createElement(L.a,{style:{color:_.b.getColorValue(t.icon.color)},sx:{fontSize:40}})),T.default.createElement("h4",{style:{margin:12}},T.default.createElement(N.a,{style:{fontSize:18,fontWeight:500},config:t.enableCameraTitle})),T.default.createElement(P.Box,{style:{marginBottom:"12px",maxWidth:350,textAlign:"center"}},T.default.createElement(N.a,{config:t.enableCameraExplanation,asHtml:!0})),T.default.createElement(P.Box,null,T.default.createElement(G,{icon:T.default.createElement(P.Close,{style:{fontSize:18}}),iconPosition:"right",onClick:e.onCloseClick,visible:t.closeButton.visible,text:t.closeButton.text,background:t.closeButton.background,foreground:t.closeButton.foreground,ariaLabel:t.closeButton.accessibilityDescription,styleOverrides:{fontSize:14,padding:"8px 20px",gap:"6px"}})))))}var nl=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function il(e,t){return nl(this,void 0,void 0,(function*(){return{value:yield e,source:t}}))}var rl=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function ol(e){var t;const n=e.configuration.screens.camera,[i,r]=Object(T.useState)(n.cameraConfiguration.autoSnappingEnabled?"auto":"manual"),[o,a]=Object(T.useState)(n.cameraConfiguration.flashEnabled),[s,c]=T.default.useState(!1),u=Object(T.useRef)(null);const[l,d]=Object(T.useState)(n.introduction.showAutomatically);Object(T.useEffect)((()=>{e.scanLimitReached&&r("manual")}),[e.scanLimitReached]);const m="ENABLED"===n.userGuidance.visibility||"AUTO_CAPTURE_ONLY"===n.userGuidance.visibility&&"auto"===i;Object(T.useEffect)((()=>{const t=e.configuration.screens.camera.viewFinder.minimumInsets;t.top+=n.topUserGuidance.visible?40:0,t.bottom+=m?56:0}),[]);const h=null===(t=e.pages)||void 0===t?void 0:t[e.pages.length-1],[f,p]=Object(T.useState)(null),g=Nc(null==h?void 0:h.finalImageUrl());Object(T.useEffect)((()=>{0===e.pages.length?p(null):g.value&&p(g.value)}),[g,e.pages.length]);const[v,y]=Object(T.useState)(!1),C=0===n.timeouts.initialScanDelay||$u(n.timeouts.initialScanDelay),[b,A]=Object(T.useState)("START"),[S,w]=Object(T.useState)(!0),{documentScannerView:E,documentScannerViewRef:D,torchSupported:x,scannerInitialized:B,activeCamera:I,availableCameras:O,setActiveCamera:k}=function(e){const t=e.configuration.screens.camera,n=t.cameraConfiguration,i=t.scannerParameters,r=!e.pauseAR&&("ENABLED"===t.polygon.visibility||"AUTO_CAPTURE_ONLY"===t.polygon.visibility&&"auto"===e.snappingMode),o=e=>r?_.b.getColorValue(e):"#00000000",a=(new Lu).videoConstraints;a.width.ideal=n.idealPreviewResolution.width,a.height.ideal=n.idealPreviewResolution.height,a.facingMode="FRONT"===n.cameraModule?"user":"environment";const s=!e.scanningPaused&&"auto"===e.snappingMode,c={videoConstraints:a,onError:e.onError,backgroundColor:_.b.getColorValue(t.backgroundColor),onDocumentDetected:e.onImageCaptured,autoCaptureEnabled:s,autoCaptureDelay:n.autoSnappingDelay,autoCaptureSensitivity:n.autoSnappingSensitivity,detectionParameters:{aspectRatios:i.aspectRatios,acceptedAngleScore:i.acceptedAngleScore,acceptedBrightnessThreshold:i.acceptedBrightnessThreshold,acceptedSizeScore:i.acceptedSizeScore,ignoreOrientationMismatch:i.ignoreOrientationMismatch},ignoreBadAspectRatio:!1,spinnerColor:"transparent",style:{outline:{label:{backgroundColor:"transparent",color:"transparent"},path:{stroke:o(t.polygon.autoSnapProgress.strokeColor),strokeWidth:t.polygon.autoSnapProgress.strokeWidth},polygon:{strokeWidthSearching:t.polygon.documentNotOk.strokeWidth,strokeSearching:o(t.polygon.documentNotOk.strokeColor),fillSearching:o(t.polygon.documentNotOk.fillColor),strokeWidthCapturing:t.polygon.documentOk.strokeWidth,fillCapturing:o(t.polygon.documentOk.fillColor),strokeCapturing:o(t.polygon.documentOk.strokeColor)}}},finder:t.viewFinder},u=Object(T.useRef)(null);Object(T.useEffect)((()=>()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.dispose()}),[]),Object(T.useEffect)((()=>{u.current&&(s?u.current.enableAutoCapture():u.current.disableAutoCapture())}),[e.scanningPaused,e.snappingMode,u.current]);const[l,d]=Object(T.useState)(!1);Object(T.useEffect)((()=>{u.current&&l&&u.current.setTorchState(e.torchEnabled).catch((e=>{}))}),[e.torchEnabled,u.current,l]);const[m,h]=Object(T.useState)(!1),[f,p]=Object(T.useState)(null),[g,v]=Object(T.useState)([]);Object(T.useEffect)((()=>{u.current||h(!1)}),[u.current]);const y=T.default.createElement(Ju,{root:e.root,sdk:e.sdk,ref:u,configuration:c,onSuccess:function(){var e,t,n;d(null===(e=u.current)||void 0===e?void 0:e.getActiveCameraInfo().supportsTorchControl),h(!0);const i=null===(t=u.current)||void 0===t?void 0:t.getActiveCameraInfo();p(null!=i?i:null),v(i?[i]:[]),null===(n=u.current)||void 0===n||n.fetchAvailableCameras().then(v)},onFailure:e.onError,hideShutterButton:!0,onStatusStringUpdate:e.onUserGuidanceTextUpdate,pauseAR:e.pauseAR});return{documentScannerView:y,documentScannerViewRef:u,torchSupported:l,scannerInitialized:m,activeCamera:f,availableCameras:g,setActiveCamera:function(e){var t;return p(e),null===(t=u.current)||void 0===t?void 0:t.switchCamera(e.deviceId)}}}({root:e.root,sdk:e.sdk,configuration:e.configuration,onImageCaptured:e=>{F(il(Promise.resolve(e),"AUTO_SNAP"))},onUserGuidanceTextUpdate:function(e){(!S||"ERROR_NOTHING_DETECTED"!==e&&L)&&(A(e),w(!1))},snappingMode:i,scanningPaused:e.scanningPaused||!C,torchEnabled:o,onError:t=>{t instanceof el.a?y(!0):e.onError(t)},pauseAR:!e.visible||e.scanningPaused||!C}),L=$u(1e3),[R,M]=Object(T.useState)(!1);Object(T.useEffect)((()=>{requestAnimationFrame((()=>M(!1)))}),[R]);function F(t){M(n.captureFeedback.cameraBlinkEnabled),ce.INSTANCE.vibrate(e.configuration.screens.camera.vibration),e.onImageCaptured(t)}return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{display:e.visible?"block":"none","data-sb-screen-camera":!0,style:{position:"absolute",width:"100vw"}},T.default.createElement(nu,{config:n.introduction,isOpen:l,onClose:()=>{d(!1)}}),T.default.createElement(su,{cameraSelectConfig:{availableCameras:O,activeCamera:I,onSelect:e=>rl(this,void 0,void 0,(function*(){yield k(e),a(!1)}))},onCloseButtonClick:()=>{var t;0===e.pages.length?null===(t=e.onClose)||void 0===t||t.call(e):c(!0)},config:e.configuration,onShowIntroButtonClick:()=>d(!0)}),T.default.createElement(Eu,{config:e.configuration,sdk:e.sdk,documentScannerView:E,showHand:S,userGuidanceText:b,bottomUserGuidanceVisible:m,snappingMode:i,showCameraBlink:R}),T.default.createElement(yu,{buttonStates:{importButtonEnabled:!e.scanningPaused,snappingModeState:i,snappingModeButtonEnabled:!e.scanLimitReached,torchState:o&&x?"on":"off",torchButtonEnabled:x,reviewButtonCount:e.pages.length,reviewButtonPreviewImageUrl:f,reviewButtonEnabled:e.pages.length>0,shutterButtonState:e.scanningPaused||!B?"loading":i},sdk:e.sdk,onFileSelectDialogOpened:function(){u.current=i,r("manual")},onFileSelectDialogClosed:function(){u.current&&(r(u.current),u.current=null)},onFileUploaded:t=>e.onImageCaptured(il(t,"IMPORTED")),snappingModeButtonClick:()=>r((e=>function(e){return"auto"===e?"manual":"auto"}(e))),onTorchButtonClick:()=>a((e=>!e)),onReviewButtonClick:e.onReviewButtonClick,onShutterButtonClick:function(){var e;return rl(this,void 0,void 0,(function*(){w(!1),F(il(null===(e=D.current)||void 0===e?void 0:e.detectAndCrop(),"MANUAL_SNAP"))}))},scanLimitReached:e.scanLimitReached,config:e.configuration}),T.default.createElement(pu,{open:s,config:e.configuration.screens.camera.cancelAlertDialog,onCancelClick:()=>c(!1),onActionClick:()=>{},onOkClick:e.onClose}),T.default.createElement(tl,{visible:v,onCloseClick:e.onClose,config:e.configuration})))}function al(e){const t=Object(T.useMemo)((()=>Object(P.createTheme)({components:{MuiButtonBase:{styleOverrides:{root:{"&:hover, &:focus":{outline:"none"}}},defaultProps:{disableRipple:!0}}}})),[]);return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.ThemeProvider,{theme:t},T.default.createElement(P.Typography,{component:"div"},e.children)))}function sl(e){const t=_.b.getColorValue(e.color);return T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("mask",{id:"mask0_856_1211",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},T.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),T.default.createElement("g",{mask:"url(#mask0_856_1211)"},T.default.createElement("path",{d:"M3 9V3H5V6.35C5.83333 5.31667 6.85417 4.5 8.0625 3.9C9.27083 3.3 10.5833 3 12 3C13.9667 3 15.7208 3.55833 17.2625 4.675C18.8042 5.79167 19.8833 7.23333 20.5 9H18.325C17.7583 7.8 16.9167 6.83333 15.8 6.1C14.6833 5.36667 13.4167 5 12 5C11.05 5 10.1542 5.175 9.3125 5.525C8.47083 5.875 7.73333 6.36667 7.1 7H9V9H3ZM6 18H18L14.25 13L11.25 17L9 14L6 18ZM5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V12H5V20H19V12H21V20C21 20.55 20.8042 21.0208 20.4125 21.4125C20.0208 21.8042 19.55 22 19 22H5Z",fill:t})))}function cl(e){const t=e.config,n=e.isQualityAcceptable?t.acceptWhenOkButton:t.acceptWhenNotOkButton;return T.default.createElement(P.Box,{sx:{backgroundColor:_.b.getColorValue(e.backgroundColor),height:78,display:"flex",width:"100%",zIndex:1e3,justifyContent:"center"}},T.default.createElement(P.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)",maxWidth:400}},T.default.createElement(H,{config:e.config.retakeButton,icon:sl,enabled:!0,debugName:"ack-retake",onClick:e.onRetake}),T.default.createElement(H,{config:n,icon:e=>T.default.createElement(P.Check,{style:e}),enabled:!0,debugName:"ack-use-scan",onClick:e.onAccept})))}function ul(e){if(!e.config.visible)return null;const t=_.b.getColorValue(e.config.color);return T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("mask",{id:"mask0_447_6066",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},T.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),T.default.createElement("g",{mask:"url(#mask0_447_6066)"},T.default.createElement("path",{d:"M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H13V5H5V19H19V11H21V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM6 17H18L14.25 12L11.25 16L9 13L6 17Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.17 8.83C15.95 9.61 16.8933 10 18 10C19.1067 10 20.05 9.61 20.83 8.83C21.61 8.05 22 7.10667 22 6C22 4.89333 21.61 3.95 20.83 3.17C20.05 2.39 19.1067 2 18 2C16.8933 2 15.95 2.39 15.17 3.17C14.39 3.95 14 4.89333 14 6C14 7.10667 14.39 8.05 15.17 8.83ZM18.4 6.8V3.6H17.6V6.8H18.4ZM18.28 8.28C18.2 8.36 18.1067 8.4 18 8.4C17.8933 8.4 17.8 8.36 17.72 8.28C17.64 8.2 17.6 8.10667 17.6 8C17.6 7.89333 17.64 7.8 17.72 7.72C17.8 7.64 17.8933 7.6 18 7.6C18.1067 7.6 18.2 7.64 18.28 7.72C18.36 7.8 18.4 7.89333 18.4 8C18.4 8.10667 18.36 8.2 18.28 8.28Z",fill:t})))}function ll(e){if(!e.visible||!e.config.visible)return null;const t=e.config.background;return T.default.createElement(P.Box,{style:Object.assign({backgroundColor:_.b.getColorValue(t.fillColor),borderWidth:t.strokeWidth,borderColor:_.b.getColorValue(t.strokeColor),display:"flex",alignItems:"center",flexDirection:"row",padding:"10px",borderRadius:"5px",alignSelf:"center",width:"calc(100% - 40px)",margin:10,maxWidth:"438px"},e.style)},T.default.createElement(ul,{config:e.config.icon}),T.default.createElement(N.a,{style:{marginLeft:"10px",fontSize:"14px",lineHeight:"16px",fontWeight:400},config:e.config.title}))}function dl(e){return T.default.createElement("img",{"data-sb-acknowledgment-image":!0,style:{display:"block",maxWidth:"90%",objectFit:"contain",flex:1,height:`calc(100 * ${R} - 78px - 52px - 20px)`,paddingTop:10},src:e.image,alt:""})}function ml(e){if(!e.visible)return null;const t=e.isQualityAcceptable;return T.default.createElement("div",{style:{display:"inherit",flexDirection:"inherit",justifyContent:"inherit",alignItems:"inherit",height:"100%",width:"100%"}},T.default.createElement(dl,{image:e.base64Image}),T.default.createElement(ll,{visible:!t,config:e.banner.config}),T.default.createElement(cl,{isQualityAcceptable:t,backgroundColor:e.bottomBar.backgroundColor,config:e.bottomBar.config,onRetake:e.bottomBar.onRetake,onAccept:e.bottomBar.onAccept}))}function hl(e){const t=_.b.getColorValue(e.config.checkMarkColor),n=_.b.getColorValue(e.config.checkMarkBackgroundColor);return T.default.createElement("svg",{"data-sb-acknowledgment-checkmark":!0,width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M71.2135 31.8234C72.376 32.9859 72.376 34.8984 71.2135 36.0609L43.0885 64.1859C42.5073 64.7672 41.7385 65.0672 40.9698 65.0672C40.201 65.0672 39.4323 64.7672 38.851 64.1859L24.7885 50.1234C23.626 48.9609 23.626 47.0484 24.7885 45.8859C25.951 44.7234 27.8635 44.7234 29.026 45.8859L40.9698 57.8297L66.976 31.8234C68.1385 30.6422 70.051 30.6422 71.2135 31.8234Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48 0C21.525 0 0 21.525 0 48C0 74.475 21.525 96 48 96C74.475 96 96 74.475 96 48C96 21.525 74.475 0 48 0ZM71.2135 36.0609C72.376 34.8984 72.376 32.9859 71.2135 31.8234C70.051 30.6422 68.1385 30.6422 66.976 31.8234L40.9698 57.8297L29.026 45.8859C27.8635 44.7234 25.951 44.7234 24.7885 45.8859C23.626 47.0484 23.626 48.9609 24.7885 50.1234L38.851 64.1859C39.4323 64.7672 40.201 65.0672 40.9698 65.0672C41.7385 65.0672 42.5073 64.7672 43.0885 64.1859L71.2135 36.0609Z",fill:n}))}function fl(e){if(!e.visible)return null;if("PageSnapFeedbackNone"===e.mode._type)return null;if("PageSnapFunnelAnimation"===e.mode._type)return T.default.createElement(dl,{image:e.base64Image});if("PageSnapCheckMarkAnimation"===e.mode._type)return T.default.createElement(hl,{config:e.mode});throw new Error(`Unknown PageSnapFeedbackMode: ${e.mode}`)}var pl=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function gl(e){const t=Nc(e.croppedDetectionResult);Object(T.useEffect)((()=>{(null===(null==t?void 0:t.value)||(null==t?void 0:t.error))&&e.onReject()}),[null==t?void 0:t.value,null==t?void 0:t.error]);const n=e.configuration.screens.camera.acknowledgement,i=e.configuration.screens.camera.captureFeedback,r=e.configuration.outputSettings,o=n.acknowledgementMode,[a,s]=T.default.useState(null),[c,u]=T.default.useState(null),l=T.default.useRef(null),d=null!==c,m=()=>"ALWAYS"===o||"NONE"!==o&&(!!d&&("BAD_QUALITY"===o&&!c)),h=t=>{setTimeout((()=>{f(),e.onAccept(t,l.current)}),1500)},f=()=>{s(null),u(null)},p={null:-1,VERY_POOR:0,POOR:1,REASONABLE:2,GOOD:3,EXCELLENT:4};let g;Object(T.useEffect)((()=>{var a;if(null==t?void 0:t.value){const c=t.value.value;let d=null!==(a=c.result.croppedImage)&&void 0!==a?a:c.originalImage;function m(){return pl(this,void 0,void 0,(function*(){if(null!==r.defaultFilter&&"FILTERED_DOCUMENT"===r.documentAnalysisMode){const t=yield e.sdk.createImageProcessor();d=(yield t.applyFilter(d,r.defaultFilter,"COPY_IMAGE")).result}if("PageSnapFunnelAnimation"===i.snapFeedbackMode._type||"ALWAYS"===o||"BAD_QUALITY"===o){const t=yield e.sdk.imageToJpeg(d),n=yield b.toBase64(t,!1);s(n)}if("NONE"===o)return u(!0),void h(t.value);if(null===c.result.croppedImage)return void u(!1);const a=new Jh.Config.DocumentQualityAnalyzerConfiguration,m=yield e.sdk.createDocumentQualityAnalyzer(a),f=yield m.run(d);l.current=f.result.quality,yield m.destroy();const g=p[f.result.quality]>=p[n.minimumQuality];u(g),g&&"BAD_QUALITY"===o&&h(t.value)}))}return m(),()=>{f()}}}),[null==t?void 0:t.value]),g=m()?n.backgroundColor:"PageSnapFeedbackNone"===i.snapFeedbackMode._type?"transparent":i.snapFeedbackMode.overlayColor,g=_.b.getColorValue(g);const v=i.cameraBlinkEnabled?wu:"0s";return T.default.createElement(L.a,{open:e.visible},T.default.createElement(P.Fade,{tabIndex:-1,"data-sb-screen-acknowledgment":!0,in:e.visible,timeout:250,style:{position:"absolute",width:"100vw",height:`calc(100 * ${R})`,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",transitionDelay:e.visible?v:"0s"}},T.default.createElement(P.Box,{style:{display:e.visible?"flex":"none",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:g,zIndex:1e3}},T.default.createElement(fl,{visible:!m()&&d,base64Image:a,mode:i.snapFeedbackMode}),T.default.createElement(ml,{visible:m(),isQualityAcceptable:c,base64Image:a,banner:{config:n.badImageHint},bottomBar:{backgroundColor:e.configuration.appearance.bottomBarBackgroundColor,config:n.bottomBar,onRetake:()=>{f(),e.onReject()},onAccept:()=>{f(),e.onAccept(null==t?void 0:t.value,l.current)}}}))))}function vl(e){const t=e.config.screens.review,[n,i]=T.default.useState(null);return T.default.createElement(T.default.Fragment,null,T.default.createElement(iu,{backgroundColor:_.b.getColorValue(e.config.appearance.topBarBackgroundColor),leftContent:T.default.createElement(G,{disabled:!e.buttonsEnabled,onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:T.default.createElement(L.a,{sx:{fontSize:24}}),debugName:"close-review-screen"}),centerTitle:t.topBarTitle,centerTitleReplacementArgs:[`${e.numPages}`],rightContent:T.default.createElement(T.default.Fragment,null,T.default.createElement(G,{disabled:!e.buttonsEnabled,onClick:e=>i(e.currentTarget),visible:t.topBarMoreButton.visible,text:"",background:new ne.a({strokeColor:"transparent",fillColor:"transparent",strokeWidth:0}),foreground:new ne.g({color:t.topBarMoreButton.color,iconVisible:!0}),icon:T.default.createElement(L.a,{sx:{fontSize:24}}),debugName:"more",id:"sb-button-review-more",ariaLabel:_.b.getLocalizedText(t.topBarMoreButton.accessibilityDescription)}),T.default.createElement(P.Menu,{anchorEl:n,open:null!==n,onClose:()=>i(null),MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:_.b.getColorValue(t.morePopup.backgroundColor)}}}},T.default.createElement(ou,{disabled:!1,autoFocus:!0,ariaLabel:t.morePopup.deleteAll.accessibilityDescription,onClick:()=>{i(null),e.onDeleteButtonClick()},textColor:t.morePopup.deleteAll.title.color},T.default.createElement(L.a,{sx:{color:_.b.getColorValue(t.morePopup.deleteAll.icon.color),visibility:t.morePopup.deleteAll.icon.visible?"visible":"hidden"}}),T.default.createElement(N.a,{config:t.morePopup.deleteAll.title,style:{marginLeft:8}}))))}))}function yl(e){const t=_.b.getColorValue(e.color);return T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M6 22C5.45 22 4.97917 21.8042 4.5875 21.4125C4.19583 21.0208 4 20.55 4 20V4C4 3.45 4.19583 2.97917 4.5875 2.5875C4.97917 2.19583 5.45 2 6 2H14L20 8V12.35C19.6833 12.2333 19.3583 12.1458 19.025 12.0875C18.6917 12.0292 18.35 12 18 12V9H13V4H6V20H12.35C12.4833 20.3833 12.65 20.7417 12.85 21.075C13.05 21.4083 13.2833 21.7167 13.55 22H6Z",fill:t}),T.default.createElement("path",{d:"M16.8624 19V22H18.8624V19H21.8624V17H18.8624V14H16.8624V17H13.8624V19H16.8624Z",fill:t}))}function Cl(e){const t=_.b.getColorValue(e.color);return T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("mask",{id:"mask0_856_1229",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},T.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),T.default.createElement("g",{mask:"url(#mask0_856_1229)"},T.default.createElement("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:t})))}function bl(){return Cc("tablet")?80:160}function Al(e){const t=Cc("tablet"),n=e.config.screens.review,i=T.default.createElement(T.default.Fragment,null,T.default.createElement(W,{style:{height:42,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,textTransform:"none",padding:"0 20px",width:"100%"},polygonConfig:Object.assign(Object.assign({},n.bottomBar.submitButton.background),{cornerRadius:4})},T.default.createElement(N.a,{config:{text:_.b.getLocalizedText(n.bottomBar.submitButton.text),visible:!0,color:n.bottomBar.submitButton.foreground.color,useShadow:n.bottomBar.submitButton.foreground.useShadow}}))),r=Object.assign(Object.assign({padding:"4px"},z(n.bottomBar.submitButton.background.fillColor)),{"& span":{transition:"transform 0.3s !important"},"&:hover span":{transform:"translateX(6px) !important"},"& > div, &":{transition:"border-radius 0.3s !important"},"&:hover > div, &:hover":{borderRadius:"0px !important"}});return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:bl(),width:"100%"}},T.default.createElement(P.Box,{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:t?"space-between":"center",height:80}},t&&T.default.createElement(P.Box,{visibility:"hidden"}),T.default.createElement(P.Box,{style:{display:"flex",flexDirection:"row",maxWidth:"600px",justifyContent:"space-around",flexGrow:1}},T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.addButton,icon:yl,onClick:e.onAddPageClick,debugName:"add-page"}),T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.retakeButton,icon:sl,onClick:e.onRetakeClick,debugName:"retake"}),T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.cropButton,icon:e=>T.default.createElement(L.a,{sx:{color:e}}),onClick:e.onCropClick,debugName:"crop-button"}),T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.rotateButton,icon:e=>T.default.createElement(L.a,{sx:{color:e}}),onClick:e.onRotateClick,debugName:"rotate-button"}),T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.deleteButton,icon:Cl,onClick:e.onDeleteClick,debugName:"delete-button"})),t&&T.default.createElement(P.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":_.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:172,marginX:"4px"},r),onClick:e.onSubmitClick},i)),!t&&T.default.createElement(P.Box,{style:{padding:"12px",display:"flex"}},T.default.createElement(P.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":_.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:600,margin:"0 auto"},r),onClick:e.onSubmitClick},i))))}function Sl(e){const t=e.config.pageCounter;return T.default.createElement(P.Box,{style:{display:"flex",width:"100%",backgroundColor:_.b.getColorValue(e.config.backgroundColor),justifyContent:"space-between",alignItems:"end",padding:"16px 0"}},T.default.createElement(P.Box,{style:{width:72,height:20}}),T.default.createElement(P.Box,null,T.default.createElement(W,{polygonConfig:{strokeColor:t.background.strokeColor,fillColor:t.background.fillColor,strokeWidth:t.background.strokeWidth,cornerRadius:4},style:{visibility:t.visible?"visible":"hidden"}},T.default.createElement(N.a,{config:t.title,replacementArgs:[`${e.currentPage}`,`${e.totalNumPages}`],style:{fontSize:14,padding:"8px 12px"}}))),T.default.createElement(P.Box,null,T.default.createElement(P.IconButton,{onClick:e.onZoomButtonClick,"aria-label":_.b.getLocalizedText(e.config.zoomButton.accessibilityDescription),sx:Object.assign({backgroundColor:_.b.getColorValue(e.config.zoomButton.backgroundColor),color:_.b.getColorValue(e.config.zoomButton.foregroundColor),margin:"0 16px",visibility:e.config.zoomButton.visible?"visible":"hidden","&:hover":{backgroundColor:_.b.getColorValue(e.config.zoomButton.activeBackgroundColor),color:_.b.getColorValue(e.config.zoomButton.activeForegroundColor)}},z(e.config.zoomButton.foregroundColor))},T.default.createElement(L.a,null))))}function wl(){return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M5.6236 27.7347C2.97532 25.2802 1.23517 22.0019 0.686077 18.4331C0.136983 14.8642 0.811227 11.2145 2.59919 8.0774C4.38716 4.94028 7.1837 2.50018 10.5342 1.15382C13.8847 -0.192539 17.592 -0.365996 21.0536 0.661651L20.0518 4.03609C17.3518 3.23452 14.46 3.36982 11.8467 4.41998C9.23329 5.47014 7.05198 7.37342 5.65737 9.82037C4.26276 12.2673 3.73685 15.1141 4.16514 17.8978C4.59343 20.6815 5.95075 23.2385 8.01641 25.1531L5.6236 27.7347Z",fill:"black",fillOpacity:"0.15"},T.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 16.5 16",from:"360 16.5 16",dur:"2s",begin:"0s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M16.5 1.76C16.5 0.787979 17.2903 -0.0100083 18.2565 0.0967004C20.3808 0.331329 22.4428 0.989952 24.3179 2.04006C26.7065 3.37771 28.7119 5.30584 30.1422 7.64002C31.5726 9.9742 32.3802 12.6364 32.4877 15.3718C32.5951 18.1073 31.9989 20.8246 30.7561 23.2638C29.5133 25.7031 27.6654 27.7826 25.3891 29.3035C23.1129 30.8244 20.4845 31.7359 17.7553 31.9507C15.0262 32.1655 12.2876 31.6764 9.80145 30.5303C7.84973 29.6305 6.10487 28.3495 4.6664 26.7687C4.01218 26.0498 4.19322 24.9414 4.9796 24.3701C5.76598 23.7987 6.85859 23.9836 7.5348 24.6819C8.60362 25.7856 9.87071 26.6862 11.2751 27.3336C13.2143 28.2276 15.3504 28.6091 17.4792 28.4415C19.6079 28.274 21.6581 27.5631 23.4335 26.3767C25.209 25.1904 26.6503 23.5684 27.6198 21.6658C28.5892 19.7632 29.0542 17.6437 28.9704 15.51C28.8865 13.3764 28.2567 11.2999 27.1409 9.47922C26.0252 7.65856 24.4611 6.15461 22.598 5.11125C21.2487 4.35561 19.7753 3.85986 18.2542 3.6439C17.2918 3.50727 16.5 2.73202 16.5 1.76Z",fill:"black"},T.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 16.5 16",from:"360 16.5 16",dur:"2s",begin:"0s",repeatCount:"indefinite"}))))}function El(e){return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Dialog,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},slotProps:{backdrop:{style:{backgroundColor:"transparent"}}},open:e.open,transitionDuration:100},T.default.createElement(P.Box,{"data-sb-loading-spinner":!0,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-busy":open?"true":"false",style:{backgroundColor:"#EFEFEF",border:"1px solid #CCC",borderRadius:"4px",height:65,width:65,display:"flex",alignItems:"center",justifyContent:"center"}},T.default.createElement(wl,null))))}function Dl(e){const t=e.config.visible&&e.active;return T.default.createElement(T.default.Fragment,null,T.default.createElement("div",{style:{width:"40px"}},T.default.createElement(P.Button,{[`data-sb-button-${e.debugName}`]:!0,sx:Object.assign({color:_.b.getColorValue(e.config.color),minWidth:"auto",visibility:t?"visible":"hidden",paddingX:"4px",marginX:"4px"},j(e.config.color)),onClick:e.onClick,"aria-label":_.b.getLocalizedText(e.config.accessibilityDescription)},T.default.createElement(e.icon,null))))}var xl=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function Bl(e){var t,n;const i=Nc(e.page.finalImageUrl()),[r,o]=T.default.useState(null),[a,s]=T.default.useState(!1);Object(T.useEffect)((()=>{(()=>{xl(this,void 0,void 0,(function*(){!e.animateRotation&&i.value&&(yield new Promise((e=>{const t=document.createElement("img");t.onload=e,t.src=i.value})),o(i.value),s(!1)),e.animateRotation&&s(!0)}))})()}),[i.value,e.animateRotation]);const c=T.default.useRef(null),u=(()=>{const e=c.current;if(a&&e){const t=e.parentElement;let n;if([e.clientHeight,e.clientWidth,t.clientHeight,e.clientHeight].some((e=>0===e)))n=1;else{const i=1/(e.clientWidth/e.clientHeight),r=t.clientWidth/t.clientHeight;n=t.clientHeight>e.naturalWidth&&t.clientWidth>e.naturalHeight?Math.max(e.naturalHeight/t.clientHeight,1):i<r?t.clientHeight/e.clientWidth:t.clientWidth/e.clientHeight}return{transform:`rotate(90deg) scale(${n})`,transition:"transform 0.5s"}}return{transform:"none",transition:"none"}})();return null===r&&null!==e.onAnimateRotationDone.current?(null===(n=(t=e.onAnimateRotationDone).current)||void 0===n||n.call(t),null):T.default.createElement(T.default.Fragment,null,r&&T.default.createElement("img",{"data-sb-carousel-page":!0,ref:c,onTransitionEnd:()=>{var t,n;return null===(n=(t=e.onAnimateRotationDone).current)||void 0===n?void 0:n.call(t)},style:Object.assign(Object.assign({},e.style),u),src:r,alt:`Page ${e.index}`}))}function Il(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function Tl(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&n.every((n=>{const i=e[n],r=t[n];return"function"==typeof i?`${i}`==`${r}`:Il(i)&&Il(r)?Tl(i,r):i===r}))}function Ol(e){return e.concat().sort(((e,t)=>e.name>t.name?1:-1)).map((e=>e.options))}function kl(e){return"number"==typeof e}function Pl(e){return"string"==typeof e}function Ll(e){return"boolean"==typeof e}function _l(e){return"[object Object]"===Object.prototype.toString.call(e)}function Rl(e){return Math.abs(e)}function Ml(e){return Math.sign(e)}function Fl(e,t){return Rl(e-t)}function Nl(e){return Hl(e).map(Number)}function Vl(e){return e[Wl(e)]}function Wl(e){return Math.max(0,e.length-1)}function jl(e,t){return t===Wl(e)}function zl(e,t=0){return Array.from(Array(e),((e,n)=>t+n))}function Hl(e){return Object.keys(e)}function Ul(e,t){return[e,t].reduce(((e,t)=>(Hl(t).forEach((n=>{const i=e[n],r=t[n],o=_l(i)&&_l(r);e[n]=o?Ul(i,r):r})),e)),{})}function Zl(e,t){return"undefined"!=typeof t.MouseEvent&&e instanceof t.MouseEvent}function Gl(){let e=[];const t={add:function(n,i,r,o={passive:!0}){let a;if("addEventListener"in n)n.addEventListener(i,r,o),a=()=>n.removeEventListener(i,r,o);else{const e=n;e.addListener(r),a=()=>e.removeListener(r)}return e.push(a),t},clear:function(){e=e.filter((e=>e()))}};return t}function Yl(e,t,n,i){const r=Gl(),o=1e3/60;let a=null,s=0,c=0;function u(e){if(!c)return;a||(a=e);const r=e-a;for(a=e,s+=r;s>=o;)n(o),s-=o;i(s/o),c&&t.requestAnimationFrame(u)}function l(){t.cancelAnimationFrame(c),a=null,s=0,c=0}return{init:function(){r.add(e,"visibilitychange",(()=>{e.hidden&&(a=null,s=0)}))},destroy:function(){l(),r.clear()},start:function(){c||(c=t.requestAnimationFrame(u))},stop:l,update:()=>n(o),render:i}}function Ql(e=0,t=0){const n=Rl(e-t);function i(t){return t<e}function r(e){return e>t}function o(e){return i(e)||r(e)}return{length:n,max:t,min:e,constrain:function(n){return o(n)?i(n)?e:t:n},reachedAny:o,reachedMax:r,reachedMin:i,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}}}function ql(e,t,n){const{constrain:i}=Ql(0,e),r=e+1;let o=a(t);function a(e){return n?Rl((r+e)%r):i(e)}function s(){return o}function c(){return ql(e,s(),n)}const u={get:s,set:function(e){return o=a(e),u},add:function(e){return c().set(s()+e)},clone:c};return u}function Xl(e,t,n,i,r,o,a,s,c,u,l,d,m,h,f,p,g,v,y){const{cross:C,direction:b}=e,A=["INPUT","SELECT","TEXTAREA"],S={passive:!1},w=Gl(),E=Gl(),D=Ql(50,225).constrain(h.measure(20)),x={mouse:300,touch:400},B={mouse:500,touch:600},I=f?43:25;let T=!1,O=0,k=0,P=!1,L=!1,_=!1,R=!1;function M(e){if(!Zl(e,i)&&e.touches.length>=2)return F(e);const t=o.readPoint(e),n=o.readPoint(e,C),a=Fl(t,O),c=Fl(n,k);if(!L&&!R){if(!e.cancelable)return F(e);if(L=a>c,!L)return F(e)}const l=o.pointerMove(e);a>p&&(_=!0),u.useFriction(.3).useDuration(.75),s.start(),r.add(b(l)),e.preventDefault()}function F(e){const t=l.byDistance(0,!1).index!==d.get(),n=o.pointerUp(e)*(f?B:x)[R?"mouse":"touch"],i=function(e,t){const n=d.add(-1*Ml(e)),i=l.byDistance(e,!f).distance;return f||Rl(e)<D?i:g&&t?.5*i:l.byIndex(n.get(),0).distance}(b(n),t),r=function(e,t){if(0===e||0===t)return 0;if(Rl(e)<=Rl(t))return 0;const n=Fl(Rl(e),Rl(t));return Rl(n/e)}(n,i),a=I-10*r,s=v+r/50;L=!1,P=!1,E.clear(),u.useDuration(a).useFriction(s),c.distance(i,!f),R=!1,m.emit("pointerUp")}function N(e){_&&(e.stopPropagation(),e.preventDefault(),_=!1)}return{init:function(e){if(!y)return;function s(s){(Ll(y)||y(e,s))&&function(e){const s=Zl(e,i);if(R=s,_=f&&s&&!e.buttons&&T,T=Fl(r.get(),a.get())>=2,s&&0!==e.button)return;if(function(e){const t=e.nodeName||"";return A.includes(t)}(e.target))return;P=!0,o.pointerDown(e),u.useFriction(0).useDuration(0),r.set(a),function(){const e=R?n:t;E.add(e,"touchmove",M,S).add(e,"touchend",F).add(e,"mousemove",M,S).add(e,"mouseup",F)}(),O=o.readPoint(e),k=o.readPoint(e,C),m.emit("pointerDown")}(s)}const c=t;w.add(c,"dragstart",(e=>e.preventDefault()),S).add(c,"touchmove",(()=>{}),S).add(c,"touchend",(()=>{})).add(c,"touchstart",s).add(c,"mousedown",s).add(c,"touchcancel",F).add(c,"contextmenu",F).add(c,"click",N,!0)},destroy:function(){w.clear(),E.clear()},pointerDown:function(){return P}}}function Kl(e,t){let n,i;function r(e){return e.timeStamp}function o(n,i){const r="client"+("x"===(i||e.scroll)?"X":"Y");return(Zl(n,t)?n:n.touches[0])[r]}return{pointerDown:function(e){return n=e,i=e,o(e)},pointerMove:function(e){const t=o(e)-o(i),a=r(e)-r(n)>170;return i=e,a&&(n=e),t},pointerUp:function(e){if(!n||!i)return 0;const t=o(i)-o(n),a=r(e)-r(n),s=r(e)-r(i)>170,c=t/a;return a&&!s&&Rl(c)>.1?c:0},readPoint:o}}function Jl(e,t,n,i,r,o,a){const s=[e].concat(i);let c,u,l=[],d=!1;function m(e){return r.measureSize(a.measure(e))}return{init:function(r){o&&(u=m(e),l=i.map(m),c=new ResizeObserver((n=>{(Ll(o)||o(r,n))&&function(n){for(const o of n){if(d)return;const n=o.target===e,a=i.indexOf(o.target),s=n?u:l[a];if(Rl(m(n?e:i[a])-s)>=.5){r.reInit(),t.emit("resize");break}}}(n)})),n.requestAnimationFrame((()=>{s.forEach((e=>c.observe(e)))})))},destroy:function(){d=!0,c&&c.disconnect()}}}function $l(e,t,n,i,r){const o=r.measure(10),a=r.measure(50),s=Ql(.1,.99);let c=!1;function u(){return!c&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:u,constrain:function(r){if(!u())return;const c=e.reachedMin(t.get())?"min":"max",l=Rl(e[c]-t.get()),d=n.get()-t.get(),m=s.constrain(l/a);n.subtract(d*m),!r&&Rl(d)<o&&(n.set(e.constrain(n.get())),i.useDuration(25).useBaseFriction())},toggleActive:function(e){c=!e}}}function ed(e,t,n,i){const r=t.min+.1,o=t.max+.1,{reachedMin:a,reachedMax:s}=Ql(r,o);return{loop:function(t){if(!function(e){return 1===e?s(n.get()):-1===e&&a(n.get())}(t))return;const r=e*(-1*t);i.forEach((e=>e.add(r)))}}}function td(e,t,n,i,r){const{reachedAny:o,removeOffset:a,constrain:s}=i;function c(e){return e.concat().sort(((e,t)=>Rl(e)-Rl(t)))[0]}function u(t,i){const r=[t,t+n,t-n];if(!e)return t;if(!i)return c(r);const o=r.filter((e=>Ml(e)===i));return o.length?c(o):Vl(r)-n}const l={byDistance:function(n,i){const c=r.get()+n,{index:l,distance:d}=function(n){const i=e?a(n):s(n),r=t.map(((e,t)=>({diff:u(e-i,0),index:t}))).sort(((e,t)=>Rl(e.diff)-Rl(t.diff))),{index:o}=r[0];return{index:o,distance:i}}(c),m=!e&&o(c);return!i||m?{index:l,distance:n}:{index:l,distance:n+u(t[l]-d,0)}},byIndex:function(e,n){return{index:e,distance:u(t[e]-r.get(),n)}},shortcut:u};return l}function nd(e,t,n,i,r,o,a,s){const c={passive:!0,capture:!0};let u=0;function l(e){"Tab"===e.code&&(u=(new Date).getTime())}return{init:function(d){s&&(o.add(document,"keydown",l,!1),t.forEach(((t,l)=>{o.add(t,"focus",(t=>{(Ll(s)||s(d,t))&&function(t){if((new Date).getTime()-u>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const o=n.findIndex((e=>e.includes(t)));kl(o)&&(r.useDuration(0),i.index(o,0),a.emit("slideFocus"))}(l)}),c)})))}}}function id(e){let t=e;function n(e){return kl(e)?e:e.get()}return{get:function(){return t},set:function(e){t=n(e)},add:function(e){t+=n(e)},subtract:function(e){t-=n(e)}}}function rd(e,t){const n="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},i=t.style;let r=!1;return{clear:function(){r||(i.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){r||(i.transform=n(e.direction(t)))},toggleActive:function(e){r=!e}}}function od(e,t,n,i,r,o,a,s,c){const u=Nl(r),l=Nl(r).reverse(),d=function(){const e=a[0];return f(h(l,e),n,!1)}().concat(function(){const e=t-a[0]-1;return f(h(u,e),-n,!0)}());function m(e,t){return e.reduce(((e,t)=>e-r[t]),t)}function h(e,t){return e.reduce(((e,n)=>m(e,t)>0?e.concat([n]):e),[])}function f(r,a,u){const l=function(e){return o.map(((n,r)=>({start:n-i[r]+.5+e,end:n+t-.5+e})))}(a);return r.map((t=>{const i=u?0:-n,r=u?n:0,o=u?"end":"start",a=l[t][o];return{index:t,loopPoint:a,slideLocation:id(-1),translate:rd(e,c[t]),target:()=>s.get()>a?i:r}}))}return{canLoop:function(){return d.every((({index:e})=>m(u.filter((t=>t!==e)),t)<=.1))},clear:function(){d.forEach((e=>e.translate.clear()))},loop:function(){d.forEach((e=>{const{target:t,translate:n,slideLocation:i}=e,r=t();r!==i.get()&&(n.to(r),i.set(r))}))},loopPoints:d}}function ad(e,t,n){let i,r=!1;return{init:function(o){n&&(i=new MutationObserver((e=>{r||(Ll(n)||n(o,e))&&function(e){for(const n of e)if("childList"===n.type){o.reInit(),t.emit("slidesChanged");break}}(e)})),i.observe(e,{childList:!0}))},destroy:function(){i&&i.disconnect(),r=!0}}}function sd(e,t,n,i){const r={};let o,a=null,s=null,c=!1;return{init:function(){o=new IntersectionObserver((e=>{c||(e.forEach((e=>{const n=t.indexOf(e.target);r[n]=e})),a=null,s=null,n.emit("slidesInView"))}),{root:e.parentElement,threshold:i}),t.forEach((e=>o.observe(e)))},destroy:function(){o&&o.disconnect(),c=!0},get:function(e=!0){if(e&&a)return a;if(!e&&s)return s;const t=function(e){return Hl(r).reduce(((t,n)=>{const i=parseInt(n),{isIntersecting:o}=r[i];return(e&&o||!e&&!o)&&t.push(i),t}),[])}(e);return e&&(a=t),e||(s=t),t}}}function cd(e,t,n,i,r,o,a,s,c){const{startEdge:u,endEdge:l,direction:d}=e,m=kl(n);return{groupSlides:function(e){return m?function(e,t){return Nl(e).filter((e=>e%t==0)).map((n=>e.slice(n,n+t)))}(e,n):function(e){return e.length?Nl(e).reduce(((n,m,h)=>{const f=Vl(n)||0,p=0===f,g=m===Wl(e),v=r[u]-o[f][u],y=r[u]-o[m][l],C=!i&&p?d(a):0,b=Rl(y-(!i&&g?d(s):0)-(v+C));return h&&b>t+c&&n.push(m),g&&n.push(e.length),n}),[]).map(((t,n,i)=>{const r=Math.max(i[n-1]||0);return e.slice(r,t)})):[]}(e)}}}function ud(e,t,n,i,r,o,a){const{align:s,axis:c,direction:u,startIndex:l,loop:d,duration:m,dragFree:h,dragThreshold:f,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:y,watchResize:C,watchSlides:b,watchDrag:A,watchFocus:S}=o,w={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:i,offsetHeight:r}=e;return{top:t,right:n+i,bottom:t+r,left:n,width:i,height:r}}},E=w.measure(t),D=n.map(w.measure),x=function(e,t){const n="rtl"===t,i="y"===e,r=!i&&n?-1:1;return{scroll:i?"y":"x",cross:i?"x":"y",startEdge:i?"top":n?"right":"left",endEdge:i?"bottom":n?"left":"right",measureSize:function(e){const{height:t,width:n}=e;return i?t:n},direction:function(e){return e*r}}}(c,u),B=x.measureSize(E),I=function(e){return{measure:function(t){return e*(t/100)}}}(B),T=function(e,t){const n={start:function(){return 0},center:function(e){return i(e)/2},end:i};function i(e){return t-e}return{measure:function(i,r){return Pl(e)?n[e](i):e(t,i,r)}}}(s,B),O=!d&&!!y,k=d||!!y,{slideSizes:P,slideSizesWithGaps:L,startGap:_,endGap:R}=function(e,t,n,i,r,o){const{measureSize:a,startEdge:s,endEdge:c}=e,u=n[0]&&r,l=function(){if(!u)return 0;const e=n[0];return Rl(t[s]-e[s])}(),d=function(){if(!u)return 0;const e=o.getComputedStyle(Vl(i));return parseFloat(e.getPropertyValue(`margin-${c}`))}(),m=n.map(a),h=n.map(((e,t,n)=>{const i=!t,r=jl(n,t);return i?m[t]+l:r?m[t]+d:n[t+1][s]-e[s]})).map(Rl);return{slideSizes:m,slideSizesWithGaps:h,startGap:l,endGap:d}}(x,E,D,n,k,r),M=cd(x,B,g,d,E,D,_,R,2),{snaps:F,snapsAligned:N}=function(e,t,n,i,r){const{startEdge:o,endEdge:a}=e,{groupSlides:s}=r,c=s(i).map((e=>Vl(e)[a]-e[0][o])).map(Rl).map(t.measure),u=i.map((e=>n[o]-e[o])).map((e=>-Rl(e))),l=s(u).map((e=>e[0])).map(((e,t)=>e+c[t]));return{snaps:u,snapsAligned:l}}(x,T,E,D,M),V=-Vl(F)+Vl(L),{snapsContained:W,scrollContainLimit:j}=function(e,t,n,i,r){const o=Ql(-t+e,0),a=n.map(((e,t)=>{const{min:i,max:r}=o,a=o.constrain(e),s=!t,u=jl(n,t);return s?r:u||c(i,a)?i:c(r,a)?r:a})).map((e=>parseFloat(e.toFixed(3)))),s=function(){const e=a[0],t=Vl(a);return Ql(a.lastIndexOf(e),a.indexOf(t)+1)}();function c(e,t){return Fl(e,t)<1}return{snapsContained:function(){if(t<=e+r)return[o.max];if("keepSnaps"===i)return a;const{min:n,max:c}=s;return a.slice(n,c)}(),scrollContainLimit:s}}(B,V,N,y,2),z=O?W:N,{limit:H}=function(e,t,n){const i=t[0];return{limit:Ql(n?i-e:Vl(t),i)}}(V,z,d),U=ql(Wl(z),l,d),Z=U.clone(),G=Nl(n),Y=Yl(i,r,(e=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:i}},r)=>{i||n.constrain(e.pointerDown()),t.seek(r)})(se,e)),(e=>(({scrollBody:e,translate:t,location:n,offsetLocation:i,scrollLooper:r,slideLooper:o,dragHandler:a,animation:s,eventHandler:c,scrollBounds:u,options:{loop:l}},d)=>{const m=e.settled(),h=!u.shouldConstrain(),f=l?m:m&&h;f&&!a.pointerDown()&&(s.stop(),c.emit("settle")),f||c.emit("scroll");const p=n.get()*d+X.get()*(1-d);i.set(p),l&&(r.loop(e.direction()),o.loop()),t.to(i.get())})(se,e))),Q=z[U.get()],q=id(Q),X=id(Q),K=id(Q),J=id(Q),$=function(e,t,n,i,r,o){let a=0,s=0,c=r,u=o,l=e.get(),d=0;function m(e){return c=e,f}function h(e){return u=e,f}const f={direction:function(){return s},duration:function(){return c},velocity:function(){return a},seek:function(t){const r=t/1e3,o=c*r,m=i.get()-e.get();let h=0;return c?(n.set(e),a+=m/o,a*=u,l+=a,e.add(a*r),h=l-d):(a=0,n.set(i),e.set(i),h=m),s=Ml(h),d=l,f},settled:function(){return Rl(i.get()-t.get())<.001},useBaseFriction:function(){return h(o)},useBaseDuration:function(){return m(r)},useFriction:h,useDuration:m};return f}(q,K,X,J,m,.68),ee=td(d,z,V,H,J),te=function(e,t,n,i,r,o,a){function s(r){const s=r.distance,c=r.index!==t.get();o.add(s),s&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),c&&(n.set(t.get()),t.set(r.index),a.emit("select"))}return{distance:function(e,t){s(r.byDistance(e,t))},index:function(e,n){const i=t.clone().set(e);s(r.byIndex(i.get(),n))}}}(Y,U,Z,$,ee,J,a),ne=function(e){const{max:t,length:n}=e;return{get:function(e){return n?(e-t)/-n:0}}}(H),ie=Gl(),re=sd(t,n,a,p),{slideRegistry:oe}=function(e,t,n,i,r,o){const{groupSlides:a}=r,{min:s,max:c}=i;return{slideRegistry:function(){const i=a(o),r=!e||"keepSnaps"===t;return 1===n.length?[o]:r?i:i.slice(s,c).map(((e,t,n)=>{const i=!t,r=jl(n,t);return i?zl(Vl(n[0])+1):r?zl(Wl(o)-Vl(n)[0]+1,Vl(n)[0]):e}))}()}}(O,y,z,j,M,G),ae=nd(e,n,oe,te,$,ie,a,S),se={ownerDocument:i,ownerWindow:r,eventHandler:a,containerRect:E,slideRects:D,animation:Y,axis:x,dragHandler:Xl(x,e,i,r,J,Kl(x,r),q,Y,te,$,ee,U,a,I,h,f,v,.68,A),eventStore:ie,percentOfView:I,index:U,indexPrevious:Z,limit:H,location:q,offsetLocation:K,previousLocation:X,options:o,resizeHandler:Jl(t,a,r,n,x,C,w),scrollBody:$,scrollBounds:$l(H,K,J,$,I),scrollLooper:ed(V,H,K,[q,K,X,J]),scrollProgress:ne,scrollSnapList:z.map(ne.get),scrollSnaps:z,scrollTarget:ee,scrollTo:te,slideLooper:od(x,B,V,P,L,F,z,K,n),slideFocus:ae,slidesHandler:ad(t,a,b),slidesInView:re,slideIndexes:G,slideRegistry:oe,slidesToScroll:M,target:J,translate:rd(x,t)};return se}const ld={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function dd(e){function t(e,t){return Ul(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const i=n.breakpoints||{},r=Hl(i).filter((t=>e.matchMedia(t).matches)).map((e=>i[e])).reduce(((e,n)=>t(e,n)),{});return t(n,r)},optionsMediaQueries:function(t){return t.map((e=>Hl(e.breakpoints||{}))).reduce(((e,t)=>e.concat(t)),[]).map(e.matchMedia)}};return n}function md(e,t,n){const i=e.ownerDocument,r=i.defaultView,o=dd(r),a=function(e){let t=[];return{init:function(n,i){return t=i.filter((({options:t})=>!1!==e.optionsAtMedia(t).active)),t.forEach((t=>t.init(n,e))),i.reduce(((e,t)=>Object.assign(e,{[t.name]:t})),{})},destroy:function(){t=t.filter((e=>e.destroy()))}}}(o),s=Gl(),c=function(){let e,t={};function n(e){return t[e]||[]}const i={init:function(t){e=t},emit:function(t){return n(t).forEach((n=>n(e,t))),i},off:function(e,r){return t[e]=n(e).filter((e=>e!==r)),i},on:function(e,r){return t[e]=n(e).concat([r]),i},clear:function(){t={}}};return i}(),{mergeOptions:u,optionsAtMedia:l,optionsMediaQueries:d}=o,{on:m,off:h,emit:f}=c,p=x;let g,v,y,C,b=!1,A=u(ld,md.globalOptions),S=u(A),w=[];function E(t){const n=ud(e,y,C,i,r,t,c);if(t.loop&&!n.slideLooper.canLoop()){return E(Object.assign({},t,{loop:!1}))}return n}function D(t,n){b||(A=u(A,t),S=l(A),w=n||w,function(){const{container:t,slides:n}=S,i=Pl(t)?e.querySelector(t):t;y=i||e.children[0];const r=Pl(n)?y.querySelectorAll(n):n;C=[].slice.call(r||y.children)}(),g=E(S),d([A,...w.map((({options:e})=>e))]).forEach((e=>s.add(e,"change",x))),S.active&&(g.translate.to(g.location.get()),g.animation.init(),g.slidesInView.init(),g.slideFocus.init(O),g.eventHandler.init(O),g.resizeHandler.init(O),g.slidesHandler.init(O),g.options.loop&&g.slideLooper.loop(),y.offsetParent&&C.length&&g.dragHandler.init(O),v=a.init(O,w)))}function x(e,t){const n=T();B(),D(u({startIndex:n},e),t),c.emit("reInit")}function B(){g.dragHandler.destroy(),g.eventStore.clear(),g.translate.clear(),g.slideLooper.clear(),g.resizeHandler.destroy(),g.slidesHandler.destroy(),g.slidesInView.destroy(),g.animation.destroy(),a.destroy(),s.clear()}function I(e,t,n){S.active&&!b&&(g.scrollBody.useBaseFriction().useDuration(!0===t?0:S.duration),g.scrollTo.index(e,n||0))}function T(){return g.index.get()}const O={canScrollNext:function(){return g.index.add(1).get()!==T()},canScrollPrev:function(){return g.index.add(-1).get()!==T()},containerNode:function(){return y},internalEngine:function(){return g},destroy:function(){b||(b=!0,s.clear(),B(),c.emit("destroy"),c.clear())},off:h,on:m,emit:f,plugins:function(){return v},previousScrollSnap:function(){return g.indexPrevious.get()},reInit:p,rootNode:function(){return e},scrollNext:function(e){I(g.index.add(1).get(),e,-1)},scrollPrev:function(e){I(g.index.add(-1).get(),e,1)},scrollProgress:function(){return g.scrollProgress.get(g.location.get())},scrollSnapList:function(){return g.scrollSnapList},scrollTo:I,selectedScrollSnap:T,slideNodes:function(){return C},slidesInView:function(){return g.slidesInView.get()},slidesNotInView:function(){return g.slidesInView.get(!1)}};return D(t,n),setTimeout((()=>c.emit("init")),0),O}function hd(e={},t=[]){const n=Object(T.useRef)(e),i=Object(T.useRef)(t),[r,o]=Object(T.useState)(),[a,s]=Object(T.useState)(),c=Object(T.useCallback)((()=>{r&&r.reInit(n.current,i.current)}),[r]);return Object(T.useEffect)((()=>{Tl(n.current,e)||(n.current=e,c())}),[e,c]),Object(T.useEffect)((()=>{(function(e,t){if(e.length!==t.length)return!1;const n=Ol(e),i=Ol(t);return n.every(((e,t)=>Tl(e,i[t])))})(i.current,t)||(i.current=t,c())}),[t,c]),Object(T.useEffect)((()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){md.globalOptions=hd.globalOptions;const e=md(a,n.current,i.current);return o(e),()=>e.destroy()}o(void 0)}),[a,o]),[s,r]}md.globalOptions=void 0,hd.globalOptions=void 0;function fd(e){var t,n,i;const r=Object(T.useMemo)((()=>{var t;return null!==(t=e.currentPosition)&&void 0!==t?t:0}),[]),o={duration:20,startIndex:r},[a,s]=hd(o);Object(T.useEffect)((()=>{s&&s.on("select",(()=>{e.onGoToPage(null==s?void 0:s.selectedScrollSnap())}))}),[s]),Object(T.useEffect)((()=>{s&&(e.buttonsEnabled?s.reInit({watchDrag:!0}):s.reInit({watchDrag:!1}))}),[e.buttonsEnabled]);const c=bl();return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{sx:{flexGrow:1,backgroundColor:_.b.getColorValue(e.configuration.screens.review.backgroundColor),width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"32px"}},T.default.createElement(Dl,{config:e.configuration.screens.review.switchPreviousPageButton,icon:L.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition-1),active:e.currentPosition>0,debugName:"carousel-back"}),T.default.createElement("div",{className:"embla",ref:a,style:{overflow:"hidden",width:"100%",height:"100%"}},T.default.createElement("div",{className:"embla__container",style:{display:"flex",height:"100%"}},null===(t=e.document)||void 0===t?void 0:t.pages.map(((t,n)=>T.default.createElement("div",{className:"embla__slide",key:t.id,style:{position:"relative",minWidth:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0"}},T.default.createElement(Bl,{page:t,animateRotation:t.id===e.currentlyRotatingPageId,onAnimateRotationDone:e.onRotationAnimationDone,index:n+1,style:{maxHeight:`calc(100 * ${R} - ${50+c+72+32}px)`,maxWidth:"100%"}})))))),T.default.createElement(Dl,{config:e.configuration.screens.review.switchNextPageButton,icon:L.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition+1),active:e.currentPosition<(null===(i=null===(n=e.document)||void 0===n?void 0:n.pages)||void 0===i?void 0:i.length)-1,debugName:"carousel-forward"})))}var pd=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function gd(e){var t,n,i,r,o,a;const s=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),[c,u]=T.default.useState(!1);Object(T.useEffect)((()=>{e.visible&&!e.configuration.screens.review.enabled&&e.onSubmit()}),[e.visible]),Object(T.useEffect)((()=>{var t,n;0===(null===(n=null===(t=e.document)||void 0===t?void 0:t.pages)||void 0===n?void 0:n.length)&&e.visible&&!c&&e.onClose()}),[null===(n=e.document)||void 0===n?void 0:n.pages,e.visible,c]);const[l,d]=Object(T.useState)(!0),[m,h]=Object(T.useState)(null),f=Object(T.useRef)(null),[p,g]=Object(T.useState)(!1),[v,y]=Object(T.useState)(!1);return Object(T.useEffect)((()=>{d(!p&&!v)}),[p,v]),e.visible?T.default.createElement(T.default.Fragment,null,T.default.createElement(El,{open:c}),T.default.createElement(pu,{open:p,config:e.configuration.screens.review.deletePageAlertDialog,onCancelClick:()=>g(!1),onActionClick:()=>{g(!1),e.onRetakeImage(e.currentPosition)},onOkClick:()=>pd(this,void 0,void 0,(function*(){var t,n,i;u(!0),(null===(n=null===(t=e.document)||void 0===t?void 0:t.pages)||void 0===n?void 0:n.length)>1&&e.onGoToPage(Math.max(e.currentPosition-1,0)),yield null===(i=e.document)||void 0===i?void 0:i.deletePage(s),u(!1),g(!1)}))}),T.default.createElement(pu,{open:v,config:e.configuration.screens.review.deleteAllPagesAlertDialog,onCancelClick:()=>y(!1),onOkClick:()=>pd(this,void 0,void 0,(function*(){var t;u(!0),yield null===(t=e.document)||void 0===t?void 0:t.deleteAllPages(),u(!1),y(!1)}))}),T.default.createElement(P.Box,{"data-sb-screen-review":!0,display:e.visible?"flex":"none",style:{position:"absolute",width:"100vw",height:`calc(100 * ${R})`,flexDirection:"column",alignItems:"center",justifyContent:"center"}},T.default.createElement(vl,{config:e.configuration,numPages:null===(r=null===(i=e.document)||void 0===i?void 0:i.pages)||void 0===r?void 0:r.length,onCloseButtonClick:e.onClose,onDeleteButtonClick:()=>y(!0),buttonsEnabled:l}),T.default.createElement(fd,{buttonsEnabled:l,document:e.document,currentPosition:e.currentPosition,onGoToPage:e.onGoToPage,configuration:e.configuration,onRotationAnimationDone:f,currentlyRotatingPageId:m}),T.default.createElement(Sl,{config:e.configuration.screens.review,currentPage:e.currentPosition+1,totalNumPages:null===(a=null===(o=e.document)||void 0===o?void 0:o.pages)||void 0===a?void 0:a.length,onZoomButtonClick:()=>e.onZoomButtonClick(e.currentPosition)}),T.default.createElement(Al,{config:e.configuration,onSubmitClick:e.onSubmit,onAddPageClick:()=>{e.onInsertImage(e.currentPosition+1)},onRetakeClick:()=>e.onRetakeImage(e.currentPosition),onCropClick:()=>e.onCropButtonClick(e.currentPosition),onRotateClick:()=>pd(this,void 0,void 0,(function*(){var t,n;if(null!==f.current)return;d(!1),u(!0);const i=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),r=new Promise((e=>{f.current=e,h(i.id)})),o=null===(n=e.document)||void 0===n?void 0:n.cropAndRotatePage(i,null,1);yield Promise.all([r,o]),yield i.finalImageUrl(),f.current=null,h(null),d(!0),u(!1)})),onDeleteClick:()=>g(!0),buttonsEnabled:l}))):null}var vd=function(e,t){return Number(e.toFixed(t))},yd=function(e,t,n){n&&"function"==typeof n&&n(e,t)},Cd={easeOut:function(e){return-Math.cos(e*Math.PI)/2+.5},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},bd=function(e){"number"==typeof e&&cancelAnimationFrame(e)},Ad=function(e){e.mounted&&(bd(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function Sd(e,t,n,i){if(e.mounted){var r=(new Date).getTime();Ad(e),e.animation=function(){if(!e.mounted)return bd(e.animation);var o=(new Date).getTime()-r,a=(0,Cd[t])(o/n);o>=n?(i(1),e.animation=null):e.animation&&(i(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function wd(e,t,n,i){var r=function(e){var t=e.scale,n=e.positionX,i=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(i))}(t);if(e.mounted&&r){var o=e.setTransformState,a=e.transformState,s=a.scale,c=a.positionX,u=a.positionY,l=t.scale-s,d=t.positionX-c,m=t.positionY-u;0===n?o(t.scale,t.positionX,t.positionY):Sd(e,i,n,(function(e){o(s+l*e,c+d*e,u+m*e)}))}}var Ed=function(e,t){var n=e.wrapperComponent,i=e.contentComponent,r=e.setup.centerZoomedOut;if(!n||!i)throw new Error("Components are not mounted");var o=function(e,t,n){var i=e.offsetWidth,r=e.offsetHeight,o=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:i,wrapperHeight:r,newContentWidth:o,newDiffWidth:i-o,newContentHeight:a,newDiffHeight:r-a}}(n,i,t),a=o.wrapperWidth,s=o.wrapperHeight,c=function(e,t,n,i,r,o,a){var s=e>t?n*(a?1:.5):0,c=i>r?o*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:i-r-c,maxPositionY:c}}(a,o.newContentWidth,o.newDiffWidth,s,o.newContentHeight,o.newDiffHeight,Boolean(r));return c},Dd=function(e,t,n,i){return vd(i?e<t?t:e>n?n:e:e,2)},xd=function(e,t){var n=Ed(e,t);return e.bounds=n,n};function Bd(e,t,n,i,r,o,a){var s=n.minPositionX,c=n.minPositionY,u=n.maxPositionX,l=n.maxPositionY,d=0,m=0;return a&&(d=r,m=o),{x:Dd(e,s-d,u+d,i),y:Dd(t,c-m,l+m,i)}}function Id(e,t,n,i,r,o){var a=e.transformState,s=a.scale,c=a.positionX,u=a.positionY,l=i-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:c,y:u}):Bd(c-t*l,u-n*l,r,o,0,0,null)}function Td(e,t,n,i,r){var o=t-(r?i:0);return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=o?o:e}var Od=function(e,t){var n=e.setup.panning.excluded,i=e.isInitialized,r=e.wrapperComponent,o=t.target,a="shadowRoot"in o&&"composedPath"in t?t.composedPath().some((function(e){return e instanceof Element&&(null==r?void 0:r.contains(e))})):null==r?void 0:r.contains(o);return!!(i&&o&&a)&&!um(o,n)},kd=function(e){var t=e.isInitialized,n=e.isPanning,i=e.setup.panning.disabled;return!(!t||!n||i)};function Pd(e,t,n,i,r){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,c=e.transformState,u=c.scale,l=c.positionX,d=c.positionY;if(null!==a&&null!==s&&(t!==l||n!==d)){var m=Bd(t,n,s,o,i,r,a),h=m.x,f=m.y;e.setTransformState(u,h,f)}}var Ld=function(e,t){var n=e.setup,i=e.transformState.scale,r=n.minScale,o=n.disablePadding;return t>0&&i>=r&&!o?t:0};function _d(e,t,n,i,r,o,a,s,c,u){if(r){var l;if(t>a&&n>a)return(l=a+(e-a)*u)>c?c:l<a?a:l;if(t<o&&n<o)return(l=o+(e-o)*u)<s?s:l>o?o:l}return i?t:Dd(e,o,a,r)}function Rd(e,t){var n=function(e){var t=e.mounted,n=e.setup,i=n.disabled,r=n.velocityAnimation,o=e.transformState.scale;return!(r.disabled&&!(o>1)&&i&&!t)}(e);if(n){var i=e.lastMousePosition,r=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,c=Date.now();if(i&&r&&a){var u=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),l=t.x-i.x,d=t.y-i.y,m=l/u,h=d/u,f=c-r,p=l*l+d*d,g=Math.sqrt(p)/f;e.velocity={velocityX:m,velocityY:h,total:g}}e.lastMousePosition=t,e.velocityTime=c}}function Md(e,t){var n=e.transformState.scale;Ad(e),xd(e,n),void 0!==window.TouchEvent&&t instanceof TouchEvent?function(e,t){var n=t.touches,i=e.transformState,r=i.positionX,o=i.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-r,y:s-o}}}(e,t):function(e,t){var n=e.transformState,i=n.positionX,r=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-i,y:a-r}}(e,t)}function Fd(e){var t=e.transformState.scale,n=e.setup,i=n.minScale,r=n.alignmentAnimation,o=r.disabled,a=r.sizeX,s=r.sizeY,c=r.animationTime,u=r.animationType;if(!(o||t<i||!a&&!s)){var l=function(e){var t=e.transformState,n=t.positionX,i=t.positionY,r=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,c=o.centerZoomedOut,u=e.wrapperComponent;if(!a&&u&&e.bounds){var l=e.bounds,d=l.maxPositionX,m=l.minPositionX,h=l.maxPositionY,f=l.minPositionY,p=n>d||n<m,g=i>h||i<f,v=Id(e,n>d?u.offsetWidth:e.setup.minPositionX||0,i>h?u.offsetHeight:e.setup.minPositionY||0,r,e.bounds,s||c),y=v.x,C=v.y;return{scale:r,positionX:p?y:n,positionY:g?C:i}}}(e);l&&wd(e,l,c,u)}}function Nd(e,t,n){var i=e.startCoords,r=e.setup.alignmentAnimation,o=r.sizeX,a=r.sizeY;if(i){var s=function(e,t,n){var i=e.startCoords,r=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,c=r.positionX,u=r.positionY;if(!i)return{x:c,y:u};var l=t-i.x,d=n-i.y;return{x:a?c:l,y:s?u:d}}(e,t,n),c=s.x,u=s.y,l=Ld(e,o),d=Ld(e,a);Rd(e,{x:c,y:u}),Pd(e,c,u,l,d)}}function Vd(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,i=e.wrapperComponent,r=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=null==i?void 0:i.getBoundingClientRect(),a=null==r?void 0:r.getBoundingClientRect(),s=(null==o?void 0:o.width)||0,c=(null==o?void 0:o.height)||0,u=(null==a?void 0:a.width)||0,l=(null==a?void 0:a.height)||0,d=s<u||c<l;!t&&n&&(null==n?void 0:n.total)>.1&&d?function(e){var t=e.velocity,n=e.bounds,i=e.setup,r=e.wrapperComponent,o=function(e){var t=e.mounted,n=e.velocity,i=e.bounds,r=e.setup,o=r.disabled,a=r.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&o&&!t||!n||!i)}(e);if(o&&t&&n&&r){var a=t.velocityX,s=t.velocityY,c=t.total,u=n.maxPositionX,l=n.minPositionX,d=n.maxPositionY,m=n.minPositionY,h=i.limitToBounds,f=i.alignmentAnimation,p=i.zoomAnimation,g=i.panning,v=g.lockAxisY,y=g.lockAxisX,C=p.animationType,b=f.sizeX,A=f.sizeY,S=f.velocityAlignmentTime,w=function(e,t){var n=e.setup.velocityAnimation,i=n.equalToMove,r=n.animationTime,o=n.sensitivity;return i?r*t*o:r}(e,c),E=Math.max(w,S),D=Ld(e,b),x=Ld(e,A),B=D*r.offsetWidth/100,I=x*r.offsetHeight/100,T=u+B,O=l-B,k=d+I,P=m-I,L=e.transformState,_=(new Date).getTime();Sd(e,C,E,(function(t){var n=e.transformState,i=n.scale,r=n.positionX,o=n.positionY,c=((new Date).getTime()-_)/S,p=1-(0,Cd[f.animationType])(Math.min(1,c)),g=1-t,C=r+a*g,b=o+s*g,A=_d(C,L.positionX,r,y,h,l,u,O,T,p),w=_d(b,L.positionY,o,v,h,m,d,P,k,p);r===C&&o===b||e.setTransformState(i,A,w)}))}}(e):Fd(e)}}function Wd(e,t,n,i){var r=e.setup,o=r.minScale,a=r.maxScale,s=r.limitToBounds,c=Td(vd(t,2),o,a,0,!1),u=Id(e,n,i,c,xd(e,c),s);return{scale:c,positionX:u.x,positionY:u.y}}function jd(e,t,n){var i=e.transformState.scale,r=e.wrapperComponent,o=e.setup,a=o.minScale,s=o.limitToBounds,c=o.zoomAnimation,u=c.disabled,l=c.animationTime,d=c.animationType,m=u||i>=a;if((i>=1||s)&&Fd(e),!m&&r&&e.mounted){var h=Wd(e,a,t||r.offsetWidth/2,n||r.offsetHeight/2);h&&wd(e,h,l,d)}}var zd=function(){return zd=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},zd.apply(this,arguments)};function Hd(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ud=1,Zd=0,Gd=0,Yd={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!1,smooth:!0,wheel:{step:.2,disabled:!1,smoothStep:.001,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,wheelPanning:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},Qd=function(e){var t,n,i,r;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:Ud,scale:null!==(n=e.initialScale)&&void 0!==n?n:Ud,positionX:null!==(i=e.initialPositionX)&&void 0!==i?i:Zd,positionY:null!==(r=e.initialPositionY)&&void 0!==r?r:Gd}},qd=function(e){var t=zd({},Yd);return Object.keys(e).forEach((function(n){var i="undefined"!=typeof e[n];if("undefined"!=typeof Yd[n]&&i){var r=Object.prototype.toString.call(Yd[n]),o="[object Object]"===r,a="[object Array]"===r;t[n]=o?zd(zd({},Yd[n]),e[n]):a?Hd(Hd([],Yd[n],!0),e[n],!0):e[n]}})),t},Xd=function(e,t,n){var i=e.transformState.scale,r=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,c=o.zoomAnimation,u=o.smooth,l=c.size;if(!r)throw new Error("Wrapper is not mounted");var d=u?i*Math.exp(t*n):i+t*n;return Td(vd(d,3),s,a,l,!1)};function Kd(e,t,n,i,r){var o=e.wrapperComponent,a=e.transformState,s=a.scale,c=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var l=(o.offsetWidth/2-c)/s,d=(o.offsetHeight/2-u)/s,m=Wd(e,Xd(e,t,n),l,d);if(!m)return console.error("Error during zoom event. New transformation state was not calculated.");wd(e,m,i,r)}function Jd(e,t,n,i){var r=e.setup,o=e.wrapperComponent,a=r.limitToBounds,s=Qd(e.props),c=e.transformState,u=c.scale,l=c.positionX,d=c.positionY;if(o){var m=Ed(e,s.scale),h=Bd(s.positionX,s.positionY,m,a,0,0,o),f={scale:s.scale,positionX:h.x,positionY:h.y};u===s.scale&&l===s.positionX&&d===s.positionY||(null==i||i(),wd(e,f,t,n))}}var $d=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Kd(e,1,t,n,i)}},em=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Kd(e,-1,t,n,i)}},tm=function(e){return function(t,n,i,r,o){void 0===r&&(r=300),void 0===o&&(o="easeOut");var a=e.transformState,s=a.positionX,c=a.positionY,u=a.scale,l=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&l&&d){var m={positionX:Number.isNaN(t)?s:t,positionY:Number.isNaN(n)?c:n,scale:Number.isNaN(i)?u:i};wd(e,m,r,o)}}},nm=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),Jd(e,t,n)}},im=function(e){return function(t,n,i){void 0===n&&(n=200),void 0===i&&(i="easeOut");var r=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=dm(t||r.scale,o,a);wd(e,s,n,i)}}},rm=function(e){return function(t,n,i,r){void 0===i&&(i=600),void 0===r&&(r="easeOut"),Ad(e);var o=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(o&&a&&o.contains(a)){var s=function(e,t,n){var i=e.wrapperComponent,r=e.contentComponent,o=e.transformState,a=e.setup,s=a.limitToBounds,c=a.minScale,u=a.maxScale;if(!i||!r)return o;var l,d,m,h,f,p,g,v,y=i.getBoundingClientRect(),C=t.getBoundingClientRect(),b=(l=i,d=r,m=o,h=t.getBoundingClientRect(),f=l.getBoundingClientRect(),p=d.getBoundingClientRect(),g=f.x*m.scale,v=f.y*m.scale,{x:(h.x-p.x+g)/m.scale,y:(h.y-p.y+v)/m.scale}),A=b.x,S=b.y,w=C.width/o.scale,E=C.height/o.scale,D=i.offsetWidth/w,x=i.offsetHeight/E,B=Td(n||Math.min(D,x),c,u,0,!1),I=(y.width-w*B)/2,T=(y.height-E*B)/2,O=Bd((y.left-A)*B+I,(y.top-S)*B+T,Ed(e,B),s,0,0,i);return{positionX:O.x,positionY:O.y,scale:B}}(e,a,n);wd(e,s,i,r)}}},om=function(e){return{instance:e,zoomIn:$d(e),zoomOut:em(e),setTransform:tm(e),resetTransform:nm(e),centerView:im(e),zoomToElement:rm(e)}},am=function(e){return{instance:e,state:e.transformState}},sm=function(e){var t={};return Object.assign(t,am(e)),Object.assign(t,om(e)),t};function cm(){try{return{get passive(){return!0,!1}}}catch(e){return!1}}var um=function(e,t){return t.some((function(t){return e.matches("".concat(t,", .").concat(t,", ").concat(t," *, .").concat(t," *"))}))},lm=function(e){e&&clearTimeout(e)},dm=function(e,t,n){var i=n.offsetWidth*e,r=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-i)/2,positionY:(t.offsetHeight-r)/2}};function mm(e,t,n){var i=t.getBoundingClientRect(),r=0,o=0;if("clientX"in e)r=(e.clientX-i.left)/n,o=(e.clientY-i.top)/n;else{var a=e.touches[0];r=(a.clientX-i.left)/n,o=(a.clientY-i.top)/n}return(Number.isNaN(r)||Number.isNaN(o))&&console.error("No mouse or touch offset found"),{x:r,y:o}}var hm=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},fm=function(e,t){var n=e.props,i=n.onWheel,r=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState.scale,c=a.limitToBounds,u=a.centerZoomedOut,l=a.zoomAnimation,d=a.wheel,m=a.disablePadding,h=a.smooth,f=l.size,p=l.disabled,g=d.step,v=d.smoothStep;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var y=function(e,t){var n,i,r=function(e){return e?e.deltaY<0?1:-1:0}(e);return i=r,"number"==typeof(n=t)?n:i}(t,null),C=function(e,t,n,i,r){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,c=s.maxScale,u=s.minScale,l=s.zoomAnimation,d=s.disablePadding,m=l.size,h=l.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=o+t*n;if(r)return f;var p=!i&&!h;return Td(vd(f,3),u,c,m,p&&!d)}(e,y,h?v*Math.abs(t.deltaY):g,!t.ctrlKey);if(s!==C){var b=xd(e,C),A=mm(t,o,s),S=c&&(p||0===f||u||m),w=Id(e,A.x,A.y,C,b,S),E=w.x,D=w.y;e.previousWheelEvent=t,e.setTransformState(C,E,D),yd(sm(e),t,i),yd(sm(e),t,r)}},pm=function(e,t){var n=e.props,i=n.onWheelStop,r=n.onZoomStop;lm(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(jd(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var o=function(e,t){var n=e.previousWheelEvent,i=e.transformState.scale,r=e.setup,o=r.maxScale,a=r.minScale;return!!n&&(i<o||i>a||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);o&&(lm(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,yd(sm(e),t,i),yd(sm(e),t,r))}),160))},gm=function(e){for(var t=0,n=0,i=0;i<2;i+=1)t+=e.touches[i].clientX,n+=e.touches[i].clientY;return{x:t/2,y:n/2}},vm=function(e,t){var n=e.contentComponent,i=e.pinchStartDistance,r=e.wrapperComponent,o=e.transformState.scale,a=e.setup,s=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,l=a.alignmentAnimation,d=u.disabled,m=u.size;if(null!==i&&n){var h=function(e,t,n){var i=n.getBoundingClientRect(),r=e.touches,o=vd(r[0].clientX-i.left,5),a=vd(r[0].clientY-i.top,5);return{x:(o+vd(r[1].clientX-i.left,5))/2/t,y:(a+vd(r[1].clientY-i.top,5))/2/t}}(t,o,n);if(Number.isFinite(h.x)&&Number.isFinite(h.y)){var f=hm(t),p=function(e,t){var n=e.pinchStartScale,i=e.pinchStartDistance,r=e.setup,o=r.maxScale,a=r.minScale,s=r.zoomAnimation,c=r.disablePadding,u=s.size,l=s.disabled;if(!n||null===i||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:Td(vd(t/i*n,2),a,o,u,!l&&!c)}(e,f),g=gm(t),v=g.x-(e.pinchLastCenterX||0),y=g.y-(e.pinchLastCenterY||0);if(p!==o||0!==v||0!==y){e.pinchLastCenterX=g.x,e.pinchLastCenterY=g.y;var C=xd(e,p),b=s&&(d||0===m||c),A=Id(e,h.x,h.y,p,C,b),S=A.x,w=A.y;e.pinchMidpoint=h,e.lastDistance=f;var E=l.sizeX,D=l.sizeY,x=Bd(S+v,w+y,C,s,Ld(e,E),Ld(e,D),r),B=x.x,I=x.y;e.setTransformState(p,B,I)}}}},ym=function(e,t){var n=e.props.onZoomStop,i=e.setup.doubleClick.animationTime;lm(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout((function(){e.doubleClickStopEventTimer=null,yd(sm(e),t,n)}),i)};function Cm(e,t){var n=e.setup,i=e.doubleClickStopEventTimer,r=e.transformState,o=e.contentComponent,a=r.scale,s=e.props,c=s.onZoomStart,u=s.onZoom,l=n.doubleClick,d=l.disabled,m=l.mode,h=l.step,f=l.animationTime,p=l.animationType;if(!d&&!i){if("reset"===m)return function(e,t){var n=e.props,i=n.onZoomStart,r=n.onZoom,o=e.setup.doubleClick,a=o.animationTime,s=o.animationType;yd(sm(e),t,i),Jd(e,a,s,(function(){return yd(sm(e),t,r)})),ym(e,t)}(e,t);if(!o)return console.error("No ContentComponent found");var g=function(e,t){return"toggle"===e?1===t?1:-1:"zoomOut"===e?-1:1}(m,e.transformState.scale),v=Xd(e,g,h);if(a!==v){yd(sm(e),t,c);var y=mm(t,o,a),C=Wd(e,v,y.x,y.y);if(!C)return console.error("Error during zoom event. New transformation state was not calculated.");yd(sm(e),t,u),wd(e,C,f,p),ym(e,t)}}}var bm=function(e){var t=this;this.mounted=!0,this.pinchLastCenterX=null,this.pinchLastCenterY=null,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.isWheelPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){t.initializeWindowEvents()},this.unmount=function(){t.cleanupWindowEvents()},this.update=function(e){t.props=e,xd(t,t.transformState.scale),t.setup=qd(e)},this.initializeWindowEvents=function(){var e,n,i=cm(),r=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,o=null==r?void 0:r.defaultView;null===(n=t.wrapperComponent)||void 0===n||n.addEventListener("wheel",t.onWheelPanning,i),null==o||o.addEventListener("mousedown",t.onPanningStart,i),null==o||o.addEventListener("mousemove",t.onPanning,i),null==o||o.addEventListener("mouseup",t.onPanningStop,i),null==r||r.addEventListener("mouseleave",t.clearPanning,i),null==o||o.addEventListener("keyup",t.setKeyUnPressed,i),null==o||o.addEventListener("keydown",t.setKeyPressed,i)},this.cleanupWindowEvents=function(){var e,n,i=cm(),r=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,o=null==r?void 0:r.defaultView;null==o||o.removeEventListener("mousedown",t.onPanningStart,i),null==o||o.removeEventListener("mousemove",t.onPanning,i),null==o||o.removeEventListener("mouseup",t.onPanningStop,i),null==r||r.removeEventListener("mouseleave",t.clearPanning,i),null==o||o.removeEventListener("keyup",t.setKeyUnPressed,i),null==o||o.removeEventListener("keydown",t.setKeyPressed,i),document.removeEventListener("mouseleave",t.clearPanning,i),Ad(t),null===(n=t.observer)||void 0===n||n.disconnect()},this.handleInitializeWrapperEvents=function(e){var n=cm();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},this.handleInitialize=function(e){var n=t.setup.centerOnInit;t.applyTransformation(),t.onInitCallbacks.forEach((function(e){return e(sm(t))})),n&&(t.setCenter(),t.observer=new ResizeObserver((function(){var n,i=e.offsetWidth,r=e.offsetHeight;(i>0||r>0)&&(t.onInitCallbacks.forEach((function(e){return e(sm(t))})),t.setCenter(),null===(n=t.observer)||void 0===n||n.disconnect())})),setTimeout((function(){var e;null===(e=t.observer)||void 0===e||e.disconnect()}),5e3),t.observer.observe(e))},this.onWheelZoom=function(e){if(!t.setup.disabled){var n=function(e,t){var n=e.setup.wheel,i=n.disabled,r=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,c=e.isPanning,u=t.target;return!(!s||c||i||!u||r&&!t.ctrlKey||o&&t.ctrlKey||um(u,a))}(t,e);n&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(function(e,t){var n=e.props,i=n.onWheelStart,r=n.onZoomStart;e.wheelStopEventTimer||(Ad(e),yd(sm(e),t,i),yd(sm(e),t,r))}(t,e),fm(t,e),pm(t,e))}},this.onWheelPanning=function(e){var n=t.setup,i=n.disabled,r=n.wheel,o=n.panning;if(t.wrapperComponent&&t.contentComponent&&!i&&r.wheelDisabled&&!o.disabled&&o.wheelPanning&&!e.ctrlKey){e.preventDefault(),e.stopPropagation();var a=t.transformState,s=a.positionX,c=a.positionY,u=s-e.deltaX,l=c-e.deltaY,d=o.lockAxisX?s:u,m=o.lockAxisY?c:l,h=t.setup.alignmentAnimation,f=h.sizeX,p=h.sizeY,g=Ld(t,f),v=Ld(t,p);d===s&&m===c||Pd(t,d,m,g,v)}},this.onPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;n||Od(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(0!==e.button||t.setup.panning.allowLeftClickPan)&&(1!==e.button||t.setup.panning.allowMiddleClickPan)&&(2!==e.button||t.setup.panning.allowRightClickPan)&&(e.preventDefault(),e.stopPropagation(),Ad(t),Md(t,e),yd(sm(t),e,i))},this.onPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;n||kd(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Nd(t,e.clientX,e.clientY),yd(sm(t),e,i))},this.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(Vd(t),yd(sm(t),e,n))},this.onPinchStart=function(e){var n=t.setup.disabled,i=t.props,r=i.onPinchingStart,o=i.onZoomStart;if(!n){var a=function(e,t){var n=e.setup.pinch,i=n.disabled,r=n.excluded,o=e.isInitialized,a=t.target;return!(!o||i||!a||um(a,r))}(t,e);a&&(function(e,t){var n=hm(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1;var i=gm(t);e.pinchLastCenterX=i.x,e.pinchLastCenterY=i.y,Ad(e)}(t,e),Ad(t),yd(sm(t),e,r),yd(sm(t),e,o))}},this.onPinch=function(e){var n=t.setup.disabled,i=t.props,r=i.onPinching,o=i.onZoom;if(!n){var a=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,i=e.pinchStartDistance;return!(!n||t||!i)}(t);a&&(e.preventDefault(),e.stopPropagation(),vm(t,e),yd(sm(t),e,r),yd(sm(t),e,o))}},this.onPinchStop=function(e){var n,i,r=t.props,o=r.onPinchingStop,a=r.onZoomStop;t.pinchStartScale&&(i=(n=t).pinchMidpoint,n.velocity=null,n.lastDistance=null,n.pinchMidpoint=null,n.pinchStartScale=null,n.pinchStartDistance=null,jd(n,null==i?void 0:i.x,null==i?void 0:i.y),yd(sm(t),e,o),yd(sm(t),e,a))},this.onTouchPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;if(!n&&Od(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,Ad(t);var r=e.touches,o=1===r.length,a=2===r.length;o&&(Ad(t),Md(t,e),yd(sm(t),e,i)),a&&t.onPinchStart(e)}},this.onTouchPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!kd(t))return;e.preventDefault(),e.stopPropagation();var r=e.touches[0];Nd(t,r.clientX,r.clientY),yd(sm(t),e,i)}else e.touches.length>1&&t.onPinch(e)},this.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},this.onDoubleClick=function(e){if(!t.setup.disabled){var n=function(e,t){var n=e.isInitialized,i=e.setup,r=e.wrapperComponent,o=i.doubleClick,a=o.disabled,s=o.excluded,c=t.target,u=null==r?void 0:r.contains(c);return!(!(n&&c&&u)||a||um(c,s))}(t,e);n&&Cm(t,e)}},this.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},this.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},this.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},this.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},this.setTransformState=function(e,n,i){var r=t.props.onTransformed;if(Number.isNaN(e)||Number.isNaN(n)||Number.isNaN(i))console.error("Detected NaN set state values");else{e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=i,t.applyTransformation();var o=sm(t);t.onChangeCallbacks.forEach((function(e){return e(o)})),yd(o,{scale:e,positionX:n,positionY:i},r)}},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=dm(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},this.handleTransformStyles=function(e,n,i){return t.props.customTransform?t.props.customTransform(e,n,i):function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")}(e,n,i)},this.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,i=e.positionX,r=e.positionY,o=t.handleTransformStyles(i,r,n);t.contentComponent.style.transform=o}},this.getContext=function(){return sm(t)},this.onChange=function(e){return t.onChangeCallbacks.has(e)||t.onChangeCallbacks.add(e),function(){t.onChangeCallbacks.delete(e)}},this.onInit=function(e){return t.onInitCallbacks.has(e)||t.onInitCallbacks.add(e),function(){t.onInitCallbacks.delete(e)}},this.init=function(e,n){t.cleanupWindowEvents(),t.wrapperComponent=e,t.contentComponent=n,xd(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(n),t.initializeWindowEvents(),t.isInitialized=!0;var i=sm(t);yd(i,void 0,t.props.onInit)},this.props=e,this.setup=qd(this.props),this.transformState=Qd(this.props)},Am=T.default.createContext(null),Sm=T.default.forwardRef((function(e,t){var n,i,r=Object(T.useRef)(new bm(e)).current,o=(n=e.children,i=om(r),"function"==typeof n?n(i):n);return Object(T.useImperativeHandle)(t,(function(){return om(r)}),[r]),Object(T.useEffect)((function(){r.update(e)}),[r,e]),T.default.createElement(Am.Provider,{value:r},o)}));T.default.forwardRef((function(e,t){var n,i=Object(T.useRef)(null),r=Object(T.useContext)(Am);return Object(T.useEffect)((function(){return r.onChange((function(e){if(i.current){i.current.style.transform=r.handleTransformStyles(0,0,1/e.instance.transformState.scale)}}))}),[r]),T.default.createElement("div",zd({},e,{ref:(n=[i,t],function(e){n.forEach((function(t){"function"==typeof t?t(e):null!=t&&(t.current=e)}))})}))}));var wm="transform-component-module_wrapper__SPB86",Em="transform-component-module_content__FBWxo";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__SPB86 {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__FBWxo {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__FBWxo img {\n pointer-events: none;\n}\n");var Dm=function(e){var t=e.children,n=e.wrapperClass,i=void 0===n?"":n,r=e.contentClass,o=void 0===r?"":r,a=e.wrapperStyle,s=e.contentStyle,c=e.wrapperProps,u=void 0===c?{}:c,l=e.contentProps,d=void 0===l?{}:l,m=Object(T.useContext)(Am),h=m.init,f=m.cleanupWindowEvents,p=Object(T.useRef)(null),g=Object(T.useRef)(null);return Object(T.useEffect)((function(){var e=p.current,t=g.current;return null!==e&&null!==t&&h&&(null==h||h(e,t)),function(){null==f||f()}}),[]),T.default.createElement("div",zd({},u,{ref:p,className:"react-transform-wrapper ".concat(wm," ").concat(i),style:a}),T.default.createElement("div",zd({},d,{ref:g,className:"react-transform-component ".concat(Em," ").concat(o),style:s}),t))};function xm(e){var t;const n=Nc(null===(t=e.page)||void 0===t?void 0:t.finalImageUrl());if(!(e.visible&&n.value))return null;const i=e.config.closeButton;return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{style:{touchAction:"none",backgroundColor:_.b.getColorValue(e.config.overlayColor)}},T.default.createElement(P.Box,{style:{textAlign:"right",height:"45px",paddingRight:8}},T.default.createElement(G,{onClick:e.onCloseButtonClick,visible:i.visible,text:i.text,background:i.background,foreground:i.foreground,ariaLabel:_.b.getLocalizedText(i.accessibilityDescription),iconPosition:"right",icon:T.default.createElement(L.a,{style:{paddingLeft:4}})})),T.default.createElement(Sm,{centerOnInit:!0},T.default.createElement(Dm,{wrapperStyle:{width:"100%"},contentStyle:{width:"100%"}},T.default.createElement(P.Box,{style:{width:"100%",height:`calc(100 *${R} - 45px)`,display:"flex",justifyContent:"center",alignItems:"center",touchAction:"none"}},T.default.createElement("img",{src:n.value,alt:"Zoomed image",style:{maxWidth:"100%",maxHeight:"100%"}}))))))}var Bm=n(80);class Im{constructor(){this.disabled=!1,this.color="transparent"}}class Tm{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20,this.filter=""}}class Om{constructor(){this.color="#1ec31e",this.width=4}}class km{constructor(){this.padding=10}}class Pm{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class Lm{constructor(){this.width=2,this.color="white"}}class _m{constructor(){this.size=20,this.color="white"}}class Rm extends Bm.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new km,this.style.magneticLines=new Im,this.style.polygon=new Om,this.style.polygon.handles=new Tm,this.style.magnifier=new Pm,this.style.magnifier.border=new Lm,this.style.magnifier.crosshair=new _m}static fromJson(e){const t=new Rm;return this.mapValues(e,t,["style"]),e.style&&(this.mapValues(e.style,t.style,["polygon","magneticLines","magnifier"]),e.style.polygon&&(this.mapValues(e.style.polygon,t.style.polygon,["handles"]),e.style.polygon.handles&&this.mapValues(e.style.polygon.handles,t.style.polygon.handles)),e.style.magneticLines&&this.mapValues(e.style.magneticLines,t.style.magneticLines,[]),e.style.magnifier&&(this.mapValues(e.style.magnifier,t.style.magnifier,["border","crosshair"]),e.style.magnifier.border&&this.mapValues(e.style.magnifier.border,t.style.magnifier.border,[]),e.style.magnifier.crosshair&&this.mapValues(e.style.magnifier.crosshair,t.style.magnifier.crosshair,[]))),t}}class Mm extends T.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(e){return T.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},T.default.createElement("line",{x1:e.start.x.toString(),y1:e.start.y.toString(),x2:e.end.x.toString(),y2:e.end.y.toString(),style:{stroke:this.props.style.color,strokeWidth:2}}))}componentDidUpdate(e,t,n){this.props.style.disabled||this.snapToClosestIfAnyAreClose()}render(){var e,t,n,i,r,o;return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},null===(n=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.horizontal)||void 0===t?void 0:t.scaled)||void 0===n?void 0:n.map((e=>this.fromPoint(e))),null===(o=null===(r=null===(i=this.props.lines)||void 0===i?void 0:i.vertical)||void 0===r?void 0:r.scaled)||void 0===o?void 0:o.map((e=>this.fromPoint(e))))}snapToClosestIfAnyAreClose(){var e,t,n,i;const r=this.props.movingLine;let o=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.vertical)||void 0===t?void 0:t.scaled;if(r.isHorizontal&&(o=null===(i=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===i?void 0:i.scaled),!o||0===o.length)return;const a=this.midPoint(r.points[0].coordinates,r.points[1].coordinates),s=o.map((e=>({distance:this.distanceToLine(e,a),mLine:e})));s.sort(((e,t)=>e.distance-t.distance)),s[0].distance<this.BUFFER&&this.props.snapTo({magneticLine:s[0].mLine,polygonLine:r})}distanceToLine(e,t){const n=t.x-e.start.x,i=t.y-e.start.y,r=e.end.x-e.start.x,o=e.end.y-e.start.y,a=r*r+o*o;if(0===a)return 1/0;const s=(n*r+i*o)/a;let c;return c=s<=0?e.start:s>=1?e.end:new hs.a(e.start.x+s*r,e.start.y+s*o),hs.a.distance(t,c)}midPoint(e,t){return new hs.a((e.x+t.x)/2,(e.y+t.y)/2)}}class Fm extends T.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var e,t;return(null===(e=this.props.style)||void 0===e?void 0:e.size)?(null===(t=this.props)||void 0===t?void 0:t.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var e,t,n;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(e=this.props.style)||void 0===e?void 0:e.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(t=this.props.style)||void 0===t?void 0:t.color,position:"absolute",cursor:"pointer",zIndex:500,filter:null===(n=this.props.style)||void 0===n?void 0:n.filter}}nextIndex(e){return(e+1)%this.POINT_COUNT}previousIndex(e){return(e-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(e){return e%2==0}isOutOfBounds(e,t){return e<-this.DRAG_BUFFER||e>t+this.DRAG_BUFFER}get invisibleHandleStyle(){return{width:"50px",height:"50px",opacity:0,position:"relative",top:this.pointSize/2-25+"px",left:this.pointSize/2-25+"px",borderRadius:"25px"}}}class Nm extends Fm{create(){if(!this.props.points||4!==this.props.points.length)return null;const e=[];for(let t=0;t<this.POINT_COUNT;t++){const n=this.props.points[t],i=T.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x-this.pointSize/2+"px",top:n.y-this.pointSize/2+"px"}),key:t.toString(),ref:e=>this.items[t]=e,onPointerDown:e=>this.cornerTouchStart(e,t),onPointerUp:e=>this.cornerTouchEnd(e),onPointerMove:e=>this.cornerTouchMove(e,t),"data-sb-cropping-corner":t},T.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));e.push(i)}return e}cornerTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=hs.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],r=hs.a.fromHtmlElement(i);this.parentOffset=new hs.a(n.x-r.x,n.y-r.y),this.props.cornerMoveStart({index:t,point:this.props.points[t]})}cornerTouchMove(e,t){if(!this.parentOffset)return;const n=hs.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),{x:i,y:r}=Object(sc.b)({x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},this.pointSize,this.props.containerSize),o=this.pointSize/2,a=this.props.points[t];this.props.points[t]=new hs.a(i+o,r+o),Vs.isConvex(this.props.points)?this.props.cornerMoved({index:t,point:this.props.points[t]}):this.props.points[t]=a}cornerTouchEnd(e){e.target.releasePointerCapture(e.pointerId),this.parentOffset=null,this.props.cornerMoveEnd()}render(){return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",cursor:"pointer",zIndex:500,userSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none"}},this.create())}}class Vm extends Fm{create(){if(!this.props.points||4!==this.props.points.length)return null;const e=[];for(let t=0;t<this.POINT_COUNT;t++){const n=this.props.points[t];let i=this.props.points[this.nextIndex(t)];const r=T.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(i.x-n.x)/2-this.pointSize/2+"px",top:n.y+(i.y-n.y)/2-this.pointSize/2+"px"}),key:t.toString(),ref:e=>this.items[t]=e,onPointerDown:e=>this.lineTouchStart(e,t),onPointerMove:e=>this.lineTouchMove(e,t),onPointerUp:e=>this.lineTouchEnd(e),"data-sb-cropping-side":t},T.default.createElement("div",{style:this.invisibleHandleStyle}));e.push(r)}return e}lineTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=hs.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],r=hs.a.fromHtmlElement(i),o=this.props.points[t],a=this.props.points[this.nextIndex(t)];this.point0Start=y.copy(this.props.points[this.previousIndex(t)]),this.point1Start=y.copy(o),this.point2Start=y.copy(a),this.point3Start=y.copy(this.props.points[this.nextIndex(this.nextIndex(t))]),this.point1Offset=new hs.a(o.x-r.x,o.y-r.y),this.point2Offset=new hs.a(a.x-r.x,a.y-r.y),this.parentOffset=new hs.a(n.x-r.x,n.y-r.y)}lineTouchMove(e,t){if(!this.parentOffset)return;const n=hs.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.props.points[this.previousIndex(t)];let r=new hs.a(null,null),o=new hs.a(null,null);const a=this.props.points[this.nextIndex(t+1)],s=n.x-this.parentOffset.x,c=n.y-this.parentOffset.y;if(this.isHorizontal(t)){const e=c+this.point1Offset.y,t=c+this.point2Offset.y,n=e-this.point1Start.y;r.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),o.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),r.y=e,o.y=t}else{const e=s+this.point1Offset.x,t=s+this.point2Offset.x,n=e-this.point1Start.x;r.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),o.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),r.x=e,o.x=t}r=hs.a.clamp(r,this.props.containerSize),o=hs.a.clamp(o,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,r,i,this.isHorizontal(t)?"y":"x")||this.isNearOpposingPoint(this.point1Start,o,a,this.isHorizontal(t)?"y":"x")||this.areEdgesCrossing(i,r,o,a)||Vs.isConvex([i,r,o,a])&&(this.props.points[t].x=r.x,this.props.points[t].y=r.y,this.props.points[this.nextIndex(t)].x=o.x,this.props.points[this.nextIndex(t)].y=o.y,this.props.lineMoved({points:[{index:t,coordinates:r},{index:this.nextIndex(t),coordinates:o}],previousPoint:i,nextPoint:a,isHorizontal:this.isHorizontal(t)}))}lineTouchEnd(e){e.target.releasePointerCapture(e.pointerId),this.parentOffset=null}isNearOpposingPoint(e,t,n,i){if(e[i]>n[i]){if(t[i]-10<n[i])return!0}else if(t[i]>n[i]-10)return!0;return!1}areEdgesCrossing(e,t,n,i){const r=e.x,o=e.y,a=t.x,s=t.y,c=n.x,u=n.y,l=i.x,d=i.y;return((r-c)*(s-u)-(o-u)*(a-c))*((r-l)*(s-d)-(o-d)*(a-l))<0&&((c-r)*(d-o)-(u-o)*(l-r))*((c-a)*(d-s)-(u-s)*(l-a))<0}render(){return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class Wm extends T.default.Component{render(){return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},T.default.createElement(Nm,{ref:e=>this.corners=e,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:this.props.cornerMoved,cornerMoveEnd:this.props.cornerMoveEnd}),T.default.createElement(Vm,{ref:e=>this.lines=e,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,lineMoved:this.props.lineMoved}))}setFrame(){for(let e=0;e<this.corners.POINT_COUNT;e++){const t=this.props.coordinatePoints[e];this.corners.items[e]&&(this.corners.items[e].style.left=t.x-this.corners.pointSize/2+"px",this.corners.items[e].style.top=t.y-this.corners.pointSize/2+"px");let n=this.props.coordinatePoints[this.corners.nextIndex(e)];this.lines.items[e]&&(this.lines.items[e].style.left=t.x+(n.x-t.x)/2-this.corners.pointSize/2+"px",this.lines.items[e].style.top=t.y+(n.y-t.y)/2-this.corners.pointSize/2+"px")}}snapTo(e){const t=[e.polygonLine.previousPoint,e.polygonLine.points[0].coordinates],n=[e.polygonLine.points[1].coordinates,e.polygonLine.nextPoint],i=[e.magneticLine.start,e.magneticLine.end];this.props.coordinatePoints[e.polygonLine.points[0].index]=Vs.intersection(t,i),this.props.coordinatePoints[e.polygonLine.points[1].index]=Vs.intersection(n,i),this.props.cornerMoveEnd(),this.setFrame()}}class jm extends T.default.Component{constructor(e){super(e),this.state={movingLine:void 0}}render(){return T.default.createElement("div",null,T.default.createElement(Wm,{ref:e=>this.handles=e,containerSize:this.props.size,coordinatePoints:this.props.points,rotations:this.props.rotations,scale:this.props.scale,style:this.props.handleStyle,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:e=>{this.setFrame(),this.props.cornerMoved(e)},cornerMoveEnd:this.props.cornerMoveEnd,lineMoved:e=>{this.setFrame(),this.setState({movingLine:e})}}),T.default.createElement(Mm,{style:this.props.magneticLineStyle,lines:this.props.magneticLines,movingLine:this.state.movingLine,snapTo:e=>{var t,n;null===(t=this.handles)||void 0===t||t.snapTo(e),null===(n=this.polygon)||void 0===n||n.setFrame()}}),T.default.createElement(zu,{size:this.props.size,points:this.props.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:e=>this.polygon=e}))}setFrame(){var e,t;null===(e=this.polygon)||void 0===e||e.setFrame(),null===(t=this.handles)||void 0===t||t.setFrame()}}class zm extends T.default.Component{render(){return T.default.createElement("img",{ref:e=>this.image=e,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute"},src:this.props.src,alt:".",onLoad:e=>{e.target&&this.props.onImageLoaded(e.target)}})}}class Hm extends T.default.Component{constructor(){super(...arguments),this.animating=!1}width(){return this.container.offsetWidth-2*this.container.offsetLeft}height(){return this.container.offsetHeight-2*this.container.offsetTop}isAnimating(){return this.animating}render(){const{size:e,imageMargin:t,rotations:n,scale:i,duration:r}=this.props,o=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=xs.b`
|
|
34
|
+
`;return T.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},T.default.createElement(e,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),T.default.createElement("path",{d:"M90.5153 49.6094C91.715 49.6094 92.6933 50.5827 92.6321 51.7808C92.1218 61.7815 88.0988 71.3096 81.2342 78.6635C73.8743 86.548 63.7963 91.3454 53.036 92.0868C42.2757 92.8282 31.6351 89.4582 23.2634 82.6576C15.455 76.3147 10.1633 67.4283 8.28624 57.5922C8.06135 56.4138 8.89694 55.3155 10.0853 55.1509C11.2737 54.9864 12.3642 55.8183 12.5959 56.9954C14.3176 65.7412 19.0487 73.6367 26.0026 79.2856C33.5201 85.3922 43.0751 88.4183 52.7374 87.7526C62.3998 87.0869 71.4494 82.7789 78.0584 75.699C84.1719 69.1497 87.7754 60.68 88.2814 51.7807C88.3495 50.5829 89.3156 49.6094 90.5153 49.6094Z",fill:"white"}),T.default.createElement("path",{d:"M40.7013 23.4514C40.2751 22.2667 40.8885 20.9518 42.1022 20.6166C45.5928 19.6526 49.2351 19.3251 52.8537 19.6567C57.2305 20.0577 61.4662 21.4131 65.2628 23.6273C69.0594 25.8416 72.3246 28.861 74.8286 32.4731C77.3326 36.0851 79.0146 40.2021 79.7562 44.5341C80.4978 48.8662 80.281 53.3082 79.121 57.5475C77.9611 61.7868 75.8862 65.7204 73.0423 69.0714C70.1985 72.4225 66.6548 75.1095 62.6606 76.9436C59.3583 78.4599 55.8145 79.3627 52.202 79.6146C50.9459 79.7022 49.9301 78.6662 49.9379 77.4072C49.9457 76.1481 50.9746 75.1443 52.2293 75.0398C55.1749 74.7942 58.0613 74.0382 60.758 72.8C64.1467 71.244 67.1532 68.9642 69.5659 66.1212C71.9787 63.2781 73.7391 59.9408 74.7232 56.3442C75.7073 52.7475 75.8912 48.9789 75.262 45.3035C74.6328 41.6281 73.2058 38.1353 71.0814 35.0708C68.957 32.0062 66.1867 29.4445 62.9657 27.5659C59.7446 25.6873 56.151 24.5374 52.4377 24.1972C49.4828 23.9265 46.5092 24.1737 43.6497 24.9219C42.4316 25.2406 41.1274 24.6362 40.7013 23.4514Z",fill:"white"}),T.default.createElement("path",{d:"M39.9232 61.6554C39.1643 62.5529 37.8105 62.673 37.0094 61.813C35.7171 60.4259 34.6502 58.8388 33.8523 57.1092C32.7564 54.7336 32.1944 52.1468 32.206 49.5307C32.2175 46.9146 32.8022 44.3328 33.9189 41.967C35.0356 39.6011 36.6573 37.5088 38.6697 35.8372C40.6822 34.1656 43.0365 32.9554 45.567 32.2916C48.0975 31.6279 50.7428 31.5268 53.3166 31.9954C55.8904 32.464 58.3303 33.4911 60.4644 35.0042C62.0183 36.1059 63.3827 37.4458 64.5093 38.9707C65.2077 39.916 64.8412 41.2247 63.8197 41.8061C62.7982 42.3875 61.5108 42.0174 60.7778 41.0986C59.9824 40.1015 59.0489 39.2181 58.0027 38.4763C56.3759 37.3229 54.5161 36.5401 52.5541 36.1828C50.5922 35.8256 48.5758 35.9027 46.6469 36.4086C44.7179 36.9146 42.9233 37.8371 41.3893 39.1113C39.8553 40.3855 38.6192 41.9804 37.7679 43.7838C36.9167 45.5872 36.471 47.5552 36.4622 49.5494C36.4534 51.5436 36.8818 53.5154 37.7172 55.3262C38.2544 56.4908 38.9515 57.5705 39.7858 58.5353C40.5545 59.4244 40.6821 60.7579 39.9232 61.6554Z",fill:"white"})))}}class Is extends T.default.Component{constructor(e){super(e),this.state={element:e.element}}style(e){this.customStyle=e,this.forceUpdate()}update(e){this.setState({element:e})}formatText(e,t){if("None"!==t)return"Text"===t?e.text:e.format+" ("+e.text+")"}render(){var e,t,n,i,r;const o=this.state.element,a=this.props.configuration.style,s=this.formatText(o.code,this.props.configuration.textFormat),c=hs.a.width(null!==(e=this.props.animateToPoints)&&void 0!==e?e:o.points);if(!s)return null;if(!o.points)return null;const u=null!==(n=null===(t=this.customStyle)||void 0===t?void 0:t.backgroundColor)&&void 0!==n?n:o.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,l=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.textColor)&&void 0!==r?r:o.highlighted?a.highlightedTextColor:a.textColor;return T.default.createElement(us.div,{ref:e=>this.label=e,onClick:()=>{this.props.onClick&&this.props.onClick(o)},style:{x:hs.a.lowestX(o.points),y:hs.a.highestY(o.points)+3,backgroundColor:u,fontSize:12,width:c,overflow:"hidden",color:l,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px",WebkitLineClamp:2,display:"-webkit-box",WebkitBoxOrient:"vertical"},animate:this.props.animateToPoints?{x:hs.a.lowestX(this.props.animateToPoints),y:hs.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class Ts{constructor(){this.defaultFillColor="rgba(255, 0, 0, 0.3)",this.defaultHighlightedFillColor="rgba(0, 255, 0, 0.3)",this.polygonStrokeColor="rgba(255, 0, 0, 1)",this.polygonFillColor=this.defaultFillColor,this.polygonStrokeWidth=1,this.polygonCornerRadius=0,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.highlightedPolygonStrokeWidth=2,this.highlightedPolygonCornerRadius=0,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}class Os{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.countingRepeatDelay=-1,this.style=new Ts}}class ks extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new Os,this.detectionParameters=new d.BarcodeScannerConfiguration,this.onBarcodesDetected=function(e){}}static fromJson(e){var t;const n=new ks;return this.mapValues(e,n,["style","videoConstraints","overlay","finder","userGuidance"]),this.mapFinderConfiguration(n,e),e.overlay&&(this.mapValues(e.overlay,n.overlay,["style"]),e.overlay.style&&this.mapValues(e.overlay.style,n.overlay.style)),this.mapVideoConstraints(e,n),n.detectionParameters=new d.BarcodeScannerConfiguration(null!==(t=e.detectionParameters)&&void 0!==t?t:{}),n}}var Ps=n(11);class Ls{constructor(e){var t;if(this.barcodes=[],this.originalImageSize=null,this.barcodes=(null===(t=null==e?void 0:e.result)||void 0===t?void 0:t.barcodes)||[],null==e?void 0:e.originalImage){const t=e.originalImage.__image_data;this.originalImageSize=new Ps.a(t.width,t.height)}}isEmpty(){return 0===this.barcodes.length}static fromBarcode(e){const t=new Ls(void 0);return t.barcodes=[e],t}}var _s=n(13),Rs=n(33),Ms=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};ue.a;ue.b;class Fs extends Rs.b{constructor(e){var t;super(e),this.shouldComputeSize=!0,this.barcodeScannerHandle=null,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.desiredRecognitionResolution=void 0,this.desiredRecognitionResolution=this.configuration.desiredRecognitionResolution,Object.assign(this.state,{isFinderVisible:null===(t=this.configuration.finder.visible)||void 0===t||t,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0})}get configuration(){return this._configuration||(this._configuration=ks.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e){return Ms(this,void 0,void 0,(function*(){const t=_s.a.findContainerOrThrow(e);return new Promise(((n,i)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(t),this.root.render(T.default.createElement(Fs,{root:this.root,container:t,configuration:e,onSuccess:n,onFailure:i}))}))}))}onSdkReady(){return Ms(this,void 0,void 0,(function*(){const e=this.configuration.detectionParameters;this.barcodeScannerHandle=yield this.bridge.api.BarcodeScanner.create(e)}))}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Ms(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback)}))}componentDidUpdate(e,t,n){e.configuration!==this.props.configuration&&(this._configuration=ks.fromJson(this.props.configuration))}componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeScannerHandle&&this.barcodeScannerHandle.destroy()}updateDimensions(){return Ms(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}detect(){var e,t,n,i;return Ms(this,void 0,void 0,(function*(){let r=!1;try{if(!this.enabled)return;if(this.paused)return;if(this.detectionRunning)return;this.detectionRunning=!0;const o=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!o)return;const a=new Ls(o);a.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(o.originalImage)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(t=this.overlay)||void 0===t||t.update(null===(n=this.finder)||void 0===n?void 0:n.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(e){console.log(e)}finally{this.detectionRunning=!1;const e=()=>requestAnimationFrame((()=>this.detect())),t=(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)?0:this.configuration.captureDelay;r&&0!=t?setTimeout(e,t):e()}}))}recognizeBarcodes(e,t){var n,i,r,o,a,s,c,u;return Ms(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(e=!1);const c=e?ue.c.DEFAULT_DETECTION_RESOLUTION:ue.c.DETECTION_RESOLUTION_4K,u=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:c;this.camera.finderFrame=null===(i=this.finder)||void 0===i?void 0:i.holeRect;const l=yield null===(r=this.camera)||void 0===r?void 0:r.createImageData(u,!1);if(!l||!this.barcodeScannerHandle)return;t&&this.forceUpdate();const m=d.Image.fromImageData(l),h=yield null===(o=this.barcodeScannerHandle)||void 0===o?void 0:o.run(m,"CONSUME_IMAGE");if(!this.enabled)return;return null===h||null===h.result?void(null===(s=(a=this.props).onLicenseError)||void 0===s||s.call(a)):(this.camera.reusableImageBuffer=h.originalImage,h)}catch(e){return void(null===(u=(c=this.props.configuration).onError)||void 0===u||u.call(c,e))}}))}setRecognitionResolution(e){this.desiredRecognitionResolution=e}getResolution(){return Ms(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?e(Ps.a.fromJson(n)):this.camera.didLoadVideo=()=>{const t=this.camera.videoSize();e(Ps.a.fromJson(t))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}updateTorch(e){this.camera.videoStream.updateTorch(e)}render(){var e,t,n;return T.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),T.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},T.default.createElement(le.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(t=this.state.zoom)&&void 0!==t?t:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&T.default.createElement(de.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),T.default.createElement(Bs,{visible:"processing"===this.state.action}),(null===(n=this.configuration.overlay)||void 0===n?void 0:n.visible)&&T.default.createElement(Ds,{ref:e=>{e&&(this.overlay=e)},configuration:this.configuration.overlay,onPolygonSelected:e=>{const t=Ls.fromBarcode(e);this.configuration.onBarcodesDetected(t)},onBarcodeFound:(e,t,n)=>{var i;(null===(i=this.configuration.overlay)||void 0===i?void 0:i.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(e,t,n)},LabelComponent:Is,labelComponentConfig:{}}))}}Fs.root=null;var Ns=Fs;class Vs{static isConvex(e){if(e.length<4)return!0;let t=!1,n=e.length;for(let i=0;i<n;i++){const r=e[(i+2)%n].x-e[(i+1)%n].x,o=e[(i+2)%n].y-e[(i+1)%n].y,a=e[i].x-e[(i+1)%n].x,s=r*(e[i].y-e[(i+1)%n].y)-o*a;if(0==i)t=s>0;else if(t!=s>0)return!1}return!0}static distanceBetweenPoints(e,t){return Math.pow(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2),.5)}static intersection(e,t){const n=e[0],i=hs.a.subtract(e[1],n),r=t[0],o=hs.a.subtract(t[1],r);if(0===hs.a.cross(i,o))return;const a=hs.a.cross(hs.a.subtract(r,n),i)/hs.a.cross(i,o);return hs.a.add(r,hs.a.multiply(o,a))}static closest(e,t){let n=t[0],i=Math.abs(e-n);for(let r=0;r<t.length;r++){const o=Math.abs(e-t[r]);o<i&&(i=o,n=t[r])}return n}}class Ws{static setFromScanner(e,t){var n;if(!e.current)return;const i=e.current.getCapabilities();t({hasFacingOptions:(null==i?void 0:i.facingMode)&&i.facingMode.length>0,isTorchAvailable:null!==(n=e.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}function js(e,t){return e&&(e.hasFacingOptions&&t.flipCameraButton.visible||e.isTorchAvailable&&t.flashButton.visible)||t.zoomButton.visible}function zs(e){const t=Vs.closest(e.defaultZoomFactor,e.zoomSteps),n=e.zoomSteps.findIndex((e=>e==t)),[i,r]=Object(T.useState)(e.torchEnabledInitially),[o,a]=Object(T.useState)(n),s=e.zoomSteps[o],[c,u]=Object(T.useState)("BACK"==e.initialCameraModule?"environment":"user"),l=function(e){var t,n;const i=null===(n=null===(t=null==e?void 0:e.camera)||void 0===t?void 0:t.video)||void 0===n?void 0:n.parentElement,r=()=>i?i.getBoundingClientRect():null,[o,a]=Object(T.useState)(r());return Object(T.useEffect)((()=>{if(i){const e=()=>a(r());e();const t=new ResizeObserver(e);return t.observe(i),()=>{t.disconnect()}}}),[i]),o}(e.scanner),d=!!l;if(Object(T.useEffect)((()=>{var t;(null===(t=e.capabilities)||void 0===t?void 0:t.isTorchAvailable)&&d&&e.scanner.setTorchState(i)}),[e.capabilities,d,i]),Object(T.useEffect)((()=>{var t;d&&(null===(t=e.scanner)||void 0===t||t.setZoom(s))}),[d,s]),!e.capabilities||!l)return null;if(!js(e.capabilities,e.config))return null;const m=l.height-e.bottomPadding-48;return T.default.createElement(P.Box,{style:{position:"absolute",marginTop:m,marginLeft:l.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},T.default.createElement(ie,Object.assign({},e.config.flashButton,{visible:e.capabilities.isTorchAvailable&&e.config.flashButton.visible,icon:i?P.FlashlightOn:P.FlashlightOff,active:i,onClick:()=>r(!i)})),T.default.createElement("div",{style:{width:20}}),T.default.createElement(ie,Object.assign({},e.config.zoomButton,{text:`${s.toFixed(1)}x`,active:o!==n,onClick:()=>a((o+1)%e.zoomSteps.length)})),T.default.createElement("div",{style:{width:20}}),T.default.createElement(ie,Object.assign({},e.config.flipCameraButton,{visible:e.capabilities.hasFacingOptions&&e.config.flipCameraButton.visible,active:"user"===c,icon:P.FlipCameraIos,onClick:()=>{var t;const n="environment"===c?"user":"environment";u(n),null===(t=e.scanner)||void 0===t||t.setCameraDirection(n)}})))}const Hs=Object(T.createContext)(null);class Us{static compute(e,t,n){const i=(hs.a.lowestY(e)+hs.a.highestY(e))/2,r={badgeY:i,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},r),{labelY:Math.max(hs.a.highestY(e)+Us.LABEL_AND_BADGE_PADDING,t?i-Us.AR_BADGE_SIZE/2-Us.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},r),{labelY:Math.min(hs.a.lowestY(e)-Us.LABEL_AND_BADGE_PADDING,t.visible?i+Us.AR_BADGE_SIZE/2+Us.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:i,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${Us.LABEL_AND_BADGE_PADDING/2}px))`},labelY:i,labelStyle:{transform:t.visible?`translateX(-50%) translateY(${Us.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},r),{labelY:0,labelStyle:{display:"none"}}):void 0}}Us.AR_BADGE_SIZE=48,Us.LABEL_AND_BADGE_PADDING=10;var Zs=Us;function Gs(e){return e.style.visible?""==e.content?null:T.default.createElement(us.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},e.positionBadge),animate:e.animateToPoints?e.positionBadge:{},transition:e.transition},T.default.createElement(W,{polygonConfig:Object.assign(Object.assign({},e.style.background),{cornerRadius:Zs.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},e.verticalPositions.badgeStyle),{width:Zs.AR_BADGE_SIZE,height:Zs.AR_BADGE_SIZE,color:_.b.getColorValue(e.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==e?void 0:e.onClick()},T.default.createElement(P.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e.content))):null}var Ys=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};class Qs extends Is{constructor(){super(...arguments),this.count=0,this.setCount=e=>{this.count=e,this.forceUpdate()}}styleBadge(e,t){this.customBadgeStyle=e,this.customBadgeContent=t,this.forceUpdate()}badgeContent(){return this.customBadgeContent?this.customBadgeContent:0===this.count?"":"x"+this.count}render(){var e,t;let{barcodeItemConfiguration:n,barcodeItemInfoPosition:i,counterBadge:r}=this.props;const o=n,a=this.state.element,s=null!==(e=this.props.animateToPoints)&&void 0!==e?e:a.points,c=a.code,u=a.highlighted,l=(hs.a.lowestX(s)+hs.a.highestX(s))/2;void 0===i&&(i="BELOW");const d=Zs.compute(s,r,i),m=void 0===o||!1===o.titleDeselected.visible&&!1===o.subtitleDeselected.visible,h={x:l,y:Math.round(d.labelY)},f={x:l,y:Math.round(d.badgeY)},p={duration:.25,easing:"linear"};return T.default.createElement(T.default.Fragment,null,o&&T.default.createElement(us.div,{ref:e=>this.label=e,style:Object.assign(Object.assign({},h),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?h:{},transition:p},T.default.createElement(W,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:m?"inline-block":"block",zIndex:1500},d.labelStyle),polygonConfig:u?o.backgroundSelected:o.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)}},T.default.createElement(qs,{barcode:c,barcodeImageVisible:o.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:u?o.titleSelected:o.titleDeselected,barcodeSubtitle:u?o.subtitleSelected:o.subtitleDeselected}))),T.default.createElement(Gs,{onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)},style:null!==(t=this.customBadgeStyle)&&void 0!==t?t:r,positionBadge:f,content:this.badgeContent(),verticalPositions:d,transition:p,animateToPoints:this.props.animateToPoints}))}}function qs(e){var{barcode:t}=e,n=Ys(e,["barcode"]);const i=Object(T.useContext)(Hs).useBarcodeMappedData(t);return T.default.createElement(K,Object.assign({barcodeMappedData:i},n))}var Xs=n(12);function Ks(e){const t=Object(T.useRef)(),n=Object(T.useRef)(null),[i,r]=(Object(T.useContext)(Y),Object(T.useState)(void 0)),[o,a]=Object(T.useState)(!1);Object(T.useEffect)((()=>{var n,i;e.scanningPaused?null===(n=t.current)||void 0===n||n.pauseDetection():null===(i=t.current)||void 0===i||i.resumeDetection()}),[e.scanningPaused]);const s=function(e){const t=new Os;t.visible=e.visible;const n=e.polygon instanceof Xs.c,i=e.polygon,r=e,o=n?i.selected:r.polygon.partiallyScanned,a=n?i.deselected:r.polygon.partiallyScanned;return e.polygon.visible?(t.style.highlightedPolygonFillColor=_.b.getColorValue(o.fillColor),t.style.highlightedPolygonStrokeColor=_.b.getColorValue(o.strokeColor),t.style.highlightedPolygonStrokeWidth=o.strokeWidth,t.style.highlightedPolygonCornerRadius=o.cornerRadius,t.style.polygonFillColor=_.b.getColorValue(a.fillColor),t.style.polygonStrokeColor=_.b.getColorValue(a.strokeColor),t.style.polygonStrokeWidth=a.strokeWidth,t.style.polygonCornerRadius=a.cornerRadius):(t.style.highlightedPolygonFillColor="transparent",t.style.highlightedPolygonStrokeColor="transparent",t.style.polygonFillColor="transparent",t.style.polygonStrokeColor="transparent"),t.automaticSelectionEnabled=!1,t}(e.arOverlay),c=Object.assign(Object.assign({},e.barcodeScannerViewConfig),{onBarcodesDetected:i=>{var r,o,a,s,c,u;null===(r=n.current)||void 0===r||r.update(null===(a=null===(o=t.current)||void 0===o?void 0:o.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,i.originalImageSize,i.barcodes),null===(u=(c=e.barcodeScannerViewConfig).onBarcodesDetected)||void 0===u||u.call(c,i)},_onDetectionFailed:i=>{var r,o,a,s,c,u;null===(r=n.current)||void 0===r||r.update(null===(a=null===(o=t.current)||void 0===o?void 0:o.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,new Ps.a(i.__image_data.width,i.__image_data.height),[]),null===(u=(c=e.barcodeScannerViewConfig)._onDetectionFailed)||void 0===u||u.call(c,i)}});return Object(T.useEffect)((()=>{const t=js(i,e.actionBarConfig);e.setActionButtonsVisible(t),a(t)}),[i,e.actionBarConfig]),T.default.createElement(T.default.Fragment,null,e.arOverlay.visible&&T.default.createElement(Ds,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:Qs,labelComponentConfig:e.arOverlay,onBarcodeFound:e.arOnBarcodeEnter,onPolygonClick:e.arOnBarcodeClick,configuration:s}),T.default.createElement(zs,{config:e.actionBarConfig,scanner:t.current,capabilities:i,bottomPadding:e.actionBarBottomPadding,torchEnabledInitially:e.cameraConfiguration.flashEnabled,zoomSteps:e.cameraConfiguration.zoomSteps,defaultZoomFactor:e.cameraConfiguration.defaultZoomFactor,initialCameraModule:e.cameraConfiguration.cameraModule}),T.default.createElement(Ns,{root:e.root,ref:t,configuration:c,onSuccess:()=>Ws.setFromScanner(t,r),onFailure:e.onCameraPermissionDenied,onLicenseError:e.onLicenseError}))}function Js(e){return Object(T.useMemo)((()=>{const t=(new ks).videoConstraints;t.width.ideal=e.cameraConfiguration.idealPreviewResolution.width,t.height.ideal=e.cameraConfiguration.idealPreviewResolution.height,t.facingMode="FRONT"===e.cameraConfiguration.cameraModule?"user":"environment";const n=e.scannerConfiguration,i=[],r={regexFilter:n.barcodesRegexFilter,minimum1DQuietZoneSize:n.minimum1DBarcodesQuietZone,minimumSizeScore:n.minimumSizeScore,minimumTextLength:n.minimumTextLength,maximumTextLength:n.maximumTextLength,stripCheckDigits:n.stripCheckDigits,gs1Handling:n.gs1Handling};i.push(new d.BarcodeFormatCommonConfiguration(Object.assign({formats:n.barcodeFormats.length>0?n.barcodeFormats:void 0},r))),n.barcodeFormats.includes("MSI_PLESSEY")&&i.push(new d.BarcodeFormatMsiPlesseyConfiguration(Object.assign({checksumAlgorithms:[n.msiPlesseyChecksumAlgorithm]},r))),n.barcodeFormats.includes("IATA_2_OF_5")&&i.push(new d.BarcodeFormatCode2Of5Configuration(Object.assign({useIATA2OF5Checksum:n.useIATA2OF5Checksum},r))),n.barcodeFormats.includes("CODE_11")&&i.push(new d.BarcodeFormatCode11Configuration(Object.assign({checksum:n.useCode11Checksum,stripCheckDigits:n.stripCheckDigits},r))),n.barcodeFormats.includes("AUSTRALIA_POST")&&i.push(new d.BarcodeFormatAustraliaPostConfiguration(Object.assign({australiaPostCustomerFormat:n.australiaPostCustomerFormat},r)));const o=n.barcodeFormats.includes("UPC_E"),a=n.barcodeFormats.includes("UPC_A"),s=n.barcodeFormats.includes("EAN_13"),c=n.barcodeFormats.includes("EAN_8");return(c||s||a||o)&&i.push(new d.BarcodeFormatUpcEanConfiguration(Object.assign(Object.assign({extensions:n.barcodesExtensionFilter},r),{ean8:c,ean13:s,upca:a,upce:o}))),{videoConstraints:t,backgroundColor:_.b.getColorValue(e.backgroundColor),userGuidance:e.userGuidance,finder:e.viewFinder,desiredRecognitionResolution:n.maximumRecognizerResolution,detectionParameters:new d.BarcodeScannerConfiguration({returnBarcodeImage:!0,engineMode:n.engineMode,barcodeFormatConfigurations:i,extractedDocumentFormats:n.extractedDocumentFormats})}}),[e])}var $s=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function ec(e){const[t,n]=Object(T.useState)(null),[i,r]=Object(T.useState)(!0),o=Object(T.useMemo)((()=>"__sb_"+Math.random()),[]),a=e.barcodeMapper,s=e.configuration.useCase,c=Object.assign(Object.assign({},Js(e.configuration)),{onBarcodesDetected:t=>{t.barcodes.length>0&&!s.arOverlay.visible&&e.scanningEnabled.current&&n(t.barcodes[0])},onError:e.onError,containerId:o,captureDelay:0}),u=n=>$s(this,void 0,void 0,(function*(){let i;i=null===t?[]:[new k.BarcodeScannerUiItem({count:1,barcode:n})];const r={items:i};e.onSubmit(r)}));Object(T.useEffect)((()=>{t&&(ae.INSTANCE.beep(e.configuration.sound),ce.INSTANCE.vibrate(e.configuration.vibration))}),[t]),Object(T.useEffect)((()=>{null===t||s.confirmationSheetEnabled||u(t)}),[t,s.confirmationSheetEnabled]);const l=a.useBarcodeMappedData(t);Object(T.useEffect)((()=>{"FAILED"===(null==l?void 0:l.state)&&n(null)}),[null==l?void 0:l.state]),Object(T.useEffect)((()=>{const t=e.configuration.viewFinder.minimumInsets;t.top+=d.minTopPaddingForViewFinder,t.bottom+=i?80:0}),[]);const d=Object(T.useContext)(Y);return T.default.createElement(T.default.Fragment,null,T.default.createElement(Hs.Provider,{value:e.barcodeMapper},T.default.createElement(te,Object.assign({open:!!l&&["LOADED","LOADING"].includes(l.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{u(t)},barcodeMappedData:l},{sheetColorLoaded:(m=s).sheetColor,sheetColorLoading:m.barcodeInfoMapping.sheetColor,barcodeImageVisible:m.barcodeImageVisible,barcodeTitle:m.barcodeTitle,barcodeSubtitle:m.barcodeSubtitle,cancelButton:m.cancelButton,submitButton:m.submitButton,dividerColor:m.dividerColor,loadingMessage:m.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),T.default.createElement(P.Box,{id:o,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},T.default.createElement(Ks,{root:e.root,cameraConfiguration:e.configuration.cameraConfiguration,scanningPaused:null!==t,setActionButtonsVisible:r,barcodeScannerViewConfig:c,arOnBarcodeClick:e=>n(e),arOnBarcodeEnter:t=>{s.arOverlay.automaticSelectionEnabled&&e.scanningEnabled.current&&n(t)},arOverlay:Object.assign(Object.assign({},s.arOverlay),{counterBadge:Object.assign(Object.assign({},s.arOverlay.counterBadge),{visible:!1})}),containerId:o,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:e.onCameraPermissionDenied,onLicenseError:e.onError}))));var m}function tc(e){const t=Object.assign(Object.assign({},e.title),{text:_.b.getLocalizedText(e.title.text,e.textReplacementArgs)});return T.default.createElement(T.default.Fragment,null,T.default.createElement(G,Object.assign({},e.leftButton)),T.default.createElement(P.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},T.default.createElement(N.a,{config:t})),T.default.createElement(G,Object.assign({},e.rightButton)))}function nc(){return T.default.createElement("div",{style:{width:30,height:6,backgroundColor:P.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function ic(e){return T.default.createElement(P.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:e.innerRef},e.dragProps),T.default.createElement(nc,null),T.default.createElement(tc,Object.assign({},e.drawerHeaderContentProps)))}function rc(e){return T.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},T.default.createElement("path",{d:"M4.09514 37.0902V10.6304L0.019043 1.87823L3.18969 0.348877L7.76144 10.6304H32.6886L37.2484 0.348877L40.419 1.87823L36.3549 10.6304V37.0902H4.09514ZM15.994 22.013H24.494C24.9461 22.013 25.3211 21.8632 25.619 21.5637C25.9169 21.2641 26.0658 20.8871 26.0658 20.4325C26.0658 19.9779 25.9169 19.6038 25.619 19.3101C25.3211 19.0164 24.9461 18.8695 24.494 18.8695H15.994C15.5419 18.8695 15.167 19.0193 14.8691 19.3189C14.5712 19.6184 14.4223 19.9955 14.4223 20.45C14.4223 20.9046 14.5712 21.2788 14.8691 21.5725C15.167 21.8662 15.5419 22.013 15.994 22.013ZM7.50164 33.6837H32.9364V14.0489H7.50164V33.6837Z",fill:e.color}))}function oc(e){return e.isVisible?T.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},e.style.placeholderIcon.visible&&T.default.createElement(P.Avatar,{style:{backgroundColor:_.b.getColorValue(e.style.placeholderIconBackground),width:100,height:100}},T.default.createElement(rc,{color:_.b.getColorValue(e.style.placeholderIcon.color)})),T.default.createElement(P.Typography,{style:{marginTop:20},variant:"h6"},T.default.createElement(N.a,{config:e.style.placeholderTitle})),T.default.createElement(P.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},T.default.createElement(N.a,{config:e.style.placeholderSubtitle})),e.onStartClick&&e.style.startScanningButton.visible&&T.default.createElement(J,Object.assign({style:{width:"60%",marginTop:20}},e.style.startScanningButton,{visible:!0,onClick:e.onStartClick}))):null}function ac(e,t,n){const i=Object(T.useRef)(),r=Object(T.useRef)(null),[o,a]=Object(T.useState)(),[s,c]=Object(T.useState)(!1),u=Object(T.useRef)([]),l=e=>{let n="none";if(u.current.length>0){const t=200,i=((e,t)=>{let n=e[0],i=Math.abs(n.time-t);for(let r=1;r<e.length;r++){const o=Math.abs(e[r].time-t);o<i&&(n=e[r],i=o)}return n})(u.current,e.timeStamp-t),r=i.y-e.clientY,o=100;r>o?n="up":r<-o&&(n="down")}u.current.splice(0,u.current.length),t(new hs.a(e.clientX,e.clientY),n)},d={onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),c(!0),r.current=new hs.a(e.clientX,e.clientY),a(hs.a.empty()),e.stopPropagation()},onPointerMove:t=>{if(!s)return;const n=new hs.a(t.clientX,t.clientY);i.current=t,a(n),e(n),u.current.push({x:t.clientX,y:t.clientY,time:t.timeStamp})},onPointerUp:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),l(e)},onPointerCancel:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),n()}};return{startPoint:r,currentPoint:o,props:d,stop:()=>{i.current.stopPropagation()},dragOngoing:s}}var sc=n(46);function cc(e){const[t,n]=Object(T.useState)(0),[i,r]=Object(T.useState)(!1),o=Object(T.useRef)(null),a=Object(T.useContext)(Y).height,s=e=>{n(e),r(!0),setTimeout((()=>{r(!1)}),500)},c=t=>{const n=t-u.startPoint.current.y;return Object(sc.a)((e.isOpen?100:0)-100*n/(window.innerHeight-a-e.closedSheetVisibleHeight),0,100)},u=ac((e=>{n(c(e.y))}),((t,n)=>{if(t.y===u.startPoint.current.y)return;let i;i=c(t.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(i="swipe-to-open"),"down"===n&&(i="swipe-to-close"),e.onSwipe(i)}),(()=>{}));return Object(T.useEffect)((()=>{i||u.dragOngoing||!o||(e.isOpen||0===t?e.isOpen&&100!==t&&s(100):s(0))}),[e.isOpen,t,u.dragOngoing]),T.createElement("div",null,T.createElement(L.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${R} - ${a}px - ${e.closedSheetVisibleHeight}px) * ${t} / 100 + ${e.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:i?"height 500ms":void 0,backgroundColor:_.b.getColorValue(e.contentStyle.sheetColor)},elevation:24}},T.createElement(ic,{innerRef:e=>{o.current=e},drawerHeaderContentProps:e.drawerHeaderContentProps,dragProps:u.props}),e.children,T.createElement(oc,{isVisible:e.isPlaceholderVisible,style:e.contentStyle,onStartClick:()=>e.onSwipe("swipe-to-close")})))}var uc=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};function lc(e){var{inputRef:t}=e,n=uc(e,["inputRef"]);const i=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return T.default.createElement("input",Object.assign({},i,{ref:t}))}function dc(e){const t=!!e.barcode,[n,i]=T.default.useState(""),r=T.default.useRef(null),o={backgroundColor:_.b.getColorValue(e.dialogStyling.sheetColor)};return Object(T.useEffect)((()=>{t&&i(String(e.barcode.count))}),[t]),T.default.createElement(T.default.Fragment,null,T.default.createElement(ee,{open:t,modalOverlayColor:e.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.focus()}},onClose:e.onCancel,PaperProps:{component:"form",onSubmit:t=>{t.preventDefault(),e.setCounter(e.barcode.barcode,parseInt(n)||0)}}},T.default.createElement(P.DialogContent,{style:o},T.default.createElement(P.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},T.default.createElement(N.a,{config:e.dialogStyling.title})),T.default.createElement(P.Typography,{fontSize:14,textAlign:"center"},T.default.createElement(N.a,{config:e.dialogStyling.info})),T.default.createElement(P.Box,{sx:{display:"flex",border:"2px solid",borderColor:_.b.getColorValue(e.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},T.default.createElement(lc,{inputRef:r,value:n,onChange:e=>{const t=parseInt(e.target.value.replaceAll(/[^0-9]/g,""));i(t>=0?t.toString():"")},type:"text",pattern:"[0-9]*"}),e.dialogStyling.clearTextButton.visible&&T.default.createElement(L.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>i(""),htmlColor:_.b.getColorValue(e.dialogStyling.clearTextButton.color)}))),T.default.createElement(P.DialogActions,{sx:Object.assign(Object.assign({},o),{pt:0})},T.default.createElement(L.a,{container:!0,spacing:2},T.default.createElement(L.a,{item:!0,xs:12},T.default.createElement(L.a,{color:_.b.getColorValue(e.dialogStyling.dividerColor)})),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},onClick:e.onCancel},e.dialogStyling.cancelButton))),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({icon:P.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},e.dialogStyling.updateButton)))))))}function mc(e){return T.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:_.b.getColorValue(e.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},T.default.createElement(L.a,{style:{height:"100%",color:_.b.getColorValue(e.config.iconColor),paddingRight:e.visibleOffset/2,cursor:"pointer"}}))}class hc{}hc.ScanbotPrimary="#c8193c",hc.LightGray="#F5F5F5",hc.Gray="#808080",hc.DarkGray="#333333",hc.Orange="#FF5533",hc.White="#FFFFFF",hc.TransparentGreen="rgba(0, 255, 0, 0.5)",hc.TransparentGray="rgba(50, 50, 50, 0.5)",hc.TransparentBlack="rgba(0, 0, 0, 0.3)",hc.SBNegative="#FF3737";var fc=hc;const pc=0,gc=800,vc=1200;function yc(e){switch(e){case"mobile":return Object(P.useMediaQuery)("(min-width:"+pc+"px) and (max-width:"+(gc-1)+"px)");case"tablet":return Object(P.useMediaQuery)("(min-width:"+gc+"px) and (max-width:"+(vc-1)+"px)");case"desktop":return Object(P.useMediaQuery)("(min-width:"+vc+"px)")}}function Cc(e){switch(e){case"mobile":return Object(P.useMediaQuery)("(min-width:"+pc+"px)");case"tablet":return Object(P.useMediaQuery)("(min-width:"+gc+"px)");case"desktop":return Object(P.useMediaQuery)("(min-width:"+vc+"px)")}}const bc=150;function Ac(e){const[t,n]=Object(T.useState)(0),[i,r]=Object(T.useState)(!1);let o;const a=ac((e=>{let t=a.startPoint.current.x-e.x;t<0?a.stop():n(-t)}),(t=>{if(t.x===a.startPoint.current.x)return;if(a.startPoint.current.x-t.x>75){const t=e.animateBackAfterDelete?()=>{u(0)}:void 0;u(bc,t)}else u(0)}),(()=>{u(0)})),s=Object(T.useContext)(Hs),c=s.useBarcodeMappedData(e.barcode);Object(T.useEffect)((()=>{const t={barcode:e.barcode,callback:()=>e.onDelete(e.barcode)};return s.addOnEvictionListener(t),()=>{s.removeOnEvictionListener(t)}}),[]);const u=(t,i)=>{const a=t>=bc,s=-o.getBoundingClientRect().width;n(a?s:0),r(!0),setTimeout((()=>{r(!1),a&&e.onDelete(e.barcode),i&&i()}),200)},l=yc("desktop")&&e.swipeToDeleteConfig.enabled,d=!l&&e.swipeToDeleteConfig.enabled;return Object(T.useEffect)((()=>{d||u(0)}),[d]),T.default.createElement(P.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:e=>{e&&(o=e)}},T.default.createElement(mc,{config:e.swipeToDeleteConfig,visibleOffset:bc}),T.default.createElement(P.Box,Object.assign({sx:{width:"100%",backgroundColor:_.b.getColorValue(e.sheetColor),transform:`translateX(${t}px)`,transition:i?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px"}},d?a.props:{}),T.default.createElement(K,Object.assign({barcodeMappedData:c},e,{readonlyCount:e.readonlyCount})),null!==e.readonlyCount&&T.default.createElement(P.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",paddingRight:"16px",color:_.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",e.readonlyCount),l&&T.default.createElement(L.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",paddingRight:"16px",color:_.b.getColorValue("?sbColorOnSurface")},onClick:()=>e.onDelete(e.barcode)}),T.default.createElement(P.Box,{sx:{width:"0px"}})))}function Sc(e){const t=_.b.getColorValue(e.sheetContent.dividerColor),n=e.sheetContent.manualCountChangeEnabled&&"COUNTING"===e.mode,i=(t,n)=>{let i=e.indicatorColor.partial;return n===t.count?i=e.indicatorColor.complete:0===n&&(i=e.indicatorColor.notScanned),_.b.getColorValue(i)};return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Divider,{style:{borderColor:t}}),e.barcodes.length>0&&T.default.createElement(L.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},T.default.createElement(L.a,{sx:{p:0}},e.barcodes.map((({barcode:r,count:o})=>{const a=e.expectedBarcodes.find((e=>e.barcodeValue===r.text)),s=r.text+r.format+o;return T.default.createElement(L.a,{key:s,sx:{padding:0,borderBottom:`1px solid ${t}`}},e.indicatorColor&&T.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:i(a,o),position:"absolute"}}),T.default.createElement(Ac,{barcode:r,animateBackAfterDelete:e.animateBackAfterDelete,onDelete:()=>e.onBarcodeChange({type:"remove",barcode:r}),counterForm:n&&{counter:o,manualCountChangeColor:e.sheetContent.manualCountChangeColor,manualCountOutlineColor:e.sheetContent.manualCountOutlineColor,addButtonEnabled:void 0===a||a.count>o,removeButtonEnabled:void 0===a||o>0,setCounter:t=>{e.onBarcodeChange({type:"setCount",barcodes:[r],computeNewCount:()=>t})},onNumberClick:()=>e.onNumberClick({barcode:r,count:o})},readonlyCount:"COUNTING"!==e.mode||e.sheetContent.manualCountChangeEnabled?null:o,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,displayRightArrow:!1,imageSize:n?84:40,barcodeImageVisible:e.sheetContent.barcodeItemImageVisible,barcodeTitle:e.sheetContent.barcodeItemTitle,barcodeSubtitle:e.sheetContent.barcodeItemSubtitle,swipeToDeleteConfig:e.sheetContent.swipeToDelete,sheetColor:e.sheetContent.sheetColor}))})))))}function wc(e){const t=e.badgeStyle||{},n=e.overlap||"circular";return T.default.createElement(P.Badge,{anchorOrigin:{vertical:"top",horizontal:"left"},badgeContent:e.text,showZero:!0,color:"primary",overlap:n,slotProps:{badge:{style:Object.assign(Object.assign({},t),{backgroundColor:e.backgroundColor,color:e.foregroundColor,fontWeight:"bold"})}}},e.children)}function Ec(e){if(!e.buttonStyling.visible)return null;return T.default.createElement(P.Box,{style:e.style},T.default.createElement(wc,{text:e.text,backgroundColor:_.b.getColorValue(e.buttonStyling.badgeBackgroundColor),foregroundColor:_.b.getColorValue(e.buttonStyling.badgeForegroundColor)},T.default.createElement(P.IconButton,{sx:{backgroundColor:_.b.getColorValue(e.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:_.b.getColorValue(e.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:e.onClick,disableRipple:!0,disableFocusRipple:!0},T.default.createElement(L.a,{sx:{color:_.b.getColorValue(e.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:_.b.getColorValue(e.buttonStyling.activeForegroundColor)}}}))))}const Dc=(e,t)=>(null===e.format||null===t.format||e.format===t.format)&&e.text===t.text,xc=(e,t)=>e.find((e=>((e,t)=>e.barcodeValue===t.text)(e,t)));class Bc{constructor(e,t){this.expectedCount=e,this.foundCount=t}isFulFilled(){return void 0!==this.expectedCount&&void 0!==this.foundCount&&this.expectedCount===this.foundCount}toString(){return`${this.foundCount}/${this.expectedCount}`}}function Ic(e){const t=Object(T.useContext)(_.a).getColorValue,n={backgroundColor:t(e.sheetColor)};return T.default.createElement(ee,{modalOverlayColor:e.modalOverlayColor,open:e.open},T.default.createElement(P.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},T.default.createElement(P.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},T.default.createElement(N.a,{config:e.title})),T.default.createElement(P.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},T.default.createElement(N.a,{config:e.subtitle}))),T.default.createElement(P.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},T.default.createElement(L.a,{container:!0,spacing:2},T.default.createElement(L.a,{item:!0,xs:12},T.default.createElement(L.a,{color:t(e.dividerColor)})),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},icon:e.cancelButton.icon,onClick:e.cancelButton.onClick},e.cancelButton.style))),T.default.createElement(L.a,{item:!0,xs:6},T.default.createElement(J,Object.assign({style:{width:"100%"},icon:e.okButton.icon,onClick:e.okButton.onClick},e.okButton.style))))))}function Tc(e){return e.open?T.default.createElement(Ic,{open:e.open,dividerColor:e.style.dividerColor,modalOverlayColor:e.style.modalOverlayColor,sheetColor:e.style.sheetColor,title:e.style.title,subtitle:e.style.subtitle,cancelButton:{style:e.style.cancelButton,onClick:e.onDismiss},okButton:{style:e.style.okButton,onClick:e.onSubmit}}):null}class Oc{constructor(e,t,n){this.barcodeItemSubtitleText=e,this.foundBarcodes=t,this.expectedBarcodes=n}useBarcodeMappedData(e){var t,n,i;const r=null!==(n=null===(t=this.foundBarcodes.find((t=>Dc(t.barcode,e))))||void 0===t?void 0:t.count.toString())&&void 0!==n?n:"0",o=xc(this.expectedBarcodes,e);return{state:"LOADED",value:{title:`${null!==(i=o.title)&&void 0!==i?i:e.text}`,subtitle:_.b.getLocalizedText(this.barcodeItemSubtitleText,[r,null==o?void 0:o.count.toString()]),barcodeImage:o.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function kc(e){const t=Object(T.useContext)(Y);return T.default.createElement(L.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:t.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:_.b.getColorValue(e.sheetContent.sheetColor)}},T.default.createElement(L.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},T.default.createElement(tc,Object.assign({},e.headerProps))),e.barcodeList,T.default.createElement(oc,{isVisible:e.isEmptyStateVisible,style:e.sheetContent}))}var Pc=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function Lc(e){const t=Object(T.useRef)(),n=Object(T.useRef)(new Date("2001-01-01")),[i,r]=Object(T.useReducer)(function(e,t,n,i){return(r,o)=>{const a=e.useCase,s="FindAndPickScanningMode"===a._type,c=s?"COUNTING":a.mode,u=s?a.expectedBarcodes:[],l=e=>{let t=[...r];const n=o.barcodes||[o.barcode];for(const i of n){const n=t.findIndex((e=>Dc(e.barcode,i)));if(-1===n)t.push({barcode:i,count:e(0)});else{const i=t[n];t[n]=Object.assign(Object.assign({},i),{count:e(i.count,i)})}}return t},d=(e,n)=>{var r;if(t.current=new Date,!n)return e;const o=null===(r=xc(u,n.barcode))||void 0===r?void 0:r.count;return void 0===o||o===e?e:(i(),e+1)};switch(o.type){case"onBarcodesDetected":{if((new Date).getTime()-t.current.getTime()<a.countingRepeatDelay||!n.current)return[...r];if(s)return a.arOverlay.automaticSelectionEnabled?l(d):[...r];const e=a.arOverlay;if(!e.visible||e.automaticSelectionEnabled){let e=!1;return l((n=>{let r="COUNTING"===c?n+1:1;return r===n||e||(t.current=new Date,i()),r}))}return l((e=>e))}case"onARCodeClick":return l(((e,t)=>{if(s)return d(e,t);const n="UNIQUE"===c?1-e:e+1;return n>0&&i(),n}));case"onCountEditDialogChange":{let e=()=>o.count||0;if(s){const t=xc(u,o.barcode);o.count>t.count&&(e=()=>t.count)}return l(e)}case"setCount":return l(o.computeNewCount);case"remove":return r.map((e=>Object.assign(Object.assign({},e),{count:Dc(e.barcode,o.barcode)?0:e.count})));case"clear":return r.map((e=>Object.assign(Object.assign({},e),{count:0})));case"setHtmlElements":let e=!1;const m=r.map((t=>Dc(t.barcode,o.barcode)?(e=!0,Object.assign(Object.assign({},t),{polygonElement:o.polygonElement,labelElement:o.labelElement})):t));return e||m.push({barcode:o.barcode,count:0,labelElement:o.labelElement,polygonElement:o.polygonElement}),m}}}(e.configuration,n,e.scanningEnabled,(()=>{ae.INSTANCE.beep(e.configuration.sound),ce.INSTANCE.vibrate(e.configuration.vibration)})),[]),[o,a]=T.default.useState(null),[s,c]=Object(T.useState)(!1),u=Object(T.useMemo)((()=>"__sb_"+Math.random()),[]),[l,m]=Object(T.useState)(!0),h=e.barcodeMapper,[f,p]=Object(T.useState)(null),g="FindAndPickScanningMode"===e.configuration.useCase._type,v=e.configuration.useCase,y=g?"COUNTING":v.mode,C=Object(T.useRef)(Object.assign(Object.assign({},Js(e.configuration)),{onBarcodesDetected:e=>{r({type:"onBarcodesDetected",barcodes:e.barcodes})},_onDetectionFailed(e){},onError:e.onError,captureDelay:1e3/60}));Object(T.useEffect)((()=>{if(g){const e=S();for(const n of e){const e=[(t=n.barcodeValue,new d.BarcodeItem({format:null,sourceImage:null,text:t,rawBytes:null,rawBytesEncodings:[],structuredAppendInfo:null,quad:[],quadNormalized:[],extendedQuad:[],extendedQuadNormalized:[],upcEanExtension:null,extractedDocument:null}))];r({type:"setCount",barcodes:e,computeNewCount:()=>0})}}var t;const n=e.configuration.viewFinder.minimumInsets;n.top+=V.minTopPaddingForContent,n.bottom+=N}),[]),Object(T.useEffect)((()=>{C.current.container=t.current}),[t]),Object(T.useEffect)((()=>{if(g)for(const e of i){const t=v.arOverlay,n=e.polygonElement,i=e.labelElement;if(E(e.barcode)){const r=W(e.barcode);let o=e.count+"/"+r.expectedCount;v.arOverlay.automaticSelectionEnabled||0!==e.count||(o=T.default.createElement(P.TouchApp,null)),r.isFulFilled()?(null==n||n.style(_.b.getPolygonColorValues(t.polygon.completed,t.polygon.visible)),null==i||i.styleBadge(t.badge.completed,T.default.createElement(P.Check,null))):(null==n||n.style(_.b.getPolygonColorValues(t.polygon.partiallyScanned,t.polygon.visible)),null==i||i.styleBadge(t.badge.partiallyScanned,o))}else null==n||n.style(_.b.getPolygonColorValues(t.polygon.rejected,t.polygon.visible)),null==i||i.styleBadge(t.badge.rejected,T.default.createElement(P.Close,null))}else for(const e of i){if(e.polygonElement){const t=v.arOverlay.polygon,n=e.count>0?t.selected:t.deselected;e.polygonElement.style(_.b.getPolygonColorValues(n,t.visible))}e.labelElement&&(e.labelElement.update(Object.assign(Object.assign({},e.labelElement.state.element),{highlighted:e.count>0})),e.labelElement.setCount(e.count))}}),[i]);const b=i.reduce(((e,t)=>e+t.count),0),A=()=>S().every((e=>i.some((t=>t.barcode.text===e.barcodeValue&&t.count===e.count)))),S=()=>g?v.expectedBarcodes:[],w=e=>xc(S(),e),E=e=>!!w(e),D=()=>g?i.filter((e=>E(e.barcode))):i.filter((e=>e.count>0)),x=()=>Pc(this,void 0,void 0,(function*(){const t=D().map((e=>new k.BarcodeScannerUiItem({count:"COUNTING"===y?e.count:1,barcode:e.barcode})));e.onSubmit({items:t})})),B=T.default.createElement(Sc,{expectedBarcodes:S(),barcodes:D(),animateBackAfterDelete:g,onBarcodeChange:r,sheetContent:v.sheetContent,onNumberClick:e=>a(e),mode:y,indicatorColor:g&&{partial:v.scanningPartiallyColor,complete:v.scanningCompletedColor,notScanned:v.scanningNotScannedColor}}),I={textReplacementArgs:[b.toString()],leftButton:Object.assign(Object.assign({},v.sheetContent.clearAllButton),{onClick:()=>r({type:"clear"}),disabled:0===b}),rightButton:Object.assign(Object.assign({},v.sheetContent.submitButton),{onClick:()=>Pc(this,void 0,void 0,(function*(){if(g){const e=v;let t=null;e.partialScannedAlertDialogEnabled&&!A()&&(t=e.partialScannedAlertDialog),e.confirmationAlertDialogEnabled&&A()&&(t=e.confirmationAlertDialog),t?p(t):yield x()}else yield x()})),disabled:!g&&!v.allowEmptySubmission&&0===b}),title:v.sheetContent.title},O=yc("mobile"),R="BUTTON"!==v.sheet.mode&&O?"SMALL"===v.sheet.collapsedVisibleHeight?69:128:0,M=O&&"BUTTON"===v.sheet.mode,F=M?76:0,N=(l?80:0)+F,V=Object(T.useContext)(Y),W=e=>{const t=i.find((t=>t.barcode.text===e.text)),n=w(e);return new Bc(null==n?void 0:n.count,null==t?void 0:t.count)},j=S().reduce(((e,t)=>e+t.count),0);g&&I.textReplacementArgs.push(j.toString());const z=g?new Oc(v.sheetContent.barcodeItemSubtitle.text,i,S()):h,H=!g&&0===b;return T.default.createElement(T.default.Fragment,null,T.default.createElement(Hs.Provider,{value:z},T.default.createElement(L.a,{container:!0,sx:{display:"flex",flexDirection:O?"column":"row",height:`calc(${V.remainingVisibleBodyHeight} - ${R}px)`},alignItems:"stretch"},T.default.createElement(L.a,{id:u,item:!0,ref:t,component:"div",xs:O?12:7,zIndex:100},M&&T.default.createElement(Ec,{style:{position:"absolute",marginTop:`calc(${V.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:g?`${b}/${j}`:b.toString(),onClick:()=>c(!s),buttonStyling:v.sheet.listButton}),T.default.createElement(Ks,{root:e.root,arOverlay:(()=>{if(g){const e=v.arOverlay;return Object.assign(Object.assign({},e),{counterBadge:Object.assign({},e.badge.partiallyScanned)})}const e=v.arOverlay,t=e.counterBadge;return Object.assign(Object.assign({},e),{counterBadge:Object.assign(Object.assign({},t),{visible:t.visible&&"COUNTING"===y})})})(),containerId:u,barcodeScannerViewConfig:C.current,onCameraPermissionDenied:e.onCameraPermissionDenied,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16+F,setActionButtonsVisible:m,arOnBarcodeClick:e=>{r({type:"onARCodeClick",barcode:e})},arOnBarcodeEnter:(e,t,n)=>{if(!n||!t)return;r({type:"setHtmlElements",barcode:e,labelElement:n,polygonElement:t})},scanningPaused:s&&O,cameraConfiguration:e.configuration.cameraConfiguration,onLicenseError:e.onError}),O&&T.default.createElement(cc,{closedSheetVisibleHeight:R,sheetStyle:v.sheet,contentStyle:v.sheetContent,manualCountEditDialog:v.manualCountEditDialog,isPlaceholderVisible:H,onBarcodeChange:e=>r(e),drawerHeaderContentProps:I,isOpen:s,onSwipe:e=>{c("swipe-to-open"===e)}},B)),Cc("tablet")&&T.default.createElement(kc,{headerProps:I,sheetContent:v.sheetContent,isEmptyStateVisible:H,barcodeList:B})),T.default.createElement(dc,{barcode:o,dialogStyling:v.manualCountEditDialog,onCancel:()=>a(null),setCounter:(e,t)=>{r({type:"onCountEditDialogChange",barcode:e,count:t}),a(null)}}),T.default.createElement(Tc,{open:null!==f,style:f,onDismiss:()=>p(null),onSubmit:x})))}const _c=Object(T.createContext)(null),Rc={didCatch:!1,error:null};class Mc extends T.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Rc}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:r,reason:"imperative-api"}),this.setState(Rc)}}componentDidCatch(e,t){var n,i;null===(n=(i=this.props).onError)||void 0===n||n.call(i,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:i}=this.props;var r,o;n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some(((e,n)=>!Object.is(e,t[n])))}(e.resetKeys,i)&&(null===(r=(o=this.props).onReset)||void 0===r||r.call(o,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Rc))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:r,error:o}=this.state;let a=e;if(r){const e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)a=t(e);else if(n)a=Object(T.createElement)(n,e);else{if(null!==i&&!Object(T.isValidElement)(i))throw o;a=i}}return Object(T.createElement)(_c.Provider,{value:{didCatch:r,error:o,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Fc(){const e=Object(T.useRef)(!0);return Object(T.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function Nc(e){const t=Fc(),[,n]=Object(T.useReducer)((e=>e+1),0),i=Object(T.useRef)();return Object(T.useMemo)((()=>{i.current={loading:!0,value:void 0,error:null}}),[e]),function(e,t){Object(T.useMemo)((()=>{e&&e.then((e=>{t({loading:!1,error:null,value:e})})).catch((e=>{t({loading:!1,error:{reason:e},value:void 0})}))}),[e])}(e,(e=>{i.current=e,t.current&&n()})),e?i.current:null}var Vc=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Wc{constructor(e,t){this.barcodeItemMapper=e,this.onError=t,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=e=>ds(e),this.onEvictionListeners=new Set}getBarcodeMappedData(e){const t=this.hash(e);if(!this.cache.has(t)){const n=(()=>Vc(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const t=new k.BarcodeScannerUiItem({count:1,barcode:e});return this.barcodeItemMapper(t)}{const t=yield b.toDataUrl(yield Jh.instance.imageToJpeg(e.sourceImage)),n=e.upcEanExtension?` ${e.upcEanExtension}`:"";return{title:e.text+n,subtitle:e.format,barcodeImage:t}}})))();this.cache.set(t,n)}return this.cache.get(t)}useBarcodeMappedData(e){const t=Object(T.useRef)(!1),n=Nc(e&&this.getBarcodeMappedData(e));if(Object(T.useEffect)((()=>{n&&n.error&&(t.current=!1,this.cacheEntryPendingRetries.push({barcode:e,retry:()=>{this.cache.delete(this.hash(e)),t.current=!0}}),this.onError((()=>{for(const e of this.cacheEntryPendingRetries)e.retry();this.cacheEntryPendingRetries.length=0}),(()=>{t.current=!0;for(const e of this.cacheEntryPendingRetries)for(const t of this.onEvictionListeners)this.hash(t.barcode)==this.hash(e.barcode)&&t.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let i;return i=n.value?"LOADED":n.error&&!t.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:i}}addOnEvictionListener(e){this.onEvictionListeners.add(e)}removeOnEvictionListener(e){this.onEvictionListeners.delete(e)}}k.BarcodeItemErrorState;function jc(e){return T.default.createElement(Ic,{open:e.open,dividerColor:e.dividerColor,modalOverlayColor:e.modalOverlayColor,sheetColor:e.sheetColor,title:e.title,subtitle:e.subtitle,cancelButton:{style:e.cancelButton,onClick:e.handleCancel},okButton:{style:e.retryButton,icon:P.Replay,onClick:e.handleRetry}})}function zc(e){const t=Object(T.useContext)(Y);if(!e.visible)return null;const n={textAlign:"center",maxWidth:"94%",wordWrap:"break-word"};return T.default.createElement(P.Box,{sx:{paddingTop:t.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:_.b.getColorValue(e.config.background)}},T.default.createElement(P.Box,{sx:{height:t.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},e.config.icon.visible&&T.default.createElement(P.Box,null,T.default.createElement(P.Avatar,{sx:{width:100,height:100,backgroundColor:_.b.getColorValue(e.config.iconBackground),margin:"24px"}},T.default.createElement(L.a,{sx:{fontSize:50,color:_.b.getColorValue(e.config.icon.color)}}))),T.default.createElement(P.Typography,{sx:Object.assign({fontSize:20},n)},T.default.createElement(N.a,{config:e.config.enableCameraTitle})),T.default.createElement(P.Typography,{sx:Object.assign({fontSize:16,paddingTop:"12px"},n)},T.default.createElement(N.a,{config:e.config.enableCameraExplanation,asHtml:!0})),T.default.createElement(P.Box,{sx:{paddingTop:"16px"}},T.default.createElement(G,Object.assign({},e.config.closeButton,{styleOverrides:{fontSize:14},onClick:e.onCloseClick})))))}function Hc(e){const t=Object(T.useRef)(Object(P.createTheme)({palette:{primary:{main:fc.ScanbotPrimary},secondary:{main:fc.DarkGray}}})),[n,i]=Object(T.useState)(!1),[r,o]=Object(T.useState)(!1),[a,s]=Object(T.useState)(e.configuration.timeouts.initialScanDelay<=0),c=Object(T.useRef)(!1),u=Object(T.useRef)(),l=Object(T.useRef)(),d=e.configuration.useCase,m="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,h=Object(T.useMemo)((()=>new Wc(null==m?void 0:m.barcodeItemMapper,((e,t)=>{i(!0),u.current=()=>{i(!1),e()},l.current=()=>{i(!1),t()}}))),[]);let f;if(Object(T.useMemo)((()=>{_.b.setPalette(e.configuration.palette),_.b.setLocalization(e.configuration.localization)}),[e.configuration]),Object(T.useEffect)((()=>{if(e.configuration.timeouts.autoCancelTimeout>0){const t=setTimeout((()=>{e.onClose()}),e.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(t)}}}),[]),Object(T.useEffect)((()=>{if(e.configuration.timeouts.initialScanDelay>0){const t=setTimeout((()=>{s(!0)}),e.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(t)}}}),[]),Object(T.useEffect)((()=>{c.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)f=T.default.createElement(ec,{root:e.root,configuration:e.configuration,barcodeMapper:h,onClose:e.onClose,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>o(!0),scanningEnabled:c});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");f=T.default.createElement(Lc,{root:e.root,configuration:e.configuration,barcodeMapper:h,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>o(!0),scanningEnabled:c})}return T.default.createElement(T.default.Fragment,null,T.default.createElement(M,null),T.default.createElement(Mc,{onError:e.onError,fallback:T.default.createElement("div",null,"Error")},T.default.createElement(_.a.Provider,{value:Object(_.c)(e.configuration.palette)},T.default.createElement(P.ThemeProvider,{theme:t.current},m&&T.default.createElement(jc,Object.assign({open:n,handleCancel:l.current,handleRetry:u.current,modalOverlayColor:m.modalOverlayColor,dividerColor:m.dividerColor,sheetColor:m.sheetColor},m.errorState)),T.default.createElement(L.a,{sx:{height:`100 * ${R}`,width:"100vw",backgroundColor:_.b.getColorValue(e.configuration.backgroundColor)}},T.default.createElement(Q,Object.assign({cameraPermissionDenied:r,onBackPress:e.onClose},e.configuration.topBar),!r&&f,T.default.createElement(zc,{visible:r,onCloseClick:e.onClose,config:e.configuration.cameraPermission})))))))}class Uc{constructor(e){this.document=e}}var Zc=n(22),Gc=n(40);function Yc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.489746)",fill:"transparent"}),T.default.createElement("path",{d:"M173.211 205.398H94.7913C93.9699 205.398 93.3054 204.733 93.3054 203.912V80.0909C93.3054 79.2695 93.9699 78.605 94.7913 78.605H173.211C174.033 78.605 174.697 79.2695 174.697 80.0909V203.912C174.697 204.733 174.033 205.398 173.211 205.398ZM96.2771 202.426H171.726V81.5767H96.2771V202.426ZM160.829 184.761H152.575V181.789H160.829V184.761ZM160.829 168.252H107.173V165.28H160.829V168.252ZM160.829 151.742H152.575V148.77H160.829V151.742ZM136.065 151.742H107.173V148.77H136.065V151.742ZM160.829 135.233H152.575V132.261H160.829V135.233ZM136.065 135.233H107.173V132.261H136.065V135.233ZM160.829 118.723H152.575V115.751H160.829V118.723ZM136.065 118.723H107.173V115.751H136.065V118.723ZM160.829 102.214H152.575V99.2419H160.829V102.214ZM136.065 102.214H107.173V99.2419H136.065V102.214Z",fill:t}),T.default.createElement("path",{d:"M178.826 66.5525H170.571V63.5808H178.826V66.5525ZM154.062 66.5525H125.17V63.5808H154.062V66.5525ZM178.826 50.043H170.571V47.0713H178.826V50.043ZM154.062 50.043H125.17V47.0713H154.062V50.043Z",fill:t}),T.default.createElement("path",{d:"M111.302 35.8152C111.302 34.9939 111.967 34.3293 112.788 34.3293H191.208C192.03 34.3293 192.694 34.9939 192.694 35.8152V135.232C192.694 136.053 192.03 136.718 191.208 136.718H173.213V133.746H189.722V37.3011H114.274V80.0903H111.302V35.8152Z",fill:t}),T.default.createElement("path",{d:"M174.46 79.6618C174.202 78.8819 173.363 78.4596 172.583 78.7174L172.105 82.0053L188.88 134.381L191.134 136.258C191.134 136.258 191.134 134.195 192.079 134.381L174.46 79.6618Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M172.051 142.95V124.876L96.3274 152.397V170.471L172.051 142.95Z",fill:t})))}function Qc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.237671)",fill:"transparent"}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.3575 73.6228C84.5124 73.6228 83.8287 74.3065 83.8287 75.1516V189.81C83.8287 190.655 84.5124 191.339 85.3575 191.339H174.536C175.381 191.339 176.065 190.655 176.065 189.81V100.631C176.065 100.224 175.904 99.8371 175.619 99.5526L150.139 74.073C149.851 73.7842 149.464 73.6228 149.057 73.6228H85.3575ZM86.8863 76.6804V188.281H173.007V102.16H149.057C148.212 102.16 147.528 101.476 147.528 100.631V76.6804H86.8863ZM170.846 99.1025L150.585 78.8419V99.1025H170.846Z",fill:t}),T.default.createElement("path",{d:"M147.528 177.665H96.5686V174.607H147.528V177.665ZM164.514 167.048H96.5686V163.991H164.514V167.048ZM164.514 156.432H96.5686V153.374H164.514V156.432ZM133.149 105.956L130.987 103.795L119.33 115.456L109.767 105.893C113.742 104.559 116.613 100.801 116.613 96.3846C116.613 90.8598 112.115 86.3626 106.591 86.3626H96.5686V121.864H99.6261V106.407H105.958L117.169 117.618L105.508 129.279L107.669 131.44L119.33 119.779L130.992 131.44L133.153 129.279L121.492 117.618L133.149 105.956ZM99.6261 103.349V89.4202H106.591C110.429 89.4202 113.555 92.5457 113.555 96.3846C113.555 100.224 110.429 103.349 106.591 103.349H99.6261Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M98.0973 60.883C97.2523 60.883 96.5686 61.5667 96.5686 62.4118V73.6228H99.6261V63.9406H160.268V87.8914C160.268 88.7365 160.951 89.4202 161.796 89.4202H185.747V175.541H176.076V178.599H187.276C188.121 178.599 188.805 177.915 188.805 177.07V87.8914C188.805 87.4838 188.643 87.0973 188.359 86.8128L162.879 61.3331C162.591 61.0444 162.204 60.883 161.796 60.883H98.0973ZM183.586 86.3626L163.325 66.1021V86.3626H183.586Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M110.837 48.1432C109.992 48.1432 109.308 48.8269 109.308 49.672V60.883H112.366V51.2007H173.007V75.1516C173.007 75.9967 173.691 76.6804 174.536 76.6804H198.487V162.802H188.816V165.859H200.016C200.861 165.859 201.545 165.175 201.545 164.33V75.1516C201.545 74.7439 201.383 74.3575 201.099 74.073L175.619 48.5933C175.33 48.3046 174.944 48.1432 174.536 48.1432H110.837ZM196.326 73.6228L176.065 53.3623V73.6228H196.326Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M172.844 188.832H86.629V113.394L172.844 148.212V188.832Z",fill:"url(#paint0_linear_557_1465)"})),T.default.createElement("defs",null,T.default.createElement("linearGradient",{id:"paint0_linear_557_1465",x1:"130.151",y1:"118.368",x2:"129.736",y2:"188.832",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),T.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function qc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",fill:"transparent"}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.2563 72.9183C84.4112 72.9183 83.7275 73.607 83.7275 74.4583V189.956C83.7275 190.807 84.4112 191.496 85.2563 191.496H174.435C175.28 191.496 175.964 190.807 175.964 189.956V100.124C175.964 99.7137 175.802 99.3244 175.518 99.0378L150.038 73.3717C149.75 73.0808 149.363 72.9183 148.955 72.9183H85.2563ZM86.7851 75.9982V188.416H172.906V101.664H148.955C148.11 101.664 147.427 100.976 147.427 100.124V75.9982H86.7851ZM170.745 98.5844L150.484 78.1756V98.5844H170.745Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M161.695 124.25H97.9961V127.33H161.695V124.25ZM161.695 137.084H97.9961V140.168H161.695V137.084ZM161.695 149.917H97.9961V153.001H161.695V149.917ZM161.695 162.75H97.9961V165.834H161.695V162.75Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M97.9961 60.0852C97.1511 60.0852 96.4674 60.774 96.4674 61.6252V72.9183H99.5249V63.1652H160.166V87.2913C160.166 88.1426 160.85 88.8313 161.695 88.8313H185.646V175.583H175.975V178.663H187.175C188.02 178.663 188.704 177.974 188.704 177.123V87.2913C188.704 86.8807 188.542 86.4914 188.258 86.2048L162.778 60.5387C162.489 60.2478 162.103 60.0852 161.695 60.0852H97.9961ZM183.485 85.7513L163.224 65.3425V85.7513H183.485Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M110.736 47.2522C109.891 47.2522 109.207 47.9409 109.207 48.7922V60.0852H112.265V50.3321H172.906V74.4583C172.906 75.3095 173.59 75.9982 174.435 75.9982H198.386V162.75H188.715V165.83H199.915C200.76 165.83 201.443 165.141 201.443 164.29V74.4583C201.443 74.0476 201.282 73.6583 200.998 73.3717L175.518 47.7056C175.229 47.4147 174.843 47.2522 174.435 47.2522H110.736ZM196.224 72.9183L175.964 52.5095V72.9183H196.224Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M172.844 188.594H86.629V113.156L172.844 147.974V188.594Z",fill:"url(#paint0_linear_557_1462)"})),T.default.createElement("defs",null,T.default.createElement("linearGradient",{id:"paint0_linear_557_1462",x1:"130.151",y1:"118.13",x2:"129.736",y2:"188.594",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),T.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function Xc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.252197)",fill:"transparent"}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8858 67.2461H206.331C207.315 67.2461 208.112 68.0427 208.112 69.0274V148.198C208.112 149.183 207.315 149.979 206.331 149.979H57.8858C56.9011 149.979 56.1045 149.183 56.1045 148.198V69.0274C56.1045 68.0427 56.9011 67.2461 57.8858 67.2461ZM204.549 70.8088H188.502L184.935 70.8038H79.2767L75.719 70.8088H59.6672V146.417H204.549V70.8088Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.232 131.072H70.4609V134.579H192.232V131.072Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.023 124.445H70.4609V127.951H137.023V124.445Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M154.834 91.8126C156.378 91.2748 157.875 91.8812 159.135 93.0581C159.912 93.7836 160.383 94.9148 160.697 96.2223C161.89 101.192 158.931 105.086 155.401 107.747C154.487 108.436 153.507 109.065 152.504 109.634C152.629 111.883 152.971 113.886 153.518 115.307C153.958 116.449 154.414 116.91 154.695 117.045C154.824 117.106 155.197 117.245 156.082 116.593C157.154 115.804 158.48 114.339 160.054 111.889C162.325 108.353 163.811 105.745 164.733 103.853C164.871 103.57 164.994 103.305 165.105 103.06C164.618 101.743 165.065 100.362 165.498 99.625C165.624 99.4115 165.788 99.1797 165.997 98.9797C166.151 98.8316 166.576 98.4573 167.217 98.4428C167.593 98.4343 167.97 98.5556 168.278 98.8062C168.562 99.0368 168.712 99.3145 168.792 99.5191C168.942 99.9021 168.95 100.295 168.937 100.573C168.909 101.173 168.741 101.894 168.437 102.749C168.829 103.064 169.379 103.266 170.06 103.302C171.173 103.362 172.298 102.941 172.954 102.213C174.863 100.095 177.418 98.185 180.536 97.8253C181.365 97.7297 182.224 97.6408 183.098 97.5504C186.089 97.241 189.256 96.9135 191.961 96.2372C193.699 95.8027 195.099 95.2557 196.067 94.5713C196.998 93.9135 197.455 93.1906 197.539 92.3236L200.494 92.6118C200.305 94.546 199.225 95.9753 197.781 96.9957C196.375 97.9894 194.564 98.6466 192.681 99.1174C189.748 99.8507 186.282 100.208 183.263 100.519C182.426 100.606 181.624 100.688 180.876 100.775C178.776 101.017 176.834 102.343 175.159 104.201C173.808 105.699 171.758 106.366 169.903 106.267C168.995 106.219 168.054 105.978 167.227 105.507C166.23 107.501 164.725 110.11 162.552 113.493C160.889 116.083 159.331 117.887 157.843 118.984C156.448 120.011 154.889 120.429 153.414 119.723C152.091 119.09 151.273 117.738 150.747 116.374C150.182 114.907 149.821 113.068 149.634 111.082C147.662 111.967 145.746 112.619 144.193 113.033L143.427 110.165C145.145 109.706 147.328 108.933 149.482 107.874C149.478 107.086 149.496 106.294 149.536 105.509C149.738 101.57 150.496 97.4995 151.843 94.8477C152.501 93.5543 153.451 92.2939 154.834 91.8126ZM152.479 106.174C152.868 105.918 153.248 105.652 153.614 105.376C156.807 102.969 158.585 100.145 157.81 96.9152C157.538 95.781 157.238 95.349 157.108 95.2275C156.299 94.4715 155.923 94.577 155.81 94.6164C155.534 94.7123 155.042 95.107 154.49 96.1927C153.42 98.2992 152.695 101.883 152.501 105.661C152.493 105.832 152.485 106.003 152.479 106.174ZM165.971 100.375C165.971 100.375 165.972 100.379 165.972 100.388L165.971 100.375Z",fill:t}),T.default.createElement("path",{d:"M74.5812 93.19H81.7632C84.4565 93.19 86.647 95.3805 86.647 98.0737C86.647 100.767 84.4565 102.957 81.7632 102.957H79.4686V107.051H76.8794V102.957H70.9902V100.372H81.7632C83.0308 100.372 84.0615 99.3413 84.0615 98.0737C84.0615 96.8061 83.0308 95.7755 81.7632 95.7755H74.5812C71.888 95.7755 69.6974 93.585 69.6974 90.8917C69.6974 88.1985 71.888 86.0079 74.5812 86.0079H76.8794V81.9142H79.465V86.0079H85.3542V88.5935H74.5812C73.3136 88.5935 72.283 89.6241 72.283 90.8917C72.283 92.1593 73.3136 93.19 74.5812 93.19Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M85.851 89.0878H74.5831C73.5888 89.0878 72.7797 89.8969 72.7797 90.8912C72.7797 91.8856 73.5888 92.6947 74.5831 92.6947H81.7651C84.7317 92.6947 87.1437 95.1067 87.1437 98.0732C87.1437 101.04 84.7317 103.452 81.7651 103.452H79.9653V107.546H76.3866V103.452H70.4973V99.8767H81.7651C82.7595 99.8767 83.5686 99.0676 83.5686 98.0732C83.5686 97.0789 82.7595 96.2698 81.7651 96.2698H74.5831C71.6166 96.2698 69.2046 93.8578 69.2046 90.8912C69.2046 87.9247 71.6166 85.5126 74.5831 85.5126H76.3866V81.4189H79.9617V85.5126H85.851V89.0878ZM85.3542 86.0079V88.5935H74.5812C73.3136 88.5935 72.283 89.6241 72.283 90.8917C72.283 92.1593 73.3136 93.19 74.5812 93.19H81.7632C84.4565 93.19 86.647 95.3805 86.647 98.0737C86.647 100.767 84.4565 102.957 81.7632 102.957H79.4686V107.051H76.8794V102.957H70.9902V100.372H81.7632C83.0308 100.372 84.0615 99.3413 84.0615 98.0737C84.0615 96.8061 83.0308 95.7755 81.7632 95.7755H74.5812C71.888 95.7755 69.6974 93.585 69.6974 90.8917C69.6974 88.1985 71.888 86.0079 74.5812 86.0079H76.8794V81.9142H79.465V86.0079H85.3542Z",fill:t}),T.default.createElement("path",{d:"M77.888 170.225C77.888 171.209 78.6847 172.006 79.6694 172.006H228.114C229.099 172.006 229.895 171.209 229.895 170.225V91.0542C229.895 90.0696 229.099 89.2729 228.114 89.2729H206.718V92.8306L210.286 92.8356H226.333V168.443H81.4507V148.197H77.888V170.225Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M124.937 70.8245H143.011L115.49 146.438H97.4164L124.937 70.8245Z",fill:t})),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M157.336 70.8245H162.725L134.954 146.438H129.565L157.336 70.8245Z",fill:t})))}function Kc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.371094)",fill:"transparent"}),T.default.createElement("path",{d:"M130.218 153.186H68.4406C63.9202 153.186 60.516 149.782 60.516 145.272V72.9456C60.516 68.4316 63.9202 65.0322 68.4406 65.0322H183.475C187.996 65.0322 191.4 68.4316 191.4 72.9456V126.127H188.332V72.9456C188.332 70.1334 186.291 68.0955 183.475 68.0955H68.4406C65.6244 68.0955 63.5836 70.1334 63.5836 72.9456V145.272C63.5836 148.08 65.6244 150.122 68.4406 150.122H130.218V153.186ZM167.041 114.518H128.493V111.455H167.041V114.518Z",fill:t}),T.default.createElement("path",{d:"M121.698 153.186H183.476C187.997 153.186 191.401 149.782 191.401 145.272L191.4 72.9456C191.4 68.4316 187.996 65.0322 183.475 65.0322H68.4406C63.9202 65.0322 60.516 68.4316 60.516 72.9456L60.5169 126.127H63.5845L63.5836 72.9456C63.5836 70.1334 65.6244 68.0955 68.4406 68.0955H183.475C186.291 68.0955 188.332 70.1334 188.332 72.9456L188.333 145.272C188.333 148.08 186.292 150.122 183.476 150.122H121.698V153.186Z",fill:t}),T.default.createElement("path",{d:"M215.429 174.458H104.655C99.1122 174.458 94.6003 169.953 94.6003 164.418V152.25H97.6679V164.418C97.6679 168.264 100.804 171.395 104.655 171.395H215.429C219.281 171.395 222.417 168.268 222.417 164.418V96.3454C222.417 92.4994 219.285 89.368 215.429 89.368H190.462V86.3048H215.429C220.976 86.3048 225.484 90.8103 225.484 96.3454V164.418C225.484 169.957 220.976 174.458 215.429 174.458Z",fill:t}),T.default.createElement("path",{d:"M166.838 91.7213H128.493V88.658H166.838V91.7213Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M167.041 103.232H128.696V100.169H167.041V103.232Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M177.817 140.631H74.0316V137.568H177.817V140.631Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M208.701 108.301H191.401V105.238H208.701V108.301Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M208.904 119.812H191.603V116.748H208.904V119.812Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M191.401 128.035V131.098H208.904V128.035H191.401Z",fill:"#A5A5A5"}),T.default.createElement("path",{d:"M112.159 121.403H115.229V119.282C115.229 111.233 110.38 103.947 103.123 100.631C106.044 98.1624 107.766 94.5534 107.766 90.656C107.766 83.3827 101.818 77.4666 94.5044 77.4666C87.1911 77.4666 81.2423 83.3827 81.2423 90.656C81.2423 94.5534 82.9651 98.1624 85.8862 100.631C78.6283 103.947 73.7798 111.233 73.7798 119.282V121.403H76.8501V119.282C76.8501 111.551 82.1165 104.643 89.6559 102.488C90.2614 102.314 90.7006 101.788 90.7603 101.165C90.82 100.542 90.4917 99.9436 89.9288 99.6595C86.4619 97.908 84.3127 94.4601 84.3127 90.656C84.3127 85.0664 88.884 80.5201 94.5044 80.5201C100.125 80.5201 104.696 85.0664 104.696 90.656C104.696 94.4601 102.543 97.908 99.08 99.6595C98.5171 99.9436 98.1888 100.542 98.2485 101.165C98.3082 101.788 98.7474 102.314 99.3529 102.488C106.892 104.643 112.159 111.551 112.159 119.282V121.403Z",fill:"#A5A5A5"}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M126.999 68.3479H145.072L117.552 150.417H99.4783L126.999 68.3479Z",fill:t})),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M164.554 68.3479H169.942L142.171 150.417H136.783L164.554 68.3479Z",fill:t})))}function Jc(e){const{color:t}=e;return T.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.118896)",fill:"transparent"}),T.default.createElement("path",{d:"M130.218 152.933H68.4406C63.9202 152.933 60.516 149.53 60.516 145.02V72.6932C60.516 68.1791 63.9202 64.7798 68.4406 64.7798H183.475C187.996 64.7798 191.4 68.1791 191.4 72.6932V125.875H188.332V72.6932C188.332 69.8809 186.291 67.843 183.475 67.843H68.4406C65.6244 67.843 63.5836 69.8809 63.5836 72.6932V145.02C63.5836 147.828 65.6244 149.87 68.4406 149.87H130.218V152.933ZM113.176 135.915H74.8314V132.852H113.176V135.915ZM100.395 101.879H74.8314C73.9836 101.879 73.2976 101.194 73.2976 100.348V79.075C73.2976 78.2283 73.9836 77.5433 74.8314 77.5433H100.395C101.242 77.5433 101.928 78.2283 101.928 79.075V100.348C101.928 101.194 101.242 101.879 100.395 101.879ZM93.4074 98.8159H98.8609V89.1156H93.4074V98.8159ZM84.8863 98.8159H90.344V87.584C90.344 86.7373 91.03 86.0524 91.8778 86.0524H98.8651V80.6066H84.8863V98.8159ZM76.3652 98.8159H81.8187V93.3701H76.3652V98.8159ZM76.3652 90.3069H81.8187V80.6066H76.3652V90.3069Z",fill:t}),T.default.createElement("path",{d:"M121.698 152.933H183.476C187.997 152.933 191.401 149.53 191.401 145.02L191.4 72.6932C191.4 68.1791 187.996 64.7798 183.475 64.7798H68.4406C63.9202 64.7798 60.516 68.1791 60.516 72.6932L60.5169 125.875H63.5845L63.5836 72.6932C63.5836 69.8809 65.6244 67.843 68.4406 67.843H183.475C186.291 67.843 188.332 69.8809 188.332 72.6932L188.333 145.02C188.333 147.828 186.292 149.87 183.476 149.87H121.698V152.933Z",fill:t}),T.default.createElement("path",{d:"M215.429 174.206H104.655C99.1122 174.206 94.6003 169.7 94.6003 164.165V151.997H97.6679V164.165C97.6679 168.011 100.804 171.143 104.655 171.143H215.429C219.281 171.143 222.417 168.016 222.417 164.165V118.897H190.462V115.834H222.417V106.134H190.462V103.07H222.417V96.093C222.417 92.2469 219.285 89.1156 215.429 89.1156H190.462V86.0524H215.429C220.976 86.0524 225.484 90.5579 225.484 96.093V164.165C225.484 169.705 220.976 174.206 215.429 174.206Z",fill:t}),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M111.248 68.0957H129.322L101.801 150.165H83.7275L111.248 68.0957Z",fill:t})),T.default.createElement("g",{style:{mixBlendMode:"soft-light"}},T.default.createElement("path",{d:"M154.606 68.0957H159.994L132.223 150.165H126.835L154.606 68.0957Z",fill:t})))}function $c(e){const{color:t}=e;return T.default.createElement("svg",{width:"337",height:"239",viewBox:"0 0 337 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("g",{clipPath:"url(#clip0_1905_44505)"},T.default.createElement("g",{clipPath:"url(#clip1_1905_44505)"},T.default.createElement("rect",{x:"123.533",y:"171.794",width:"141.309",height:"98.298",rx:"4.5",transform:"rotate(-75 123.533 171.794)",fill:"#CCCCCC"}),T.default.createElement("rect",{x:"141.935",y:"103.117",width:"70.2",height:"98.3382",transform:"rotate(-75 141.935 103.117)",fill:"#707070"}),T.default.createElement("path",{d:"M186.43 78.0454C185.241 82.4824 180.658 85.123 176.213 83.9321C171.768 82.7411 169.12 78.1626 170.308 73.7256C171.497 69.2887 176.081 66.6478 180.525 67.8387C184.97 69.0297 187.619 73.6084 186.43 78.0454Z",fill:"#979696"}),T.default.createElement("path",{d:"M208.798 70.2396L201.899 95.989C201.454 97.6486 199.746 98.6329 198.083 98.1874C189.312 95.8371 184.085 86.8014 186.431 78.0452C188.777 69.2891 197.822 64.0775 206.593 66.4278C208.256 66.8735 209.243 68.5801 208.798 70.2396Z",fill:"#979696"}),T.default.createElement("rect",{x:"193.097",y:"176.458",width:"114.3",height:"5.4",rx:"2.7",transform:"rotate(-75 193.097 176.458)",fill:"black",fillOpacity:"0.48"}),T.default.createElement("rect",{x:"200.052",y:"178.321",width:"114.3",height:"5.4",rx:"2.7",transform:"rotate(-75 200.052 178.321)",fill:"black",fillOpacity:"0.48"}),T.default.createElement("rect",{x:"207.006",y:"180.184",width:"114.3",height:"5.4",rx:"2.7",transform:"rotate(-75 207.006 180.184)",fill:"black",fillOpacity:"0.48"}),T.default.createElement("rect",{x:"123.533",y:"171.794",width:"141.3",height:"12.6",transform:"rotate(-75 123.533 171.794)",fill:"black",fillOpacity:"0.15"})),T.default.createElement("rect",{x:"83.5",y:"60.7505",width:"98.2995",height:"141.306",rx:"4.5",fill:"#2D2D2D"}),T.default.createElement("path",{d:"M132.49 82.3113C112.132 82.3113 95.6279 98.8152 95.6279 119.174C95.6279 139.532 112.132 156.036 132.49 156.036C152.849 156.036 169.353 139.532 169.353 119.174C169.353 98.8152 152.849 82.3113 132.49 82.3113ZM159.771 105.35H146.486C145.215 98.9838 143.231 93.838 141.205 89.868C149.322 92.2906 155.987 97.9198 159.771 105.35ZM141.706 119.174C141.706 121.916 141.5 124.435 141.218 126.853H123.763C123.48 124.435 123.274 121.916 123.274 119.174C123.274 116.43 123.477 113.911 123.757 111.494H141.224C141.503 113.911 141.706 116.43 141.706 119.174ZM124.782 105.35C126.488 97.6518 129.302 92.0591 131.596 88.5448C131.899 88.536 132.184 88.455 132.49 88.455C132.799 88.455 133.085 88.5376 133.393 88.5464C135.698 92.0832 138.502 97.6783 140.199 105.35H124.782ZM123.776 89.868C121.757 93.8296 119.771 98.9811 118.499 105.35H105.209C108.994 97.9198 115.658 92.2921 123.776 89.868ZM102.862 111.494H117.566C117.309 113.927 117.131 116.457 117.131 119.174C117.131 121.891 117.314 124.419 117.575 126.853H102.862C102.22 124.384 101.771 121.841 101.771 119.174C101.772 116.507 102.22 113.963 102.862 111.494ZM105.209 132.997H118.514C119.798 139.378 121.785 144.567 123.767 148.476C115.654 146.052 108.992 140.425 105.209 132.997ZM131.596 149.802C129.395 146.416 126.527 140.808 124.79 132.997H140.191C138.457 140.803 135.592 146.408 133.383 149.802C133.08 149.811 132.797 149.892 132.491 149.892C132.185 149.892 131.901 149.812 131.596 149.802ZM141.217 148.476C143.201 144.564 145.187 139.378 146.468 132.997H159.771C155.988 140.424 149.329 146.051 141.217 148.476ZM162.119 126.853H147.407C147.667 124.419 147.85 121.891 147.85 119.174C147.85 116.457 147.673 113.927 147.416 111.494H162.118C162.76 113.963 163.209 116.506 163.209 119.174C163.209 121.841 162.76 124.385 162.119 126.853Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M99.6611 180.618V171.822H102.979C103.563 171.822 104.009 171.85 104.317 171.906C104.749 171.979 105.111 172.116 105.403 172.317C105.695 172.519 105.93 172.803 106.108 173.166C106.286 173.53 106.375 173.93 106.375 174.366C106.375 175.114 106.137 175.747 105.661 176.265C105.185 176.783 104.325 177.042 103.081 177.042H100.825V180.618H99.6611ZM100.825 176.004H103.099C103.851 176.004 104.385 175.864 104.701 175.584C105.017 175.304 105.175 174.91 105.175 174.402C105.175 174.034 105.082 173.719 104.896 173.457C104.71 173.195 104.464 173.022 104.161 172.938C103.964 172.886 103.603 172.86 103.075 172.86H100.825V176.004Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M105.979 180.618L109.357 171.822H110.611L114.211 180.618H112.885L111.859 177.954H108.182L107.216 180.618H105.979ZM108.517 177.006H111.499L110.581 174.57C110.301 173.83 110.093 173.222 109.957 172.746C109.845 173.31 109.687 173.87 109.483 174.426L108.517 177.006Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M114.746 177.791L115.844 177.695C115.896 178.135 116.017 178.496 116.207 178.778C116.397 179.06 116.692 179.288 117.092 179.462C117.492 179.636 117.942 179.723 118.442 179.723C118.886 179.723 119.278 179.657 119.618 179.525C119.958 179.393 120.211 179.213 120.377 178.982C120.543 178.752 120.626 178.501 120.626 178.229C120.626 177.953 120.546 177.712 120.386 177.506C120.226 177.3 119.962 177.128 119.594 176.987C119.358 176.895 118.836 176.752 118.028 176.558C117.22 176.364 116.654 176.181 116.33 176.009C115.91 175.789 115.597 175.516 115.391 175.19C115.185 174.864 115.082 174.499 115.082 174.095C115.082 173.651 115.208 173.236 115.46 172.85C115.712 172.464 116.08 172.171 116.564 171.971C117.048 171.771 117.586 171.671 118.178 171.671C118.83 171.671 119.405 171.776 119.903 171.986C120.401 172.196 120.783 172.505 121.051 172.913C121.319 173.321 121.463 173.783 121.483 174.299L120.368 174.383C120.308 173.827 120.105 173.407 119.759 173.123C119.413 172.839 118.902 172.697 118.226 172.697C117.522 172.697 117.009 172.826 116.687 173.084C116.365 173.342 116.204 173.653 116.204 174.017C116.204 174.333 116.318 174.593 116.546 174.797C116.77 175.001 117.354 175.21 118.301 175.424C119.246 175.638 119.895 175.825 120.247 175.985C120.759 176.221 121.137 176.52 121.381 176.882C121.625 177.244 121.747 177.661 121.747 178.133C121.747 178.601 121.613 179.042 121.345 179.456C121.077 179.87 120.692 180.192 120.19 180.422C119.688 180.652 119.123 180.767 118.495 180.767C117.699 180.767 117.032 180.651 116.494 180.419C115.956 180.187 115.534 179.838 115.228 179.372C114.923 178.907 114.762 178.379 114.746 177.791Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M122.939 177.791L124.037 177.695C124.089 178.135 124.21 178.496 124.4 178.778C124.59 179.06 124.885 179.288 125.285 179.462C125.685 179.636 126.135 179.723 126.635 179.723C127.079 179.723 127.471 179.657 127.811 179.525C128.151 179.393 128.404 179.213 128.571 178.982C128.736 178.752 128.819 178.501 128.819 178.229C128.819 177.953 128.74 177.712 128.579 177.506C128.419 177.3 128.155 177.128 127.787 176.987C127.551 176.895 127.029 176.752 126.221 176.558C125.413 176.364 124.847 176.181 124.523 176.009C124.103 175.789 123.79 175.516 123.585 175.19C123.378 174.864 123.275 174.499 123.275 174.095C123.275 173.651 123.401 173.236 123.653 172.85C123.905 172.464 124.273 172.171 124.757 171.971C125.241 171.771 125.779 171.671 126.371 171.671C127.023 171.671 127.598 171.776 128.096 171.986C128.594 172.196 128.977 172.505 129.245 172.913C129.513 173.321 129.657 173.783 129.677 174.299L128.561 174.383C128.501 173.827 128.298 173.407 127.952 173.123C127.606 172.839 127.095 172.697 126.419 172.697C125.715 172.697 125.202 172.826 124.88 173.084C124.558 173.342 124.397 173.653 124.397 174.017C124.397 174.333 124.511 174.593 124.739 174.797C124.963 175.001 125.548 175.21 126.494 175.424C127.44 175.638 128.089 175.825 128.441 175.985C128.953 176.221 129.33 176.52 129.575 176.882C129.818 177.244 129.941 177.661 129.941 178.133C129.941 178.601 129.807 179.042 129.539 179.456C129.271 179.87 128.885 180.192 128.384 180.422C127.881 180.652 127.316 180.767 126.689 180.767C125.893 180.767 125.226 180.651 124.688 180.419C124.15 180.187 123.728 179.838 123.422 179.372C123.116 178.907 122.955 178.379 122.939 177.791Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M131.533 180.618V171.822H134.851C135.435 171.822 135.881 171.85 136.189 171.906C136.621 171.979 136.983 172.116 137.275 172.317C137.567 172.519 137.802 172.803 137.98 173.166C138.158 173.53 138.247 173.93 138.247 174.366C138.247 175.114 138.009 175.747 137.533 176.265C137.057 176.783 136.197 177.042 134.953 177.042H132.697V180.618H131.533ZM132.697 176.004H134.971C135.723 176.004 136.257 175.864 136.573 175.584C136.889 175.304 137.047 174.91 137.047 174.402C137.047 174.034 136.954 173.719 136.768 173.457C136.582 173.195 136.336 173.022 136.033 172.938C135.836 172.886 135.475 172.86 134.947 172.86H132.697V176.004Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M139.374 176.334C139.374 174.874 139.766 173.731 140.55 172.905C141.334 172.079 142.346 171.666 143.586 171.666C144.398 171.666 145.13 171.86 145.782 172.248C146.434 172.636 146.931 173.177 147.273 173.871C147.615 174.565 147.786 175.352 147.786 176.231C147.786 177.123 147.606 177.921 147.246 178.625C146.886 179.329 146.376 179.862 145.716 180.224C145.056 180.586 144.344 180.767 143.58 180.767C142.752 180.767 142.012 180.567 141.36 180.167C140.708 179.767 140.215 179.221 139.879 178.529C139.542 177.838 139.374 177.106 139.374 176.334ZM140.574 176.352C140.574 177.412 140.859 178.247 141.429 178.856C141.999 179.467 142.714 179.771 143.574 179.771C144.45 179.771 145.171 179.463 145.737 178.848C146.303 178.232 146.586 177.358 146.586 176.226C146.586 175.51 146.465 174.885 146.223 174.351C145.981 173.817 145.627 173.403 145.161 173.109C144.695 172.815 144.172 172.668 143.592 172.668C142.768 172.668 142.059 172.951 141.465 173.517C140.871 174.083 140.574 175.028 140.574 176.352Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M149.304 180.618V171.822H153.203C153.988 171.822 154.583 171.901 154.991 172.059C155.399 172.217 155.725 172.497 155.969 172.896C156.213 173.296 156.335 173.738 156.335 174.222C156.335 174.846 156.133 175.372 155.729 175.8C155.325 176.228 154.701 176.5 153.857 176.616C154.165 176.764 154.399 176.91 154.559 177.054C154.899 177.366 155.221 177.756 155.525 178.224L157.055 180.618H155.591L154.427 178.788C154.087 178.26 153.807 177.856 153.587 177.576C153.367 177.296 153.17 177.1 152.996 176.988C152.822 176.876 152.645 176.798 152.465 176.754C152.333 176.726 152.117 176.712 151.817 176.712H150.467V180.618H149.304V180.618ZM150.468 175.704H152.97C153.501 175.704 153.918 175.649 154.218 175.539C154.517 175.429 154.746 175.253 154.901 175.011C155.057 174.769 155.135 174.506 155.135 174.222C155.135 173.806 154.984 173.464 154.682 173.196C154.38 172.928 153.903 172.794 153.251 172.794H150.467L150.468 175.704Z",fill:"#CCCCCC"}),T.default.createElement("path",{d:"M160.174 180.618V172.86H157.276V171.822H164.248V172.86H161.338V180.618H160.174Z",fill:"#CCCCCC"})),T.default.createElement("defs",null,T.default.createElement("clipPath",{id:"clip0_1905_44505"},T.default.createElement("rect",{width:"337",height:"238.748",fill:"white"})),T.default.createElement("clipPath",{id:"clip1_1905_44505"},T.default.createElement("rect",{x:"123.533",y:"171.794",width:"141.309",height:"98.298",rx:"4.5",transform:"rotate(-75 123.533 171.794)",fill:"white"}))))}function eu(e){if(e.source instanceof Zc.j||e.source instanceof Gc.c)return null;const t="#FFFFFF";return T.default.createElement(P.Box,{sx:{backgroundColor:e.fill,borderRadius:1,width:"100%",height:250}},T.default.createElement(P.Box,{sx:{padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - 20px)"}},(()=>{if(e.source instanceof Zc.k)return T.default.createElement(Yc,{color:t});if(e.source instanceof Zc.i)return T.default.createElement(Qc,{color:t});if(e.source instanceof Zc.d)return T.default.createElement(qc,{color:t});if(e.source instanceof Zc.a)return T.default.createElement(Xc,{color:t});if(e.source instanceof Zc.e)return T.default.createElement(Kc,{color:t});if(e.source instanceof Zc.b)return T.default.createElement(Jc,{color:t});if(e.source instanceof Gc.b)return T.default.createElement($c,{color:t});if(e.source instanceof Zc.c||e.source instanceof Gc.a){const n=e.source;return T.default.createElement("img",{src:n.uri,style:{color:t,backgroundColor:e.fill,maxHeight:"100%",maxWidth:"100%"},alt:""})}throw new Error("Unknown intro image type")})()))}function tu(e){return T.default.createElement(T.default.Fragment,null,T.default.createElement(ee,{modalOverlayColor:"rgba(0, 0, 0, 0.64)",open:e.isOpen,onClose:e.onClose,width:"min(calc(100% - 2 * 24px), 500px)",PaperProps:{sx:{m:"10px",p:"10px",maxHeight:`calc(100 * ${R} - 2 * 24px)`,backgroundColor:_.b.getColorValue(e.backgroundColor)}}},T.default.createElement(P.Typography,{component:"div"},e.children)))}function nu(e){return T.default.createElement(tu,{isOpen:e.isOpen,onClose:e.onClose,backgroundColor:e.config.backgroundColor},T.default.createElement(P.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},T.default.createElement(N.a,{style:Object.assign({fontWeight:600,fontSize:16},q(1)),config:e.config.title}),T.default.createElement(P.Box,null,T.default.createElement(G,{onClick:e.onClose,visible:e.config.topBarDoneButton.visible,text:e.config.topBarDoneButton.text,background:e.config.topBarDoneButton.background,foreground:e.config.topBarDoneButton.foreground,icon:T.default.createElement(L.a,{sx:{fontSize:24}}),debugName:"close-introduction"}))),T.default.createElement(P.Box,{sx:{width:"100%",border:`1px solid ${_.b.getColorValue(e.config.dividerColor)}`,marginBottom:"12px"}}),T.default.createElement(N.a,{config:e.config.subtitle,style:{fontSize:16,paddingBottom:"10px"}}),e.config.items.map(((e,t)=>{const n=e.image instanceof Zc.j;return T.default.createElement(P.Box,{key:t,sx:{display:"flex",flexDirection:"column"}},T.default.createElement(P.Box,{sx:{pt:n?0:"10px",pb:n?0:"10px",backgroundColor:"rgb(191, 191, 191)"}},T.default.createElement(eu,{source:e.image})),T.default.createElement(N.a,{style:{fontWeight:500,fontSize:14,padding:1,paddingLeft:15,textIndent:-15},config:e.text}))})))}function iu(e){return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{sx:{backgroundColor:_.b.getColorValue(e.backgroundColor),display:"flex",justifyContent:"space-between",alignItems:"center",height:50,width:"100vw"}},T.default.createElement(P.Box,{style:{flexBasis:0,flexGrow:1}},e.leftContent),T.default.createElement(P.Box,null,T.default.createElement("h1",{style:{fontSize:18,fontWeight:500,textAlign:"center"}},T.default.createElement(N.a,{config:e.centerTitle,replacementArgs:e.centerTitleReplacementArgs}))),T.default.createElement(P.Box,{style:{flexBasis:0,flexGrow:1,textAlign:"right",whiteSpace:"nowrap"}},e.rightContent)))}function ru(e){return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Menu,{anchorEl:e.anchor,open:null!==e.anchor,onClose:e.onClose,MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:_.b.getColorValue(e.backgroundColor),minWidth:e.minWidth}}}},e.children))}function ou(e){const t=_.b.getColorValue(e.textColor);return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.MenuItem,{tabIndex:0,disabled:e.disabled,autoFocus:e.autoFocus,"aria-label":_.b.getLocalizedText(e.ariaLabel),onClick:e.onClick,sx:Object.assign(Object.assign({"&, &:hover, &:focus":{backgroundColor:"transparent"}},j(t)),{paddingX:"8px",marginX:"8px"})},e.children))}function au(e){const[t,n]=T.default.useState(!1),[i,r]=T.default.useState(null),o=Boolean(i),a=e.config.screens.camera.topBarCameraSelect;return T.default.createElement(T.default.Fragment,null,T.default.createElement(G,{id:"sb-button-camera-select",ariaLabel:_.b.getLocalizedText(a.button.accessibilityDescription),onClick:e=>r(e.currentTarget),visible:a.button.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:a.button.color,iconVisible:!0,useShadow:!1},icon:T.default.createElement(T.default.Fragment,null,T.default.createElement(L.a,null),!o&&T.default.createElement(L.a,{sx:{marginX:"-4px"}}),o&&T.default.createElement(L.a,{sx:{marginX:"-4px"}})),buttonWidth:48}),T.default.createElement(ru,{anchor:i,ariaLabelledBy:"sb-button-camera-select",backgroundColor:a.backgroundColor,onClose:()=>r(null),minWidth:"calc(min(100% - 40px, 323px))"},T.default.createElement(P.MenuItem,{disabled:!0,sx:{borderBottomColor:_.b.getColorValue(a.dividerColor),borderBottomStyle:"solid",borderBottomWidth:"1px",fontSize:14,marginTop:"-4px",marginBottom:"4px",marginX:"4px",width:"calc(100% - 8px)",opacity:"1 !important"}},T.default.createElement(N.a,{config:a.title})),e.cameraSelectConfig.availableCameras.map((i=>{const o=i.deviceId===e.cameraSelectConfig.activeCamera.deviceId,s=o?a.menuEntryActive:a.menuEntry;return T.default.createElement(ou,{disabled:t,key:i.deviceId,autoFocus:o,ariaLabel:s.accessibilityDescription,textColor:s.title.color,onClick:()=>{r(null),n(!0),e.cameraSelectConfig.onSelect(i).finally((()=>n(!1)))}},s.icon.visible&&T.default.createElement(L.a,{style:{color:_.b.getColorValue(s.icon.color),marginRight:"8px"}}),T.default.createElement(P.Typography,{variant:"inherit",noWrap:!0},T.default.createElement(N.a,{config:Object.assign(Object.assign({},s.title),{text:i.label})})),o&&T.default.createElement(L.a,{style:{color:_.b.getColorValue(s.icon.color),marginLeft:"auto",paddingLeft:15,fontSize:16}}))}))))}function su(e){const t=e.config.screens.camera;return T.default.createElement(T.default.Fragment,null,T.default.createElement(iu,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:T.default.createElement(G,{ariaLabel:_.b.getLocalizedText(t.topBarBackButton.accessibilityDescription),onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:T.default.createElement(L.a,{sx:{fontSize:24}}),debugName:"close-camera-screen"}),centerTitle:t.topBarTitle,rightContent:T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{style:{display:"flex",justifyContent:"space-around",alignItems:"center",whiteSpace:"nowrap",maxWidth:120,marginLeft:"auto"}},T.default.createElement(au,{config:e.config,cameraSelectConfig:e.cameraSelectConfig}),T.default.createElement(G,{ariaLabel:_.b.getLocalizedText(t.topBarIntroButton.accessibilityDescription),visible:t.topBarIntroButton.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:t.topBarIntroButton.color,iconVisible:!0,useShadow:!1},debugName:"show-introduction",icon:T.default.createElement(L.a,{sx:{fontSize:24}}),onClick:e.onShowIntroButtonClick,buttonWidth:20})))}))}function cu(e){const t=_.b.getColorValue(e.color);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L9 3H15L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4ZM4 19H20V7H15.95L14.125 5H9.875L8.05 7H4V19Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.80078 16.5L11.0008 7.5H13.0008L16.2008 16.5H14.3008L13.6008 14.5H10.4008L9.70078 16.5H7.80078ZM13.1508 13.15H10.8508L12.0008 9.5L13.1508 13.15Z",fill:t})))}function uu(e){const t=_.b.getColorValue(e.color);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"23",height:"22",viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{paddingTop:2,paddingRight:1}},T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.018 15.145L22.018 17.145V5.01997C22.018 4.46997 21.8222 3.99914 21.4305 3.60747C21.0388 3.2158 20.568 3.01997 20.018 3.01997H16.868L15.018 1.01997H9.01799L7.51799 2.64497L8.94299 4.06997L9.89299 3.01997H14.143L15.968 5.01997H20.018V15.145ZM2.60549 18.4325C2.99716 18.8241 3.46799 19.02 4.01799 19.02H18.193L20.493 21.32L21.918 19.895L21.043 19.02L19.043 17.02L15.668 13.645L14.218 12.195L10.843 8.81997L9.39299 7.36997L7.04299 5.01997L5.04299 3.01997L2.11799 0.0949707L0.692993 1.51997L2.69533 3.52231C2.66494 3.54959 2.63499 3.57797 2.60549 3.60747C2.21383 3.99914 2.01799 4.46997 2.01799 5.01997V17.02C2.01799 17.57 2.21383 18.0408 2.60549 18.4325ZM4.19299 5.01997H4.01799V17.02H16.193L14.1538 14.9807L12.6236 13.4506L11.7055 12.5325H13.618L13.726 12.841C13.9158 12.6605 14.0761 12.4519 14.2069 12.2153L13.1654 11.1741L13.168 11.1825H10.868L11.4203 9.42965L10.8219 8.83152C10.4317 9.04725 10.1179 9.3434 9.88049 9.71997C9.74455 9.93561 9.64684 10.1671 9.58737 10.4143L11.7055 12.5325H10.418L9.71799 14.5325H7.81799L9.36226 10.1892L8.05722 8.8842L4.19299 5.01997ZM14.4768 9.63538L10.8494 6.00662L11.018 5.53247H13.018L14.4768 9.63538Z",fill:t}),T.default.createElement("path",{d:"M9.88049 9.71997C9.74455 9.93561 9.64684 10.1671 9.58737 10.4143L11.7055 12.5325H13.618L13.726 12.841C13.9158 12.6605 14.0761 12.4519 14.2069 12.2153L13.1654 11.1741L13.168 11.1825H10.868L11.4203 9.42965L10.8219 8.83152C10.4317 9.04725 10.1179 9.3434 9.88049 9.71997Z",fill:t})))}function lu(e){return"NoButtonMode"===e.config._type?T.default.createElement(T.default.Fragment,null):"PagePreviewMode"===e.config._type?T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Button,{"data-sb-button-preview":!0,"arial-label":_.b.getLocalizedText(e.config.accessibilityDescription),disabled:!e.enabled,sx:Object.assign({paddingY:"11px"},j(e.config.pageCounter.background.fillColor)),onClick:e.onClick},T.default.createElement(wc,{text:`${e.count}`,backgroundColor:_.b.getColorValue(e.config.pageCounter.background.fillColor),badgeStyle:{borderColor:_.b.getColorValue(e.config.pageCounter.background.strokeColor),borderWidth:e.config.pageCounter.background.strokeWidth,borderStyle:"solid"},overlap:"rectangular",foregroundColor:_.b.getColorValue(e.config.pageCounter.foregroundColor)},e.previewImageUrl&&T.default.createElement("img",{style:{maxWidth:40,maxHeight:56},src:e.previewImageUrl,alt:"Preview image of the last page"}),!e.previewImageUrl&&T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(e.config.imagePlaceholderColor),width:40,height:56}})))):"TextButtonMode"===e.config._type?T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Button,{"data-sb-button-preview":!0,disabled:!e.enabled,onClick:e.onClick,"aria-label":_.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign(Object.assign({},j(e.config.style.color)),{textTransform:"none"})},T.default.createElement(N.a,{config:e.config.style,replacementArgs:[`${e.count}`]}))):void 0}function du(e){const t=_.b.getColorValue(e.color);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"65",height:"65",viewBox:"0 0 65 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M6.72501 49.1933C6.13188 49.5779 5.33687 49.4102 4.97627 48.8021C1.72147 43.3141 0.176561 36.9684 0.556438 30.5796C0.96168 23.7643 3.53609 17.2572 7.90342 12.0093C12.2708 6.76151 18.202 3.04806 24.8305 1.41171C31.4589 -0.224643 38.4369 0.301896 44.7447 2.91437C51.0525 5.52685 56.3594 10.0883 59.8898 15.9321C63.4202 21.7758 64.989 28.5956 64.3669 35.3946C63.7449 42.1936 60.9646 48.6154 56.4323 53.7215C52.1838 58.508 46.6046 61.9032 40.4226 63.4828C39.7377 63.6578 39.0569 63.2143 38.9094 62.523C38.7619 61.8316 39.2037 61.1543 39.888 60.9769C45.5359 59.5128 50.6318 56.4001 54.5177 52.0221C58.6874 47.3245 61.2453 41.4164 61.8176 35.1613C62.3899 28.9063 60.9466 22.6321 57.6986 17.2558C54.4506 11.8796 49.5683 7.68302 43.7651 5.27954C37.9619 2.87607 31.5422 2.39165 25.444 3.89709C19.3459 5.40253 13.8891 8.81891 9.87115 13.6469C5.8532 18.4749 3.48475 24.4615 3.11192 30.7316C2.76447 36.5751 4.16728 42.3794 7.12605 47.4081C7.48454 48.0173 7.31814 48.8087 6.72501 49.1933Z",fill:"url(#paint0_linear_779_506)"},T.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 32.5 32.5",from:"360 32.5 32.5",dur:"2s",begin:"0s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M6.72501 49.1933C6.13188 49.5779 5.33687 49.4102 4.97627 48.8021C1.72147 43.3141 0.176561 36.9684 0.556438 30.5796C0.96168 23.7643 3.53609 17.2572 7.90342 12.0093C12.2708 6.76151 18.202 3.04806 24.8305 1.41171C31.4589 -0.224643 38.4369 0.301896 44.7447 2.91437C51.0525 5.52685 56.3594 10.0883 59.8898 15.9321C63.4202 21.7758 64.989 28.5956 64.3669 35.3946C63.7449 42.1936 60.9646 48.6154 56.4323 53.7215C52.1838 58.508 46.6046 61.9032 40.4226 63.4828C39.7377 63.6578 39.0569 63.2143 38.9094 62.523C38.7619 61.8316 39.2037 61.1543 39.888 60.9769C45.5359 59.5128 50.6318 56.4001 54.5177 52.0221C58.6874 47.3245 61.2453 41.4164 61.8176 35.1613C62.3899 28.9063 60.9466 22.6321 57.6986 17.2558C54.4506 11.8796 49.5683 7.68302 43.7651 5.27954C37.9619 2.87607 31.5422 2.39165 25.444 3.89709C19.3459 5.40253 13.8891 8.81891 9.87115 13.6469C5.8532 18.4749 3.48475 24.4615 3.11192 30.7316C2.76447 36.5751 4.16728 42.3794 7.12605 47.4081C7.48454 48.0173 7.31814 48.8087 6.72501 49.1933Z",fill:"url(#paint1_linear_779_506)"},T.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 32.5 32.5",from:"360 32.5 32.5",dur:"2s",begin:"0s",repeatCount:"indefinite"})),T.default.createElement("defs",null,T.default.createElement("linearGradient",{id:"paint0_linear_779_506",x1:"60.3614",y1:"33.7149",x2:"37.0173",y2:"64.479",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{stopColor:t}),T.default.createElement("stop",{offset:"0.847585",stopColor:t,stopOpacity:"0"})),T.default.createElement("linearGradient",{id:"paint1_linear_779_506",x1:"8.69831",y1:"51.1273",x2:"20.179",y2:"68.157",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{stopColor:t}),T.default.createElement("stop",{offset:"0.370714",stopColor:t,stopOpacity:"0"})))))}function mu(e){const t=_.b.getColorValue(e.color);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("g",{clipPath:"url(#clip0_780_4723)"},T.default.createElement("path",{d:"M22.5127 8.09418C24.6704 8.09418 26.4195 6.34504 26.4195 4.18735C26.4195 2.02967 24.6704 0.280518 22.5127 0.280518C20.355 0.280518 18.6058 2.02967 18.6058 4.18735C18.6058 6.34504 20.355 8.09418 22.5127 8.09418Z",fill:t,fillOpacity:"0.2"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.4s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M9.93003 13.2714C12.0877 13.2714 13.8369 11.5223 13.8369 9.3646C13.8369 7.20691 12.0877 5.45776 9.93003 5.45776C7.77234 5.45776 6.02319 7.20691 6.02319 9.3646C6.02319 11.5223 7.77234 13.2714 9.93003 13.2714Z",fill:t,fillOpacity:"0.4"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.2s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M4.80063 25.8922C6.95832 25.8922 8.70747 24.143 8.70747 21.9853C8.70747 19.8276 6.95832 18.0785 4.80063 18.0785C2.64295 18.0785 0.893799 19.8276 0.893799 21.9853C0.893799 24.143 2.64295 25.8922 4.80063 25.8922Z",fill:t,fillOpacity:"0.6"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.0s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M9.9282 38.4743C12.0859 38.4743 13.835 36.7252 13.835 34.5675C13.835 32.4098 12.0859 30.6606 9.9282 30.6606C7.77051 30.6606 6.02136 32.4098 6.02136 34.5675C6.02136 36.7252 7.77051 38.4743 9.9282 38.4743Z",fill:t,fillOpacity:"0.8"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.8s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M22.5127 43.7196C24.6704 43.7196 26.4195 41.9704 26.4195 39.8127C26.4195 37.655 24.6704 35.9059 22.5127 35.9059C20.355 35.9059 18.6058 37.655 18.6058 39.8127C18.6058 41.9704 20.355 43.7196 22.5127 43.7196Z",fill:t,fillOpacity:"1"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.6s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M35.0819 38.4743C37.2396 38.4743 38.9887 36.7252 38.9887 34.5675C38.9887 32.4098 37.2396 30.6606 35.0819 30.6606C32.9242 30.6606 31.175 32.4098 31.175 34.5675C31.175 36.7252 32.9242 38.4743 35.0819 38.4743Z",fill:t,fillOpacity:"0.7"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.4s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M40.1988 25.8922C42.3565 25.8922 44.1057 24.143 44.1057 21.9853C44.1057 19.8276 42.3565 18.0785 40.1988 18.0785C38.0411 18.0785 36.292 19.8276 36.292 21.9853C36.292 24.143 38.0411 25.8922 40.1988 25.8922Z",fill:t,fillOpacity:"0.5"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.2s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M35.0819 13.31C37.2396 13.31 38.9887 11.5609 38.9887 9.40317C38.9887 7.24549 37.2396 5.49634 35.0819 5.49634C32.9242 5.49634 31.175 7.24549 31.175 9.40317C31.175 11.5609 32.9242 13.31 35.0819 13.31Z",fill:t,fillOpacity:"0.3"},T.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"0s",repeatCount:"indefinite"}))),T.default.createElement("defs",null,T.default.createElement("clipPath",{id:"clip0_780_4723"},T.default.createElement("rect",{width:"44",height:"44",fill:t,transform:"translate(0.5)"})))))}function hu(e){const t=_.b.getColorValue(e.innerColor),n=_.b.getColorValue(e.outerColor);return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"65",height:"64",viewBox:"0 0 65 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.5 2.66666C16.2996 2.66666 3.16666 15.7996 3.16666 32C3.16666 48.2004 16.2996 61.3333 32.5 61.3333C48.7004 61.3333 61.8333 48.2004 61.8333 32C61.8333 15.7996 48.7004 2.66666 32.5 2.66666ZM0.5 32C0.5 14.3269 14.8269 0 32.5 0C50.1731 0 64.5 14.3269 64.5 32C64.5 49.6731 50.1731 64 32.5 64C14.8269 64 0.5 49.6731 0.5 32Z",fill:n}),T.default.createElement("path",{d:"M56.7425 32C56.7425 45.3885 45.8889 56.242 32.5004 56.242C19.1119 56.242 8.2584 45.3885 8.2584 32C8.2584 18.6115 19.1119 7.75793 32.5004 7.75793C45.8889 7.75793 56.7425 18.6115 56.7425 32Z",fill:t})))}function fu(e){const t="manual"===e.state||"auto"===e.state&&e.config.enabledInAutoSnappingMode;return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Button,{disabled:!t,onClick:e.onClick,"aria-label":_.b.getLocalizedText(e.config.accessibilityDescription),"data-sb-button-shutter":!0,sx:Object.assign({width:56,margin:0,padding:0},j(e.config.innerColor))},"auto"===e.state&&T.default.createElement(du,{key:"auto",color:e.config.outerColor}),"loading"===e.state&&T.default.createElement(mu,{key:"loading",color:e.config.outerColor}),"manual"===e.state&&T.default.createElement(hu,{key:"manual",innerColor:e.config.innerColor,outerColor:e.config.outerColor})))}function pu(e){const t={backgroundColor:_.b.getColorValue(e.config.sheetColor)};let n=[{config:e.config.okButton,onClick:e.onOkClick,debugName:"ok"},{config:e.config.actionButton,onClick:e.onActionClick,debugName:"action"},{config:e.config.cancelButton,onClick:e.onCancelClick,debugName:"cancel"}].filter((e=>e.config.visible));2===n.length&&(n=n.reverse());const i=2===n.length?6:12,[r,o]=T.default.useState(!0);Object(T.useEffect)((()=>{o(e.open)}),[e.open]);const a=r?1:.5;return T.default.createElement(T.default.Fragment,null,T.default.createElement(ee,{modalOverlayColor:e.config.modalOverlayColor,open:e.open,PaperProps:{style:{borderRadius:"8px"}},onClose:e.onCancelClick},T.default.createElement(P.DialogContent,{sx:Object.assign(Object.assign({},t),{p:2,pb:1,textAlign:"center"})},T.default.createElement(P.Typography,{sx:{fontSize:"16px",fontWeight:"bold"}},T.default.createElement(N.a,{config:e.config.title})),T.default.createElement(P.Typography,{sx:{fontSize:"14px",lineHeight:"16pt",pt:1}},T.default.createElement(N.a,{config:e.config.subtitle}))),T.default.createElement(P.DialogActions,{sx:Object.assign(Object.assign({},t),{pt:1})},T.default.createElement(L.a,{container:!0,spacing:2},T.default.createElement(L.a,{item:!0,xs:12},T.default.createElement(L.a,{color:_.b.getColorValue(e.config.dividerColor)})),n.map(((e,t)=>{return T.default.createElement(L.a,{item:!0,xs:i,key:t},T.default.createElement(J,{disabled:!r,style:Object.assign({width:"100%",opacity:a},(n=e.config,Z(_.b.getColorValue(n.background.fillColor))?j(n.foreground.color):Object.assign(Object.assign({},z(n.background.fillColor)),{"& span":{transition:"transform 0.3s !important"},"&:hover span":{transform:"translateX(6px) !important"},"& > div, &":{transition:"border-radius 0.3s !important"},"&:hover > div, &:hover":{borderRadius:"0px !important"}}))),onClick:()=>{o(!1),e.onClick()},visible:e.config.visible,text:e.config.text,foreground:e.config.foreground,background:e.config.background,debugName:e.debugName,accessibilityDescription:_.b.getLocalizedText(e.config.accessibilityDescription)}));var n}))))))}const gu=["image/jpeg","image/jpg","image/png","image/bmp","image/dib","image/tiff"];var vu=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function yu(e){const t=e.config.screens.camera.bottomBar,n="auto"===e.buttonStates.snappingModeState?t.autoSnappingModeButton:t.manualSnappingModeButton,i="auto"===e.buttonStates.snappingModeState?cu:uu,r="on"===e.buttonStates.torchState?t.torchOnButton:t.torchOffButton,o=T.default.createRef();Object(T.useEffect)((()=>{o.current&&(o.current.oncancel=e.onFileSelectDialogClosed)}),[o.current]);const[a,s]=T.default.useState(!1),c=()=>s(!0);return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{"data-sb-bottom-bar":!0,sx:{backgroundColor:_.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:112,display:"flex",alignItems:"center",justifyContent:"center"}},T.default.createElement(P.Box,{sx:{maxWidth:400,display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)"}},T.default.createElement("div",null,T.default.createElement(H,{onClick:e.scanLimitReached?c:e.onFileSelectDialogOpened,enabled:e.buttonStates.importButtonEnabled,config:t.importButton,iconButtonComponent:e.scanLimitReached?"button":"label",icon:({color:e})=>T.default.createElement(L.a,{sx:{color:e}}),debugName:"import"},!e.scanLimitReached&&T.default.createElement("input",{hidden:!0,type:"file",accept:gu.join(", "),ref:o,onChange:t=>{var n,i;e.onFileSelectDialogClosed();const r=null===(i=null===(n=null==t?void 0:t.target)||void 0===n?void 0:n.files)||void 0===i?void 0:i[0];r&&(()=>{vu(this,void 0,void 0,(function*(){const t=e.sdk.detectAndCropDocument(d.Image.fromEncodedBinaryData(yield r.arrayBuffer()),"CONSUME_IMAGE");e.onFileUploaded(t)}))})()},value:""}))),T.default.createElement("div",null,T.default.createElement(H,{enabled:e.buttonStates.snappingModeButtonEnabled,config:n,icon:i,onClick:e.snappingModeButtonClick,debugName:"snapping-mode"})),T.default.createElement(fu,{state:e.buttonStates.shutterButtonState,onClick:e.scanLimitReached?c:e.onShutterButtonClick,config:e.config.screens.camera.bottomBar.shutterButton}),T.default.createElement("div",null,T.default.createElement(H,{enabled:e.buttonStates.torchButtonEnabled,config:r,icon:t=>(e.buttonStates.torchState,T.default.createElement(L.a,{sx:t})),onClick:e.onTorchButtonClick,debugName:"torch"})),T.default.createElement("div",null,T.default.createElement(lu,{enabled:e.buttonStates.reviewButtonEnabled,config:t.previewButton,count:e.buttonStates.reviewButtonCount,previewImageUrl:e.buttonStates.reviewButtonPreviewImageUrl,onClick:e.onReviewButtonClick})))),T.default.createElement(pu,{open:a,config:e.config.screens.camera.limitReachedAlertDialog,onCancelClick:()=>{},onActionClick:()=>{},onOkClick:()=>{s(!1)}}))}function Cu(e){const t=_.b.getColorValue(e.color),n=221/376,i=`calc(${e.maxHeight} - ${e.paddingTop}px - ${e.paddingBottom}px)`,r=e.maxWidth,o=`min(${`calc(${i} * ${n})`}, ${r})`,a=`min(${i}, ${`calc(${r} / ${n})`})`;return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{style:{width:o,height:a,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom},viewBox:"0 0 221 376",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M25.2696 149.527V20.2272C25.2696 9.60794 33.8814 1 44.5006 1H147.398C158.018 1 166.629 9.60794 166.629 20.2272V267.036C166.629 277.655 158.018 286.263 147.398 286.263H44.5006C33.8814 286.263 25.2696 277.655 25.2696 267.036V262.47M25.2696 200.917V183.453M27.5913 182.88V202.205M27.5913 224.958V239.567M27.5913 259.894V267.036C27.5913 267.902 27.6573 268.757 27.781 269.593L27.7889 269.64C27.8213 269.83 27.8538 270.021 27.8898 270.208C28.0875 271.246 28.3818 272.25 28.7617 273.212C28.8353 273.411 28.9166 273.609 29.0021 273.8C29.5369 275.014 30.211 276.159 31.0016 277.209C31.0791 277.304 31.157 277.411 31.2345 277.506C31.7807 278.205 32.3892 278.85 33.0366 279.457C33.3 279.701 33.5714 279.934 33.8505 280.159C33.9474 280.243 34.0482 280.32 34.149 280.392C34.4471 280.625 34.7532 280.847 35.0674 281.06L35.0712 281.063C35.0891 281.077 35.1074 281.092 35.1254 281.102C35.3193 281.228 35.5129 281.35 35.7068 281.473C35.924 281.602 36.1446 281.732 36.3656 281.854C36.5905 281.976 36.8153 282.095 37.044 282.209C37.1562 282.263 37.2726 282.32 37.3848 282.37L37.3905 282.372C37.5049 282.429 37.6194 282.485 37.7337 282.53C38.0865 282.683 38.443 282.824 38.8072 282.958C39.0477 283.045 39.2916 283.125 39.5359 283.202C39.6599 283.24 39.784 283.278 39.9081 283.313C40.2841 283.412 40.6639 283.511 41.0475 283.587C41.1716 283.614 41.2995 283.641 41.4311 283.664C41.5628 283.687 41.6907 283.713 41.8186 283.732C42.0782 283.774 42.3419 283.813 42.6053 283.839C42.7912 283.866 42.9775 283.877 43.1634 283.893C43.3184 283.904 43.4734 283.912 43.6284 283.919C43.9192 283.935 44.2059 283.942 44.5006 283.942H147.395C147.693 283.942 147.984 283.935 148.274 283.919C148.43 283.912 148.584 283.904 148.739 283.893C149.042 283.87 149.34 283.843 149.642 283.809C149.526 283.82 149.414 283.828 149.298 283.839C157.731 282.889 164.308 275.716 164.308 267.036V20.2272C164.308 11.2009 157.196 3.80228 148.274 3.34114H148.263C147.976 3.32548 147.689 3.31784 147.395 3.31784H44.5006C44.2059 3.31784 43.9231 3.32548 43.6326 3.34114H43.6284C43.4734 3.34878 43.3184 3.3568 43.1634 3.36825C43.0161 3.37969 42.8611 3.39535 42.7099 3.40679C34.2265 4.30614 27.5913 11.507 27.5913 20.2272V151.388M25.2696 238.278V226.254M34.1941 158.545V20.2306C34.1941 14.7975 38.4134 10.2996 43.8178 9.94611H43.9106L44.0499 9.93198C44.2141 9.92475 44.3641 9.92472 44.5034 9.92472H59.3495C60.1993 9.96748 60.8848 10.6244 60.9704 11.4631L60.9713 11.4779C60.9744 11.5301 60.9776 11.5829 60.9776 11.6383V11.6597C61.1811 16.011 64.772 19.4736 69.1698 19.4736H122.73C127.127 19.4736 130.718 16.011 130.922 11.6597V11.6383C130.922 11.5829 130.925 11.5304 130.928 11.4782L130.929 11.4631C131.015 10.6244 131.7 9.96748 132.549 9.92472H147.396C147.535 9.92472 147.685 9.92475 147.849 9.93198L147.988 9.94611H148.082C153.486 10.2996 157.705 14.7975 157.705 20.2306V267.036C157.705 272.376 153.536 276.892 148.217 277.308C148.165 277.312 148.123 277.315 148.081 277.319L148.078 277.319H148.042L148.014 277.323H147.953L147.932 277.327L147.93 277.327L147.929 277.327C147.751 277.335 147.574 277.342 147.396 277.342H44.5034C44.3255 277.342 44.148 277.335 43.9701 277.327L43.969 277.327L43.9679 277.327L43.9465 277.323H43.8858L43.8572 277.319H43.8217L43.8187 277.319C43.7769 277.315 43.7345 277.312 43.6823 277.308C38.3633 276.892 34.1941 272.376 34.1941 267.036V178.586M23.6521 148.301C23.6147 148.268 23.5193 148.222 23.3693 148.163C23.0612 148.043 22.636 148.008 22.2253 147.974C22.0313 147.958 21.8432 147.942 21.6714 147.919L20.8934 147.811C17.5128 147.337 13.6811 146.802 10.5597 147.83C10.3058 147.914 9.97642 148.033 9.68745 148.214C7.45931 149.607 2.80262 154.442 1.61011 159.826C0.977204 162.683 1.41084 165.294 2.89957 167.585C5.96789 172.306 10.5074 175.841 14.5438 178.676C15.524 179.364 16.6101 180.101 17.9614 180.995C18.1866 181.144 18.3939 181.293 18.5924 181.434C19.294 181.936 19.8482 182.332 20.7503 182.431C23.522 182.735 26.401 182.373 29.0765 181.383L29.3048 181.299C30.427 180.886 31.8238 180.373 32.4861 179.432C34.1031 177.136 36.2369 173.538 37.2172 169.433C37.6402 167.662 37.7405 166.251 37.5325 164.993C37.0481 162.071 34.9474 159.796 32.4452 157.346C32.1406 157.237 31.7749 156.862 31.0886 156.066C30.9542 155.91 30.8446 155.781 30.782 155.72L25.3035 150.365C24.763 149.837 24.3217 149.364 23.9259 148.769C23.8278 148.623 23.7709 148.512 23.7247 148.422M23.6521 148.301C23.6682 148.314 23.6819 148.338 23.7247 148.422M23.6521 148.301L23.6529 148.301C23.669 148.315 23.6819 148.338 23.7247 148.422M166.63 213.913L173.334 220.343M173.334 220.343L173.38 220.386C172.942 224.452 172.916 225.028 173.235 230.114M173.334 220.343C173.026 223.089 172.754 226.806 173.072 229.253M173.334 220.343C173.495 218.899 173.667 217.723 173.767 217.141M173.235 230.114C173.252 230.386 173.27 230.67 173.289 230.969L173.289 230.971M173.235 230.114L173.294 230.423C173.335 230.581 173.322 230.772 173.289 230.971M173.235 230.114L173.073 229.263M173.289 230.971L173.172 232.02M173.289 230.971C173.252 231.196 173.191 231.431 173.157 231.641M173.172 232.02L173.163 232.103M173.172 232.02C173.168 231.93 173.163 231.799 173.157 231.641M173.172 232.02C173.176 232.096 173.179 232.142 173.182 232.146M173.163 232.103L172.448 238.511M173.163 232.103C173.168 232.118 173.175 232.132 173.182 232.146M173.163 232.103C173.119 231.984 173.128 231.822 173.157 231.641M172.448 238.511L172.388 238.594C172.361 238.632 170.173 241.232 166.854 246.152M172.448 238.511L173.072 229.253M173.072 229.253C173.072 229.253 173.073 229.257 173.073 229.263M173.072 229.253L173.073 229.263M173.073 229.263C173.089 229.397 173.129 230.85 173.157 231.641M173.182 232.146C173.687 232.904 174.584 233.798 175.666 234.725M173.182 232.146C173.535 232.81 174.468 233.726 175.666 234.725M175.666 234.725C179.226 237.776 184.8 241.195 185.104 241.381C185.033 241.338 179.198 237.671 175.666 234.725ZM173.767 217.141C174.564 217.463 176.281 218.113 178.633 218.417M173.767 217.141C174.18 217.329 175.973 218.088 178.633 218.417M173.767 217.141L166.558 206.5M178.633 218.417C181.548 218.793 185.438 218.636 189.756 216.658M178.633 218.417C181.534 218.776 185.465 218.623 189.756 216.658M189.756 216.658C189.827 216.626 189.898 216.593 189.969 216.559M67.4683 323.631C70.4328 329.189 74.192 335.823 77.6768 341.522C92.8799 366.399 95.2 373.141 95.5527 374.664V375.7M67.4683 323.631C72.9296 307.707 97.7699 290.507 98.2854 290.15L98.2916 290.146C98.04 290.321 73.495 307.571 67.4683 323.631ZM67.4683 323.631C62.152 313.572 58.8077 305.831 56.9292 301.071C55.0301 296.265 52.4092 291.749 49.1397 287.657L47.9153 286.137M28.8505 204.209C31.3841 207.632 32.9003 212.464 31.6452 217.3C30.4889 221.756 27.8489 225.222 24.3855 226.861V237.921C27.7065 239.088 29.7911 241.302 30.5828 244.508C31.9643 250.084 29.9423 257.645 25.9796 261.726C24.1702 263.585 22.1669 264.543 20.1136 264.543C19.8662 264.543 19.6185 264.528 19.37 264.501L24.9855 268.636M34.147 152.964L26.212 149.313C25.8452 149.145 25.5564 149.529 25.8452 149.811L31.3237 155.166C31.3955 155.236 31.5222 155.382 31.6757 155.56L31.6786 155.563C31.9222 155.846 32.4736 156.485 32.6873 156.606H32.7968L32.9098 156.716C34.9429 158.703 37.7268 161.424 38.2968 164.867C38.5227 166.23 38.4193 167.738 37.9711 169.614C36.9622 173.838 34.7761 177.527 33.1198 179.879C32.3187 181.017 30.7957 181.577 29.5724 182.027L29.3457 182.11C27.1996 182.905 24.9271 183.312 22.6761 183.312C22.3249 183.312 21.9749 183.301 21.6252 183.281C22.2994 184.192 23.7392 186.664 25.2718 190.467M211.09 375.7V374.664L213.502 342.095L215.94 316.496L219.792 274.632C220.431 267.696 219.597 260.833 217.316 254.235C214.986 247.501 213.473 241.094 212.817 235.192C212.268 230.25 212.46 225.348 212.646 220.608C212.995 211.71 213.297 204.026 208.158 200.602C200.156 195.267 175.98 167.503 173.151 161.277C172.263 159.324 171 158.464 169.497 158.79C168.553 158.994 167.372 159.481 166.702 160.263M146.375 286.09C145.308 288.615 143.615 292.089 142.556 294.787M130.056 113.003H63.0631M130.056 84.3738H100.854M130.056 147.359H63.0631M130.056 181.714H63.0631M130.056 121.592H63.0631M130.056 92.9627H100.854M130.056 155.948H63.0631M130.056 190.303H63.0631M130.056 130.181H63.0631M130.056 164.537H63.0631M130.056 198.892H63.0631M130.056 138.77H63.0631M130.056 173.125H63.0631M130.056 207.481H63.0631M30.8954 217.105C29.7728 221.431 27.2014 224.769 23.8407 226.264C22.4226 226.896 20.8755 227.194 19.2463 227.145C13.854 226.987 9.84776 225.057 7.66123 221.564C5.3411 217.859 5.23957 212.578 7.39594 207.783C10.7883 200.246 23.0215 200.651 23.9228 200.691C25.9616 201.409 27.6374 202.632 28.9043 204.325C31.3378 207.564 32.1005 212.461 30.8954 217.105ZM23.8772 238.567C27.0829 239.619 29.0858 241.68 29.8306 244.695C31.154 250.036 29.2183 257.279 25.4236 261.184C24.0047 262.646 21.7086 264.253 18.833 263.627C16.7477 263.173 14.7108 261.619 12.78 259.001C5.82762 249.577 5.68905 247.795 8.07293 242.887C10.5545 237.78 14.2157 237.19 20.5306 237.867C21.6693 237.988 22.7263 238.2 23.6764 238.498L23.8772 238.567ZM135.782 224.965H56.7644C52.4952 224.965 49.0344 221.505 49.0344 217.235V79.8139C49.0344 75.5447 52.4952 72.0839 56.7644 72.0839H135.782C140.051 72.0839 143.512 75.5447 143.512 79.8139V217.235C143.512 221.505 140.051 224.965 135.782 224.965Z",stroke:t,strokeWidth:"1.75936"}),T.default.createElement("defs",null,T.default.createElement("linearGradient",{id:"paint0_linear_441_9693",x1:"110.664",y1:"375.7",x2:"110.664",y2:"1",gradientUnits:"userSpaceOnUse"},T.default.createElement("stop",{offset:"0.029183",stopColor:t,stopOpacity:"0"}),T.default.createElement("stop",{offset:"0.204626",stopColor:t})))))}function bu(e){return e.config.visible?T.default.createElement("div",{style:e.style},T.default.createElement(W,{polygonConfig:{strokeColor:e.config.background.strokeColor,fillColor:e.config.background.fillColor,cornerRadius:0,strokeWidth:0},sx:{minHeight:40,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",width:"100%"}},T.default.createElement(N.a,{config:e.config.title,style:{textAlign:"center",maxWidth:"94%",wordWrap:"break-word"},debugName:"top-user-guidance"}))):null}function Au(e){const t=e.config.screens.camera.userGuidance.statesTitles,n="auto"===e.snappingMode?t.readyToCapture:t.captureManual,i={NOT_ACQUIRED:t.noDocumentFound,OK:n,OK_BUT_TOO_SMALL:t.tooSmall,OK_BUT_BAD_ANGLES:t.badAngles,OK_BUT_BAD_ASPECT_RATIO:t.badAspectRatio,OK_BUT_OFF_CENTER:t.textHintOffCenter,OK_BUT_ORIENTATION_MISMATCH:t.orientationMismatch,OK_BUT_TOO_DARK:t.tooDark,ERROR_NOTHING_DETECTED:t.noDocumentFound,ERROR_TOO_DARK:t.tooDark,ERROR_TOO_NOISY:t.tooNoisy,START:e.config.screens.camera.userGuidance.title.text};return T.default.createElement(N.a,{config:Object.assign(Object.assign({},e.config.screens.camera.userGuidance.title),{text:_.b.getLocalizedText(i[e.text])})})}const Su=`calc(100 * ${R} - 50px - 112px)`,wu="0.5s";function Eu(e){const t=e.config.screens.camera,n=e.bottomUserGuidanceVisible?56:0;return T.default.createElement(T.default.Fragment,null,T.default.createElement("div",{style:{position:"absolute",width:"100%",height:Su}},e.documentScannerView),T.default.createElement("div",{style:{position:"absolute",width:"100%",height:Su,backgroundColor:"white",opacity:e.showCameraBlink?1:0,transition:e.showCameraBlink?"":"opacity 0.5s ease-in"}}),T.default.createElement(P.Box,{sx:{height:Su,position:"relative"}},T.default.createElement(bu,{config:t.topUserGuidance}),e.bottomUserGuidanceVisible&&T.default.createElement(P.Box,{key:"bottomUserGuidance",sx:{position:"absolute",marginTop:`calc(${Su} - ${n}px)`,width:"100%",display:"flex",justifyContent:"center"}},T.default.createElement(W,{polygonConfig:{fillColor:t.userGuidance.background.fillColor,strokeColor:t.userGuidance.background.strokeColor,strokeWidth:t.userGuidance.background.strokeWidth,cornerRadius:4},sx:{padding:"6px 10px"}},T.default.createElement(Au,{config:e.config,text:e.userGuidanceText,snappingMode:e.snappingMode}))),t.scanAssistanceOverlay.visible&&!t.viewFinder.visible&&T.default.createElement(P.Box,{key:"scanAssistanceOverlay",sx:{backgroundColor:_.b.getColorValue(t.scanAssistanceOverlay.backgroundColor),height:"100%",display:"flex",justifyContent:"center",alignItems:"center",opacity:e.showHand?1:0,transition:"opacity 0.5s"}},T.default.createElement(Cu,{color:t.scanAssistanceOverlay.foregroundColor,maxWidth:"80%",maxHeight:`min(calc(${Su} * 0.85), 600px)`,paddingTop:40,paddingBottom:n}))))}const Du={OK:"Capturing your document... Please do not move the camera.",OK_BUT_TOO_SMALL:"The document is too small. Try moving closer.",OK_BUT_BAD_ANGLES:"This is a bad camera angle. Hold the device straight over the document.",OK_BUT_BAD_ASPECT_RATIO:"Rotate the device sideways, so that the document fits better into the screen.",OK_BUT_OFF_CENTER:"Try holding the device at the center of the document.",OK_BUT_TOO_DARK:"A document was detected, but it is too dark. Try turning on a light.",OK_BUT_ORIENTATION_MISMATCH:"The document seems to be upside down. Please rotate the device or document",ERROR_NOTHING_DETECTED:"Please hold the device over a document to start scanning.",ERROR_TOO_DARK:"It is too dark. Try turning on a light.",ERROR_TOO_NOISY:"Please move the document to a clear surface.",NOT_ACQUIRED:"Scanning failed."};class xu{constructor(e){this.initializing={enabled:!0,value:"Initializing..."},this.hint=e}}class Bu{constructor(){this.outline=new Iu,this.captureButton=new Pu}}class Iu{constructor(){this.polygon=new Tu,this.path=new Ou,this.label=new ku}}class Tu{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent",this.strokeWidthCapturing=2,this.strokeWidthSearching=2}}class Ou{constructor(){this.stroke="green",this.strokeWidth=4}}class ku{}class Pu{constructor(){this.color="#FFF"}}class Lu extends S.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new d.DocumentScannerParameters,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new xu(Du),this.style=new Bu,this.onDocumentDetected=function(e){},this.finder=Object(w.b)(),this.finder.visible=!1}static fromJson(e){var t,n;const i=new Lu;if(S.a.mapValuesDeep(null!==(t=e.finder)&&void 0!==t?t:{},i.finder),this.mapValues(e,i,["text","style","videoConstraints","detectionParameters","finder"]),e.text&&e.text&&(e.text.hint&&this.mapValues(e.text.hint,i.text.hint),e.text.initializing&&this.mapValues(e.text.initializing,i.text.initializing)),e.style){this.mapValues(e.style,i.style,["outline","captureButton"]);const t=e.style.outline;if(t){this.mapValues(t,i.style.outline,["polygon","path","label"]);const e=t.polygon;e&&this.mapValues(e,i.style.outline.polygon);const n=t.path;n&&this.mapValues(n,i.style.outline.path);const r=t.label;r&&this.mapValues(r,i.style.outline.label)}const n=e.style.captureButton;n&&this.mapValues(n,i.style.captureButton)}return this.mapVideoConstraints(e,i),i.detectionParameters=new d.DocumentScannerParameters(null!==(n=e.detectionParameters)&&void 0!==n?n:{}),i}}var _u=n(87),Ru=n.n(_u),Mu=n(83),Fu={insert:"head",singleton:!1},Nu=(Ru()(Mu.a,Fu),Mu.a.locals,n(57)),Vu=n.n(Nu);class Wu{constructor(e){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=e}setDuration(e){const t=Date.now()/1e3,n=t-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const i=-e*this.t;this.element&&(this.element.style.animationDuration=`${e}s`,this.element.style.animationDelay=`${i}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=t,this.lastDuration=e}}class ju extends T.default.Component{constructor(){super(...arguments),this.inner1=new Wu("scanbot-shutter-rotate"),this.inner2=new Wu("scanbot-shutter-rotate")}render(){return T.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(e){"searching"==e?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,T.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==e||"manual"==e,"scanbot-shutter-fade-out":"searching"==e||"capturing"==e,"scanbot-shutter-pulse-fast":"processing"==e},T.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},T.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==e||"capturing"==e,"scanbot-shutter-fade-out":"processing"==e||"manual"==e},T.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(e=>{this.inner1.element=e}))}captureSearchingInner2(){const{action:e}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==e||"capturing"==e,"scanbot-shutter-fade-out":"processing"==e||"manual"==e},T.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(e=>{this.inner2.element=e}))}path(e){return T.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:e})}svgBase(e,t,n){return T.default.createElement("div",{className:Vu()(e),ref:n},T.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},t))}}class zu extends T.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return T.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible",fill:this.props.polygonStyle.fill}},this.fill())}fill(){if(!this.props.points||0===this.props.points.length)return null;const e=[];for(let t=0;t<this.LINE_COUNT;t++){const n=this.props.points[t],i=this.props.points[(t+1)%this.LINE_COUNT];e.push(T.default.createElement("line",{key:t,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:i.x,y2:i.y}))}return e}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}zu.CLASSNAME="scanbot-document-outline";class Hu extends T.default.Component{constructor(e){super(e),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(e,t,n,i){if(t&&t.some((e=>Number.isNaN(e.x)||Number.isNaN(e.y))))return;const r={points:e,animatedPoints:t,isOk:n,isVisible:i};this.setState(r)}pointStringOrLatestValidPoints(e){return e&&e.length>0?hs.a.toSvgString(e):hs.a.toSvgString(this.latestValidPoints)}render(){var e;this.state.points&&(this.latestValidPoints=this.state.points);const t=null!==(e=this.props.style)&&void 0!==e?e:{},n=Vu()(zu.CLASSNAME,{[`${zu.CLASSNAME}-ok`]:this.state.isOk},{[`${zu.CLASSNAME}-visible`]:this.state.isVisible},{[`${zu.CLASSNAME}-hidden`]:!this.state.isVisible});return T.default.createElement(us.polygon,{ref:e=>this.polygon=e,transition:{duration:.1},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?t.strokeCapturing:t.strokeSearching,fill:this.state.isOk?t.fillCapturing:t.fillSearching,strokeWidth:this.state.isOk?t.strokeWidthCapturing:t.strokeWidthSearching},onClick:()=>{},className:n})}}var Uu=Hu;class Zu extends T.default.Component{constructor(e){super(e),this.state={path:void 0}}render(){var e,t;return this.state.path?T.default.createElement(us.path,{pathLength:"1",strokeDasharray:"1 1",initial:{strokeDashoffset:1},animate:{strokeDashoffset:0,d:this.state.path},transition:{strokeDashoffset:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:0,repeatType:"loop",repeatDelay:1},d:{duration:.1}},stroke:(null===(e=this.props.style)||void 0===e?void 0:e.stroke)||"white",strokeWidth:(null===(t=this.props.style)||void 0===t?void 0:t.strokeWidth)||2,fill:"none",d:this.state.path,className:`${zu.CLASSNAME}-path`}):null}animate(e){const t="M"+hs.a.toSvgString(e)+"z";this.setState({path:t})}clear(){this.setState({path:void 0})}}class Gu extends T.default.Component{render(){return T.default.createElement(us.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},T.default.createElement(Uu,{ref:e=>this.polygon=e,style:this.props.polygonStyle}),T.default.createElement(Zu,{ref:e=>this.path=e,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(e,t,n){var i;const r="processing"!==n&&!!e,o=null!==(i=this.previous)&&void 0!==i?i:e,a=this.previous?e:void 0;this.polygon.update(o,a,t,r),this.previous=e,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class Yu extends T.default.Component{constructor(){super(...arguments),this.state={text:this.props.initializationText,ok:!1,validPoints:!1}}render(){const{ok:e,text:t,validPoints:n}=this.state,i="processing"!==this.props.action&&n;return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},T.default.createElement(Gu,{ref:e=>{this.polygon=e},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:e,isVisible:i,autoCaptureSensitivity:this.props.autoCaptureSensitivity}),T.default.createElement("label",{ref:e=>this.label=e,style:Object.assign({position:"absolute",display:t.enabled?"inline":"none",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",backgroundColor:"rgba(0, 0, 0, 0.4)",color:"white",borderRadius:"0.25em",padding:"0.05em 0.3em 0.05em 0.3em",fontFamily:"sans-serif",fontSize:"0.9em",fontWeight:"300"},this.props.style.label),dangerouslySetInnerHTML:{__html:t.value}}))}update(e,t,n){this.polygon.update(t,e,this.props.action),"searching"===this.props.action||"capturing"===this.props.action?(this.label.innerHTML=n,this.label.style.display="inline"):(this.label.innerHTML="",this.label.style.display="none")}}class Qu{constructor(e,t=Qu.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(e),this.sensitivity=t}check(e){let t=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(e[n],this.lastPolygon[n])){t=!0;break}}else t=!0;return t}reset(){this.lastPolygon=void 0}update(e){this.lastPolygon=e}isPointMoved(e,t){return Vs.distanceBetweenPoints(e,t)/this.maxDistance>this.sensitivity}calculateMaxDistance(e){let t=new hs.a(0,0),n=new hs.a(e.width,e.height);return Vs.distanceBetweenPoints(t,n)}}Qu.DEFAULT_SENSITIVITY=.5;var qu=n(16),Xu=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};ue.b;ue.a;class Ku extends ue.c{constructor(e){if(super(e),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>Xu(this,void 0,void 0,(function*(){const e=yield this.detectAndCrop();this.configuration.onDocumentDetected(e)})),Object.assign(this.state,{action:this.defaultAction}),!this.isSupported()){throw Error("Camera can only be accessed if the content is served via HTTPS, or on localhost. Check DocumentScannerView.isSupported() before creating the scanner.")}if(!e.sdk)throw Error("Initialize the SDK by calling ScanbotSDK.initialize() before using the document scanner.")}get defaultAction(){return this.isAutoCaptureEnabled()?"searching":"manual"}get enabled(){return!("searching"!=this.state.action&&"capturing"!=this.state.action&&"manual"!=this.state.action||this.disposed||this.props.pauseAR)}get configuration(){return this._configuration||(this._configuration=Lu.fromJson(this.props.configuration)),this._configuration}componentDidUpdate(e){e.configuration!==this.props.configuration&&(this._configuration=void 0)}get autoCaptureSensitivity(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}static create(e,t){return Xu(this,void 0,void 0,(function*(){const n=_s.a.findContainerOrThrow(e);return new Promise(((i,r)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(n),this.root.render(T.default.createElement(Ku,{root:this.root,container:n,configuration:e,onSuccess:i,onFailure:r,sdk:t}))}))}))}detectAndCrop(){var e,t,n,i,r;return Xu(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"}),this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const i=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Ku.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);return i?(I.a.debug("Detect & Crop document of size: "+i.height*i.width),this.handle||(yield this.createHandle()),yield null===(n=this.handle)||void 0===n?void 0:n.scan(new d.Image(i))):null}}catch(e){return null===(r=(i=this.configuration).onError)||void 0===r||r.call(i,e),null}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(e){this._configuration?this._configuration.autoCaptureEnabled=e:this.props.configuration.autoCaptureEnabled=e,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}onSdkReady(){return Xu(this,void 0,void 0,(function*(){this.createHandle()}))}createHandle(){return Xu(this,void 0,void 0,(function*(){const e=new d.DocumentScannerConfiguration({parameters:this.configuration.detectionParameters});this.handle=yield this.bridge.api.DocumentScanner.create(e)}))}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Xu(this,void 0,void 0,(function*(){e.componentDidMount.call(this),this.detect()}))}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});var t;return Xu(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield null===(t=this.handle)||void 0===t?void 0:t.destroy()}))}detect(){var e,t,n,i;return Xu(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const n=yield this.detectInWebWorker();if(!n||!this.enabled)return;if(!this.outline)return;this.camera.reusableImageBuffer=n.originalImage;const i=n.result,r=this.getStatusString(i),o="OK"===r,a=r.startsWith("OK")?this.scalePolygonPointsToPixels(i.pointsNormalized):void 0;this.outline.update(o,a,y.getProperty(this.configuration.text.hint,r)),null===(t=(e=this.props).onStatusStringUpdate)||void 0===t||t.call(e,r),yield this.handleAutoCapture(o,a)}catch(e){null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(e){return this.configuration.ignoreBadAspectRatio&&"OK_BUT_BAD_ASPECT_RATIO"===e.status?"OK":e.status}detectInWebWorker(){var e,t,n,i,r;return Xu(this,void 0,void 0,(function*(){try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const i=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(ue.c.DEFAULT_DETECTION_RESOLUTION,!1);return i&&this.enabled?yield null===(n=this.handle)||void 0===n?void 0:n.run(new d.Image(i),"CONSUME_IMAGE"):null}catch(e){return null===(r=(i=this.configuration).onError)||void 0===r||r.call(i,e),null}}))}handleAutoCapture(e,t){return Xu(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled&&!this.preventAutoCapture)if(e&&!this.autoCaptureToken&&t){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const e=this.getCameraFrameSize();this.polygonMovementPredicate=new Qu(e)}if(this.runMovementPredicate(t))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>Xu(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const e=yield this.detectAndCrop(),t=e.result.detectionResult;if(null==t?void 0:t.pointsNormalized){const e=this.scalePolygonPointsToPixels(t.pointsNormalized);if(this.runMovementPredicate(e))return}(null==t?void 0:t.status.startsWith("OK"))&&this.configuration.onDocumentDetected&&(this.configuration.onDocumentDetected(e),this.preventAutoCapture=!0,setTimeout((()=>{this.preventAutoCapture=!1}),this.configuration.autoCaptureDelay))}))),this.autoCaptureSensitivity)}else!e&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(e){this.setState({action:e})}render(){var e,t,n,i;const{action:r}=this.state,{configuration:o}=this,a=null===(e=o.style)||void 0===e?void 0:e.captureButton,s=!(null!==(t=this.props.hideShutterButton)&&void 0!==t&&t);return T.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(n=this.configuration)||void 0===n?void 0:n.spinnerColor),T.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},T.default.createElement(le.a,{configuration:this.configuration,videoConstraints:o.videoConstraints,mirrored:o.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}}),s&&T.default.createElement(ju,{color:(null==a?void 0:a.color)?a.color:"FFF",action:r,onClick:this.enabled?o.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}})),this.configuration.finder.visible&&T.default.createElement(de.a,{ref:e=>{this.finder=e},guidanceConfiguration:new qu.b({visible:!1}),configuration:o.finder}),T.default.createElement(Yu,{ref:e=>{this.outline=e},style:null===(i=o.style)||void 0===i?void 0:i.outline,initializationText:o.text.initializing,action:r,autoCaptureSensitivity:this.autoCaptureSensitivity}))}scalePolygonPointsToPixels(e){var t;if(e){const n=this.getCameraFrameSize(),i=Ps.a.fromHtmlElement(this.camera.video),r=_s.a.findScale(i,n);(null===(t=this.finder)||void 0===t?void 0:t.holeRect)&&(e=e.map((e=>new hs.a((e.x*this.finder.holeRect.width+this.finder.holeRect.x)/i.width,(e.y*this.finder.holeRect.height+this.finder.holeRect.y)/i.height)))),e=null==(e=_s.a.convertToViewportPointsFromParentSize(n,e))?void 0:e.map((e=>hs.a.scaleToPoint(e,r.x,r.y,r.scale)))}return e}runMovementPredicate(e){const t=this.polygonMovementPredicate.check(e);return this.polygonMovementPredicate.update(e),t}getCameraFrameSize(){return this.camera.calculateFrameSize(ue.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}Ku.DETECT_AND_CROP_RESOLUTION=0,Ku.root=null;var Ju=Ku;function $u(e){const[t,n]=Object(T.useState)(!1);return Object(T.useEffect)((()=>{const t=setTimeout((()=>{n(!0)}),e);return()=>clearTimeout(t)}),[]),t}var el=n(18);function tl(e){if(!e.visible)return null;const t=e.config.screens.camera.cameraPermission;return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Dialog,{fullScreen:!0,open:e.visible,transitionDuration:0},T.default.createElement(iu,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:null,rightContent:null,centerTitle:e.config.screens.camera.topBarTitle}),T.default.createElement(P.Box,{style:{height:`calc(100 * ${R} - 50px)`,backgroundColor:_.b.getColorValue(t.background),display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(t.iconBackground),borderRadius:40,width:80,height:80,display:"flex",justifyContent:"center",alignItems:"center"}},T.default.createElement(L.a,{style:{color:_.b.getColorValue(t.icon.color)},sx:{fontSize:40}})),T.default.createElement("h4",{style:{margin:12}},T.default.createElement(N.a,{style:{fontSize:18,fontWeight:500},config:t.enableCameraTitle})),T.default.createElement(P.Box,{style:{marginBottom:"12px",maxWidth:350,textAlign:"center"}},T.default.createElement(N.a,{config:t.enableCameraExplanation,asHtml:!0})),T.default.createElement(P.Box,null,T.default.createElement(G,{icon:T.default.createElement(P.Close,{style:{fontSize:18}}),iconPosition:"right",onClick:e.onCloseClick,visible:t.closeButton.visible,text:t.closeButton.text,background:t.closeButton.background,foreground:t.closeButton.foreground,ariaLabel:t.closeButton.accessibilityDescription,styleOverrides:{fontSize:14,padding:"8px 20px",gap:"6px"}})))))}var nl=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function il(e,t){return nl(this,void 0,void 0,(function*(){return{value:yield e,source:t}}))}var rl=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function ol(e){var t;const n=e.configuration.screens.camera,[i,r]=Object(T.useState)(n.cameraConfiguration.autoSnappingEnabled?"auto":"manual"),[o,a]=Object(T.useState)(n.cameraConfiguration.flashEnabled),[s,c]=T.default.useState(!1),u=Object(T.useRef)(null);const[l,d]=Object(T.useState)(n.introduction.showAutomatically);Object(T.useEffect)((()=>{e.scanLimitReached&&r("manual")}),[e.scanLimitReached]);const m="ENABLED"===n.userGuidance.visibility||"AUTO_CAPTURE_ONLY"===n.userGuidance.visibility&&"auto"===i;Object(T.useEffect)((()=>{const t=e.configuration.screens.camera.viewFinder.minimumInsets;t.top+=n.topUserGuidance.visible?40:0,t.bottom+=m?56:0}),[]);const h=null===(t=e.pages)||void 0===t?void 0:t[e.pages.length-1],[f,p]=Object(T.useState)(null),g=Nc(null==h?void 0:h.finalImageUrl());Object(T.useEffect)((()=>{0===e.pages.length?p(null):g.value&&p(g.value)}),[g,e.pages.length]);const[v,y]=Object(T.useState)(!1),C=0===n.timeouts.initialScanDelay||$u(n.timeouts.initialScanDelay),[b,A]=Object(T.useState)("START"),[S,w]=Object(T.useState)(!0),{documentScannerView:E,documentScannerViewRef:D,torchSupported:x,scannerInitialized:B,activeCamera:I,availableCameras:O,setActiveCamera:k}=function(e){const t=e.configuration.screens.camera,n=t.cameraConfiguration,i=t.scannerParameters,r=!e.pauseAR&&("ENABLED"===t.polygon.visibility||"AUTO_CAPTURE_ONLY"===t.polygon.visibility&&"auto"===e.snappingMode),o=e=>r?_.b.getColorValue(e):"#00000000",a=(new Lu).videoConstraints;a.width.ideal=n.idealPreviewResolution.width,a.height.ideal=n.idealPreviewResolution.height,a.facingMode="FRONT"===n.cameraModule?"user":"environment";const s=!e.scanningPaused&&"auto"===e.snappingMode,c={videoConstraints:a,onError:e.onError,backgroundColor:_.b.getColorValue(t.backgroundColor),onDocumentDetected:e.onImageCaptured,autoCaptureEnabled:s,autoCaptureDelay:n.autoSnappingDelay,autoCaptureSensitivity:n.autoSnappingSensitivity,detectionParameters:{aspectRatios:i.aspectRatios,acceptedAngleScore:i.acceptedAngleScore,acceptedBrightnessThreshold:i.acceptedBrightnessThreshold,acceptedSizeScore:i.acceptedSizeScore,ignoreOrientationMismatch:i.ignoreOrientationMismatch},ignoreBadAspectRatio:!1,spinnerColor:"transparent",style:{outline:{label:{backgroundColor:"transparent",color:"transparent"},path:{stroke:o(t.polygon.autoSnapProgress.strokeColor),strokeWidth:t.polygon.autoSnapProgress.strokeWidth},polygon:{strokeWidthSearching:t.polygon.documentNotOk.strokeWidth,strokeSearching:o(t.polygon.documentNotOk.strokeColor),fillSearching:o(t.polygon.documentNotOk.fillColor),strokeWidthCapturing:t.polygon.documentOk.strokeWidth,fillCapturing:o(t.polygon.documentOk.fillColor),strokeCapturing:o(t.polygon.documentOk.strokeColor)}}},finder:t.viewFinder},u=Object(T.useRef)(null);Object(T.useEffect)((()=>()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.dispose()}),[]),Object(T.useEffect)((()=>{u.current&&(s?u.current.enableAutoCapture():u.current.disableAutoCapture())}),[e.scanningPaused,e.snappingMode,u.current]);const[l,d]=Object(T.useState)(!1);Object(T.useEffect)((()=>{u.current&&l&&u.current.setTorchState(e.torchEnabled).catch((e=>{}))}),[e.torchEnabled,u.current,l]);const[m,h]=Object(T.useState)(!1),[f,p]=Object(T.useState)(null),[g,v]=Object(T.useState)([]);Object(T.useEffect)((()=>{u.current||h(!1)}),[u.current]);const y=T.default.createElement(Ju,{root:e.root,sdk:e.sdk,ref:u,configuration:c,onSuccess:function(){var e,t,n;d(null===(e=u.current)||void 0===e?void 0:e.getActiveCameraInfo().supportsTorchControl),h(!0);const i=null===(t=u.current)||void 0===t?void 0:t.getActiveCameraInfo();p(null!=i?i:null),v(i?[i]:[]),null===(n=u.current)||void 0===n||n.fetchAvailableCameras().then(v)},onFailure:e.onError,hideShutterButton:!0,onStatusStringUpdate:e.onUserGuidanceTextUpdate,pauseAR:e.pauseAR});return{documentScannerView:y,documentScannerViewRef:u,torchSupported:l,scannerInitialized:m,activeCamera:f,availableCameras:g,setActiveCamera:function(e){var t;return p(e),null===(t=u.current)||void 0===t?void 0:t.switchCamera(e.deviceId)}}}({root:e.root,sdk:e.sdk,configuration:e.configuration,onImageCaptured:e=>{F(il(Promise.resolve(e),"AUTO_SNAP"))},onUserGuidanceTextUpdate:function(e){(!S||"ERROR_NOTHING_DETECTED"!==e&&L)&&(A(e),w(!1))},snappingMode:i,scanningPaused:e.scanningPaused||!C,torchEnabled:o,onError:t=>{t instanceof el.a?y(!0):e.onError(t)},pauseAR:!e.visible||e.scanningPaused||!C}),L=$u(1e3),[R,M]=Object(T.useState)(!1);Object(T.useEffect)((()=>{requestAnimationFrame((()=>M(!1)))}),[R]);function F(t){M(n.captureFeedback.cameraBlinkEnabled),ce.INSTANCE.vibrate(e.configuration.screens.camera.vibration),e.onImageCaptured(t)}return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{display:e.visible?"block":"none","data-sb-screen-camera":!0,style:{position:"absolute",width:"100vw"}},T.default.createElement(nu,{config:n.introduction,isOpen:l,onClose:()=>{d(!1)}}),T.default.createElement(su,{cameraSelectConfig:{availableCameras:O,activeCamera:I,onSelect:e=>rl(this,void 0,void 0,(function*(){yield k(e),a(!1)}))},onCloseButtonClick:()=>{var t;0===e.pages.length?null===(t=e.onClose)||void 0===t||t.call(e):c(!0)},config:e.configuration,onShowIntroButtonClick:()=>d(!0)}),T.default.createElement(Eu,{config:e.configuration,sdk:e.sdk,documentScannerView:E,showHand:S,userGuidanceText:b,bottomUserGuidanceVisible:m,snappingMode:i,showCameraBlink:R}),T.default.createElement(yu,{buttonStates:{importButtonEnabled:!e.scanningPaused,snappingModeState:i,snappingModeButtonEnabled:!e.scanLimitReached,torchState:o&&x?"on":"off",torchButtonEnabled:x,reviewButtonCount:e.pages.length,reviewButtonPreviewImageUrl:f,reviewButtonEnabled:e.pages.length>0,shutterButtonState:e.scanningPaused||!B?"loading":i},sdk:e.sdk,onFileSelectDialogOpened:function(){u.current=i,r("manual")},onFileSelectDialogClosed:function(){u.current&&(r(u.current),u.current=null)},onFileUploaded:t=>e.onImageCaptured(il(t,"IMPORTED")),snappingModeButtonClick:()=>r((e=>function(e){return"auto"===e?"manual":"auto"}(e))),onTorchButtonClick:()=>a((e=>!e)),onReviewButtonClick:e.onReviewButtonClick,onShutterButtonClick:function(){var e;return rl(this,void 0,void 0,(function*(){w(!1),F(il(null===(e=D.current)||void 0===e?void 0:e.detectAndCrop(),"MANUAL_SNAP"))}))},scanLimitReached:e.scanLimitReached,config:e.configuration}),T.default.createElement(pu,{open:s,config:e.configuration.screens.camera.cancelAlertDialog,onCancelClick:()=>c(!1),onActionClick:()=>{},onOkClick:e.onClose}),T.default.createElement(tl,{visible:v,onCloseClick:e.onClose,config:e.configuration})))}function al(e){const t=Object(T.useMemo)((()=>Object(P.createTheme)({components:{MuiButtonBase:{styleOverrides:{root:{"&:hover, &:focus":{outline:"none"}}},defaultProps:{disableRipple:!0}}}})),[]);return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.ThemeProvider,{theme:t},T.default.createElement(P.Typography,{component:"div"},e.children)))}function sl(e){const t=_.b.getColorValue(e.color);return T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("mask",{id:"mask0_856_1211",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},T.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),T.default.createElement("g",{mask:"url(#mask0_856_1211)"},T.default.createElement("path",{d:"M3 9V3H5V6.35C5.83333 5.31667 6.85417 4.5 8.0625 3.9C9.27083 3.3 10.5833 3 12 3C13.9667 3 15.7208 3.55833 17.2625 4.675C18.8042 5.79167 19.8833 7.23333 20.5 9H18.325C17.7583 7.8 16.9167 6.83333 15.8 6.1C14.6833 5.36667 13.4167 5 12 5C11.05 5 10.1542 5.175 9.3125 5.525C8.47083 5.875 7.73333 6.36667 7.1 7H9V9H3ZM6 18H18L14.25 13L11.25 17L9 14L6 18ZM5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V12H5V20H19V12H21V20C21 20.55 20.8042 21.0208 20.4125 21.4125C20.0208 21.8042 19.55 22 19 22H5Z",fill:t})))}function cl(e){const t=e.config,n=e.isQualityAcceptable?t.acceptWhenOkButton:t.acceptWhenNotOkButton;return T.default.createElement(P.Box,{sx:{backgroundColor:_.b.getColorValue(e.backgroundColor),height:78,display:"flex",width:"100%",zIndex:1e3,justifyContent:"center"}},T.default.createElement(P.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)",maxWidth:400}},T.default.createElement(H,{config:e.config.retakeButton,icon:sl,enabled:!0,debugName:"ack-retake",onClick:e.onRetake}),T.default.createElement(H,{config:n,icon:e=>T.default.createElement(P.Check,{style:e}),enabled:!0,debugName:"ack-use-scan",onClick:e.onAccept})))}function ul(e){if(!e.config.visible)return null;const t=_.b.getColorValue(e.config.color);return T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("mask",{id:"mask0_447_6066",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},T.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),T.default.createElement("g",{mask:"url(#mask0_447_6066)"},T.default.createElement("path",{d:"M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H13V5H5V19H19V11H21V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM6 17H18L14.25 12L11.25 16L9 13L6 17Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.17 8.83C15.95 9.61 16.8933 10 18 10C19.1067 10 20.05 9.61 20.83 8.83C21.61 8.05 22 7.10667 22 6C22 4.89333 21.61 3.95 20.83 3.17C20.05 2.39 19.1067 2 18 2C16.8933 2 15.95 2.39 15.17 3.17C14.39 3.95 14 4.89333 14 6C14 7.10667 14.39 8.05 15.17 8.83ZM18.4 6.8V3.6H17.6V6.8H18.4ZM18.28 8.28C18.2 8.36 18.1067 8.4 18 8.4C17.8933 8.4 17.8 8.36 17.72 8.28C17.64 8.2 17.6 8.10667 17.6 8C17.6 7.89333 17.64 7.8 17.72 7.72C17.8 7.64 17.8933 7.6 18 7.6C18.1067 7.6 18.2 7.64 18.28 7.72C18.36 7.8 18.4 7.89333 18.4 8C18.4 8.10667 18.36 8.2 18.28 8.28Z",fill:t})))}function ll(e){if(!e.visible||!e.config.visible)return null;const t=e.config.background;return T.default.createElement(P.Box,{style:Object.assign({backgroundColor:_.b.getColorValue(t.fillColor),borderWidth:t.strokeWidth,borderColor:_.b.getColorValue(t.strokeColor),display:"flex",alignItems:"center",flexDirection:"row",padding:"10px",borderRadius:"5px",alignSelf:"center",width:"calc(100% - 40px)",margin:10,maxWidth:"438px"},e.style)},T.default.createElement(ul,{config:e.config.icon}),T.default.createElement(N.a,{style:{marginLeft:"10px",fontSize:"14px",lineHeight:"16px",fontWeight:400},config:e.config.title}))}function dl(e){return T.default.createElement("img",{"data-sb-acknowledgment-image":!0,style:{display:"block",maxWidth:"90%",objectFit:"contain",flex:1,height:`calc(100 * ${R} - 78px - 52px - 20px)`,paddingTop:10},src:e.image,alt:""})}function ml(e){if(!e.visible)return null;const t=e.isQualityAcceptable;return T.default.createElement("div",{style:{display:"inherit",flexDirection:"inherit",justifyContent:"inherit",alignItems:"inherit",height:"100%",width:"100%"}},T.default.createElement(dl,{image:e.base64Image}),T.default.createElement(ll,{visible:!t,config:e.banner.config}),T.default.createElement(cl,{isQualityAcceptable:t,backgroundColor:e.bottomBar.backgroundColor,config:e.bottomBar.config,onRetake:e.bottomBar.onRetake,onAccept:e.bottomBar.onAccept}))}function hl(e){const t=_.b.getColorValue(e.config.checkMarkColor),n=_.b.getColorValue(e.config.checkMarkBackgroundColor);return T.default.createElement("svg",{"data-sb-acknowledgment-checkmark":!0,width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M71.2135 31.8234C72.376 32.9859 72.376 34.8984 71.2135 36.0609L43.0885 64.1859C42.5073 64.7672 41.7385 65.0672 40.9698 65.0672C40.201 65.0672 39.4323 64.7672 38.851 64.1859L24.7885 50.1234C23.626 48.9609 23.626 47.0484 24.7885 45.8859C25.951 44.7234 27.8635 44.7234 29.026 45.8859L40.9698 57.8297L66.976 31.8234C68.1385 30.6422 70.051 30.6422 71.2135 31.8234Z",fill:t}),T.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48 0C21.525 0 0 21.525 0 48C0 74.475 21.525 96 48 96C74.475 96 96 74.475 96 48C96 21.525 74.475 0 48 0ZM71.2135 36.0609C72.376 34.8984 72.376 32.9859 71.2135 31.8234C70.051 30.6422 68.1385 30.6422 66.976 31.8234L40.9698 57.8297L29.026 45.8859C27.8635 44.7234 25.951 44.7234 24.7885 45.8859C23.626 47.0484 23.626 48.9609 24.7885 50.1234L38.851 64.1859C39.4323 64.7672 40.201 65.0672 40.9698 65.0672C41.7385 65.0672 42.5073 64.7672 43.0885 64.1859L71.2135 36.0609Z",fill:n}))}function fl(e){if(!e.visible)return null;if("PageSnapFeedbackNone"===e.mode._type)return null;if("PageSnapFunnelAnimation"===e.mode._type)return T.default.createElement(dl,{image:e.base64Image});if("PageSnapCheckMarkAnimation"===e.mode._type)return T.default.createElement(hl,{config:e.mode});throw new Error(`Unknown PageSnapFeedbackMode: ${e.mode}`)}var pl=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function gl(e){const t=Nc(e.croppedDetectionResult);Object(T.useEffect)((()=>{(null===(null==t?void 0:t.value)||(null==t?void 0:t.error))&&e.onReject()}),[null==t?void 0:t.value,null==t?void 0:t.error]);const n=e.configuration.screens.camera.acknowledgement,i=e.configuration.screens.camera.captureFeedback,r=e.configuration.outputSettings,o=n.acknowledgementMode,[a,s]=T.default.useState(null),[c,u]=T.default.useState(null),l=T.default.useRef(null),d=null!==c,m=()=>"ALWAYS"===o||"NONE"!==o&&(!!d&&("BAD_QUALITY"===o&&!c)),h=t=>{setTimeout((()=>{f(),e.onAccept(t,l.current)}),1500)},f=()=>{s(null),u(null)},p={null:-1,VERY_POOR:0,POOR:1,REASONABLE:2,GOOD:3,EXCELLENT:4};let g;Object(T.useEffect)((()=>{var a;if(null==t?void 0:t.value){const c=t.value.value;let d=null!==(a=c.result.croppedImage)&&void 0!==a?a:c.originalImage;function m(){return pl(this,void 0,void 0,(function*(){if(null!==r.defaultFilter&&"FILTERED_DOCUMENT"===r.documentAnalysisMode){const t=yield e.sdk.createImageProcessor();d=(yield t.applyFilter(d,r.defaultFilter,"COPY_IMAGE")).result}if("PageSnapFunnelAnimation"===i.snapFeedbackMode._type||"ALWAYS"===o||"BAD_QUALITY"===o){const t=yield e.sdk.imageToJpeg(d),n=yield b.toBase64(t,!1);s(n)}if("NONE"===o)return u(!0),void h(t.value);if(null===c.result.croppedImage)return void u(!1);const a=new Jh.Config.DocumentQualityAnalyzerConfiguration,m=yield e.sdk.createDocumentQualityAnalyzer(a),f=yield m.run(d);l.current=f.result.quality,yield m.destroy();const g=p[f.result.quality]>=p[n.minimumQuality];u(g),g&&"BAD_QUALITY"===o&&h(t.value)}))}return m(),()=>{f()}}}),[null==t?void 0:t.value]),g=m()?n.backgroundColor:"PageSnapFeedbackNone"===i.snapFeedbackMode._type?"transparent":i.snapFeedbackMode.overlayColor,g=_.b.getColorValue(g);const v=i.cameraBlinkEnabled?wu:"0s";return T.default.createElement(L.a,{open:e.visible},T.default.createElement(P.Fade,{tabIndex:-1,"data-sb-screen-acknowledgment":!0,in:e.visible,timeout:250,style:{position:"absolute",width:"100vw",height:`calc(100 * ${R})`,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",transitionDelay:e.visible?v:"0s"}},T.default.createElement(P.Box,{style:{display:e.visible?"flex":"none",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:g,zIndex:1e3}},T.default.createElement(fl,{visible:!m()&&d,base64Image:a,mode:i.snapFeedbackMode}),T.default.createElement(ml,{visible:m(),isQualityAcceptable:c,base64Image:a,banner:{config:n.badImageHint},bottomBar:{backgroundColor:e.configuration.appearance.bottomBarBackgroundColor,config:n.bottomBar,onRetake:()=>{f(),e.onReject()},onAccept:()=>{f(),e.onAccept(null==t?void 0:t.value,l.current)}}}))))}function vl(e){const t=e.config.screens.review,[n,i]=T.default.useState(null);return T.default.createElement(T.default.Fragment,null,T.default.createElement(iu,{backgroundColor:_.b.getColorValue(e.config.appearance.topBarBackgroundColor),leftContent:T.default.createElement(G,{disabled:!e.buttonsEnabled,onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:T.default.createElement(L.a,{sx:{fontSize:24}}),debugName:"close-review-screen"}),centerTitle:t.topBarTitle,centerTitleReplacementArgs:[`${e.numPages}`],rightContent:T.default.createElement(T.default.Fragment,null,T.default.createElement(G,{disabled:!e.buttonsEnabled,onClick:e=>i(e.currentTarget),visible:t.topBarMoreButton.visible,text:"",background:new ne.a({strokeColor:"transparent",fillColor:"transparent",strokeWidth:0}),foreground:new ne.g({color:t.topBarMoreButton.color,iconVisible:!0}),icon:T.default.createElement(L.a,{sx:{fontSize:24}}),debugName:"more",id:"sb-button-review-more",ariaLabel:_.b.getLocalizedText(t.topBarMoreButton.accessibilityDescription)}),T.default.createElement(P.Menu,{anchorEl:n,open:null!==n,onClose:()=>i(null),MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:_.b.getColorValue(t.morePopup.backgroundColor)}}}},T.default.createElement(ou,{disabled:!1,autoFocus:!0,ariaLabel:t.morePopup.deleteAll.accessibilityDescription,onClick:()=>{i(null),e.onDeleteButtonClick()},textColor:t.morePopup.deleteAll.title.color},T.default.createElement(L.a,{sx:{color:_.b.getColorValue(t.morePopup.deleteAll.icon.color),visibility:t.morePopup.deleteAll.icon.visible?"visible":"hidden"}}),T.default.createElement(N.a,{config:t.morePopup.deleteAll.title,style:{marginLeft:8}}))))}))}function yl(e){const t=_.b.getColorValue(e.color);return T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M6 22C5.45 22 4.97917 21.8042 4.5875 21.4125C4.19583 21.0208 4 20.55 4 20V4C4 3.45 4.19583 2.97917 4.5875 2.5875C4.97917 2.19583 5.45 2 6 2H14L20 8V12.35C19.6833 12.2333 19.3583 12.1458 19.025 12.0875C18.6917 12.0292 18.35 12 18 12V9H13V4H6V20H12.35C12.4833 20.3833 12.65 20.7417 12.85 21.075C13.05 21.4083 13.2833 21.7167 13.55 22H6Z",fill:t}),T.default.createElement("path",{d:"M16.8624 19V22H18.8624V19H21.8624V17H18.8624V14H16.8624V17H13.8624V19H16.8624Z",fill:t}))}function Cl(e){const t=_.b.getColorValue(e.color);return T.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("mask",{id:"mask0_856_1229",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},T.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),T.default.createElement("g",{mask:"url(#mask0_856_1229)"},T.default.createElement("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:t})))}function bl(){return Cc("tablet")?80:160}function Al(e){const t=Cc("tablet"),n=e.config.screens.review,i=T.default.createElement(T.default.Fragment,null,T.default.createElement(W,{style:{height:42,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,textTransform:"none",padding:"0 20px",width:"100%"},polygonConfig:Object.assign(Object.assign({},n.bottomBar.submitButton.background),{cornerRadius:4})},T.default.createElement(N.a,{config:{text:_.b.getLocalizedText(n.bottomBar.submitButton.text),visible:!0,color:n.bottomBar.submitButton.foreground.color,useShadow:n.bottomBar.submitButton.foreground.useShadow}}))),r=Object.assign(Object.assign({padding:"4px"},z(n.bottomBar.submitButton.background.fillColor)),{"& span":{transition:"transform 0.3s !important"},"&:hover span":{transform:"translateX(6px) !important"},"& > div, &":{transition:"border-radius 0.3s !important"},"&:hover > div, &:hover":{borderRadius:"0px !important"}});return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:bl(),width:"100%"}},T.default.createElement(P.Box,{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:t?"space-between":"center",height:80}},t&&T.default.createElement(P.Box,{visibility:"hidden"}),T.default.createElement(P.Box,{style:{display:"flex",flexDirection:"row",maxWidth:"600px",justifyContent:"space-around",flexGrow:1}},T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.addButton,icon:yl,onClick:e.onAddPageClick,debugName:"add-page"}),T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.retakeButton,icon:sl,onClick:e.onRetakeClick,debugName:"retake"}),T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.cropButton,icon:e=>T.default.createElement(L.a,{sx:{color:e}}),onClick:e.onCropClick,debugName:"crop-button"}),T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.rotateButton,icon:e=>T.default.createElement(L.a,{sx:{color:e}}),onClick:e.onRotateClick,debugName:"rotate-button"}),T.default.createElement(H,{enabled:e.buttonsEnabled,config:n.bottomBar.deleteButton,icon:Cl,onClick:e.onDeleteClick,debugName:"delete-button"})),t&&T.default.createElement(P.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":_.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:172,marginX:"4px"},r),onClick:e.onSubmitClick},i)),!t&&T.default.createElement(P.Box,{style:{padding:"12px",display:"flex"}},T.default.createElement(P.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":_.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:600,margin:"0 auto"},r),onClick:e.onSubmitClick},i))))}function Sl(e){const t=e.config.pageCounter;return T.default.createElement(P.Box,{style:{display:"flex",width:"100%",backgroundColor:_.b.getColorValue(e.config.backgroundColor),justifyContent:"space-between",alignItems:"end",padding:"16px 0"}},T.default.createElement(P.Box,{style:{width:72,height:20}}),T.default.createElement(P.Box,null,T.default.createElement(W,{polygonConfig:{strokeColor:t.background.strokeColor,fillColor:t.background.fillColor,strokeWidth:t.background.strokeWidth,cornerRadius:4},style:{visibility:t.visible?"visible":"hidden"}},T.default.createElement(N.a,{config:t.title,replacementArgs:[`${e.currentPage}`,`${e.totalNumPages}`],style:{fontSize:14,padding:"8px 12px"}}))),T.default.createElement(P.Box,null,T.default.createElement(P.IconButton,{onClick:e.onZoomButtonClick,"aria-label":_.b.getLocalizedText(e.config.zoomButton.accessibilityDescription),sx:Object.assign({backgroundColor:_.b.getColorValue(e.config.zoomButton.backgroundColor),color:_.b.getColorValue(e.config.zoomButton.foregroundColor),margin:"0 16px",visibility:e.config.zoomButton.visible?"visible":"hidden","&:hover":{backgroundColor:_.b.getColorValue(e.config.zoomButton.activeBackgroundColor),color:_.b.getColorValue(e.config.zoomButton.activeForegroundColor)}},z(e.config.zoomButton.foregroundColor))},T.default.createElement(L.a,null))))}function wl(){return T.default.createElement(T.default.Fragment,null,T.default.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("path",{d:"M5.6236 27.7347C2.97532 25.2802 1.23517 22.0019 0.686077 18.4331C0.136983 14.8642 0.811227 11.2145 2.59919 8.0774C4.38716 4.94028 7.1837 2.50018 10.5342 1.15382C13.8847 -0.192539 17.592 -0.365996 21.0536 0.661651L20.0518 4.03609C17.3518 3.23452 14.46 3.36982 11.8467 4.41998C9.23329 5.47014 7.05198 7.37342 5.65737 9.82037C4.26276 12.2673 3.73685 15.1141 4.16514 17.8978C4.59343 20.6815 5.95075 23.2385 8.01641 25.1531L5.6236 27.7347Z",fill:"black",fillOpacity:"0.15"},T.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 16.5 16",from:"360 16.5 16",dur:"2s",begin:"0s",repeatCount:"indefinite"})),T.default.createElement("path",{d:"M16.5 1.76C16.5 0.787979 17.2903 -0.0100083 18.2565 0.0967004C20.3808 0.331329 22.4428 0.989952 24.3179 2.04006C26.7065 3.37771 28.7119 5.30584 30.1422 7.64002C31.5726 9.9742 32.3802 12.6364 32.4877 15.3718C32.5951 18.1073 31.9989 20.8246 30.7561 23.2638C29.5133 25.7031 27.6654 27.7826 25.3891 29.3035C23.1129 30.8244 20.4845 31.7359 17.7553 31.9507C15.0262 32.1655 12.2876 31.6764 9.80145 30.5303C7.84973 29.6305 6.10487 28.3495 4.6664 26.7687C4.01218 26.0498 4.19322 24.9414 4.9796 24.3701C5.76598 23.7987 6.85859 23.9836 7.5348 24.6819C8.60362 25.7856 9.87071 26.6862 11.2751 27.3336C13.2143 28.2276 15.3504 28.6091 17.4792 28.4415C19.6079 28.274 21.6581 27.5631 23.4335 26.3767C25.209 25.1904 26.6503 23.5684 27.6198 21.6658C28.5892 19.7632 29.0542 17.6437 28.9704 15.51C28.8865 13.3764 28.2567 11.2999 27.1409 9.47922C26.0252 7.65856 24.4611 6.15461 22.598 5.11125C21.2487 4.35561 19.7753 3.85986 18.2542 3.6439C17.2918 3.50727 16.5 2.73202 16.5 1.76Z",fill:"black"},T.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",to:"0 16.5 16",from:"360 16.5 16",dur:"2s",begin:"0s",repeatCount:"indefinite"}))))}function El(e){return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Dialog,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},slotProps:{backdrop:{style:{backgroundColor:"transparent"}}},open:e.open,transitionDuration:100},T.default.createElement(P.Box,{"data-sb-loading-spinner":!0,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-busy":open?"true":"false",style:{backgroundColor:"#EFEFEF",border:"1px solid #CCC",borderRadius:"4px",height:65,width:65,display:"flex",alignItems:"center",justifyContent:"center"}},T.default.createElement(wl,null))))}function Dl(e){const t=e.config.visible&&e.active;return T.default.createElement(T.default.Fragment,null,T.default.createElement("div",{style:{width:"40px"}},T.default.createElement(P.Button,{[`data-sb-button-${e.debugName}`]:!0,sx:Object.assign({color:_.b.getColorValue(e.config.color),minWidth:"auto",visibility:t?"visible":"hidden",paddingX:"4px",marginX:"4px"},j(e.config.color)),onClick:e.onClick,"aria-label":_.b.getLocalizedText(e.config.accessibilityDescription)},T.default.createElement(e.icon,null))))}var xl=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function Bl(e){var t,n;const i=Nc(e.page.finalImageUrl()),[r,o]=T.default.useState(null),[a,s]=T.default.useState(!1);Object(T.useEffect)((()=>{(()=>{xl(this,void 0,void 0,(function*(){!e.animateRotation&&i.value&&(yield new Promise((e=>{const t=document.createElement("img");t.onload=e,t.src=i.value})),o(i.value),s(!1)),e.animateRotation&&s(!0)}))})()}),[i.value,e.animateRotation]);const c=T.default.useRef(null),u=(()=>{const e=c.current;if(a&&e){const t=e.parentElement;let n;if([e.clientHeight,e.clientWidth,t.clientHeight,e.clientHeight].some((e=>0===e)))n=1;else{const i=1/(e.clientWidth/e.clientHeight),r=t.clientWidth/t.clientHeight;n=t.clientHeight>e.naturalWidth&&t.clientWidth>e.naturalHeight?Math.max(e.naturalHeight/t.clientHeight,1):i<r?t.clientHeight/e.clientWidth:t.clientWidth/e.clientHeight}return{transform:`rotate(90deg) scale(${n})`,transition:"transform 0.5s"}}return{transform:"none",transition:"none"}})();return null===r&&null!==e.onAnimateRotationDone.current?(null===(n=(t=e.onAnimateRotationDone).current)||void 0===n||n.call(t),null):T.default.createElement(T.default.Fragment,null,r&&T.default.createElement("img",{"data-sb-carousel-page":!0,ref:c,onTransitionEnd:()=>{var t,n;return null===(n=(t=e.onAnimateRotationDone).current)||void 0===n?void 0:n.call(t)},style:Object.assign(Object.assign({},e.style),u),src:r,alt:`Page ${e.index}`}))}function Il(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function Tl(e,t){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&n.every((n=>{const i=e[n],r=t[n];return"function"==typeof i?`${i}`==`${r}`:Il(i)&&Il(r)?Tl(i,r):i===r}))}function Ol(e){return e.concat().sort(((e,t)=>e.name>t.name?1:-1)).map((e=>e.options))}function kl(e){return"number"==typeof e}function Pl(e){return"string"==typeof e}function Ll(e){return"boolean"==typeof e}function _l(e){return"[object Object]"===Object.prototype.toString.call(e)}function Rl(e){return Math.abs(e)}function Ml(e){return Math.sign(e)}function Fl(e,t){return Rl(e-t)}function Nl(e){return Hl(e).map(Number)}function Vl(e){return e[Wl(e)]}function Wl(e){return Math.max(0,e.length-1)}function jl(e,t){return t===Wl(e)}function zl(e,t=0){return Array.from(Array(e),((e,n)=>t+n))}function Hl(e){return Object.keys(e)}function Ul(e,t){return[e,t].reduce(((e,t)=>(Hl(t).forEach((n=>{const i=e[n],r=t[n],o=_l(i)&&_l(r);e[n]=o?Ul(i,r):r})),e)),{})}function Zl(e,t){return"undefined"!=typeof t.MouseEvent&&e instanceof t.MouseEvent}function Gl(){let e=[];const t={add:function(n,i,r,o={passive:!0}){let a;if("addEventListener"in n)n.addEventListener(i,r,o),a=()=>n.removeEventListener(i,r,o);else{const e=n;e.addListener(r),a=()=>e.removeListener(r)}return e.push(a),t},clear:function(){e=e.filter((e=>e()))}};return t}function Yl(e,t,n,i){const r=Gl(),o=1e3/60;let a=null,s=0,c=0;function u(e){if(!c)return;a||(a=e);const r=e-a;for(a=e,s+=r;s>=o;)n(o),s-=o;i(s/o),c&&t.requestAnimationFrame(u)}function l(){t.cancelAnimationFrame(c),a=null,s=0,c=0}return{init:function(){r.add(e,"visibilitychange",(()=>{e.hidden&&(a=null,s=0)}))},destroy:function(){l(),r.clear()},start:function(){c||(c=t.requestAnimationFrame(u))},stop:l,update:()=>n(o),render:i}}function Ql(e=0,t=0){const n=Rl(e-t);function i(t){return t<e}function r(e){return e>t}function o(e){return i(e)||r(e)}return{length:n,max:t,min:e,constrain:function(n){return o(n)?i(n)?e:t:n},reachedAny:o,reachedMax:r,reachedMin:i,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}}}function ql(e,t,n){const{constrain:i}=Ql(0,e),r=e+1;let o=a(t);function a(e){return n?Rl((r+e)%r):i(e)}function s(){return o}function c(){return ql(e,s(),n)}const u={get:s,set:function(e){return o=a(e),u},add:function(e){return c().set(s()+e)},clone:c};return u}function Xl(e,t,n,i,r,o,a,s,c,u,l,d,m,h,f,p,g,v,y){const{cross:C,direction:b}=e,A=["INPUT","SELECT","TEXTAREA"],S={passive:!1},w=Gl(),E=Gl(),D=Ql(50,225).constrain(h.measure(20)),x={mouse:300,touch:400},B={mouse:500,touch:600},I=f?43:25;let T=!1,O=0,k=0,P=!1,L=!1,_=!1,R=!1;function M(e){if(!Zl(e,i)&&e.touches.length>=2)return F(e);const t=o.readPoint(e),n=o.readPoint(e,C),a=Fl(t,O),c=Fl(n,k);if(!L&&!R){if(!e.cancelable)return F(e);if(L=a>c,!L)return F(e)}const l=o.pointerMove(e);a>p&&(_=!0),u.useFriction(.3).useDuration(.75),s.start(),r.add(b(l)),e.preventDefault()}function F(e){const t=l.byDistance(0,!1).index!==d.get(),n=o.pointerUp(e)*(f?B:x)[R?"mouse":"touch"],i=function(e,t){const n=d.add(-1*Ml(e)),i=l.byDistance(e,!f).distance;return f||Rl(e)<D?i:g&&t?.5*i:l.byIndex(n.get(),0).distance}(b(n),t),r=function(e,t){if(0===e||0===t)return 0;if(Rl(e)<=Rl(t))return 0;const n=Fl(Rl(e),Rl(t));return Rl(n/e)}(n,i),a=I-10*r,s=v+r/50;L=!1,P=!1,E.clear(),u.useDuration(a).useFriction(s),c.distance(i,!f),R=!1,m.emit("pointerUp")}function N(e){_&&(e.stopPropagation(),e.preventDefault(),_=!1)}return{init:function(e){if(!y)return;function s(s){(Ll(y)||y(e,s))&&function(e){const s=Zl(e,i);if(R=s,_=f&&s&&!e.buttons&&T,T=Fl(r.get(),a.get())>=2,s&&0!==e.button)return;if(function(e){const t=e.nodeName||"";return A.includes(t)}(e.target))return;P=!0,o.pointerDown(e),u.useFriction(0).useDuration(0),r.set(a),function(){const e=R?n:t;E.add(e,"touchmove",M,S).add(e,"touchend",F).add(e,"mousemove",M,S).add(e,"mouseup",F)}(),O=o.readPoint(e),k=o.readPoint(e,C),m.emit("pointerDown")}(s)}const c=t;w.add(c,"dragstart",(e=>e.preventDefault()),S).add(c,"touchmove",(()=>{}),S).add(c,"touchend",(()=>{})).add(c,"touchstart",s).add(c,"mousedown",s).add(c,"touchcancel",F).add(c,"contextmenu",F).add(c,"click",N,!0)},destroy:function(){w.clear(),E.clear()},pointerDown:function(){return P}}}function Kl(e,t){let n,i;function r(e){return e.timeStamp}function o(n,i){const r="client"+("x"===(i||e.scroll)?"X":"Y");return(Zl(n,t)?n:n.touches[0])[r]}return{pointerDown:function(e){return n=e,i=e,o(e)},pointerMove:function(e){const t=o(e)-o(i),a=r(e)-r(n)>170;return i=e,a&&(n=e),t},pointerUp:function(e){if(!n||!i)return 0;const t=o(i)-o(n),a=r(e)-r(n),s=r(e)-r(i)>170,c=t/a;return a&&!s&&Rl(c)>.1?c:0},readPoint:o}}function Jl(e,t,n,i,r,o,a){const s=[e].concat(i);let c,u,l=[],d=!1;function m(e){return r.measureSize(a.measure(e))}return{init:function(r){o&&(u=m(e),l=i.map(m),c=new ResizeObserver((n=>{(Ll(o)||o(r,n))&&function(n){for(const o of n){if(d)return;const n=o.target===e,a=i.indexOf(o.target),s=n?u:l[a];if(Rl(m(n?e:i[a])-s)>=.5){r.reInit(),t.emit("resize");break}}}(n)})),n.requestAnimationFrame((()=>{s.forEach((e=>c.observe(e)))})))},destroy:function(){d=!0,c&&c.disconnect()}}}function $l(e,t,n,i,r){const o=r.measure(10),a=r.measure(50),s=Ql(.1,.99);let c=!1;function u(){return!c&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:u,constrain:function(r){if(!u())return;const c=e.reachedMin(t.get())?"min":"max",l=Rl(e[c]-t.get()),d=n.get()-t.get(),m=s.constrain(l/a);n.subtract(d*m),!r&&Rl(d)<o&&(n.set(e.constrain(n.get())),i.useDuration(25).useBaseFriction())},toggleActive:function(e){c=!e}}}function ed(e,t,n,i){const r=t.min+.1,o=t.max+.1,{reachedMin:a,reachedMax:s}=Ql(r,o);return{loop:function(t){if(!function(e){return 1===e?s(n.get()):-1===e&&a(n.get())}(t))return;const r=e*(-1*t);i.forEach((e=>e.add(r)))}}}function td(e,t,n,i,r){const{reachedAny:o,removeOffset:a,constrain:s}=i;function c(e){return e.concat().sort(((e,t)=>Rl(e)-Rl(t)))[0]}function u(t,i){const r=[t,t+n,t-n];if(!e)return t;if(!i)return c(r);const o=r.filter((e=>Ml(e)===i));return o.length?c(o):Vl(r)-n}const l={byDistance:function(n,i){const c=r.get()+n,{index:l,distance:d}=function(n){const i=e?a(n):s(n),r=t.map(((e,t)=>({diff:u(e-i,0),index:t}))).sort(((e,t)=>Rl(e.diff)-Rl(t.diff))),{index:o}=r[0];return{index:o,distance:i}}(c),m=!e&&o(c);return!i||m?{index:l,distance:n}:{index:l,distance:n+u(t[l]-d,0)}},byIndex:function(e,n){return{index:e,distance:u(t[e]-r.get(),n)}},shortcut:u};return l}function nd(e,t,n,i,r,o,a,s){const c={passive:!0,capture:!0};let u=0;function l(e){"Tab"===e.code&&(u=(new Date).getTime())}return{init:function(d){s&&(o.add(document,"keydown",l,!1),t.forEach(((t,l)=>{o.add(t,"focus",(t=>{(Ll(s)||s(d,t))&&function(t){if((new Date).getTime()-u>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const o=n.findIndex((e=>e.includes(t)));kl(o)&&(r.useDuration(0),i.index(o,0),a.emit("slideFocus"))}(l)}),c)})))}}}function id(e){let t=e;function n(e){return kl(e)?e:e.get()}return{get:function(){return t},set:function(e){t=n(e)},add:function(e){t+=n(e)},subtract:function(e){t-=n(e)}}}function rd(e,t){const n="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},i=t.style;let r=!1;return{clear:function(){r||(i.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){r||(i.transform=n(e.direction(t)))},toggleActive:function(e){r=!e}}}function od(e,t,n,i,r,o,a,s,c){const u=Nl(r),l=Nl(r).reverse(),d=function(){const e=a[0];return f(h(l,e),n,!1)}().concat(function(){const e=t-a[0]-1;return f(h(u,e),-n,!0)}());function m(e,t){return e.reduce(((e,t)=>e-r[t]),t)}function h(e,t){return e.reduce(((e,n)=>m(e,t)>0?e.concat([n]):e),[])}function f(r,a,u){const l=function(e){return o.map(((n,r)=>({start:n-i[r]+.5+e,end:n+t-.5+e})))}(a);return r.map((t=>{const i=u?0:-n,r=u?n:0,o=u?"end":"start",a=l[t][o];return{index:t,loopPoint:a,slideLocation:id(-1),translate:rd(e,c[t]),target:()=>s.get()>a?i:r}}))}return{canLoop:function(){return d.every((({index:e})=>m(u.filter((t=>t!==e)),t)<=.1))},clear:function(){d.forEach((e=>e.translate.clear()))},loop:function(){d.forEach((e=>{const{target:t,translate:n,slideLocation:i}=e,r=t();r!==i.get()&&(n.to(r),i.set(r))}))},loopPoints:d}}function ad(e,t,n){let i,r=!1;return{init:function(o){n&&(i=new MutationObserver((e=>{r||(Ll(n)||n(o,e))&&function(e){for(const n of e)if("childList"===n.type){o.reInit(),t.emit("slidesChanged");break}}(e)})),i.observe(e,{childList:!0}))},destroy:function(){i&&i.disconnect(),r=!0}}}function sd(e,t,n,i){const r={};let o,a=null,s=null,c=!1;return{init:function(){o=new IntersectionObserver((e=>{c||(e.forEach((e=>{const n=t.indexOf(e.target);r[n]=e})),a=null,s=null,n.emit("slidesInView"))}),{root:e.parentElement,threshold:i}),t.forEach((e=>o.observe(e)))},destroy:function(){o&&o.disconnect(),c=!0},get:function(e=!0){if(e&&a)return a;if(!e&&s)return s;const t=function(e){return Hl(r).reduce(((t,n)=>{const i=parseInt(n),{isIntersecting:o}=r[i];return(e&&o||!e&&!o)&&t.push(i),t}),[])}(e);return e&&(a=t),e||(s=t),t}}}function cd(e,t,n,i,r,o,a,s,c){const{startEdge:u,endEdge:l,direction:d}=e,m=kl(n);return{groupSlides:function(e){return m?function(e,t){return Nl(e).filter((e=>e%t==0)).map((n=>e.slice(n,n+t)))}(e,n):function(e){return e.length?Nl(e).reduce(((n,m,h)=>{const f=Vl(n)||0,p=0===f,g=m===Wl(e),v=r[u]-o[f][u],y=r[u]-o[m][l],C=!i&&p?d(a):0,b=Rl(y-(!i&&g?d(s):0)-(v+C));return h&&b>t+c&&n.push(m),g&&n.push(e.length),n}),[]).map(((t,n,i)=>{const r=Math.max(i[n-1]||0);return e.slice(r,t)})):[]}(e)}}}function ud(e,t,n,i,r,o,a){const{align:s,axis:c,direction:u,startIndex:l,loop:d,duration:m,dragFree:h,dragThreshold:f,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:y,watchResize:C,watchSlides:b,watchDrag:A,watchFocus:S}=o,w={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:i,offsetHeight:r}=e;return{top:t,right:n+i,bottom:t+r,left:n,width:i,height:r}}},E=w.measure(t),D=n.map(w.measure),x=function(e,t){const n="rtl"===t,i="y"===e,r=!i&&n?-1:1;return{scroll:i?"y":"x",cross:i?"x":"y",startEdge:i?"top":n?"right":"left",endEdge:i?"bottom":n?"left":"right",measureSize:function(e){const{height:t,width:n}=e;return i?t:n},direction:function(e){return e*r}}}(c,u),B=x.measureSize(E),I=function(e){return{measure:function(t){return e*(t/100)}}}(B),T=function(e,t){const n={start:function(){return 0},center:function(e){return i(e)/2},end:i};function i(e){return t-e}return{measure:function(i,r){return Pl(e)?n[e](i):e(t,i,r)}}}(s,B),O=!d&&!!y,k=d||!!y,{slideSizes:P,slideSizesWithGaps:L,startGap:_,endGap:R}=function(e,t,n,i,r,o){const{measureSize:a,startEdge:s,endEdge:c}=e,u=n[0]&&r,l=function(){if(!u)return 0;const e=n[0];return Rl(t[s]-e[s])}(),d=function(){if(!u)return 0;const e=o.getComputedStyle(Vl(i));return parseFloat(e.getPropertyValue(`margin-${c}`))}(),m=n.map(a),h=n.map(((e,t,n)=>{const i=!t,r=jl(n,t);return i?m[t]+l:r?m[t]+d:n[t+1][s]-e[s]})).map(Rl);return{slideSizes:m,slideSizesWithGaps:h,startGap:l,endGap:d}}(x,E,D,n,k,r),M=cd(x,B,g,d,E,D,_,R,2),{snaps:F,snapsAligned:N}=function(e,t,n,i,r){const{startEdge:o,endEdge:a}=e,{groupSlides:s}=r,c=s(i).map((e=>Vl(e)[a]-e[0][o])).map(Rl).map(t.measure),u=i.map((e=>n[o]-e[o])).map((e=>-Rl(e))),l=s(u).map((e=>e[0])).map(((e,t)=>e+c[t]));return{snaps:u,snapsAligned:l}}(x,T,E,D,M),V=-Vl(F)+Vl(L),{snapsContained:W,scrollContainLimit:j}=function(e,t,n,i,r){const o=Ql(-t+e,0),a=n.map(((e,t)=>{const{min:i,max:r}=o,a=o.constrain(e),s=!t,u=jl(n,t);return s?r:u||c(i,a)?i:c(r,a)?r:a})).map((e=>parseFloat(e.toFixed(3)))),s=function(){const e=a[0],t=Vl(a);return Ql(a.lastIndexOf(e),a.indexOf(t)+1)}();function c(e,t){return Fl(e,t)<1}return{snapsContained:function(){if(t<=e+r)return[o.max];if("keepSnaps"===i)return a;const{min:n,max:c}=s;return a.slice(n,c)}(),scrollContainLimit:s}}(B,V,N,y,2),z=O?W:N,{limit:H}=function(e,t,n){const i=t[0];return{limit:Ql(n?i-e:Vl(t),i)}}(V,z,d),U=ql(Wl(z),l,d),Z=U.clone(),G=Nl(n),Y=Yl(i,r,(e=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:i}},r)=>{i||n.constrain(e.pointerDown()),t.seek(r)})(se,e)),(e=>(({scrollBody:e,translate:t,location:n,offsetLocation:i,scrollLooper:r,slideLooper:o,dragHandler:a,animation:s,eventHandler:c,scrollBounds:u,options:{loop:l}},d)=>{const m=e.settled(),h=!u.shouldConstrain(),f=l?m:m&&h;f&&!a.pointerDown()&&(s.stop(),c.emit("settle")),f||c.emit("scroll");const p=n.get()*d+X.get()*(1-d);i.set(p),l&&(r.loop(e.direction()),o.loop()),t.to(i.get())})(se,e))),Q=z[U.get()],q=id(Q),X=id(Q),K=id(Q),J=id(Q),$=function(e,t,n,i,r,o){let a=0,s=0,c=r,u=o,l=e.get(),d=0;function m(e){return c=e,f}function h(e){return u=e,f}const f={direction:function(){return s},duration:function(){return c},velocity:function(){return a},seek:function(t){const r=t/1e3,o=c*r,m=i.get()-e.get();let h=0;return c?(n.set(e),a+=m/o,a*=u,l+=a,e.add(a*r),h=l-d):(a=0,n.set(i),e.set(i),h=m),s=Ml(h),d=l,f},settled:function(){return Rl(i.get()-t.get())<.001},useBaseFriction:function(){return h(o)},useBaseDuration:function(){return m(r)},useFriction:h,useDuration:m};return f}(q,K,X,J,m,.68),ee=td(d,z,V,H,J),te=function(e,t,n,i,r,o,a){function s(r){const s=r.distance,c=r.index!==t.get();o.add(s),s&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),c&&(n.set(t.get()),t.set(r.index),a.emit("select"))}return{distance:function(e,t){s(r.byDistance(e,t))},index:function(e,n){const i=t.clone().set(e);s(r.byIndex(i.get(),n))}}}(Y,U,Z,$,ee,J,a),ne=function(e){const{max:t,length:n}=e;return{get:function(e){return n?(e-t)/-n:0}}}(H),ie=Gl(),re=sd(t,n,a,p),{slideRegistry:oe}=function(e,t,n,i,r,o){const{groupSlides:a}=r,{min:s,max:c}=i;return{slideRegistry:function(){const i=a(o),r=!e||"keepSnaps"===t;return 1===n.length?[o]:r?i:i.slice(s,c).map(((e,t,n)=>{const i=!t,r=jl(n,t);return i?zl(Vl(n[0])+1):r?zl(Wl(o)-Vl(n)[0]+1,Vl(n)[0]):e}))}()}}(O,y,z,j,M,G),ae=nd(e,n,oe,te,$,ie,a,S),se={ownerDocument:i,ownerWindow:r,eventHandler:a,containerRect:E,slideRects:D,animation:Y,axis:x,dragHandler:Xl(x,e,i,r,J,Kl(x,r),q,Y,te,$,ee,U,a,I,h,f,v,.68,A),eventStore:ie,percentOfView:I,index:U,indexPrevious:Z,limit:H,location:q,offsetLocation:K,previousLocation:X,options:o,resizeHandler:Jl(t,a,r,n,x,C,w),scrollBody:$,scrollBounds:$l(H,K,J,$,I),scrollLooper:ed(V,H,K,[q,K,X,J]),scrollProgress:ne,scrollSnapList:z.map(ne.get),scrollSnaps:z,scrollTarget:ee,scrollTo:te,slideLooper:od(x,B,V,P,L,F,z,K,n),slideFocus:ae,slidesHandler:ad(t,a,b),slidesInView:re,slideIndexes:G,slideRegistry:oe,slidesToScroll:M,target:J,translate:rd(x,t)};return se}const ld={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function dd(e){function t(e,t){return Ul(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const i=n.breakpoints||{},r=Hl(i).filter((t=>e.matchMedia(t).matches)).map((e=>i[e])).reduce(((e,n)=>t(e,n)),{});return t(n,r)},optionsMediaQueries:function(t){return t.map((e=>Hl(e.breakpoints||{}))).reduce(((e,t)=>e.concat(t)),[]).map(e.matchMedia)}};return n}function md(e,t,n){const i=e.ownerDocument,r=i.defaultView,o=dd(r),a=function(e){let t=[];return{init:function(n,i){return t=i.filter((({options:t})=>!1!==e.optionsAtMedia(t).active)),t.forEach((t=>t.init(n,e))),i.reduce(((e,t)=>Object.assign(e,{[t.name]:t})),{})},destroy:function(){t=t.filter((e=>e.destroy()))}}}(o),s=Gl(),c=function(){let e,t={};function n(e){return t[e]||[]}const i={init:function(t){e=t},emit:function(t){return n(t).forEach((n=>n(e,t))),i},off:function(e,r){return t[e]=n(e).filter((e=>e!==r)),i},on:function(e,r){return t[e]=n(e).concat([r]),i},clear:function(){t={}}};return i}(),{mergeOptions:u,optionsAtMedia:l,optionsMediaQueries:d}=o,{on:m,off:h,emit:f}=c,p=x;let g,v,y,C,b=!1,A=u(ld,md.globalOptions),S=u(A),w=[];function E(t){const n=ud(e,y,C,i,r,t,c);if(t.loop&&!n.slideLooper.canLoop()){return E(Object.assign({},t,{loop:!1}))}return n}function D(t,n){b||(A=u(A,t),S=l(A),w=n||w,function(){const{container:t,slides:n}=S,i=Pl(t)?e.querySelector(t):t;y=i||e.children[0];const r=Pl(n)?y.querySelectorAll(n):n;C=[].slice.call(r||y.children)}(),g=E(S),d([A,...w.map((({options:e})=>e))]).forEach((e=>s.add(e,"change",x))),S.active&&(g.translate.to(g.location.get()),g.animation.init(),g.slidesInView.init(),g.slideFocus.init(O),g.eventHandler.init(O),g.resizeHandler.init(O),g.slidesHandler.init(O),g.options.loop&&g.slideLooper.loop(),y.offsetParent&&C.length&&g.dragHandler.init(O),v=a.init(O,w)))}function x(e,t){const n=T();B(),D(u({startIndex:n},e),t),c.emit("reInit")}function B(){g.dragHandler.destroy(),g.eventStore.clear(),g.translate.clear(),g.slideLooper.clear(),g.resizeHandler.destroy(),g.slidesHandler.destroy(),g.slidesInView.destroy(),g.animation.destroy(),a.destroy(),s.clear()}function I(e,t,n){S.active&&!b&&(g.scrollBody.useBaseFriction().useDuration(!0===t?0:S.duration),g.scrollTo.index(e,n||0))}function T(){return g.index.get()}const O={canScrollNext:function(){return g.index.add(1).get()!==T()},canScrollPrev:function(){return g.index.add(-1).get()!==T()},containerNode:function(){return y},internalEngine:function(){return g},destroy:function(){b||(b=!0,s.clear(),B(),c.emit("destroy"),c.clear())},off:h,on:m,emit:f,plugins:function(){return v},previousScrollSnap:function(){return g.indexPrevious.get()},reInit:p,rootNode:function(){return e},scrollNext:function(e){I(g.index.add(1).get(),e,-1)},scrollPrev:function(e){I(g.index.add(-1).get(),e,1)},scrollProgress:function(){return g.scrollProgress.get(g.location.get())},scrollSnapList:function(){return g.scrollSnapList},scrollTo:I,selectedScrollSnap:T,slideNodes:function(){return C},slidesInView:function(){return g.slidesInView.get()},slidesNotInView:function(){return g.slidesInView.get(!1)}};return D(t,n),setTimeout((()=>c.emit("init")),0),O}function hd(e={},t=[]){const n=Object(T.useRef)(e),i=Object(T.useRef)(t),[r,o]=Object(T.useState)(),[a,s]=Object(T.useState)(),c=Object(T.useCallback)((()=>{r&&r.reInit(n.current,i.current)}),[r]);return Object(T.useEffect)((()=>{Tl(n.current,e)||(n.current=e,c())}),[e,c]),Object(T.useEffect)((()=>{(function(e,t){if(e.length!==t.length)return!1;const n=Ol(e),i=Ol(t);return n.every(((e,t)=>Tl(e,i[t])))})(i.current,t)||(i.current=t,c())}),[t,c]),Object(T.useEffect)((()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){md.globalOptions=hd.globalOptions;const e=md(a,n.current,i.current);return o(e),()=>e.destroy()}o(void 0)}),[a,o]),[s,r]}md.globalOptions=void 0,hd.globalOptions=void 0;function fd(e){var t,n,i;const r=Object(T.useMemo)((()=>{var t;return null!==(t=e.currentPosition)&&void 0!==t?t:0}),[]),o={duration:20,startIndex:r},[a,s]=hd(o);Object(T.useEffect)((()=>{s&&s.on("select",(()=>{e.onGoToPage(null==s?void 0:s.selectedScrollSnap())}))}),[s]),Object(T.useEffect)((()=>{s&&(e.buttonsEnabled?s.reInit({watchDrag:!0}):s.reInit({watchDrag:!1}))}),[e.buttonsEnabled]);const c=bl();return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{sx:{flexGrow:1,backgroundColor:_.b.getColorValue(e.configuration.screens.review.backgroundColor),width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"32px"}},T.default.createElement(Dl,{config:e.configuration.screens.review.switchPreviousPageButton,icon:L.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition-1),active:e.currentPosition>0,debugName:"carousel-back"}),T.default.createElement("div",{className:"embla",ref:a,style:{overflow:"hidden",width:"100%",height:"100%"}},T.default.createElement("div",{className:"embla__container",style:{display:"flex",height:"100%"}},null===(t=e.document)||void 0===t?void 0:t.pages.map(((t,n)=>T.default.createElement("div",{className:"embla__slide",key:t.id,style:{position:"relative",minWidth:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0"}},T.default.createElement(Bl,{page:t,animateRotation:t.id===e.currentlyRotatingPageId,onAnimateRotationDone:e.onRotationAnimationDone,index:n+1,style:{maxHeight:`calc(100 * ${R} - ${50+c+72+32}px)`,maxWidth:"100%"}})))))),T.default.createElement(Dl,{config:e.configuration.screens.review.switchNextPageButton,icon:L.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition+1),active:e.currentPosition<(null===(i=null===(n=e.document)||void 0===n?void 0:n.pages)||void 0===i?void 0:i.length)-1,debugName:"carousel-forward"})))}var pd=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function gd(e){var t,n,i,r,o,a;const s=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),[c,u]=T.default.useState(!1);Object(T.useEffect)((()=>{e.visible&&!e.configuration.screens.review.enabled&&e.onSubmit()}),[e.visible]),Object(T.useEffect)((()=>{var t,n;0===(null===(n=null===(t=e.document)||void 0===t?void 0:t.pages)||void 0===n?void 0:n.length)&&e.visible&&!c&&e.onClose()}),[null===(n=e.document)||void 0===n?void 0:n.pages,e.visible,c]);const[l,d]=Object(T.useState)(!0),[m,h]=Object(T.useState)(null),f=Object(T.useRef)(null),[p,g]=Object(T.useState)(!1),[v,y]=Object(T.useState)(!1);return Object(T.useEffect)((()=>{d(!p&&!v)}),[p,v]),e.visible?T.default.createElement(T.default.Fragment,null,T.default.createElement(El,{open:c}),T.default.createElement(pu,{open:p,config:e.configuration.screens.review.deletePageAlertDialog,onCancelClick:()=>g(!1),onActionClick:()=>{g(!1),e.onRetakeImage(e.currentPosition)},onOkClick:()=>pd(this,void 0,void 0,(function*(){var t,n,i;u(!0),(null===(n=null===(t=e.document)||void 0===t?void 0:t.pages)||void 0===n?void 0:n.length)>1&&e.onGoToPage(Math.max(e.currentPosition-1,0)),yield null===(i=e.document)||void 0===i?void 0:i.deletePage(s),u(!1),g(!1)}))}),T.default.createElement(pu,{open:v,config:e.configuration.screens.review.deleteAllPagesAlertDialog,onCancelClick:()=>y(!1),onOkClick:()=>pd(this,void 0,void 0,(function*(){var t;u(!0),yield null===(t=e.document)||void 0===t?void 0:t.deleteAllPages(),u(!1),y(!1)}))}),T.default.createElement(P.Box,{"data-sb-screen-review":!0,display:e.visible?"flex":"none",style:{position:"absolute",width:"100vw",height:`calc(100 * ${R})`,flexDirection:"column",alignItems:"center",justifyContent:"center"}},T.default.createElement(vl,{config:e.configuration,numPages:null===(r=null===(i=e.document)||void 0===i?void 0:i.pages)||void 0===r?void 0:r.length,onCloseButtonClick:e.onClose,onDeleteButtonClick:()=>y(!0),buttonsEnabled:l}),T.default.createElement(fd,{buttonsEnabled:l,document:e.document,currentPosition:e.currentPosition,onGoToPage:e.onGoToPage,configuration:e.configuration,onRotationAnimationDone:f,currentlyRotatingPageId:m}),T.default.createElement(Sl,{config:e.configuration.screens.review,currentPage:e.currentPosition+1,totalNumPages:null===(a=null===(o=e.document)||void 0===o?void 0:o.pages)||void 0===a?void 0:a.length,onZoomButtonClick:()=>e.onZoomButtonClick(e.currentPosition)}),T.default.createElement(Al,{config:e.configuration,onSubmitClick:e.onSubmit,onAddPageClick:()=>{e.onInsertImage(e.currentPosition+1)},onRetakeClick:()=>e.onRetakeImage(e.currentPosition),onCropClick:()=>e.onCropButtonClick(e.currentPosition),onRotateClick:()=>pd(this,void 0,void 0,(function*(){var t,n;if(null!==f.current)return;d(!1),u(!0);const i=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),r=new Promise((e=>{f.current=e,h(i.id)})),o=null===(n=e.document)||void 0===n?void 0:n.cropAndRotatePage(i,null,1);yield Promise.all([r,o]),yield i.finalImageUrl(),f.current=null,h(null),d(!0),u(!1)})),onDeleteClick:()=>g(!0),buttonsEnabled:l}))):null}var vd=function(e,t){return Number(e.toFixed(t))},yd=function(e,t,n){n&&"function"==typeof n&&n(e,t)},Cd={easeOut:function(e){return-Math.cos(e*Math.PI)/2+.5},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},bd=function(e){"number"==typeof e&&cancelAnimationFrame(e)},Ad=function(e){e.mounted&&(bd(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function Sd(e,t,n,i){if(e.mounted){var r=(new Date).getTime();Ad(e),e.animation=function(){if(!e.mounted)return bd(e.animation);var o=(new Date).getTime()-r,a=(0,Cd[t])(o/n);o>=n?(i(1),e.animation=null):e.animation&&(i(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function wd(e,t,n,i){var r=function(e){var t=e.scale,n=e.positionX,i=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(i))}(t);if(e.mounted&&r){var o=e.setTransformState,a=e.transformState,s=a.scale,c=a.positionX,u=a.positionY,l=t.scale-s,d=t.positionX-c,m=t.positionY-u;0===n?o(t.scale,t.positionX,t.positionY):Sd(e,i,n,(function(e){o(s+l*e,c+d*e,u+m*e)}))}}var Ed=function(e,t){var n=e.wrapperComponent,i=e.contentComponent,r=e.setup.centerZoomedOut;if(!n||!i)throw new Error("Components are not mounted");var o=function(e,t,n){var i=e.offsetWidth,r=e.offsetHeight,o=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:i,wrapperHeight:r,newContentWidth:o,newDiffWidth:i-o,newContentHeight:a,newDiffHeight:r-a}}(n,i,t),a=o.wrapperWidth,s=o.wrapperHeight,c=function(e,t,n,i,r,o,a){var s=e>t?n*(a?1:.5):0,c=i>r?o*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:i-r-c,maxPositionY:c}}(a,o.newContentWidth,o.newDiffWidth,s,o.newContentHeight,o.newDiffHeight,Boolean(r));return c},Dd=function(e,t,n,i){return vd(i?e<t?t:e>n?n:e:e,2)},xd=function(e,t){var n=Ed(e,t);return e.bounds=n,n};function Bd(e,t,n,i,r,o,a){var s=n.minPositionX,c=n.minPositionY,u=n.maxPositionX,l=n.maxPositionY,d=0,m=0;return a&&(d=r,m=o),{x:Dd(e,s-d,u+d,i),y:Dd(t,c-m,l+m,i)}}function Id(e,t,n,i,r,o){var a=e.transformState,s=a.scale,c=a.positionX,u=a.positionY,l=i-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:c,y:u}):Bd(c-t*l,u-n*l,r,o,0,0,null)}function Td(e,t,n,i,r){var o=t-(r?i:0);return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=o?o:e}var Od=function(e,t){var n=e.setup.panning.excluded,i=e.isInitialized,r=e.wrapperComponent,o=t.target,a="shadowRoot"in o&&"composedPath"in t?t.composedPath().some((function(e){return e instanceof Element&&(null==r?void 0:r.contains(e))})):null==r?void 0:r.contains(o);return!!(i&&o&&a)&&!um(o,n)},kd=function(e){var t=e.isInitialized,n=e.isPanning,i=e.setup.panning.disabled;return!(!t||!n||i)};function Pd(e,t,n,i,r){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,c=e.transformState,u=c.scale,l=c.positionX,d=c.positionY;if(null!==a&&null!==s&&(t!==l||n!==d)){var m=Bd(t,n,s,o,i,r,a),h=m.x,f=m.y;e.setTransformState(u,h,f)}}var Ld=function(e,t){var n=e.setup,i=e.transformState.scale,r=n.minScale,o=n.disablePadding;return t>0&&i>=r&&!o?t:0};function _d(e,t,n,i,r,o,a,s,c,u){if(r){var l;if(t>a&&n>a)return(l=a+(e-a)*u)>c?c:l<a?a:l;if(t<o&&n<o)return(l=o+(e-o)*u)<s?s:l>o?o:l}return i?t:Dd(e,o,a,r)}function Rd(e,t){var n=function(e){var t=e.mounted,n=e.setup,i=n.disabled,r=n.velocityAnimation,o=e.transformState.scale;return!(r.disabled&&!(o>1)&&i&&!t)}(e);if(n){var i=e.lastMousePosition,r=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,c=Date.now();if(i&&r&&a){var u=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),l=t.x-i.x,d=t.y-i.y,m=l/u,h=d/u,f=c-r,p=l*l+d*d,g=Math.sqrt(p)/f;e.velocity={velocityX:m,velocityY:h,total:g}}e.lastMousePosition=t,e.velocityTime=c}}function Md(e,t){var n=e.transformState.scale;Ad(e),xd(e,n),void 0!==window.TouchEvent&&t instanceof TouchEvent?function(e,t){var n=t.touches,i=e.transformState,r=i.positionX,o=i.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-r,y:s-o}}}(e,t):function(e,t){var n=e.transformState,i=n.positionX,r=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-i,y:a-r}}(e,t)}function Fd(e){var t=e.transformState.scale,n=e.setup,i=n.minScale,r=n.alignmentAnimation,o=r.disabled,a=r.sizeX,s=r.sizeY,c=r.animationTime,u=r.animationType;if(!(o||t<i||!a&&!s)){var l=function(e){var t=e.transformState,n=t.positionX,i=t.positionY,r=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,c=o.centerZoomedOut,u=e.wrapperComponent;if(!a&&u&&e.bounds){var l=e.bounds,d=l.maxPositionX,m=l.minPositionX,h=l.maxPositionY,f=l.minPositionY,p=n>d||n<m,g=i>h||i<f,v=Id(e,n>d?u.offsetWidth:e.setup.minPositionX||0,i>h?u.offsetHeight:e.setup.minPositionY||0,r,e.bounds,s||c),y=v.x,C=v.y;return{scale:r,positionX:p?y:n,positionY:g?C:i}}}(e);l&&wd(e,l,c,u)}}function Nd(e,t,n){var i=e.startCoords,r=e.setup.alignmentAnimation,o=r.sizeX,a=r.sizeY;if(i){var s=function(e,t,n){var i=e.startCoords,r=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,c=r.positionX,u=r.positionY;if(!i)return{x:c,y:u};var l=t-i.x,d=n-i.y;return{x:a?c:l,y:s?u:d}}(e,t,n),c=s.x,u=s.y,l=Ld(e,o),d=Ld(e,a);Rd(e,{x:c,y:u}),Pd(e,c,u,l,d)}}function Vd(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,i=e.wrapperComponent,r=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=null==i?void 0:i.getBoundingClientRect(),a=null==r?void 0:r.getBoundingClientRect(),s=(null==o?void 0:o.width)||0,c=(null==o?void 0:o.height)||0,u=(null==a?void 0:a.width)||0,l=(null==a?void 0:a.height)||0,d=s<u||c<l;!t&&n&&(null==n?void 0:n.total)>.1&&d?function(e){var t=e.velocity,n=e.bounds,i=e.setup,r=e.wrapperComponent,o=function(e){var t=e.mounted,n=e.velocity,i=e.bounds,r=e.setup,o=r.disabled,a=r.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&o&&!t||!n||!i)}(e);if(o&&t&&n&&r){var a=t.velocityX,s=t.velocityY,c=t.total,u=n.maxPositionX,l=n.minPositionX,d=n.maxPositionY,m=n.minPositionY,h=i.limitToBounds,f=i.alignmentAnimation,p=i.zoomAnimation,g=i.panning,v=g.lockAxisY,y=g.lockAxisX,C=p.animationType,b=f.sizeX,A=f.sizeY,S=f.velocityAlignmentTime,w=function(e,t){var n=e.setup.velocityAnimation,i=n.equalToMove,r=n.animationTime,o=n.sensitivity;return i?r*t*o:r}(e,c),E=Math.max(w,S),D=Ld(e,b),x=Ld(e,A),B=D*r.offsetWidth/100,I=x*r.offsetHeight/100,T=u+B,O=l-B,k=d+I,P=m-I,L=e.transformState,_=(new Date).getTime();Sd(e,C,E,(function(t){var n=e.transformState,i=n.scale,r=n.positionX,o=n.positionY,c=((new Date).getTime()-_)/S,p=1-(0,Cd[f.animationType])(Math.min(1,c)),g=1-t,C=r+a*g,b=o+s*g,A=_d(C,L.positionX,r,y,h,l,u,O,T,p),w=_d(b,L.positionY,o,v,h,m,d,P,k,p);r===C&&o===b||e.setTransformState(i,A,w)}))}}(e):Fd(e)}}function Wd(e,t,n,i){var r=e.setup,o=r.minScale,a=r.maxScale,s=r.limitToBounds,c=Td(vd(t,2),o,a,0,!1),u=Id(e,n,i,c,xd(e,c),s);return{scale:c,positionX:u.x,positionY:u.y}}function jd(e,t,n){var i=e.transformState.scale,r=e.wrapperComponent,o=e.setup,a=o.minScale,s=o.limitToBounds,c=o.zoomAnimation,u=c.disabled,l=c.animationTime,d=c.animationType,m=u||i>=a;if((i>=1||s)&&Fd(e),!m&&r&&e.mounted){var h=Wd(e,a,t||r.offsetWidth/2,n||r.offsetHeight/2);h&&wd(e,h,l,d)}}var zd=function(){return zd=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},zd.apply(this,arguments)};function Hd(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ud=1,Zd=0,Gd=0,Yd={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!1,smooth:!0,wheel:{step:.2,disabled:!1,smoothStep:.001,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,wheelPanning:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},Qd=function(e){var t,n,i,r;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:Ud,scale:null!==(n=e.initialScale)&&void 0!==n?n:Ud,positionX:null!==(i=e.initialPositionX)&&void 0!==i?i:Zd,positionY:null!==(r=e.initialPositionY)&&void 0!==r?r:Gd}},qd=function(e){var t=zd({},Yd);return Object.keys(e).forEach((function(n){var i="undefined"!=typeof e[n];if("undefined"!=typeof Yd[n]&&i){var r=Object.prototype.toString.call(Yd[n]),o="[object Object]"===r,a="[object Array]"===r;t[n]=o?zd(zd({},Yd[n]),e[n]):a?Hd(Hd([],Yd[n],!0),e[n],!0):e[n]}})),t},Xd=function(e,t,n){var i=e.transformState.scale,r=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,c=o.zoomAnimation,u=o.smooth,l=c.size;if(!r)throw new Error("Wrapper is not mounted");var d=u?i*Math.exp(t*n):i+t*n;return Td(vd(d,3),s,a,l,!1)};function Kd(e,t,n,i,r){var o=e.wrapperComponent,a=e.transformState,s=a.scale,c=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var l=(o.offsetWidth/2-c)/s,d=(o.offsetHeight/2-u)/s,m=Wd(e,Xd(e,t,n),l,d);if(!m)return console.error("Error during zoom event. New transformation state was not calculated.");wd(e,m,i,r)}function Jd(e,t,n,i){var r=e.setup,o=e.wrapperComponent,a=r.limitToBounds,s=Qd(e.props),c=e.transformState,u=c.scale,l=c.positionX,d=c.positionY;if(o){var m=Ed(e,s.scale),h=Bd(s.positionX,s.positionY,m,a,0,0,o),f={scale:s.scale,positionX:h.x,positionY:h.y};u===s.scale&&l===s.positionX&&d===s.positionY||(null==i||i(),wd(e,f,t,n))}}var $d=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Kd(e,1,t,n,i)}},em=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Kd(e,-1,t,n,i)}},tm=function(e){return function(t,n,i,r,o){void 0===r&&(r=300),void 0===o&&(o="easeOut");var a=e.transformState,s=a.positionX,c=a.positionY,u=a.scale,l=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&l&&d){var m={positionX:Number.isNaN(t)?s:t,positionY:Number.isNaN(n)?c:n,scale:Number.isNaN(i)?u:i};wd(e,m,r,o)}}},nm=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),Jd(e,t,n)}},im=function(e){return function(t,n,i){void 0===n&&(n=200),void 0===i&&(i="easeOut");var r=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=dm(t||r.scale,o,a);wd(e,s,n,i)}}},rm=function(e){return function(t,n,i,r){void 0===i&&(i=600),void 0===r&&(r="easeOut"),Ad(e);var o=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(o&&a&&o.contains(a)){var s=function(e,t,n){var i=e.wrapperComponent,r=e.contentComponent,o=e.transformState,a=e.setup,s=a.limitToBounds,c=a.minScale,u=a.maxScale;if(!i||!r)return o;var l,d,m,h,f,p,g,v,y=i.getBoundingClientRect(),C=t.getBoundingClientRect(),b=(l=i,d=r,m=o,h=t.getBoundingClientRect(),f=l.getBoundingClientRect(),p=d.getBoundingClientRect(),g=f.x*m.scale,v=f.y*m.scale,{x:(h.x-p.x+g)/m.scale,y:(h.y-p.y+v)/m.scale}),A=b.x,S=b.y,w=C.width/o.scale,E=C.height/o.scale,D=i.offsetWidth/w,x=i.offsetHeight/E,B=Td(n||Math.min(D,x),c,u,0,!1),I=(y.width-w*B)/2,T=(y.height-E*B)/2,O=Bd((y.left-A)*B+I,(y.top-S)*B+T,Ed(e,B),s,0,0,i);return{positionX:O.x,positionY:O.y,scale:B}}(e,a,n);wd(e,s,i,r)}}},om=function(e){return{instance:e,zoomIn:$d(e),zoomOut:em(e),setTransform:tm(e),resetTransform:nm(e),centerView:im(e),zoomToElement:rm(e)}},am=function(e){return{instance:e,state:e.transformState}},sm=function(e){var t={};return Object.assign(t,am(e)),Object.assign(t,om(e)),t};function cm(){try{return{get passive(){return!0,!1}}}catch(e){return!1}}var um=function(e,t){return t.some((function(t){return e.matches("".concat(t,", .").concat(t,", ").concat(t," *, .").concat(t," *"))}))},lm=function(e){e&&clearTimeout(e)},dm=function(e,t,n){var i=n.offsetWidth*e,r=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-i)/2,positionY:(t.offsetHeight-r)/2}};function mm(e,t,n){var i=t.getBoundingClientRect(),r=0,o=0;if("clientX"in e)r=(e.clientX-i.left)/n,o=(e.clientY-i.top)/n;else{var a=e.touches[0];r=(a.clientX-i.left)/n,o=(a.clientY-i.top)/n}return(Number.isNaN(r)||Number.isNaN(o))&&console.error("No mouse or touch offset found"),{x:r,y:o}}var hm=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},fm=function(e,t){var n=e.props,i=n.onWheel,r=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState.scale,c=a.limitToBounds,u=a.centerZoomedOut,l=a.zoomAnimation,d=a.wheel,m=a.disablePadding,h=a.smooth,f=l.size,p=l.disabled,g=d.step,v=d.smoothStep;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var y=function(e,t){var n,i,r=function(e){return e?e.deltaY<0?1:-1:0}(e);return i=r,"number"==typeof(n=t)?n:i}(t,null),C=function(e,t,n,i,r){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,c=s.maxScale,u=s.minScale,l=s.zoomAnimation,d=s.disablePadding,m=l.size,h=l.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=o+t*n;if(r)return f;var p=!i&&!h;return Td(vd(f,3),u,c,m,p&&!d)}(e,y,h?v*Math.abs(t.deltaY):g,!t.ctrlKey);if(s!==C){var b=xd(e,C),A=mm(t,o,s),S=c&&(p||0===f||u||m),w=Id(e,A.x,A.y,C,b,S),E=w.x,D=w.y;e.previousWheelEvent=t,e.setTransformState(C,E,D),yd(sm(e),t,i),yd(sm(e),t,r)}},pm=function(e,t){var n=e.props,i=n.onWheelStop,r=n.onZoomStop;lm(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(jd(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var o=function(e,t){var n=e.previousWheelEvent,i=e.transformState.scale,r=e.setup,o=r.maxScale,a=r.minScale;return!!n&&(i<o||i>a||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);o&&(lm(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,yd(sm(e),t,i),yd(sm(e),t,r))}),160))},gm=function(e){for(var t=0,n=0,i=0;i<2;i+=1)t+=e.touches[i].clientX,n+=e.touches[i].clientY;return{x:t/2,y:n/2}},vm=function(e,t){var n=e.contentComponent,i=e.pinchStartDistance,r=e.wrapperComponent,o=e.transformState.scale,a=e.setup,s=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,l=a.alignmentAnimation,d=u.disabled,m=u.size;if(null!==i&&n){var h=function(e,t,n){var i=n.getBoundingClientRect(),r=e.touches,o=vd(r[0].clientX-i.left,5),a=vd(r[0].clientY-i.top,5);return{x:(o+vd(r[1].clientX-i.left,5))/2/t,y:(a+vd(r[1].clientY-i.top,5))/2/t}}(t,o,n);if(Number.isFinite(h.x)&&Number.isFinite(h.y)){var f=hm(t),p=function(e,t){var n=e.pinchStartScale,i=e.pinchStartDistance,r=e.setup,o=r.maxScale,a=r.minScale,s=r.zoomAnimation,c=r.disablePadding,u=s.size,l=s.disabled;if(!n||null===i||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:Td(vd(t/i*n,2),a,o,u,!l&&!c)}(e,f),g=gm(t),v=g.x-(e.pinchLastCenterX||0),y=g.y-(e.pinchLastCenterY||0);if(p!==o||0!==v||0!==y){e.pinchLastCenterX=g.x,e.pinchLastCenterY=g.y;var C=xd(e,p),b=s&&(d||0===m||c),A=Id(e,h.x,h.y,p,C,b),S=A.x,w=A.y;e.pinchMidpoint=h,e.lastDistance=f;var E=l.sizeX,D=l.sizeY,x=Bd(S+v,w+y,C,s,Ld(e,E),Ld(e,D),r),B=x.x,I=x.y;e.setTransformState(p,B,I)}}}},ym=function(e,t){var n=e.props.onZoomStop,i=e.setup.doubleClick.animationTime;lm(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout((function(){e.doubleClickStopEventTimer=null,yd(sm(e),t,n)}),i)};function Cm(e,t){var n=e.setup,i=e.doubleClickStopEventTimer,r=e.transformState,o=e.contentComponent,a=r.scale,s=e.props,c=s.onZoomStart,u=s.onZoom,l=n.doubleClick,d=l.disabled,m=l.mode,h=l.step,f=l.animationTime,p=l.animationType;if(!d&&!i){if("reset"===m)return function(e,t){var n=e.props,i=n.onZoomStart,r=n.onZoom,o=e.setup.doubleClick,a=o.animationTime,s=o.animationType;yd(sm(e),t,i),Jd(e,a,s,(function(){return yd(sm(e),t,r)})),ym(e,t)}(e,t);if(!o)return console.error("No ContentComponent found");var g=function(e,t){return"toggle"===e?1===t?1:-1:"zoomOut"===e?-1:1}(m,e.transformState.scale),v=Xd(e,g,h);if(a!==v){yd(sm(e),t,c);var y=mm(t,o,a),C=Wd(e,v,y.x,y.y);if(!C)return console.error("Error during zoom event. New transformation state was not calculated.");yd(sm(e),t,u),wd(e,C,f,p),ym(e,t)}}}var bm=function(e){var t=this;this.mounted=!0,this.pinchLastCenterX=null,this.pinchLastCenterY=null,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.isWheelPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){t.initializeWindowEvents()},this.unmount=function(){t.cleanupWindowEvents()},this.update=function(e){t.props=e,xd(t,t.transformState.scale),t.setup=qd(e)},this.initializeWindowEvents=function(){var e,n,i=cm(),r=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,o=null==r?void 0:r.defaultView;null===(n=t.wrapperComponent)||void 0===n||n.addEventListener("wheel",t.onWheelPanning,i),null==o||o.addEventListener("mousedown",t.onPanningStart,i),null==o||o.addEventListener("mousemove",t.onPanning,i),null==o||o.addEventListener("mouseup",t.onPanningStop,i),null==r||r.addEventListener("mouseleave",t.clearPanning,i),null==o||o.addEventListener("keyup",t.setKeyUnPressed,i),null==o||o.addEventListener("keydown",t.setKeyPressed,i)},this.cleanupWindowEvents=function(){var e,n,i=cm(),r=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,o=null==r?void 0:r.defaultView;null==o||o.removeEventListener("mousedown",t.onPanningStart,i),null==o||o.removeEventListener("mousemove",t.onPanning,i),null==o||o.removeEventListener("mouseup",t.onPanningStop,i),null==r||r.removeEventListener("mouseleave",t.clearPanning,i),null==o||o.removeEventListener("keyup",t.setKeyUnPressed,i),null==o||o.removeEventListener("keydown",t.setKeyPressed,i),document.removeEventListener("mouseleave",t.clearPanning,i),Ad(t),null===(n=t.observer)||void 0===n||n.disconnect()},this.handleInitializeWrapperEvents=function(e){var n=cm();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},this.handleInitialize=function(e){var n=t.setup.centerOnInit;t.applyTransformation(),t.onInitCallbacks.forEach((function(e){return e(sm(t))})),n&&(t.setCenter(),t.observer=new ResizeObserver((function(){var n,i=e.offsetWidth,r=e.offsetHeight;(i>0||r>0)&&(t.onInitCallbacks.forEach((function(e){return e(sm(t))})),t.setCenter(),null===(n=t.observer)||void 0===n||n.disconnect())})),setTimeout((function(){var e;null===(e=t.observer)||void 0===e||e.disconnect()}),5e3),t.observer.observe(e))},this.onWheelZoom=function(e){if(!t.setup.disabled){var n=function(e,t){var n=e.setup.wheel,i=n.disabled,r=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,c=e.isPanning,u=t.target;return!(!s||c||i||!u||r&&!t.ctrlKey||o&&t.ctrlKey||um(u,a))}(t,e);n&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(function(e,t){var n=e.props,i=n.onWheelStart,r=n.onZoomStart;e.wheelStopEventTimer||(Ad(e),yd(sm(e),t,i),yd(sm(e),t,r))}(t,e),fm(t,e),pm(t,e))}},this.onWheelPanning=function(e){var n=t.setup,i=n.disabled,r=n.wheel,o=n.panning;if(t.wrapperComponent&&t.contentComponent&&!i&&r.wheelDisabled&&!o.disabled&&o.wheelPanning&&!e.ctrlKey){e.preventDefault(),e.stopPropagation();var a=t.transformState,s=a.positionX,c=a.positionY,u=s-e.deltaX,l=c-e.deltaY,d=o.lockAxisX?s:u,m=o.lockAxisY?c:l,h=t.setup.alignmentAnimation,f=h.sizeX,p=h.sizeY,g=Ld(t,f),v=Ld(t,p);d===s&&m===c||Pd(t,d,m,g,v)}},this.onPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;n||Od(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(0!==e.button||t.setup.panning.allowLeftClickPan)&&(1!==e.button||t.setup.panning.allowMiddleClickPan)&&(2!==e.button||t.setup.panning.allowRightClickPan)&&(e.preventDefault(),e.stopPropagation(),Ad(t),Md(t,e),yd(sm(t),e,i))},this.onPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;n||kd(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Nd(t,e.clientX,e.clientY),yd(sm(t),e,i))},this.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(Vd(t),yd(sm(t),e,n))},this.onPinchStart=function(e){var n=t.setup.disabled,i=t.props,r=i.onPinchingStart,o=i.onZoomStart;if(!n){var a=function(e,t){var n=e.setup.pinch,i=n.disabled,r=n.excluded,o=e.isInitialized,a=t.target;return!(!o||i||!a||um(a,r))}(t,e);a&&(function(e,t){var n=hm(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1;var i=gm(t);e.pinchLastCenterX=i.x,e.pinchLastCenterY=i.y,Ad(e)}(t,e),Ad(t),yd(sm(t),e,r),yd(sm(t),e,o))}},this.onPinch=function(e){var n=t.setup.disabled,i=t.props,r=i.onPinching,o=i.onZoom;if(!n){var a=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,i=e.pinchStartDistance;return!(!n||t||!i)}(t);a&&(e.preventDefault(),e.stopPropagation(),vm(t,e),yd(sm(t),e,r),yd(sm(t),e,o))}},this.onPinchStop=function(e){var n,i,r=t.props,o=r.onPinchingStop,a=r.onZoomStop;t.pinchStartScale&&(i=(n=t).pinchMidpoint,n.velocity=null,n.lastDistance=null,n.pinchMidpoint=null,n.pinchStartScale=null,n.pinchStartDistance=null,jd(n,null==i?void 0:i.x,null==i?void 0:i.y),yd(sm(t),e,o),yd(sm(t),e,a))},this.onTouchPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;if(!n&&Od(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,Ad(t);var r=e.touches,o=1===r.length,a=2===r.length;o&&(Ad(t),Md(t,e),yd(sm(t),e,i)),a&&t.onPinchStart(e)}},this.onTouchPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!kd(t))return;e.preventDefault(),e.stopPropagation();var r=e.touches[0];Nd(t,r.clientX,r.clientY),yd(sm(t),e,i)}else e.touches.length>1&&t.onPinch(e)},this.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},this.onDoubleClick=function(e){if(!t.setup.disabled){var n=function(e,t){var n=e.isInitialized,i=e.setup,r=e.wrapperComponent,o=i.doubleClick,a=o.disabled,s=o.excluded,c=t.target,u=null==r?void 0:r.contains(c);return!(!(n&&c&&u)||a||um(c,s))}(t,e);n&&Cm(t,e)}},this.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},this.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},this.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},this.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},this.setTransformState=function(e,n,i){var r=t.props.onTransformed;if(Number.isNaN(e)||Number.isNaN(n)||Number.isNaN(i))console.error("Detected NaN set state values");else{e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=i,t.applyTransformation();var o=sm(t);t.onChangeCallbacks.forEach((function(e){return e(o)})),yd(o,{scale:e,positionX:n,positionY:i},r)}},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=dm(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},this.handleTransformStyles=function(e,n,i){return t.props.customTransform?t.props.customTransform(e,n,i):function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")}(e,n,i)},this.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,i=e.positionX,r=e.positionY,o=t.handleTransformStyles(i,r,n);t.contentComponent.style.transform=o}},this.getContext=function(){return sm(t)},this.onChange=function(e){return t.onChangeCallbacks.has(e)||t.onChangeCallbacks.add(e),function(){t.onChangeCallbacks.delete(e)}},this.onInit=function(e){return t.onInitCallbacks.has(e)||t.onInitCallbacks.add(e),function(){t.onInitCallbacks.delete(e)}},this.init=function(e,n){t.cleanupWindowEvents(),t.wrapperComponent=e,t.contentComponent=n,xd(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(n),t.initializeWindowEvents(),t.isInitialized=!0;var i=sm(t);yd(i,void 0,t.props.onInit)},this.props=e,this.setup=qd(this.props),this.transformState=Qd(this.props)},Am=T.default.createContext(null),Sm=T.default.forwardRef((function(e,t){var n,i,r=Object(T.useRef)(new bm(e)).current,o=(n=e.children,i=om(r),"function"==typeof n?n(i):n);return Object(T.useImperativeHandle)(t,(function(){return om(r)}),[r]),Object(T.useEffect)((function(){r.update(e)}),[r,e]),T.default.createElement(Am.Provider,{value:r},o)}));T.default.forwardRef((function(e,t){var n,i=Object(T.useRef)(null),r=Object(T.useContext)(Am);return Object(T.useEffect)((function(){return r.onChange((function(e){if(i.current){i.current.style.transform=r.handleTransformStyles(0,0,1/e.instance.transformState.scale)}}))}),[r]),T.default.createElement("div",zd({},e,{ref:(n=[i,t],function(e){n.forEach((function(t){"function"==typeof t?t(e):null!=t&&(t.current=e)}))})}))}));var wm="transform-component-module_wrapper__SPB86",Em="transform-component-module_content__FBWxo";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__SPB86 {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__FBWxo {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__FBWxo img {\n pointer-events: none;\n}\n");var Dm=function(e){var t=e.children,n=e.wrapperClass,i=void 0===n?"":n,r=e.contentClass,o=void 0===r?"":r,a=e.wrapperStyle,s=e.contentStyle,c=e.wrapperProps,u=void 0===c?{}:c,l=e.contentProps,d=void 0===l?{}:l,m=Object(T.useContext)(Am),h=m.init,f=m.cleanupWindowEvents,p=Object(T.useRef)(null),g=Object(T.useRef)(null);return Object(T.useEffect)((function(){var e=p.current,t=g.current;return null!==e&&null!==t&&h&&(null==h||h(e,t)),function(){null==f||f()}}),[]),T.default.createElement("div",zd({},u,{ref:p,className:"react-transform-wrapper ".concat(wm," ").concat(i),style:a}),T.default.createElement("div",zd({},d,{ref:g,className:"react-transform-component ".concat(Em," ").concat(o),style:s}),t))};function xm(e){var t;const n=Nc(null===(t=e.page)||void 0===t?void 0:t.finalImageUrl());if(!(e.visible&&n.value))return null;const i=e.config.closeButton;return T.default.createElement(T.default.Fragment,null,T.default.createElement(P.Box,{style:{touchAction:"none",backgroundColor:_.b.getColorValue(e.config.overlayColor)}},T.default.createElement(P.Box,{style:{textAlign:"right",height:"45px",paddingRight:8}},T.default.createElement(G,{onClick:e.onCloseButtonClick,visible:i.visible,text:i.text,background:i.background,foreground:i.foreground,ariaLabel:_.b.getLocalizedText(i.accessibilityDescription),iconPosition:"right",icon:T.default.createElement(L.a,{style:{paddingLeft:4}})})),T.default.createElement(Sm,{centerOnInit:!0},T.default.createElement(Dm,{wrapperStyle:{width:"100%"},contentStyle:{width:"100%"}},T.default.createElement(P.Box,{style:{width:"100%",height:`calc(100 *${R} - 45px)`,display:"flex",justifyContent:"center",alignItems:"center",touchAction:"none"}},T.default.createElement("img",{src:n.value,alt:"Zoomed image",style:{maxWidth:"100%",maxHeight:"100%"}}))))))}var Bm=n(80);class Im{constructor(){this.disabled=!1,this.color="transparent"}}class Tm{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20,this.filter=""}}class Om{constructor(){this.color="#1ec31e",this.width=4}}class km{constructor(){this.padding=10}}class Pm{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class Lm{constructor(){this.width=2,this.color="white"}}class _m{constructor(){this.size=20,this.color="white"}}class Rm extends Bm.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new km,this.style.magneticLines=new Im,this.style.polygon=new Om,this.style.polygon.handles=new Tm,this.style.magnifier=new Pm,this.style.magnifier.border=new Lm,this.style.magnifier.crosshair=new _m}static fromJson(e){const t=new Rm;return this.mapValues(e,t,["style"]),e.style&&(this.mapValues(e.style,t.style,["polygon","magneticLines","magnifier"]),e.style.polygon&&(this.mapValues(e.style.polygon,t.style.polygon,["handles"]),e.style.polygon.handles&&this.mapValues(e.style.polygon.handles,t.style.polygon.handles)),e.style.magneticLines&&this.mapValues(e.style.magneticLines,t.style.magneticLines,[]),e.style.magnifier&&(this.mapValues(e.style.magnifier,t.style.magnifier,["border","crosshair"]),e.style.magnifier.border&&this.mapValues(e.style.magnifier.border,t.style.magnifier.border,[]),e.style.magnifier.crosshair&&this.mapValues(e.style.magnifier.crosshair,t.style.magnifier.crosshair,[]))),t}}class Mm extends T.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(e){return T.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},T.default.createElement("line",{x1:e.start.x.toString(),y1:e.start.y.toString(),x2:e.end.x.toString(),y2:e.end.y.toString(),style:{stroke:this.props.style.color,strokeWidth:2}}))}componentDidUpdate(e,t,n){this.props.style.disabled||this.snapToClosestIfAnyAreClose()}render(){var e,t,n,i,r,o;return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},null===(n=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.horizontal)||void 0===t?void 0:t.scaled)||void 0===n?void 0:n.map((e=>this.fromPoint(e))),null===(o=null===(r=null===(i=this.props.lines)||void 0===i?void 0:i.vertical)||void 0===r?void 0:r.scaled)||void 0===o?void 0:o.map((e=>this.fromPoint(e))))}snapToClosestIfAnyAreClose(){var e,t,n,i;const r=this.props.movingLine;let o=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.vertical)||void 0===t?void 0:t.scaled;if(r.isHorizontal&&(o=null===(i=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===i?void 0:i.scaled),!o||0===o.length)return;const a=this.midPoint(r.points[0].coordinates,r.points[1].coordinates),s=o.map((e=>({distance:this.distanceToLine(e,a),mLine:e})));s.sort(((e,t)=>e.distance-t.distance)),s[0].distance<this.BUFFER&&this.props.snapTo({magneticLine:s[0].mLine,polygonLine:r})}distanceToLine(e,t){const n=t.x-e.start.x,i=t.y-e.start.y,r=e.end.x-e.start.x,o=e.end.y-e.start.y,a=r*r+o*o;if(0===a)return 1/0;const s=(n*r+i*o)/a;let c;return c=s<=0?e.start:s>=1?e.end:new hs.a(e.start.x+s*r,e.start.y+s*o),hs.a.distance(t,c)}midPoint(e,t){return new hs.a((e.x+t.x)/2,(e.y+t.y)/2)}}class Fm extends T.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var e,t;return(null===(e=this.props.style)||void 0===e?void 0:e.size)?(null===(t=this.props)||void 0===t?void 0:t.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var e,t,n;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(e=this.props.style)||void 0===e?void 0:e.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(t=this.props.style)||void 0===t?void 0:t.color,position:"absolute",cursor:"pointer",zIndex:500,filter:null===(n=this.props.style)||void 0===n?void 0:n.filter}}nextIndex(e){return(e+1)%this.POINT_COUNT}previousIndex(e){return(e-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(e){return e%2==0}isOutOfBounds(e,t){return e<-this.DRAG_BUFFER||e>t+this.DRAG_BUFFER}get invisibleHandleStyle(){return{width:"50px",height:"50px",opacity:0,position:"relative",top:this.pointSize/2-25+"px",left:this.pointSize/2-25+"px",borderRadius:"25px"}}}class Nm extends Fm{create(){if(!this.props.points||4!==this.props.points.length)return null;const e=[];for(let t=0;t<this.POINT_COUNT;t++){const n=this.props.points[t],i=T.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x-this.pointSize/2+"px",top:n.y-this.pointSize/2+"px"}),key:t.toString(),ref:e=>this.items[t]=e,onPointerDown:e=>this.cornerTouchStart(e,t),onPointerUp:e=>this.cornerTouchEnd(e),onPointerMove:e=>this.cornerTouchMove(e,t),"data-sb-cropping-corner":t},T.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));e.push(i)}return e}cornerTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=hs.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],r=hs.a.fromHtmlElement(i);this.parentOffset=new hs.a(n.x-r.x,n.y-r.y),this.props.cornerMoveStart({index:t,point:this.props.points[t]})}cornerTouchMove(e,t){if(!this.parentOffset)return;const n=hs.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),{x:i,y:r}=Object(sc.b)({x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},this.pointSize,this.props.containerSize),o=this.pointSize/2,a=this.props.points[t];this.props.points[t]=new hs.a(i+o,r+o),Vs.isConvex(this.props.points)?this.props.cornerMoved({index:t,point:this.props.points[t]}):this.props.points[t]=a}cornerTouchEnd(e){e.target.releasePointerCapture(e.pointerId),this.parentOffset=null,this.props.cornerMoveEnd()}render(){return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",cursor:"pointer",zIndex:500,userSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none"}},this.create())}}class Vm extends Fm{create(){if(!this.props.points||4!==this.props.points.length)return null;const e=[];for(let t=0;t<this.POINT_COUNT;t++){const n=this.props.points[t];let i=this.props.points[this.nextIndex(t)];const r=T.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(i.x-n.x)/2-this.pointSize/2+"px",top:n.y+(i.y-n.y)/2-this.pointSize/2+"px"}),key:t.toString(),ref:e=>this.items[t]=e,onPointerDown:e=>this.lineTouchStart(e,t),onPointerMove:e=>this.lineTouchMove(e,t),onPointerUp:e=>this.lineTouchEnd(e),"data-sb-cropping-side":t},T.default.createElement("div",{style:this.invisibleHandleStyle}));e.push(r)}return e}lineTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=hs.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],r=hs.a.fromHtmlElement(i),o=this.props.points[t],a=this.props.points[this.nextIndex(t)];this.point0Start=y.copy(this.props.points[this.previousIndex(t)]),this.point1Start=y.copy(o),this.point2Start=y.copy(a),this.point3Start=y.copy(this.props.points[this.nextIndex(this.nextIndex(t))]),this.point1Offset=new hs.a(o.x-r.x,o.y-r.y),this.point2Offset=new hs.a(a.x-r.x,a.y-r.y),this.parentOffset=new hs.a(n.x-r.x,n.y-r.y)}lineTouchMove(e,t){if(!this.parentOffset)return;const n=hs.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.props.points[this.previousIndex(t)];let r=new hs.a(null,null),o=new hs.a(null,null);const a=this.props.points[this.nextIndex(t+1)],s=n.x-this.parentOffset.x,c=n.y-this.parentOffset.y;if(this.isHorizontal(t)){const e=c+this.point1Offset.y,t=c+this.point2Offset.y,n=e-this.point1Start.y;r.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),o.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),r.y=e,o.y=t}else{const e=s+this.point1Offset.x,t=s+this.point2Offset.x,n=e-this.point1Start.x;r.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),o.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),r.x=e,o.x=t}r=hs.a.clamp(r,this.props.containerSize),o=hs.a.clamp(o,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,r,i,this.isHorizontal(t)?"y":"x")||this.isNearOpposingPoint(this.point1Start,o,a,this.isHorizontal(t)?"y":"x")||this.areEdgesCrossing(i,r,o,a)||Vs.isConvex([i,r,o,a])&&(this.props.points[t].x=r.x,this.props.points[t].y=r.y,this.props.points[this.nextIndex(t)].x=o.x,this.props.points[this.nextIndex(t)].y=o.y,this.props.lineMoved({points:[{index:t,coordinates:r},{index:this.nextIndex(t),coordinates:o}],previousPoint:i,nextPoint:a,isHorizontal:this.isHorizontal(t)}))}lineTouchEnd(e){e.target.releasePointerCapture(e.pointerId),this.parentOffset=null}isNearOpposingPoint(e,t,n,i){if(e[i]>n[i]){if(t[i]-10<n[i])return!0}else if(t[i]>n[i]-10)return!0;return!1}areEdgesCrossing(e,t,n,i){const r=e.x,o=e.y,a=t.x,s=t.y,c=n.x,u=n.y,l=i.x,d=i.y;return((r-c)*(s-u)-(o-u)*(a-c))*((r-l)*(s-d)-(o-d)*(a-l))<0&&((c-r)*(d-o)-(u-o)*(l-r))*((c-a)*(d-s)-(u-s)*(l-a))<0}render(){return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class Wm extends T.default.Component{render(){return T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},T.default.createElement(Nm,{ref:e=>this.corners=e,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:this.props.cornerMoved,cornerMoveEnd:this.props.cornerMoveEnd}),T.default.createElement(Vm,{ref:e=>this.lines=e,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,lineMoved:this.props.lineMoved}))}setFrame(){for(let e=0;e<this.corners.POINT_COUNT;e++){const t=this.props.coordinatePoints[e];this.corners.items[e]&&(this.corners.items[e].style.left=t.x-this.corners.pointSize/2+"px",this.corners.items[e].style.top=t.y-this.corners.pointSize/2+"px");let n=this.props.coordinatePoints[this.corners.nextIndex(e)];this.lines.items[e]&&(this.lines.items[e].style.left=t.x+(n.x-t.x)/2-this.corners.pointSize/2+"px",this.lines.items[e].style.top=t.y+(n.y-t.y)/2-this.corners.pointSize/2+"px")}}snapTo(e){const t=[e.polygonLine.previousPoint,e.polygonLine.points[0].coordinates],n=[e.polygonLine.points[1].coordinates,e.polygonLine.nextPoint],i=[e.magneticLine.start,e.magneticLine.end];this.props.coordinatePoints[e.polygonLine.points[0].index]=Vs.intersection(t,i),this.props.coordinatePoints[e.polygonLine.points[1].index]=Vs.intersection(n,i),this.props.cornerMoveEnd(),this.setFrame()}}class jm extends T.default.Component{constructor(e){super(e),this.state={movingLine:void 0}}render(){return T.default.createElement("div",null,T.default.createElement(Wm,{ref:e=>this.handles=e,containerSize:this.props.size,coordinatePoints:this.props.points,rotations:this.props.rotations,scale:this.props.scale,style:this.props.handleStyle,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:e=>{this.setFrame(),this.props.cornerMoved(e)},cornerMoveEnd:this.props.cornerMoveEnd,lineMoved:e=>{this.setFrame(),this.setState({movingLine:e})}}),T.default.createElement(Mm,{style:this.props.magneticLineStyle,lines:this.props.magneticLines,movingLine:this.state.movingLine,snapTo:e=>{var t,n;null===(t=this.handles)||void 0===t||t.snapTo(e),null===(n=this.polygon)||void 0===n||n.setFrame()}}),T.default.createElement(zu,{size:this.props.size,points:this.props.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:e=>this.polygon=e}))}setFrame(){var e,t;null===(e=this.polygon)||void 0===e||e.setFrame(),null===(t=this.handles)||void 0===t||t.setFrame()}}class zm extends T.default.Component{render(){return T.default.createElement("img",{ref:e=>this.image=e,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute"},src:this.props.src,alt:".",onLoad:e=>{e.target&&this.props.onImageLoaded(e.target)}})}}class Hm extends T.default.Component{constructor(){super(...arguments),this.animating=!1}width(){return this.container.offsetWidth-2*this.container.offsetLeft}height(){return this.container.offsetHeight-2*this.container.offsetTop}isAnimating(){return this.animating}render(){const{size:e,imageMargin:t,rotations:n,scale:i,duration:r}=this.props,o=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=xs.b`
|
|
35
35
|
from {transform: rotate(${o}deg) scale(${this.previousScale}); }
|
|
36
36
|
to {transform: rotate(${a}deg) scale(${i});
|
|
37
|
-
}`,c=xs.a.div`position: absolute; animation: ${s} ${r}s;`;return this.previousScale=i,T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:e=>this.container=e},T.default.createElement(c,{style:{width:this.calculate(e,"width"),height:this.calculate(e,"height"),transform:`rotate(${a}deg) scale(${i})`,marginTop:this.marginWithAspect(t,"y",e),marginLeft:this.marginWithAspect(t,"x",e)},onAnimationStart:()=>{this.animating=!0},onAnimationEnd:()=>{this.animating=!1}},this.props.children))}marginWithAspect(e,t,n){if(!e||!n)return 0;n.width,n.height;return e[t]}calculate(e,t){return e?e[t]:"100%"}}class Um extends T.default.Component{componentDidMount(){_s.a.disableScreenMovement()}componentWillUnmount(){_s.a.enableScreenMovement()}render(){return T.default.createElement("div",null)}}class Zm{constructor(e,t){this.start=e,this.end=t}static fromLineSegments(e){return e.map((e=>Zm.fromLineSegment(e)))}static fromLineSegment(e){return new Zm(e.start,e.end)}}class Gm{constructor(e,t){this.element=e,this.size=t}}class Ym{}class Qm extends T.default.Component{render(){return T.default.createElement("div",{style:this.props.style},T.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const e=this.half();return T.default.createElement("line",{x1:e,y1:0,x2:e,y2:this.props.size,stroke:this.props.color,strokeWidth:"2"})}horizontal(){const e=this.half();return T.default.createElement("line",{x1:0,y1:e,x2:this.props.size,y2:e,stroke:this.props.color,strokeWidth:"2"})}}class qm extends T.default.Component{get crosshairSize(){var e,t;return null===(t=null===(e=this.props.style)||void 0===e?void 0:e.crosshair)||void 0===t?void 0:t.size}constructor(e){super(e),this.MAX_ROTATIONS=4,this.state={frame:v.a.empty(),cropImageFitSize:Ps.a.empty(),rotation:{count:0,scale:1},margin:{left:this.props.style.margin,top:this.props.style.margin},container:{width:0},scale:{width:1,height:1}}}style(){return{container:{marginLeft:this.state.margin.left,marginTop:this.state.margin.top,width:this.state.frame.width,height:this.state.frame.height,borderRadius:this.props.style.size/2,border:this.props.style.border.width+"px solid "+this.props.style.border.color,position:"absolute",overflow:"hidden",zIndex:50,transform:"rotate("+90*this.state.rotation.count+"deg)"},image:{width:this.state.cropImageFitSize.width*this.props.style.zoom,height:this.state.cropImageFitSize.height*this.props.style.zoom,marginLeft:-this.state.frame.x,marginTop:-this.state.frame.y,objectFit:"cover"},crosshair:{margin:"auto",position:"absolute",width:this.crosshairSize,height:this.crosshairSize,top:this.state.frame.height/2-this.crosshairSize/2,left:this.state.frame.width/2-this.crosshairSize/2}}}render(){return this.state.visible?T.default.createElement("div",{style:this.style().container},T.default.createElement("img",{style:this.style().image,ref:e=>this.destination=e,src:this.props.src,alt:"."}),T.default.createElement(Qm,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(e){if(!this.state.visible)return;this.destination.src=e.source.element.src;const t=v.a.fromPoint(hs.a.scaleUpTo(e.origin,new Ps.a(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=e.container.width-(this.props.style.margin+this.props.style.size),i=this.isPointTopLeft(e.origin,e.source.size,e.rotations);this.setState({frame:t,cropImageFitSize:e.source.size,rotation:{count:e.rotations,scale:e.scale},margin:{left:i?n:this.props.style.margin},container:{width:e.container.width},scale:{width:e.source.size.width/e.container.width,height:e.source.size.height/e.container.height}})}isPointTopLeft(e,t,n){const i=e.x,r=e.y,o=this.normalizeRotations(n),a=this.state.container.width/4;return 0===o?i<a&&r<a:1===o?i<a&&r>t.height-a:2===o?i>t.width-a&&r>t.height-a:i>t.width-a&&r<a}setIsVisible(e,t){this.setState({visible:e},t)}normalizeRotations(e){return e%this.MAX_ROTATIONS}}var Xm=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Km extends T.default.Component{constructor(e){super(e),this.onResizeCallback=()=>{},this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.sdk=e.sdk,this.state={image:void 0,documentDetectionResult:void 0,polygon:void 0,calculatedSize:Ps.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:hs.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(e,t){return Xm(this,void 0,void 0,(function*(){const n=_s.a.findContainerOrThrow(e);return new Promise(((i,r)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(n),this.root.render(T.default.createElement(Km,{root:this.root,sdk:t,onReady:i,onError:r,container:n,configuration:Rm.fromJson(e)}))}))}))}componentDidMount(){var e,t,n;return Xm(this,void 0,void 0,(function*(){const i=d.Image.fromWrappedImage(null===(e=this.configuration)||void 0===e?void 0:e.image.__image_data),r=(yield this.sdk.detectAndCropDocument(i)).result.detectionResult;let o=null!==(n=null===(t=this.configuration)||void 0===t?void 0:t.polygon)&&void 0!==n?n:r.pointsNormalized;0===o.length&&(o=Km.FULL_SIZE_POLYGON);const a=yield b.toDataUrl(yield this.sdk.imageToJpeg(i));this.setState({documentDetectionResult:r,image:a,polygon:o,magneticLines:{vertical:{original:Zm.fromLineSegments(r.verticalLinesNormalized)},horizontal:{original:Zm.fromLineSegments(r.horizontalLinesNormalized)}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return Xm(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(e){return Xm(this,void 0,void 0,(function*(){Ps.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=e,this.initializeSizes())}))}onResize(){const e=this.state.points.map((e=>new hs.a(e.x/this.state.calculatedSize.width,e.y/this.state.calculatedSize.height)));this.initializeSizes(e)}initializeSizes(e,t,n){const i=new Ps.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),r=new Ps.a(this.container.width(),this.container.height()),o=b.getObjectFitSize(r,i),a=new Ps.a(o.width,o.height),s=null!=e?e:this.state.polygon,c=_s.a.convertToViewportPointsFromParentSize(a,s),u=null!=t?t:this.state.magneticLines.horizontal.original,l=null!=n?n:this.state.magneticLines.vertical.original,d=_s.a.convertLinesToViewportLines(a,u),m=_s.a.convertLinesToViewportLines(a,l);this.setState({calculatedSize:a,points:c,magneticLines:{horizontal:{original:u,scaled:d},vertical:{original:l,scaled:m}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var e,t,n,i,r,o;const a=zu.CLASSNAME,s=Vu()({[a]:!0,[`${a}-visible`]:!0}),c=this.configuration.style.polygon.width,u=(null===(e=this.state.animation)||void 0===e?void 0:e.scale)?c/this.state.animation.scale:c,l=this.configuration.style.padding||0,d=`calc(100% - 2*${l}px)`;return T.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:l}},T.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&T.default.createElement(Um,null),T.default.createElement(qm,{ref:e=>this.magnifier=e,style:this.configuration.style.magnifier}),T.default.createElement(Hm,{ref:e=>this.container=e,size:this.state.calculatedSize,rotations:null===(t=this.state.animation)||void 0===t?void 0:t.rotations,scale:null===(n=this.state.animation)||void 0===n?void 0:n.scale,duration:null===(i=this.state.animation)||void 0===i?void 0:i.duration,imageMargin:this.state.imageMargin},T.default.createElement(zm,{src:this.state.image,onImageLoaded:e=>this.onImageLoaded(e)}),T.default.createElement(jm,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${u}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(r=this.state.animation)||void 0===r?void 0:r.rotations,scale:null===(o=this.state.animation)||void 0===o?void 0:o.scale,magneticLines:this.state.magneticLines,cornerMoveStart:this.showMagnifier.bind(this),cornerMoved:this.updateMagnifier.bind(this),cornerMoveEnd:this.hideMagnifier.bind(this)}))))}showMagnifier(e){var t;null===(t=this.magnifier)||void 0===t||t.setIsVisible(!0,(()=>{var t;null===(t=this.magnifier)||void 0===t||t.update(this.magnifierOptions(e))}))}updateMagnifier(e){var t;null===(t=this.magnifier)||void 0===t||t.update(this.magnifierOptions(e))}magnifierOptions(e){const t=new Ym;return t.source=new Gm(this.htmlImage,this.state.calculatedSize),t.container=new Ps.a(this.container.width(),this.container.height()),t.origin=e.point,t.rotations=this.state.animation.rotations,t.scale=this.state.animation.scale,t}hideMagnifier(){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!1)}apply(){var e;return Xm(this,void 0,void 0,(function*(){const t=hs.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),i=yield this.sdk.createImageProcessor(),r=yield i.crop(null===(e=this.configuration)||void 0===e?void 0:e.image,t);return{image:(yield i.rotate(r.result,n,"CONSUME_IMAGE")).result,polygon:t,rotations:this.rotations}}))}toCoreRotations(e){switch(e%this.MAX_ROTATIONS){case 0:return"NONE";case 1:return"CLOCKWISE_90";case 2:return"CLOCKWISE_180";case 3:return"COUNTERCLOCKWISE_90"}}rotate(e){return Xm(this,void 0,void 0,(function*(){if(this.container.isAnimating())return void console.warn("Unable to rotate: previous rotation animation in progress");const t=this.calculateScale(this.rotations,e,this.state.calculatedSize);this.setState({animation:{rotations:this.rotations+e,scale:t,duration:1}})}))}detect(){return Xm(this,void 0,void 0,(function*(){const e=this.state.documentDetectionResult;if(0===e.pointsNormalized.length)this.resetPolygon();else{const t=Zm.fromLineSegments(e.horizontalLinesNormalized),n=Zm.fromLineSegments(e.verticalLinesNormalized);this.initializeSizes(e.pointsNormalized,t,n)}}))}resetPolygon(){const e=this.state.documentDetectionResult,t=Zm.fromLineSegments(e.horizontalLinesNormalized),n=Zm.fromLineSegments(e.verticalLinesNormalized);this.initializeSizes(Km.FULL_SIZE_POLYGON,t,n)}dispose(){_s.a.unmountSafely(this.props.root)}get rotations(){var e,t;const n=null===(e=this.state.animation)||void 0===e?void 0:e.rotations;return n&&0!==n?n:null!==(t=this.configuration.rotations)&&void 0!==t?t:0}get configuration(){return this._configuration||(this._configuration=Rm.fromJson(this.props.configuration)),this._configuration}calculateScale(e,t,n){return t?(e+t)%2==0?this.BASE_SCALE:this.calculateRatio(n):this.BASE_SCALE}calculateRatio(e){return Math.min(this.container.width()/e.height,this.container.height()/e.width)}calculateMargin(e){return e.width>e.height?{x:0,y:this.container.height()/2-e.height/2}:{x:this.container.width()/2-e.width/2,y:0}}}Km.FULL_SIZE_POLYGON=[new hs.a(0,0),new hs.a(1,0),new hs.a(1,1),new hs.a(0,1)],Km.root=null;var Jm=Km,$m=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function eh(e){const t=e.config.screens.cropping,n=T.default.useRef(null),i=T.default.useRef(null),[r,o]=T.default.useState(!0),a=Object(T.useRef)(0),s=T.default.useRef(Promise.resolve());return Object(T.useEffect)((()=>{if(n.current&&e.page)return s.current=s.current.then((()=>$m(this,void 0,void 0,(function*(){o(!0);const r=yield e.page.cropData();if(!n.current)return;a.current=r.rotations;const s=yield Jm.create({containerId:"sb-cropping-container",image:r.image,polygon:r.crop,rotations:r.rotations,style:{polygon:{color:_.b.getColorValue(t.croppingPolygonColor),handles:{color:_.b.getColorValue(t.croppingHandlerColor),border:"transparent",filter:"drop-shadow(0px 0px 2px #00000070)"}}}},e.sdk);i.current=s,o(!1)})))),()=>{s.current=s.current.then((()=>$m(this,void 0,void 0,(function*(){var e;null===(e=i.current)||void 0===e||e.dispose()}))))}}),[n.current,e.page]),e.page?T.default.createElement(T.default.Fragment,null,T.default.createElement(El,{open:r}),T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(t.backgroundColor),width:"100%",height:`calc(100 * ${R})`,display:"flex",flexDirection:"column",touchAction:"none",userSelect:"none",WebkitTapHighlightColor:"transparent"}},T.default.createElement(iu,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:T.default.createElement(G,{ariaLabel:_.b.getLocalizedText(t.topBarBackButton.accessibilityDescription),onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,debugName:"cropping-screen-close",disabled:r}),centerTitle:t.topBarTitle,rightContent:T.default.createElement(G,{ariaLabel:_.b.getLocalizedText(t.topBarConfirmButton.accessibilityDescription),onClick:()=>$m(this,void 0,void 0,(function*(){if(!i.current)return void e.onCloseButtonClick();const t=i.current;o(!0);const n=hs.a.toPolygon(t.state.points,t.state.calculatedSize),r=(4+t.rotations-a.current)%4;yield e.onApplyCrop(n,r),o(!1)})),visible:t.topBarConfirmButton.visible,text:t.topBarConfirmButton.text,background:t.topBarConfirmButton.background,foreground:t.topBarConfirmButton.foreground,debugName:"cropping-screen-apply",disabled:r})}),T.default.createElement(P.Box,{style:{flexGrow:1,width:"100%"},ref:n,id:"sb-cropping-container"}),T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:80,width:"100%",display:"flex",justifyContent:"center"}},T.default.createElement(P.Box,{style:{maxWidth:400,display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1,padding:"0 20px"}},T.default.createElement(H,{enabled:!r,config:t.bottomBar.detectButton,icon:({color:e})=>T.default.createElement(L.a,{style:{color:e}}),onClick:()=>$m(this,void 0,void 0,(function*(){var e;o(!0),yield null===(e=i.current)||void 0===e?void 0:e.detect(),o(!1)})),debugName:"retake"}),T.default.createElement(H,{enabled:!r,config:t.bottomBar.rotateButton,icon:({color:e})=>T.default.createElement(L.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.rotate(1)},debugName:"retake"}),T.default.createElement(H,{enabled:!r,config:t.bottomBar.resetButton,icon:({color:e})=>T.default.createElement(L.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.resetPolygon()},debugName:"retake"}))))):null}var th=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class nh{get id(){return this.data.id}getData(){return this.data}constructor(e,t){this.document=e,this.data=t,this._finalImageUrl=null,this.data.rotations=t.rotations||0}sdk(){return Jh.instance}loadOriginalImage(){return th(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(this.data.originalImageId)}))}loadDocumentImage(){return th(this,void 0,void 0,(function*(){return null===this.data.documentImageId?null:yield this.sdk().storage.getSBPageImage(this.data.documentImageId)}))}getPolygon(){var e;return 4===(null===(e=this.data.polygon)||void 0===e?void 0:e.length)?this.data.polygon:nh.FULL_SIZE_POLYGON}cropData(){return th(this,void 0,void 0,(function*(){return{crop:this.getPolygon(),rotations:this.data.rotations,image:yield this.loadOriginalImage()}}))}finalRawImage(){return th(this,void 0,void 0,(function*(){if(null===this.data.documentImageId){let e=yield this.loadOriginalImage();const t=this.document.data.documentImageSizeLimit,n=yield this.sdk().createImageProcessor();0!==t?(e=(yield n.resize(e,t,"COPY_IMAGE")).result,e=(yield n.crop(e,this.getPolygon(),"CONSUME_IMAGE")).result):e=(yield n.crop(e,this.getPolygon(),"COPY_IMAGE")).result;const i=this.data.filters||[];for(let t of i)e=(yield n.applyFilter(e,t,"CONSUME_IMAGE")).result;const r=nh.ROTATIONS[this.data.rotations%4];e=(yield n.rotate(e,r,"CONSUME_IMAGE")).result;const o=yield this.sdk().storage.insertSBPageImage(e);return ph._internal_updateProperty(this.data,"documentImageId",o),yield this.document.updateStorageDocument(),e}return yield this.loadDocumentImage()}))}finalImageUrl(){return null===this._finalImageUrl&&(this._finalImageUrl=(()=>th(this,void 0,void 0,(function*(){const e=yield this.finalRawImage(),t=yield this.sdk().imageToJpeg(e,"CONSUME_IMAGE");return URL.createObjectURL(new Blob([t],{type:"image/jpeg"}))})))()),this._finalImageUrl}invalidateImage(){return th(this,void 0,void 0,(function*(){null!==this.data.documentImageId&&(yield this.sdk().storage.deleteImageById(this.data.documentImageId),ph._internal_updateProperty(this.data,"documentImageId",null)),yield this.document.updateStorageDocument(),URL.revokeObjectURL(yield this._finalImageUrl),this._finalImageUrl=null}))}}nh.ROTATIONS=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],nh.FULL_SIZE_POLYGON=[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];class ih{constructor(e){this.name="SBStorageError",this.message=e}}var rh=n(5),oh=n(59),ah=n(30);const sh=["UNDEFINED","MANUAL_SNAP","AUTO_SNAP","IMPORTED"];var ch=n(81);class uh extends rh.a{constructor(e={}){super(),this.filters=null,this.polygon=[],this.documentDetectionStatus=null,this.documentQuality=null,this.source=null,this.id=null,this.originalImageId=null,this.documentImageId=null,void 0!==e.filters&&(this.filters=null!=e.filters?e.filters.map((e=>ch.a.From(e))):null),void 0!==e.polygon&&(this.polygon=e.polygon.map((e=>({x:e.x,y:e.y})))),void 0!==e.documentDetectionStatus&&(this.documentDetectionStatus=null!=e.documentDetectionStatus&&oh.a.includes(e.documentDetectionStatus)?e.documentDetectionStatus:null),void 0!==e.documentQuality&&(this.documentQuality=null!=e.documentQuality&&ah.d.includes(e.documentQuality)?e.documentQuality:null),void 0!==e.source&&(this.source=null!=e.source&&sh.includes(e.source)?e.source:null),void 0!==e.id&&(this.id=null!=e.id?e.id:null),void 0!==e.originalImageId&&(this.originalImageId=null!=e.originalImageId?e.originalImageId:null),void 0!==e.documentImageId&&(this.documentImageId=null!=e.documentImageId?e.documentImageId:null)}}class lh extends rh.a{constructor(e={}){if(super(),this.documentImageSizeLimit=0,this.id=null,this.pdfId=null,this.tiffId=null,void 0===e.creationTimestamp)throw new Error("creationTimestamp must be present in constructor argument");if(this.creationTimestamp=e.creationTimestamp,void 0===e.pages)throw new Error("pages must be present in constructor argument");this.pages=e.pages.map((e=>new uh(e))),void 0!==e.documentImageSizeLimit&&(this.documentImageSizeLimit=e.documentImageSizeLimit),void 0!==e.id&&(this.id=null!=e.id?e.id:null),void 0!==e.pdfId&&(this.pdfId=null!=e.pdfId?e.pdfId:null),void 0!==e.tiffId&&(this.tiffId=null!=e.tiffId?e.tiffId:null)}}class dh extends lh{constructor(){super(...arguments),this.pages=[]}}class mh extends uh{}var hh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class fh{get documentImageSizeLimit(){return this.configuration.outputSettings.documentImageSizeLimit}get cleanSession(){return this.configuration.cleanScanningSession}get filters(){const e=this.configuration.outputSettings;return e.defaultFilter?[e.defaultFilter]:[]}constructor(e){this.configuration=e.config,this.documentId=null==e?void 0:e.documentId}loadFromStorage(){return void 0!==this.documentId}}class ph{getData(){return this.data}get isDraft(){return this.data.id===ph.DOCUMENT_DRAFT_ID}constructor(e){var t;this._pages=[],this.data=e;for(let e=0;e<(null===(t=this.data.pages)||void 0===t?void 0:t.length);e++)this.syncPage(e)}syncPage(e){this._pages[e]=new nh(this,this.data.pages[e])}get pages(){return this._pages}splicePage(e,t,...n){return this.data.pages.splice(e,t,...n),this._pages.splice(e,t,...n.map((e=>new nh(this,e))))}sdk(){return Jh.instance}get pageCount(){return this.pages.length}pageAtIndex(e){return this.pages[e]}movePage(e,t){return hh(this,void 0,void 0,(function*(){const n=this.splicePage(e,1);if(1!==n.length)throw new Error("Unable to move page: It does not seem to exist.");this.splicePage(t,0,n[0].getData()),yield this.updateStorageDocument()}))}static loadFromStorage(e){return hh(this,void 0,void 0,(function*(){const t=yield Jh.instance.storage.getSBDocumentData(e);if(void 0===t)throw new ih("Document not found in database.");return new ph(t)}))}static create(e){return hh(this,void 0,void 0,(function*(){const t=Jh.instance;let n;if(e.loadFromStorage())n=yield ph.loadFromStorage(e.documentId);else{const i=yield t.storage.getSBDocumentData(ph.DOCUMENT_DRAFT_ID),r=void 0!==i;if(e.cleanSession&&r){for(const e of i.pages)yield t.storage.deleteImages(e);ph._internal_updateProperty(i,"pages",[])}const o=r?i:new dh({id:ph.DOCUMENT_DRAFT_ID,creationTimestamp:Date.now(),pages:[],documentImageSizeLimit:e.documentImageSizeLimit});n=new ph(o)}return n.data.filters=e.filters,yield n.updateStorageDocument(),n}))}updateStorageDocument(){return hh(this,void 0,void 0,(function*(){return yield this.sdk().storage.insertSBDocument(this)}))}delete(){return hh(this,void 0,void 0,(function*(){yield this.sdk().storage.deleteSBDocument(this);for(const e of this.pages)yield this.sdk().storage.deleteImages(e)}))}addPage(e,t,n,i){return hh(this,void 0,void 0,(function*(){void 0===i&&(i=this.pages.length);const r=e.result.detectionResult,o=new mh({id:Math.round(1e6*Math.random()),polygon:r.pointsNormalized,documentDetectionStatus:r.status,originalImageId:-1,source:n,documentQuality:t,filters:this.data.filters}),a=yield this.sdk().storage.insertSBPageImage(e.originalImage);ph._internal_updateProperty(o,"originalImageId",a),this.splicePage(i,0,o),yield this.updateStorageDocument()}))}deleteFromPosition(e){return hh(this,void 0,void 0,(function*(){const t=this.splicePage(e,1);yield this.sdk().storage.deleteImages(t[0]),yield this.updateStorageDocument()}))}deletePage(e){return hh(this,void 0,void 0,(function*(){const t=this.pages.indexOf(e);if(-1===t)throw new Error("Page not found in document.");yield this.deleteFromPosition(t)}))}deleteAllPages(){return hh(this,void 0,void 0,(function*(){for(;this.pages.length>0;)yield this.deleteFromPosition(0)}))}cropAndRotateAtIndex(e,t,n){return hh(this,void 0,void 0,(function*(){const i=this.pageAtIndex(e);yield this.cropAndRotatePage(i,t,n)}))}cropAndRotatePage(e,t,n){return hh(this,void 0,void 0,(function*(){const i=this.data.pages[this.pages.indexOf(e)];4===(null==t?void 0:t.length)&&ph._internal_updateProperty(i,"polygon",t),null!=n&&(i.rotations+=n),yield e.invalidateImage(),yield this.updateStorageDocument()}))}updateDataProperty(e,t){ph._internal_updateProperty(this.data,e,t)}static _internal_updateProperty(e,t,n){e[t]=n}deleteId(){delete this.data.id}convertToFinalVersion(){return hh(this,void 0,void 0,(function*(){if(this.isDraft){this.deleteId();const e=yield this.updateStorageDocument();ph._internal_updateProperty(this.data,"id",e),yield this.sdk().storage.deleteSBDocument(ph.DOCUMENT_DRAFT_ID)}return this}))}insertRenderedBuffer(e,t){return hh(this,void 0,void 0,(function*(){const n=yield this.sdk().storage.insertBuffer(e);return ph._internal_updateProperty(this.data,t,n),e}))}createPdf(e){return hh(this,void 0,void 0,(function*(){const t=yield this.sdk().beginPdf(e);yield t.addPages(this,e.runOcr);const n=yield t.complete();return yield this.saveRenderedPdf(n),n}))}createTiff(e={},t={}){return hh(this,void 0,void 0,(function*(){const n=yield this.sdk().beginTiff(e);yield n.addPages(this,t);const i=yield n.complete();return yield this.saveRenderedTiff(i),i}))}loadPdf(){return hh(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.pdfId)}))}loadTiff(){return hh(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.tiffId)}))}loadBuffer(e){return hh(this,void 0,void 0,(function*(){return yield this.sdk().storage.getBuffer(e)}))}saveRenderedPdf(e){return hh(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"pdfId")}))}saveRenderedTiff(e){return hh(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"tiffId")}))}deletePdf(){return hh(this,void 0,void 0,(function*(){return yield this.sdk().storage.deleteImageById(this.data.pdfId)}))}deleteTiff(){return hh(this,void 0,void 0,(function*(){return yield this.sdk().storage.deleteImageById(this.data.tiffId)}))}}ph.DOCUMENT_DRAFT_ID=-1;var gh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function vh(e){var t;Object(T.useMemo)((()=>{_.b.setPalette(e.configuration.palette),_.b.setLocalization(e.configuration.localization)}),[e.configuration]);const n=Fc(),[i,r]=Object(T.useState)(null);Object(T.useEffect)((()=>{const t=new fh({config:e.configuration,documentId:e.documentId});ph.create(t).then((t=>{var n;t instanceof ph?r(t):null===(n=e.onError)||void 0===n||n.call(e,t)}))}),[]);const[o,a]=T.default.useState({screen:"camera",insertMode:{name:"insert back"}}),s="acknowledgment"===o.screen?o:null;return Object(T.useEffect)((()=>{const t=e.configuration.screens.camera.timeouts.autoCancelTimeout;if(0!==t){const n=setTimeout(e.onClose,t);return()=>clearTimeout(n)}}),[]),T.default.createElement(T.default.Fragment,null,T.default.createElement(M,null),T.default.createElement(al,null,T.default.createElement(gl,{visible:"acknowledgment"===o.screen,configuration:e.configuration,sdk:e.sdk,croppedDetectionResult:null==s?void 0:s.croppedDetectionResult,onAccept:(t,r)=>{if(!s)throw new Error("Internal error: Invalid routing state");let o;const c=[],u=e.configuration.outputSettings.pagesScanLimit;if("insert back"===s.insertMode.name){const e=i.addPage(t.value,r,t.source);c.push(e),o=u>0&&i.pages.length+1===u?{screen:"review",position:i.pages.length}:{screen:"camera",insertMode:{name:"insert back"}}}else{const e=s.insertMode.position,n=i.addPage(t.value,r,t.source,e);c.push(n),o={screen:"review",position:e},"replace"===s.insertMode.name&&c.push((()=>gh(this,void 0,void 0,(function*(){yield i.deleteFromPosition(e),yield n})))())}Promise.all(c).then((()=>{n.current&&a((e=>"acknowledgment"===e.screen?o:e))}))},onReject:()=>{var e;return a({screen:"camera",insertMode:null!==(e=null==s?void 0:s.insertMode)&&void 0!==e?e:{name:"insert back"}})},onError:e.onError}),T.default.createElement(ol,{root:e.root,visible:["camera","acknowledgment"].includes(o.screen),scanningPaused:"camera"!==o.screen||null===i,configuration:e.configuration,onClose:()=>gh(this,void 0,void 0,(function*(){(null==i?void 0:i.isDraft)&&(yield i.delete()),e.onClose()})),onImageCaptured:e=>{if("camera"!==o.screen)throw new Error("Internal error: Invalid routing state");a({screen:"acknowledgment",croppedDetectionResult:e,insertMode:o.insertMode})},onReviewButtonClick:()=>a({screen:"review",position:Math.max(0,i.pageCount-1)}),sdk:e.sdk,pages:null!==(t=null==i?void 0:i.pages)&&void 0!==t?t:[],scanLimitReached:(()=>{var t;return!(e.configuration.outputSettings.pagesScanLimit<=0)&&(("camera"!==o.screen||"replace"!==o.insertMode.name)&&(null===(t=null==i?void 0:i.pages)||void 0===t?void 0:t.length)>=e.configuration.outputSettings.pagesScanLimit)})(),onError:e.onError}),T.default.createElement(gd,{document:i,currentPosition:"review"===o.screen?o.position:null,visible:"review"===o.screen,configuration:e.configuration,onClose:()=>a({screen:"camera",insertMode:{name:"insert back"}}),onSubmit:()=>gh(this,void 0,void 0,(function*(){const t=yield i.convertToFinalVersion(),n=new Uc(t);e.onSubmit(n)})),onGoToPage:e=>{a({screen:"review",position:e})},onRetakeImage:e=>a({screen:"camera",insertMode:{name:"replace",position:e}}),onInsertImage:e=>a({screen:"camera",insertMode:{name:"insert at",position:e}}),onZoomButtonClick:e=>a({screen:"zoom",position:e}),onCropButtonClick:e=>a({screen:"crop",position:e})}),T.default.createElement(xm,{visible:"zoom"===o.screen,page:"zoom"===o.screen?i.pageAtIndex(o.position):null,config:e.configuration.screens.review.zoomOverlay,onCloseButtonClick:()=>a({screen:"review",position:"zoom"===o.screen?o.position:0})}),T.default.createElement(eh,{sdk:e.sdk,page:"crop"===o.screen?i.pageAtIndex(o.position):null,config:e.configuration,onCloseButtonClick:()=>a({screen:"review",position:"crop"===o.screen?o.position:0}),onApplyCrop:(e,t)=>gh(this,void 0,void 0,(function*(){if("crop"!==o.screen)throw new Error("Internal error: Invalid routing state");yield i.cropAndRotateAtIndex(o.position,e,t),a({screen:"review",position:o.position})}))})))}var yh=n(78);class Ch extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new d.MrzScannerConfiguration,this.onMrzDetected=function(e){},this.finder.aspectRatio=new d.AspectRatio({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(e){var t;const n=new Ch;return this.mapValues(e,n,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(n,e),this.mapVideoConstraints(e,n),n.recognizerConfiguration=new d.MrzScannerConfiguration(null!==(t=e.recognizerConfiguration)&&void 0!==t?t:{}),n}}var bh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};ue.a;ue.b;class Ah extends Rs.b{constructor(e){super(e),this.shouldComputeSize=!0,this.updateDimensionsCallback=this.updateDimensions.bind(this)}get configuration(){return this._configuration||(this._configuration=Ch.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e){return bh(this,void 0,void 0,(function*(){const t=_s.a.findContainerOrThrow(e);return new Promise(((n,i)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(t),this.root.render(T.default.createElement(Ah,{root:this.root,container:t,configuration:e,onSuccess:n,onFailure:i}))}))}))}onSdkReady(){return bh(this,void 0,void 0,(function*(){this.handle=yield this.bridge.api.MrzScanner.create(this.configuration.recognizerConfiguration)}))}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return bh(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback)}))}componentWillUnmount(){var e;super.componentWillUnmount(),null===(e=this.handle)||void 0===e||e.destroy(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return bh(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}pauseDetection(){var e;super.pauseDetection(),null===(e=this.handle)||void 0===e||e.clearResult()}detect(){var e,t,n,i,r,o,a,s;return bh(this,void 0,void 0,(function*(){const c=this.shouldComputeSize;let u=!1;try{if(!this.enabled)return;if(this.paused)return;this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const a=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Ah.FRAME_RESOLUTION);if(!a||!this.handle)return;c&&this.forceUpdate();const s=yield null===(n=this.handle)||void 0===n?void 0:n.run(d.Image.fromImageData(a),"CONSUME_IMAGE");if(this.paused)return;if(!this.enabled)return;if(null===s)return void(null===(r=(i=this.props).onLicenseError)||void 0===r||r.call(i));this.camera.reusableImageBuffer=null==s?void 0:s.originalImage,s.result.success?(delete s.originalImage,u=!0,this.configuration.onMrzDetected(s.result)):this.configuration._onDetectionFailed&&(null===(o=this.configuration)||void 0===o||o._onDetectionFailed(s.originalImage))}catch(e){null===(s=(a=this.configuration).onError)||void 0===s||s.call(a,e)}finally{u?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}render(){return this.renderView(this.configuration)}}Ah.FRAME_RESOLUTION=1200,Ah.root=null;var Sh=Ah;function wh(e){var t,n,i;const r=[];if("TwoLineMRZFinderLayoutPreset"===e.config._type?(r.push(e.config.mrzTextLine1),r.push(e.config.mrzTextLine2)):"ThreeLineMRZFinderLayoutPreset"===e.config._type&&(r.push(e.config.mrzTextLine1),r.push(e.config.mrzTextLine2),r.push(e.config.mrzTextLine3)),!e.visible)return null;const o=null===(i=null===(n=null===(t=e.scanner)||void 0===t?void 0:t.current)||void 0===n?void 0:n.finder)||void 0===i?void 0:i.holeRect;if(!o)return null;const a=e.isTopBarGradient?o.y:o.y+e.top;return T.default.createElement("div",{style:{position:"absolute",top:a,left:o.x,width:o.width,height:o.height,justifyContent:"center",display:"flex",flexDirection:"column"}},r.map(((e,t)=>{let n=function(e,t,n="monospace",i=1,r=500){const o=document.createElement("canvas").getContext("2d");let a=i;for(;i<=r;){let c=Math.floor((i+r)/2);s=c,o.font=`${s}px ${n}`,o.measureText(e).width<=t?(a=c,i=c+1):r=c-1}var s;return a}(e,o.width-40,"Monospace");return n-=2,T.default.createElement(P.Box,{key:t,sx:{fontFamily:"Monospace",fontSize:n,fontWeight:"bold",textAlign:"center",letterSpacing:"0.1em"}},e)})))}function Eh(e,t){const n=new Ch;n.recognizerConfiguration=e.scannerConfiguration,n.userGuidance=e.finderViewUserGuidance,n.finder=e.viewFinder;const i=(new Ch).videoConstraints;return i.width.ideal=e.cameraConfiguration.idealPreviewResolution.width,i.height.ideal=e.cameraConfiguration.idealPreviewResolution.height,i.facingMode="FRONT"===e.cameraConfiguration.cameraModule?"user":"environment",n.videoConstraints=i,n.onMrzDetected=t,n}function Dh(e){if(!e.visible)return null;const t=Object(T.useMemo)((()=>"__sb_"+Math.random()),[]),n=Object(T.useRef)(),i=Object(T.useRef)(),r=e.config.cameraConfiguration,[o,a]=Object(T.useState)(void 0),[s,c]=Object(T.useState)(!0),u=Object(T.useRef)(null);Object(T.useEffect)((()=>{Jh.instance.createMrzScannerEngine(e.config.scannerConfiguration).then((t=>{i.current=t,e.onScannerReady(n);setTimeout((()=>{c(!1)}),3e3)}))}),[]);const l=Object(T.useContext)(Y),d=l.remainingVisibleBodyHeight;return T.default.createElement(T.default.Fragment,null,i&&T.default.createElement(P.Box,{id:t,sx:{width:"100%",height:d}},T.default.createElement(zs,{config:e.config.actionBar,scanner:n.current,capabilities:o,bottomPadding:16,torchEnabledInitially:r.flashEnabled,zoomSteps:r.zoomSteps,defaultZoomFactor:r.defaultZoomFactor,initialCameraModule:r.cameraModule}),T.default.createElement(Sh,{root:e.root,ref:n,configuration:Eh(e.config,(t=>{t.success&&null===u.current&&(u.current=t,e.onMrzDetected(t),setTimeout((()=>{u.current=null}),1500))})),onSuccess:()=>{Ws.setFromScanner(n,a)},onFailure:e.onCameraPermissionDenied,onLicenseError:e.onError}),T.default.createElement(bu,{config:e.config.topUserGuidance,style:{position:"absolute",width:"100%",top:l.height}}),T.default.createElement(wh,{visible:s,scanner:n,config:e.config.mrzExampleOverlay,isTopBarGradient:"GRADIENT"===e.config.topBar.mode,top:l.height})))}function xh(e){return T.default.createElement(tu,{isOpen:e.isOpen,onClose:e.onClose,backgroundColor:e.config.backgroundColor},T.default.createElement(P.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},T.default.createElement(N.a,{style:Object.assign({fontWeight:600,fontSize:16},q(1)),config:e.config.title}),T.default.createElement(P.Box,null,T.default.createElement(G,{onClick:e.onClose,foreground:new ne.g({color:e.config.title.color}),text:"",visible:!0,background:new ne.a({}),icon:T.default.createElement(L.a,{sx:{fontSize:22}}),buttonWidth:28,iconPosition:"right",debugName:"close-introduction"}))),T.default.createElement(eu,{source:e.config.image,fill:"transparent"}),T.default.createElement(N.a,{config:e.config.text,style:{fontSize:16,whiteSpace:"pre-wrap",paddingBottom:"10px",display:"block",overflowY:"scroll",maxWidth:"100%",wordWrap:"break-word",maxHeight:"250px"}}),T.default.createElement(P.Box,{sx:{paddingTop:"8px",borderTop:`1px solid ${_.b.getColorValue(e.config.dividerColor)}`}},T.default.createElement(G,Object.assign({},e.config.doneButton,{buttonWidth:"100%",styleOverrides:{justifyContent:"center",width:"100%",height:40},onClick:e.onClose}))))}function Bh(e){const t=_.b.getColorValue(e.color);return T.default.createElement("svg",{width:"74",height:"74",viewBox:"0 0 74 74",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("g",{filter:"url(#filter0_d_1905_44393)"},T.default.createElement("path",{d:"M54.5 29L33 50.5L22 39.5",stroke:t,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})),T.default.createElement("g",{filter:"url(#filter1_d_1905_44393)"},T.default.createElement("circle",{cx:"36",cy:"36",r:"32",stroke:t,strokeWidth:"4",shapeRendering:"crispEdges"})),T.default.createElement("defs",null,T.default.createElement("filter",{id:"filter0_d_1905_44393",x:"18",y:"25",width:"42.5",height:"31.5",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},T.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),T.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),T.default.createElement("feOffset",{dx:"1",dy:"1"}),T.default.createElement("feGaussianBlur",{stdDeviation:"1.5"}),T.default.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),T.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),T.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1905_44393"}),T.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1905_44393",result:"shape"})),T.default.createElement("filter",{id:"filter1_d_1905_44393",x:"0",y:"0",width:"74",height:"74",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},T.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),T.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),T.default.createElement("feOffset",{dx:"1",dy:"1"}),T.default.createElement("feGaussianBlur",{stdDeviation:"1.5"}),T.default.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),T.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),T.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1905_44393"}),T.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1905_44393",result:"shape"}))))}function Ih(e){const t=_.b.getColorValue(e.configuration.overlayBackgroundColor);return T.default.createElement(L.a,{open:e.visible},T.default.createElement(P.Fade,{tabIndex:-1,"data-sb-screen-acknowledgment":!0,in:e.visible,timeout:{enter:500,exit:500},onAnimationEnd:()=>{console.log("animation end")},addEndListener:(t,n)=>{t.addEventListener("transitionend",(()=>{setTimeout((()=>{e.transitionComplete()}),e.configuration.timeout)}),!1)},style:{backdropFilter:"blur(10px)",position:"absolute",width:"100vw",height:`calc(100 * ${R})`,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",transitionDelay:"0s",top:0}},T.default.createElement(P.Box,{style:{display:e.visible?"flex":"none",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:t,zIndex:1e3}},T.default.createElement(Bh,{color:e.configuration.iconColor}),T.default.createElement("div",{style:{height:"5px"}}),T.default.createElement(N.a,{config:e.configuration.message}))))}function Th(e){const[t,n]=Object(T.useState)(!1),[i,r]=Object(T.useState)(e.configuration.introScreen.showAutomatically),[o,a]=Object(T.useState)(null),[s,c]=Object(T.useState)(null),u=e.configuration;Object(T.useMemo)((()=>{_.b.setPalette(e.configuration.palette),_.b.setLocalization(e.configuration.localization)}),[e.configuration]);const l=u.viewFinder.aspectRatio,m=-1===l.width&&-1===l.height;if("NoLayoutPreset"!==u.mrzExampleOverlay._type&&m){const e=u.mrzExampleOverlay.adjustedFinderAspectRatio;u.viewFinder.aspectRatio=new d.AspectRatio({width:e,height:1})}return T.default.createElement(T.default.Fragment,null,T.default.createElement(M,null),T.default.createElement(al,null,T.default.createElement(P.Box,{sx:{height:`100 * ${R}`,width:"100vw",backgroundColor:_.b.getColorValue(e.configuration.backgroundColor)}},T.default.createElement(Q,Object.assign({cameraPermissionDenied:t,onBackPress:e.onClose},e.configuration.topBar,{rightItem:T.default.createElement("div",{style:{float:"right"}},T.default.createElement(G,Object.assign({icon:T.default.createElement(L.a,{sx:{fontSize:24,color:u.topBarOpenIntroScreenButton.color}})},e.configuration.topBarOpenIntroScreenButton,{text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{iconVisible:!0,useShadow:!1,color:"white"},onClick:()=>{r(!0)}})))}),T.default.createElement(Dh,{root:e.root,visible:!t,config:u,onError:e.onError,onCameraPermissionDenied:()=>{n(!0)},onMrzDetected:t=>{var n;null===(n=null==s?void 0:s.current)||void 0===n||n.pauseDetection();const i=new yh.a({rawMRZ:t.rawMRZ,mrzDocument:t.document});ae.INSTANCE.beep(e.configuration.sound),ce.INSTANCE.vibrate(e.configuration.vibration),a(i)},onScannerReady:e=>{c(e)}}),T.default.createElement(zc,{visible:t,onCloseClick:e.onClose,config:u.cameraPermission})),T.default.createElement(xh,{config:e.configuration.introScreen,isOpen:i,onClose:()=>{r(!1)}}),T.default.createElement(Ih,{visible:null!==o,configuration:e.configuration.successOverlay,transitionComplete:()=>{var t;e.onSubmit(o),a(null),null===(t=null==s?void 0:s.current)||void 0===t||t.dispose()}}))))}var Oh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class kh{constructor(){this.cancelFunctionPromise=new Promise((e=>{this.cancelFunctionPromiseResolve=e}))}invokeCancelFunction(){return Oh(this,void 0,void 0,(function*(){yield(yield this.cancelFunctionPromise)()}))}setCancelFunction(e){this.cancelFunctionPromiseResolve(e)}}var Ph=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Lh{static abortScanner(){return Ph(this,void 0,void 0,(function*(){if(!this.scannerAbortHandler)throw new Error("No scanner is currently running.");yield this.scannerAbortHandler.invokeCancelFunction()}))}static createDocumentScanner(e,t){return Ph(this,void 0,void 0,(function*(){return this.createScanner(vh,{documentId:t,sdk:Jh.instance},e)}))}static createBarcodeScanner(e){return Ph(this,void 0,void 0,(function*(){return this.createScanner(Hc,{},e,(()=>ae.INSTANCE.initialize(e.sound)))}))}static createMrzScanner(e){return Ph(this,void 0,void 0,(function*(){return this.createScanner(Th,{},e,(()=>ae.INSTANCE.initialize(e.sound)))}))}static createScanner(e,t,n,i=(()=>Promise.resolve())){return Ph(this,void 0,void 0,(function*(){return this.scannerAbortHandler=new kh,yield i(),new Promise(((i,r)=>{const{root:o,unmount:a}=this.createRoot(),s=e=>Ph(this,void 0,void 0,(function*(){yield a(),r(e),this.scannerAbortHandler=null})),c=e=>Ph(this,void 0,void 0,(function*(){yield a(),i(e),this.scannerAbortHandler=null}));this.scannerAbortHandler.setCancelFunction((()=>c(null))),o.render(T.default.createElement(e,Object.assign({root:o,configuration:n,onClose:()=>c(null),onSubmit:c,onError:s},t))),this.checkLicense(s)}))}))}static checkLicense(e){(()=>{Ph(this,void 0,void 0,(function*(){try{const t=yield Jh.instance.getLicenseInfo();t.isValid()||e(new x(t))}catch(t){e(t)}}))})()}static createRoot(){const e=Lh.createContainer("scanbot-rtu-ui-controller"),t=Object(O.createRoot)(e);return{unmount:()=>Ph(this,void 0,void 0,(function*(){return new Promise((n=>{window.setTimeout((()=>{t.unmount(),document.body.removeChild(e),n()}),0)}))})),root:t}}static createContainer(e){const t=document.createElement("div");return t.id=e,t.style.position="fixed",t.style.width="100%",t.style.height=`calc(100 * ${R})`,t.style.zIndex="1000",t.style.top="0",t.style.left="0",t.style.backgroundColor="rgba(0, 0, 0, 0.5)",document.body.appendChild(t),t}}Lh.SBDocument=ph,Lh.Config=k,Lh.scannerAbortHandler=null;var _h=Lh,Rh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};ue.a;ue.b;class Mh extends Rs.b{constructor(e){super(e),this.shouldComputeSize=!0,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(e){return Rh(this,void 0,void 0,(function*(){const t=_s.a.findContainerOrThrow(e);return new Promise(((n,i)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(t),this.root.render(T.default.createElement(Mh,{root:this.root,container:t,configuration:e,onSuccess:n,onFailure:i}))}))}))}onSdkReady(){return Rh(this,void 0,void 0,(function*(){if(this.configuration instanceof D)this.scanner=yield this.bridge.api.VinScanner.create(this.configuration.detectionConfiguration);else{if(!(this.configuration instanceof E))throw new Error(`Configuration type not supported: ${this.configuration}. \n Must be either VinScannerViewConfiguration or TextPatternScannerViewConfiguration`);this.scanner=yield this.bridge.api.TextPatternScanner.create(this.configuration.ocrConfiguration)}}))}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Rh(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback)}))}componentWillUnmount(){var e;super.componentWillUnmount(),null===(e=this.scanner)||void 0===e||e.destroy(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return Rh(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}pauseDetection(){var e;super.pauseDetection(),null===(e=this.scanner)||void 0===e||e.cleanRecognitionQueue()}detect(){var e,t,n,i,r;return Rh(this,void 0,void 0,(function*(){const o=this.shouldComputeSize;let a=!1;try{if(!this.enabled)return;if(this.paused)return;this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const i=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Mh.FRAME_RESOLUTION);if(!i)return;o&&this.forceUpdate();const r=yield null===(n=this.scanner)||void 0===n?void 0:n.run(d.Image.fromImageData(i));if(!this.enabled)return;if(null===r)return;if(r){if(a=!0,this.configuration instanceof D){const e=r;""===e.result.textResult.rawText&&""===e.result.barcodeResult.extractedVIN||this.configuration.onVinDetected(e)}else if(this.configuration instanceof E){const e=r;this.configuration.onTextDetected(e)}this.camera.reusableImageBuffer=r.originalImage}}catch(e){null===(r=(i=this.configuration).onError)||void 0===r||r.call(i,e)}finally{a?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){return this.renderView(this.configuration)}}Mh.FRAME_RESOLUTION=1200,Mh.root=null;var Fh=Mh,Nh=n(60),Vh=n(41);var Wh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class jh{constructor(){this.tokenCounter=0,this.taskMap=new Map,this.worker=function(){const e=n(91).default.replace("data:application/javascript;charset=utf-8;base64,",""),t=atob(e),i=new Blob([t],{type:"application/javascript"}),r=URL.createObjectURL(i);return new Worker(r)}(),this.worker.onmessage=e=>{const t=e.data,n=t.token;if(this.taskMap.has(n)){(0,this.taskMap.get(n).resolve)(t.data),this.taskMap.delete(n)}else console.error("Unknown token:",n)},this.worker.onerror=e=>{const t=JSON.parse(e.message.replace("Uncaught Error: ","")),n=t.token;if(console.log("Error processed:",t),this.taskMap.has(n)){(0,this.taskMap.get(n).reject)(t),this.taskMap.delete(n)}else console.error("Unknown token:",n)}}generateUniqueToken(){return this.tokenCounter++,"token_"+this.tokenCounter+"_"+Math.random().toString(36).substr(2,9)}query(e){return Wh(this,void 0,void 0,(function*(){const t=this.generateUniqueToken();return this.worker.postMessage({token:t,query:e}),new Promise(((e,n)=>{this.taskMap.set(t,{resolve:e,reject:n})}))}))}destroy(){this.worker.terminate()}}var zh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Hh{persist(){return zh(this,void 0,void 0,(function*(){const e=yield navigator.storage.persist();return e?console.log("Storage will not be cleared except by explicit user action"):console.log("Storage may be cleared by the UA under storage pressure."),e}))}estimate(){return zh(this,void 0,void 0,(function*(){yield navigator.storage.estimate();return!0}))}}var Uh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Zh{constructor(){this.utils=new Hh,this.db=new jh}clear(){return Uh(this,void 0,void 0,(function*(){yield this.db.query({type:"clear"})}))}delete(){return Uh(this,void 0,void 0,(function*(){yield this.db.query({type:"delete"})}))}getCroppedDetectionResults(e=!0){return Uh(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getCroppedDetectionResults"});if(!e)return t;const n=t.map((e=>e.id)),i=yield this.getCroppedDetectionResultImages(n);for(const e of t)this.mapImages(e,i);return t}))}getCroppedDetectionResult(e){return Uh(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getCroppedDetectionResult",data:e}),n=yield this.getCroppedDetectionResultImage(e);return this.mapImages(t,n),t}))}mapImages(e,t){const n=n=>{var i;const r=null===(i=t.find((t=>t.documentId===e.id&&t.type===n)))||void 0===i?void 0:i.data;return r?d.Image.fromWrappedImage(r):null};e.originalImage=n("original"),e.result&&(e.result.croppedImage=n("cropped"))}getCroppedDetectionResultImages(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:e})}))}getCroppedDetectionResultImage(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:[e]})}))}storeCroppedDetectionResult(e){var t;return Uh(this,void 0,void 0,(function*(){const n=JSON.parse(JSON.stringify(e));n.result.croppedImage=null,n.originalImage=null;const i=yield this.db.query({type:"storeCroppedDetectionResult",data:n}),r=[{documentId:i,data:e.originalImage.__image_data,type:"original"}];return(null===(t=e.result)||void 0===t?void 0:t.croppedImage)&&r.push({documentId:i,data:e.result.croppedImage.__image_data,type:"cropped"}),yield this.db.query({type:"storeImages",data:r}),i}))}getSBDocumentIds(){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocumentIds"})}))}getSBDocumentData(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocument",data:e})}))}insertSBDocument(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"insertSBDocument",data:e.getData()})}))}deleteSBDocument(e){return Uh(this,void 0,void 0,(function*(){const t="number"==typeof e?e:e.getData().id;return yield this.db.query({type:"deleteSBDocument",data:t})}))}insertSBPageImage(e){return Uh(this,void 0,void 0,(function*(){const t={data:e.__image_data};return yield this.db.query({type:"insertSBPageImage",data:t})}))}getSBPageImage(e){return Uh(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getSBPageImage",data:e});return d.Image.fromWrappedImage(t.data)}))}insertBuffer(e){return Uh(this,void 0,void 0,(function*(){const t={data:e};return yield this.db.query({type:"insertImageBuffer",data:t})}))}getBuffer(e){return Uh(this,void 0,void 0,(function*(){return(yield this.db.query({type:"getImageBuffer",data:e})).data}))}deleteImageById(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"deleteSBPageImages",data:[e]})}))}deleteImages(e){return Uh(this,void 0,void 0,(function*(){const t=e instanceof nh?e.getData():e,n=[t.originalImageId];t.documentImageId&&n.push(t.documentImageId),yield this.db.query({type:"deleteSBPageImages",data:n})}))}destroy(){this.db.destroy()}}class Gh extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.scannerConfiguration=new d.CheckScannerConfiguration,this.onCheckDetected=function(e){},this.finder.aspectRatio=new d.AspectRatio({width:1.5,height:1}),this.userGuidance.title.text="Please hold the device over a check to start scanning"}static fromJson(e){var t;const n=new Gh;return this.mapValues(e,n,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(n,e),this.mapVideoConstraints(e,n),n.scannerConfiguration=new d.CheckScannerConfiguration(null!==(t=e.scannerConfiguration)&&void 0!==t?t:{}),n}}var Yh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};Rs.a;class Qh extends Rs.b{constructor(e){super(e),this.configuration=e.configuration}static create(e,t){return Yh(this,void 0,void 0,(function*(){const n=_s.a.findContainerOrThrow(t);return t=Gh.fromJson(t),new Promise(((i,r)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(n),this.root.render(T.default.createElement(Qh,{root:this.root,container:n,configuration:t,onSuccess:i,onFailure:r,sdk:e}))}))}))}onSdkReady(){return Yh(this,void 0,void 0,(function*(){this.handle=yield this.bridge.api.CheckScanner.create(this.props.configuration.scannerConfiguration)}))}componentWillUnmount(){var e;super.componentWillUnmount(),null===(e=this.handle)||void 0===e||e.destroy()}get enabled(){return!this.disposed&&!this.paused}detect(){var e,t,n,i,r,o,a,s,c;return Yh(this,void 0,void 0,(function*(){if(!this.enabled)return;let u=!1;try{const s=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(Qh.FRAME_RESOLUTION);if(!s||!this.handle)return;const c=yield null===(t=this.handle)||void 0===t?void 0:t.run(d.Image.fromImageData(s),"CONSUME_IMAGE");if(null===c)return void(null===(i=(n=this.props).onLicenseError)||void 0===i||i.call(n));if(!this.enabled)return;this.camera.reusableImageBuffer=null==c?void 0:c.originalImage;const l=null===(r=null==c?void 0:c.result)||void 0===r?void 0:r.status;"SUCCESS"!==l&&"INCOMPLETE_VALIDATION"!==l||(u=!0,null===(a=(o=this.props.configuration).onCheckDetected)||void 0===a||a.call(o,c.result))}catch(e){null===(c=(s=this.configuration).onError)||void 0===c||c.call(s,e)}finally{u?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}render(){return this.renderView(this.configuration)}}Qh.FRAME_RESOLUTION=1200,Qh.root=null;var qh=Qh,Xh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Kh{constructor(){this.storage=new Zh}static get UI(){if(!i.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return Kh._ui2}static initialize(e){var t;return Xh(this,void 0,void 0,(function*(){const n=new Kh,i=e.enginePath||Kh.defaultEnginePath,r=!!e.allowThreads,o=null!==(t=e.requestSuffix)&&void 0!==t?t:`?${n.version}`;if(!i)throw new Error("To initialize the ScanbotSDK, please specify the enginePath option. This option should specify the location of the accompanying WASM and JS files in the bundle folder. It can either point to your server or a CDN. Please note that this option has been renamed from engine -> enginePath recently. Please see our documentation for more details on how to set up the enginePath correctly.");const a=[e.licenseKey,i,window.location.hostname,{captureConsole:!1,allowThreads:r,requestSuffix:o}];return n.bridge=new u(i,{allowSimd:!0,allowThreads:r,requestSuffix:o},a),n.bridge.awaitInitialized().then((()=>{var t;null===(t=e.onComplete)||void 0===t||t.call(e)})).catch((t=>{var n;null===(n=e.onComplete)||void 0===n||n.call(e,t)})),Kh.instance=n,window.scanbotSdk=n,I.a.initialize(e.verboseLogging),e.allowThreads&&!Object(l.a)()&&(I.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&I.a.debugWarn("The site is not cross-origin isolated. This prevents multithreading in the ScanbotSDK. To enable multithreading, you need to set the 'Cross-Origin-Opener-Policy' and 'Cross-Origin-Embedder-Policy' http headers. See our documentation for details.")),this.cameras.initialize(null==e?void 0:e.bestCameraDetectionStrategy),n}))}createDocumentScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return t=yield Ju.create(e,this),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createMrzScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return t=yield Sh.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createBarcodeScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return t=yield Ns.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createCheckScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return t=yield qh.create(this,e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}openCroppingView(e){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield Jm.create(e,this)}))}createTextPatternScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return e=E.fromJson(e),t=yield Fh.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createVinScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return e=D.fromJson(e),t=yield Fh.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createDocumentQualityAnalyzer(e){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.api.DocumentQualityAnalyzer.create(e)}))}createDocumentDataExtractor(e){return Xh(this,void 0,void 0,(function*(){let t;try{const i=n(92).default;return t=yield i.create(this,e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}toDataUrl(e){return Xh(this,void 0,void 0,(function*(){return B.throwIfMissingBuffer(e),yield b.toDataUrl(e)}))}detectDocument(e,t={},n="COPY_IMAGE"){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(e);const i=new d.DocumentScannerConfiguration({parameters:t}),r=yield this.bridge.api.DocumentScanner.create(i);return(yield r.scan(e,n)).result}))}detectAndCropDocument(e,t="COPY_IMAGE"){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(e);const n=new d.DocumentScannerConfiguration,i=yield this.bridge.api.DocumentScanner.create(n),r=yield i.scan(e,t);return yield i.destroy(),r}))}detectBarcodes(e,t={},n="COPY_IMAGE"){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(e),"string"==typeof e&&(e=d.Image.fromImageData(yield b.loadFromUrl(e)));const i=Object.assign({},t),r=yield this.bridge.api.BarcodeScanner.create(i);return yield r.run(e,n)}))}parseBarcodeDocument(e,t){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck();const n=yield this.bridge.api.BarcodeDocumentParser.create(e);return yield n.parse(t)}))}createMrzScannerEngine(e){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),e||(e=new d.MrzScannerConfiguration({frameAccumulationConfiguration:{maximumNumberOfAccumulatedFrames:0}})),yield this.bridge.api.MrzScanner.create(e)}))}createOcrEngine(){return Xh(this,void 0,void 0,(function*(){return yield this.bridge.api.OcrEngine.create()}))}createImageProcessor(){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.api.ImageProcessor.create()}))}getLicenseInfo(){return Xh(this,void 0,void 0,(function*(){return new m(yield this.bridge.copyArgs.getLicenseInfo())}))}beginPdf(e){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new f(this,yield this.bridge.copyArgs.beginPdf(e))}))}beginTiff(e={}){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new g(this,yield this.bridge.copyArgs.beginTiff(e))}))}imageToJpeg(e,t="COPY_IMAGE"){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(t).encodeJpeg(e)}))}get version(){return i.VERSION}get utils(){return this._utils||(this._utils=new A),this._utils}getBridge(e){return"CONSUME_IMAGE"===e?this.bridge.transferArgs:this.bridge.copyArgs}licenseCheck(){return Xh(this,void 0,void 0,(function*(){const e=yield this.getLicenseInfo();if(!e.isValid())throw console.error(`LicenseError: ${e.status}`),new x(e)}))}}Kh.defaultEnginePath="",Kh._ui2=i.BUILD_WITH_UI?_h:void 0,Kh.cameras=Vh.a.INSTANCE,Kh.Config=d,Kh._stats=Nh.a.INSTANCE;var Jh=t.a=Kh},function(e,t,n){"use strict";var i=n(88),r=n.n(i)()((function(e){return e[1]}));r.push([e.i,"\n.scanbot-shutter-fade-in {\n opacity: 1;\n}\n\n.scanbot-shutter-fade-out {\n opacity: 0;\n}\n\n.scanbot-shutter-rotate {\n animation: scanbot-shutter-rotating linear infinite;\n}\n\n.scanbot-shutter-pulse-fast {\n animation: scanbot-shutter-pulsing 1s ease-in-out infinite;\n}\n\n.scanbot-shutter-button {\n position: relative;\n width: 64px;\n height: 64px;\n left: 50%;\n bottom: 18px;\n transform: translate(-50%, -100%);\n z-index: 1000;\n}\n\n.scanbot-shutter-button-part {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.5s ease-in-out;\n}\n\n@keyframes scanbot-shutter-rotating {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes scanbot-shutter-pulsing {\n 0% {\n opacity: 0.25;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 0.25;\n }\n}\n",""]),t.a=r},function(e,t){var n,i,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c,u=[],l=!1,d=-1;function m(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!l){var e=s(m);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new f(e,t)),1!==u.length||l||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t){e.exports=function(e,t,n,i){var r=n?n.call(i,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<o.length;c++){var u=o[c];if(!s(u))return!1;var l=e[u],d=t[u];if(!1===(r=n?n.call(i,l,d,u):void 0)||void 0===r&&l!==d)return!1}return!0}},function(e,t,n){"use strict";t.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(e,t,n){"use strict";var i,r=function(){return"undefined"==typeof i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var e={};return function(t){if("undefined"==typeof e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},i=[],r=0;r<e.length;r++){var o=e[r],c=t.base?o[0]+t.base:o[0],u=n[c]||0,l="".concat(c," ").concat(u);n[c]=u+1;var d=s(l),m={css:o[1],media:o[2],sourceMap:o[3]};-1!==d?(a[d].references++,a[d].updater(m)):a.push({identifier:l,updater:g(m,t),references:1}),i.push(l)}return i}function u(e){var t=document.createElement("style"),i=e.attributes||{};if("undefined"==typeof i.nonce){var r=n.nc;r&&(i.nonce=r)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var l,d=(l=[],function(e,t){return l[e]=t,l.filter(Boolean).join("\n")});function m(e,t,n,i){var r=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=d(t,r);else{var o=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function h(e,t,n){var i=n.css,r=n.media,o=n.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var f=null,p=0;function g(e,t){var n,i,r;if(t.singleton){var o=p++;n=f||(f=u(t)),i=m.bind(null,n,o,!1),r=m.bind(null,n,o,!0)}else n=u(t),i=h.bind(null,n,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<n.length;i++){var r=s(n[i]);a[r].references--}for(var o=c(e,t),u=0;u<n.length;u++){var l=s(n[u]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}n=o}}}},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(i)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(r[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);i&&r[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},function(e,t,n){"use strict";function i(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,"a",(function(){return o}));var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=i((function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},function(e,t,n){"use strict";n.r(t),n.d(t,"ScanbotSDK",(function(){return i}));const i=n(82).a},function(e,t,n){"use strict";n.r(t),t.default="data:application/javascript;charset=utf-8;base64,InVzZSBzdHJpY3QiOwoKY29uc3QgREJfTkFNRSA9ICJTQlNES0Jhc2UiOwoKY29uc3QgU1RPUkVTID0gewogICAgQ1JPUFBFRF9ERVRFQ1RJT05fUkVTVUxUUzogImNyb3BwZWREZXRlY3Rpb25SZXN1bHRzIiwKICAgIFNCX0RPQ1VNRU5UUzogIlNCRG9jdW1lbnRzIiwKICAgIElNQUdFUzogImltYWdlcyIKCiAgICAvKioKICAgICAqIEBwYXJhbSB7c3RyaW5nfSB0b2tlbgogICAgICogQHBhcmFtIHt7IHR5cGU6IHN0cmluZywgZGF0YTogYW55IH19IHF1ZXJ5CiAgICAgKiBAcGFyYW0ge0V2ZW50fSBldmVudAogICAgICogKi8KCn07c2VsZi5hZGRFdmVudExpc3RlbmVyKCd1bmhhbmRsZWRyZWplY3Rpb24nLCBmdW5jdGlvbiAoZXZlbnQpIHsKICAgIC8vIFRoZSB3YXkgdG8gcHJvcGVybHkgdHJpZ2dlciB3b3JrZXIgZXJyb3JzIGlzIHRvIGNhdGNoIHRoZSB1bmhhbmRsZWQgcmVqZWN0aW9uIGZpcnN0LCB0aGVuIHRocm93OgogICAgLy8gaHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMvMjgwMDE3MjIvaG93LXRvLWNhdGNoLXVuY2F1Z2h0LWV4Y2VwdGlvbi1pbi1wcm9taXNlCiAgICAvLyBUaGlzIGV2ZW50IG9iamVjdCBoYXMgdHdvIHNwZWNpYWwgcHJvcGVydGllczoKICAgIC8vIGV2ZW50LnByb21pc2UgLSB0aGUgcHJvbWlzZSB0aGF0IGdlbmVyYXRlZCB0aGUgZXJyb3IKICAgIC8vIGV2ZW50LnJlYXNvbiAgLSB0aGUgdW5oYW5kbGVkIGVycm9yIG9iamVjdAogICAgdGhyb3cgZXZlbnQucmVhc29uOwp9KTsKCmZ1bmN0aW9uIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCBldmVudCkgewogICAgZXZlbnQub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IGV2ZW50LnRhcmdldC5yZXN1bHQgfSk7CiAgICB9OwogICAgZXZlbnQub25lcnJvciA9IGV2ZW50ID0+IHsKICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksICJFcnJvciBpbiBJbmRleGVkREIgcmVxdWVzdDogIiArIGV2ZW50LnRhcmdldC5lcnJvcik7CiAgICB9Owp9CgovKioKICogQHJldHVybnMge1Byb21pc2U8SURCRGF0YWJhc2U+fQogKi8KZnVuY3Rpb24gb3BlbkRCKCkgewogICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKCiAgICAgICAgLyoqIE5CISBVcGRhdGUgdmVyc2lvbiB3aGVuIERCIG1vZGVsIGNoYW5nZXMgKi8KICAgICAgICBjb25zdCBEQl9WRVJTSU9OID0gNTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gaW5kZXhlZERCLm9wZW4oREJfTkFNRSwgREJfVkVSU0lPTik7CgogICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgICAgICByZXNvbHZlKGV2ZW50LnRhcmdldFsicmVzdWx0Il0pOwogICAgICAgIH07CiAgICAgICAgcmVxdWVzdC5vbmVycm9yID0gZXZlbnQgPT4gewogICAgICAgICAgICBjb25zdCBjb2RlID0gZXZlbnQudGFyZ2V0ID8gZXZlbnQudGFyZ2V0WyJlcnJvckNvZGUiXSA6ICJVbmtub3duIGVycm9yIGNvZGUiOwogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIkVycm9yIG9wZW5pbmcgZGF0YWJhc2U6ICIgKyBjb2RlKTsKICAgICAgICB9OwogICAgICAgIHJlcXVlc3Qub251cGdyYWRlbmVlZGVkID0gZXZlbnQgPT4gewogICAgICAgICAgICAvLyBUT0RPOiAnb251cGdyYWRlbmVlZGVkJyBpcyBvbmx5IGNhbGxlZCB3aGVuIEZJUlNUIG9wZW5pbmcgdGhlIGRhdGFiYXNlCiAgICAgICAgICAgIC8vICBBTkQgd2hlbiB0aGUgdmVyc2lvbiBudW1iZXIgaXMgaW5jcmVhc2VkLiBXaGF0IGVsc2UgbmVlZHMgdG8gYmUgZG9uZSBoZXJlPwogICAgICAgICAgICBjb25zdCBkYiA9IGV2ZW50LnRhcmdldCAvKiBhcyBJREJPcGVuREJSZXF1ZXN0Ki8ucmVzdWx0OwoKICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gU1RPUkVTKSB7CiAgICAgICAgICAgICAgICBjb25zdCBuYW1lID0gU1RPUkVTW2tleV07CiAgICAgICAgICAgICAgICAvLyBUT0RPIGNhbid0IGp1c3QgZGVsZXRlIGluIHByb2R1Y3Rpb24sIG5lZWQgdG8gbWlncmF0ZSBkYXRhCiAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgIGRiLmRlbGV0ZU9iamVjdFN0b3JlKG5hbWUpOwogICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHsKICAgICAgICAgICAgICAgICAgICAvLyBDYW4ndCBkZWxldGUgb2JqZWN0IHN0b3JlIHRoYXQgZG9lc24ndCBleGlzdAogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCJFcnJvciBkZWxldGluZyBvYmplY3Qgc3RvcmU6ICIsIG5hbWUpOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGRiLmNyZWF0ZU9iamVjdFN0b3JlKG5hbWUsIHsga2V5UGF0aDogImlkIiwgYXV0b0luY3JlbWVudDogdHJ1ZSB9KTsKICAgICAgICAgICAgfQogICAgICAgIH07CiAgICB9KTsKfQoKLyoqCiAqIEBwYXJhbSB7c3RyaW5nW119IHN0b3JlTmFtZXMKICogQHJldHVybnMge1Byb21pc2U8SURCVHJhbnNhY3Rpb24+fQogKi8KYXN5bmMgZnVuY3Rpb24gZ2V0VHJhbnNhY3Rpb24oc3RvcmVOYW1lcykgewogICAgY29uc3QgZGIgPSBhd2FpdCBvcGVuREIoKTsKICAgIC8vIFRPRE8gaXMgaXQgZXZlciBhY3R1YWxseSBuZWNlc3NhcnkgdG8gd2FpdCBmb3IgYSB0cmFuc2FjdGlvbidzICdvbmNvbXBsZXRlJyBldmVudD8KICAgIHJldHVybiBkYi50cmFuc2FjdGlvbihzdG9yZU5hbWVzLCAicmVhZHdyaXRlIik7Cn0KCi8qKgogKiBAcGFyYW0ge3N0cmluZ30gbmFtZQogKiBAcmV0dXJucyB7UHJvbWlzZTxJREJPYmplY3RTdG9yZT59CiAqLwphc3luYyBmdW5jdGlvbiBnZXRTdG9yZShuYW1lKSB7CiAgICBjb25zdCB0cmFuc2FjdGlvbiA9IGF3YWl0IGdldFRyYW5zYWN0aW9uKFtuYW1lXSk7CiAgICByZXR1cm4gdHJhbnNhY3Rpb24ub2JqZWN0U3RvcmUobmFtZSk7Cn0KCi8qKgogKiBAcmV0dXJucyB7UHJvbWlzZTxJREJPYmplY3RTdG9yZT59CiAqLwphc3luYyBmdW5jdGlvbiBnZXRDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0U3RvcmUoKSB7CiAgICByZXR1cm4gZ2V0U3RvcmUoU1RPUkVTLkNST1BQRURfREVURUNUSU9OX1JFU1VMVFMpOwp9CgovKioKICogQHJldHVybnMge1Byb21pc2U8SURCT2JqZWN0U3RvcmU+fQogKi8KYXN5bmMgZnVuY3Rpb24gZ2V0SW1hZ2VzU3RvcmUoKSB7CiAgICByZXR1cm4gZ2V0U3RvcmUoU1RPUkVTLklNQUdFUyk7Cn0KCmFzeW5jIGZ1bmN0aW9uIGNsZWFyKCkgewogICAgZm9yIChjb25zdCBrZXkgaW4gU1RPUkVTKSB7CiAgICAgICAgY29uc3QgbmFtZSA9IFNUT1JFU1trZXldOwogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUobmFtZSk7CiAgICAgICAgc3RvcmUuY2xlYXIoKTsKICAgIH0KfQoKYXN5bmMgZnVuY3Rpb24gZGVsZXRlREIoKSB7CiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4gewogICAgICAgIGNvbnN0IHJlcXVlc3QgPSBpbmRleGVkREIuZGVsZXRlRGF0YWJhc2UoREJfTkFNRSk7CiAgICAgICAgcmVxdWVzdC5vbnN1Y2Nlc3MgPSBldmVudCA9PiB7CiAgICAgICAgICAgIHJlc29sdmUoZXZlbnQpOwogICAgICAgIH07CiAgICAgICAgcmVxdWVzdC5vbmVycm9yID0gZXZlbnQgPT4gewogICAgICAgICAgICByZWplY3QoZXZlbnQpOwogICAgICAgIH07CiAgICB9KTsKfQoKLyoqCiAqIEBwYXJhbSB7c3RyaW5nfSB0b2tlbgogKiBAcGFyYW0ge3sgdHlwZTogc3RyaW5nLCBkYXRhOiBhbnkgfX0gcXVlcnkKICogQHBhcmFtIHtzdHJpbmc/fSBtZXNzYWdlCiAqLwpmdW5jdGlvbiB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksIG1lc3NhZ2UpIHsKICAgIGNvbnN0IHBheWxvYWQgPSB7IHRva2VuOiB0b2tlbiwgcXVlcnk6IHF1ZXJ5LCBtZXNzYWdlOiBtZXNzYWdlIH07CiAgICBjb25zb2xlLmxvZygiRXJyb3IgaW4gU0JJbmRleGVkREIgd29ya2VyOiAiLCBwYXlsb2FkKTsKICAgIHRocm93IG5ldyBFcnJvcihKU09OLnN0cmluZ2lmeShwYXlsb2FkKSk7Cn0KCi8qKgogKiBAcGFyYW0ge01lc3NhZ2VFdmVudH0gZXZlbnQKICogQHJldHVybnMge1Byb21pc2U8dm9pZD59CiAqLwpzZWxmLm9ubWVzc2FnZSA9IGFzeW5jIGV2ZW50ID0+IHsKCiAgICBjb25zdCB0b2tlbiA9IGV2ZW50LmRhdGEudG9rZW47CiAgICBjb25zdCBxdWVyeSA9IGV2ZW50LmRhdGEucXVlcnk7CgogICAgaWYgKHF1ZXJ5LnR5cGUgPT09ICdjbGVhcicpIHsKICAgICAgICBhd2FpdCBjbGVhcigpOwogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IHRydWUgfSk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdkZWxldGUnKSB7CiAgICAgICAgYXdhaXQgZGVsZXRlREIoKTsKICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdG9rZW46IHRva2VuLCBkYXRhOiB0cnVlIH0pOwogICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnc3RvcmVDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0JykgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdFN0b3JlKCk7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmFkZChxdWVyeS5kYXRhKTsKICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCBxdWVyeSwgcmVxdWVzdCk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdnZXRDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0cycpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldENyb3BwZWREZXRlY3Rpb25SZXN1bHRTdG9yZSgpOwogICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXRBbGwoKTsKICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCBxdWVyeSwgcmVxdWVzdCk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdnZXRDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0JykgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdFN0b3JlKCk7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmdldChxdWVyeS5kYXRhKTsKICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCBxdWVyeSwgcmVxdWVzdCk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdzdG9yZUltYWdlcycpIHsKICAgICAgICBjb25zdCBpbWFnZXMgPSBxdWVyeS5kYXRhOwogICAgICAgIGNvbnN0IHRyYW5zYWN0aW9uID0gYXdhaXQgZ2V0VHJhbnNhY3Rpb24oW1NUT1JFUy5JTUFHRVNdKTsKICAgICAgICBmb3IgKGNvbnN0IGltYWdlIG9mIGltYWdlcykgewogICAgICAgICAgICB0cmFuc2FjdGlvbi5vYmplY3RTdG9yZShTVE9SRVMuSU1BR0VTKS5hZGQoaW1hZ2UpOwogICAgICAgIH0KICAgICAgICB0cmFuc2FjdGlvbi5vbmNvbXBsZXRlID0gZXZlbnQgPT4gewogICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdG9rZW46IHRva2VuLCBkYXRhOiB0cnVlIH0pOwogICAgICAgIH07CiAgICAgICAgdHJhbnNhY3Rpb24ub25lcnJvciA9ICgpID0+IHsKICAgICAgICAgICAgdGhyb3dFeGNlcHRpb24odG9rZW4sIHF1ZXJ5LCAiRXJyb3Igc3RvcmluZyBpbWFnZXMiKTsKICAgICAgICB9OwogICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZ2V0SW1hZ2VzJykgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0SW1hZ2VzU3RvcmUoKTsKICAgICAgICBjb25zdCBkb2N1bWVudElkcyA9IHF1ZXJ5LmRhdGE7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmdldEFsbCgpOwoKICAgICAgICAvLyBUT0RPOiBJZiB0aGVyZSBhcmUgbWFueSBpbWFnZXMsIGN1cnNvci1iYXNlZCBpdGVyYXRpb24gbWlnaHQgYmUgbW9yZSBlZmZpY2llbnQKICAgICAgICByZXF1ZXN0Lm9uc3VjY2VzcyA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgY29uc3QgaW1hZ2VzID0gZXZlbnQudGFyZ2V0WyJyZXN1bHQiXTsKICAgICAgICAgICAgY29uc3QgZmlsdGVyZWRJbWFnZXMgPSBpbWFnZXMuZmlsdGVyKGltYWdlID0+IGRvY3VtZW50SWRzLmluY2x1ZGVzKGltYWdlLmRvY3VtZW50SWQpKTsKICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogZmlsdGVyZWRJbWFnZXMgfSk7CiAgICAgICAgfTsKICAgICAgICByZXF1ZXN0Lm9uZXJyb3IgPSBldmVudCA9PiB7CiAgICAgICAgICAgIHRocm93RXhjZXB0aW9uKHRva2VuLCBxdWVyeSwgIkVycm9yIGdldHRpbmcgaW1hZ2VzIik7CiAgICAgICAgfTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImdldFNCRG9jdW1lbnRJZHMiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0QWxsS2V5cygpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImluc2VydFNCRG9jdW1lbnQiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUucHV0KHF1ZXJ5LmRhdGEpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCRG9jdW1lbnQiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZGVsZXRlKHF1ZXJ5LmRhdGEpOwogICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdG9rZW46IHRva2VuLCBkYXRhOiB0cnVlIH0pOwogICAgICAgIH07CiAgICAgICAgcmVxdWVzdC5vbmVycm9yID0gZXZlbnQgPT4gewogICAgICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksICJFcnJvciBkZWxldGluZyBTQiBkb2N1bWVudCIpOwogICAgICAgIH07CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJnZXRTQkRvY3VtZW50IikgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmdldChxdWVyeS5kYXRhKTsKICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCBxdWVyeSwgcmVxdWVzdCk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJpbnNlcnRTQlBhZ2VJbWFnZSIgfHwgcXVlcnkudHlwZSA9PT0gImluc2VydEltYWdlQnVmZmVyIikgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLklNQUdFUyk7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLnB1dChxdWVyeS5kYXRhKTsKICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCBxdWVyeSwgcmVxdWVzdCk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJnZXRTQlBhZ2VJbWFnZSIgfHwgcXVlcnkudHlwZSA9PT0gImdldEltYWdlQnVmZmVyIikgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLklNQUdFUyk7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmdldChxdWVyeS5kYXRhKTsKICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCBxdWVyeSwgcmVxdWVzdCk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJkZWxldGVTQlBhZ2VJbWFnZXMiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICBjb25zdCBpZHMgPSBxdWVyeS5kYXRhOwogICAgICAgIGZvciAoY29uc3QgaWQgb2YgaWRzKSB7CiAgICAgICAgICAgIHN0b3JlLmRlbGV0ZShpZCk7CiAgICAgICAgfQogICAgICAgIC8vIFdlIGNhbid0IHJlYWxseSBkbyBhbnl0aGluZyBpZiB0aGUgZGVsZXRlIGZhaWxzLCBzbyBpdCBkb2Vzbid0IG1ha2Ugc2Vuc2UgdG8gYXdhaXQgdGhlIHJlc3VsdC4KICAgICAgICAvLyBKdXN0IGFzc3VtZSBpdCB3b3JrZWQgYW5kIHJldHVybiB0aGUgcmVzdWx0IGltbWVkaWF0ZWx5LgogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IHRydWUgfSk7CiAgICB9IGVsc2UgewogICAgICAgIHRocm93RXhjZXB0aW9uKHRva2VuLCBxdWVyeSwgIlVua25vd24gcXVlcnkgdHlwZSIpOwogICAgfQp9Ow=="},function(e,t,n){"use strict";n.r(t);var i=n(0),r=n(21),o=n(14),a=n(8),s=n(17),c=n(26);class u extends c.a{constructor(){super(s.a.DEFAULT_VIDEO_RESOLUTION_HD),this.detectorParameters=new a.DocumentDataExtractorConfiguration({configurations:[]}),this.finder.aspectRatio={width:1.5,height:1},this.userGuidance.title.text="Please hold the device over a document to start scanning"}static fromJson(e){var t;const n=new u;return this.mapValues(e,n,["videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(n,e),this.mapVideoConstraints(e,n),e.detectorParameters&&e.detectorParameters.configurations&&(e.detectorParameters.configurations=[]),n.detectorParameters=new a.DocumentDataExtractorConfiguration(null!==(t=e.detectorParameters)&&void 0!==t?t:{configurations:[]}),n}}var l=n(33),d=n(13),m=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};o.a;class h extends l.b{constructor(e){super(e),this.configuration=e.configuration}static create(e,t){return m(this,void 0,void 0,(function*(){const n=d.a.findContainerOrThrow(t);return t=u.fromJson(t),new Promise(((o,a)=>{this.root&&this.root.unmount(),this.root=Object(r.createRoot)(n),this.root.render(i.default.createElement(h,{root:this.root,container:n,configuration:t,onSuccess:o,onFailure:a,sdk:e}))}))}))}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});var t;return m(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),null===(t=this.handle)||void 0===t||t.destroy()}))}get enabled(){return!this.disposed&&!this.paused}onSdkReady(){return m(this,void 0,void 0,(function*(){this.handle=yield this.props.sdk.bridge.api.DocumentDataExtractor.create(this.configuration.detectorParameters)}))}detect(){var e,t,n,i,r,s,c;return m(this,void 0,void 0,(function*(){try{if(!this.enabled)return;this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const s=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(o.c.DEFAULT_DETECTION_RESOLUTION);if(!s)return;const c=yield null===(n=this.handle)||void 0===n?void 0:n.run(new a.Image(s),"CONSUME_IMAGE");if(!c)return;if(!this.enabled)return;this.camera.reusableImageBuffer=c.originalImage,null===(r=(i=this.configuration).onDocumentDetected)||void 0===r||r.call(i,c.result)}catch(e){null===(c=(s=this.configuration).onError)||void 0===c||c.call(s,e)}finally{requestAnimationFrame((()=>this.detect()))}}))}render(){return this.renderView(this.configuration)}}h.root=null;t.default=h},function(e,t,n){"use strict";n.r(t);var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.default=r}])}));
|
|
37
|
+
}`,c=xs.a.div`position: absolute; animation: ${s} ${r}s;`;return this.previousScale=i,T.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:e=>this.container=e},T.default.createElement(c,{style:{width:this.calculate(e,"width"),height:this.calculate(e,"height"),transform:`rotate(${a}deg) scale(${i})`,marginTop:this.marginWithAspect(t,"y",e),marginLeft:this.marginWithAspect(t,"x",e)},onAnimationStart:()=>{this.animating=!0},onAnimationEnd:()=>{this.animating=!1}},this.props.children))}marginWithAspect(e,t,n){if(!e||!n)return 0;n.width,n.height;return e[t]}calculate(e,t){return e?e[t]:"100%"}}class Um extends T.default.Component{componentDidMount(){_s.a.disableScreenMovement()}componentWillUnmount(){_s.a.enableScreenMovement()}render(){return T.default.createElement("div",null)}}class Zm{constructor(e,t){this.start=e,this.end=t}static fromLineSegments(e){return e.map((e=>Zm.fromLineSegment(e)))}static fromLineSegment(e){return new Zm(e.start,e.end)}}class Gm{constructor(e,t){this.element=e,this.size=t}}class Ym{}class Qm extends T.default.Component{render(){return T.default.createElement("div",{style:this.props.style},T.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const e=this.half();return T.default.createElement("line",{x1:e,y1:0,x2:e,y2:this.props.size,stroke:this.props.color,strokeWidth:"2"})}horizontal(){const e=this.half();return T.default.createElement("line",{x1:0,y1:e,x2:this.props.size,y2:e,stroke:this.props.color,strokeWidth:"2"})}}class qm extends T.default.Component{get crosshairSize(){var e,t;return null===(t=null===(e=this.props.style)||void 0===e?void 0:e.crosshair)||void 0===t?void 0:t.size}constructor(e){super(e),this.MAX_ROTATIONS=4,this.state={frame:v.a.empty(),cropImageFitSize:Ps.a.empty(),rotation:{count:0,scale:1},margin:{left:this.props.style.margin,top:this.props.style.margin},container:{width:0},scale:{width:1,height:1}}}style(){return{container:{marginLeft:this.state.margin.left,marginTop:this.state.margin.top,width:this.state.frame.width,height:this.state.frame.height,borderRadius:this.props.style.size/2,border:this.props.style.border.width+"px solid "+this.props.style.border.color,position:"absolute",overflow:"hidden",zIndex:50,transform:"rotate("+90*this.state.rotation.count+"deg)"},image:{width:this.state.cropImageFitSize.width*this.props.style.zoom,height:this.state.cropImageFitSize.height*this.props.style.zoom,marginLeft:-this.state.frame.x,marginTop:-this.state.frame.y,objectFit:"cover"},crosshair:{margin:"auto",position:"absolute",width:this.crosshairSize,height:this.crosshairSize,top:this.state.frame.height/2-this.crosshairSize/2,left:this.state.frame.width/2-this.crosshairSize/2}}}render(){return this.state.visible?T.default.createElement("div",{style:this.style().container},T.default.createElement("img",{style:this.style().image,ref:e=>this.destination=e,src:this.props.src,alt:"."}),T.default.createElement(Qm,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(e){if(!this.state.visible)return;this.destination.src=e.source.element.src;const t=v.a.fromPoint(hs.a.scaleUpTo(e.origin,new Ps.a(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=e.container.width-(this.props.style.margin+this.props.style.size),i=this.isPointTopLeft(e.origin,e.source.size,e.rotations);this.setState({frame:t,cropImageFitSize:e.source.size,rotation:{count:e.rotations,scale:e.scale},margin:{left:i?n:this.props.style.margin},container:{width:e.container.width},scale:{width:e.source.size.width/e.container.width,height:e.source.size.height/e.container.height}})}isPointTopLeft(e,t,n){const i=e.x,r=e.y,o=this.normalizeRotations(n),a=this.state.container.width/4;return 0===o?i<a&&r<a:1===o?i<a&&r>t.height-a:2===o?i>t.width-a&&r>t.height-a:i>t.width-a&&r<a}setIsVisible(e,t){this.setState({visible:e},t)}normalizeRotations(e){return e%this.MAX_ROTATIONS}}var Xm=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Km extends T.default.Component{constructor(e){super(e),this.onResizeCallback=()=>{},this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.sdk=e.sdk,this.state={image:void 0,documentDetectionResult:void 0,polygon:void 0,calculatedSize:Ps.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:hs.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(e,t){return Xm(this,void 0,void 0,(function*(){const n=_s.a.findContainerOrThrow(e);return new Promise(((i,r)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(n),this.root.render(T.default.createElement(Km,{root:this.root,sdk:t,onReady:i,onError:r,container:n,configuration:Rm.fromJson(e)}))}))}))}componentDidMount(){var e,t,n;return Xm(this,void 0,void 0,(function*(){const i=d.Image.fromWrappedImage(null===(e=this.configuration)||void 0===e?void 0:e.image.__image_data),r=(yield this.sdk.detectAndCropDocument(i)).result.detectionResult;let o=null!==(n=null===(t=this.configuration)||void 0===t?void 0:t.polygon)&&void 0!==n?n:r.pointsNormalized;0===o.length&&(o=Km.FULL_SIZE_POLYGON);const a=yield b.toDataUrl(yield this.sdk.imageToJpeg(i));this.setState({documentDetectionResult:r,image:a,polygon:o,magneticLines:{vertical:{original:Zm.fromLineSegments(r.verticalLinesNormalized)},horizontal:{original:Zm.fromLineSegments(r.horizontalLinesNormalized)}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return Xm(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(e){return Xm(this,void 0,void 0,(function*(){Ps.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=e,this.initializeSizes())}))}onResize(){const e=this.state.points.map((e=>new hs.a(e.x/this.state.calculatedSize.width,e.y/this.state.calculatedSize.height)));this.initializeSizes(e)}initializeSizes(e,t,n){const i=new Ps.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),r=new Ps.a(this.container.width(),this.container.height()),o=b.getObjectFitSize(r,i),a=new Ps.a(o.width,o.height),s=null!=e?e:this.state.polygon,c=_s.a.convertToViewportPointsFromParentSize(a,s),u=null!=t?t:this.state.magneticLines.horizontal.original,l=null!=n?n:this.state.magneticLines.vertical.original,d=_s.a.convertLinesToViewportLines(a,u),m=_s.a.convertLinesToViewportLines(a,l);this.setState({calculatedSize:a,points:c,magneticLines:{horizontal:{original:u,scaled:d},vertical:{original:l,scaled:m}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var e,t,n,i,r,o;const a=zu.CLASSNAME,s=Vu()({[a]:!0,[`${a}-visible`]:!0}),c=this.configuration.style.polygon.width,u=(null===(e=this.state.animation)||void 0===e?void 0:e.scale)?c/this.state.animation.scale:c,l=this.configuration.style.padding||0,d=`calc(100% - 2*${l}px)`;return T.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:l}},T.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&T.default.createElement(Um,null),T.default.createElement(qm,{ref:e=>this.magnifier=e,style:this.configuration.style.magnifier}),T.default.createElement(Hm,{ref:e=>this.container=e,size:this.state.calculatedSize,rotations:null===(t=this.state.animation)||void 0===t?void 0:t.rotations,scale:null===(n=this.state.animation)||void 0===n?void 0:n.scale,duration:null===(i=this.state.animation)||void 0===i?void 0:i.duration,imageMargin:this.state.imageMargin},T.default.createElement(zm,{src:this.state.image,onImageLoaded:e=>this.onImageLoaded(e)}),T.default.createElement(jm,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${u}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(r=this.state.animation)||void 0===r?void 0:r.rotations,scale:null===(o=this.state.animation)||void 0===o?void 0:o.scale,magneticLines:this.state.magneticLines,cornerMoveStart:this.showMagnifier.bind(this),cornerMoved:this.updateMagnifier.bind(this),cornerMoveEnd:this.hideMagnifier.bind(this)}))))}showMagnifier(e){var t;null===(t=this.magnifier)||void 0===t||t.setIsVisible(!0,(()=>{var t;null===(t=this.magnifier)||void 0===t||t.update(this.magnifierOptions(e))}))}updateMagnifier(e){var t;null===(t=this.magnifier)||void 0===t||t.update(this.magnifierOptions(e))}magnifierOptions(e){const t=new Ym;return t.source=new Gm(this.htmlImage,this.state.calculatedSize),t.container=new Ps.a(this.container.width(),this.container.height()),t.origin=e.point,t.rotations=this.state.animation.rotations,t.scale=this.state.animation.scale,t}hideMagnifier(){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!1)}apply(){var e;return Xm(this,void 0,void 0,(function*(){const t=hs.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),i=yield this.sdk.createImageProcessor(),r=yield i.crop(null===(e=this.configuration)||void 0===e?void 0:e.image,t);return{image:(yield i.rotate(r.result,n,"CONSUME_IMAGE")).result,polygon:t,rotations:this.rotations}}))}toCoreRotations(e){switch(e%this.MAX_ROTATIONS){case 0:return"NONE";case 1:return"CLOCKWISE_90";case 2:return"CLOCKWISE_180";case 3:return"COUNTERCLOCKWISE_90"}}rotate(e){return Xm(this,void 0,void 0,(function*(){if(this.container.isAnimating())return void console.warn("Unable to rotate: previous rotation animation in progress");const t=this.calculateScale(this.rotations,e,this.state.calculatedSize);this.setState({animation:{rotations:this.rotations+e,scale:t,duration:1}})}))}detect(){return Xm(this,void 0,void 0,(function*(){const e=this.state.documentDetectionResult;if(0===e.pointsNormalized.length)this.resetPolygon();else{const t=Zm.fromLineSegments(e.horizontalLinesNormalized),n=Zm.fromLineSegments(e.verticalLinesNormalized);this.initializeSizes(e.pointsNormalized,t,n)}}))}resetPolygon(){const e=this.state.documentDetectionResult,t=Zm.fromLineSegments(e.horizontalLinesNormalized),n=Zm.fromLineSegments(e.verticalLinesNormalized);this.initializeSizes(Km.FULL_SIZE_POLYGON,t,n)}dispose(){_s.a.unmountSafely(this.props.root)}get rotations(){var e,t;const n=null===(e=this.state.animation)||void 0===e?void 0:e.rotations;return n&&0!==n?n:null!==(t=this.configuration.rotations)&&void 0!==t?t:0}get configuration(){return this._configuration||(this._configuration=Rm.fromJson(this.props.configuration)),this._configuration}calculateScale(e,t,n){return t?(e+t)%2==0?this.BASE_SCALE:this.calculateRatio(n):this.BASE_SCALE}calculateRatio(e){return Math.min(this.container.width()/e.height,this.container.height()/e.width)}calculateMargin(e){return e.width>e.height?{x:0,y:this.container.height()/2-e.height/2}:{x:this.container.width()/2-e.width/2,y:0}}}Km.FULL_SIZE_POLYGON=[new hs.a(0,0),new hs.a(1,0),new hs.a(1,1),new hs.a(0,1)],Km.root=null;var Jm=Km,$m=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function eh(e){const t=e.config.screens.cropping,n=T.default.useRef(null),i=T.default.useRef(null),[r,o]=T.default.useState(!0),a=Object(T.useRef)(0),s=T.default.useRef(Promise.resolve());return Object(T.useEffect)((()=>{if(n.current&&e.page)return s.current=s.current.then((()=>$m(this,void 0,void 0,(function*(){o(!0);const r=yield e.page.cropData();if(!n.current)return;a.current=r.rotations;const s=yield Jm.create({containerId:"sb-cropping-container",image:r.image,polygon:r.crop,rotations:r.rotations,style:{polygon:{color:_.b.getColorValue(t.croppingPolygonColor),handles:{color:_.b.getColorValue(t.croppingHandlerColor),border:"transparent",filter:"drop-shadow(0px 0px 2px #00000070)"}}}},e.sdk);i.current=s,o(!1)})))),()=>{s.current=s.current.then((()=>$m(this,void 0,void 0,(function*(){var e;null===(e=i.current)||void 0===e||e.dispose()}))))}}),[n.current,e.page]),e.page?T.default.createElement(T.default.Fragment,null,T.default.createElement(El,{open:r}),T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(t.backgroundColor),width:"100%",height:`calc(100 * ${R})`,display:"flex",flexDirection:"column",touchAction:"none",userSelect:"none",WebkitTapHighlightColor:"transparent"}},T.default.createElement(iu,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:T.default.createElement(G,{ariaLabel:_.b.getLocalizedText(t.topBarBackButton.accessibilityDescription),onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,debugName:"cropping-screen-close",disabled:r}),centerTitle:t.topBarTitle,rightContent:T.default.createElement(G,{ariaLabel:_.b.getLocalizedText(t.topBarConfirmButton.accessibilityDescription),onClick:()=>$m(this,void 0,void 0,(function*(){if(!i.current)return void e.onCloseButtonClick();const t=i.current;o(!0);const n=hs.a.toPolygon(t.state.points,t.state.calculatedSize),r=(4+t.rotations-a.current)%4;yield e.onApplyCrop(n,r),o(!1)})),visible:t.topBarConfirmButton.visible,text:t.topBarConfirmButton.text,background:t.topBarConfirmButton.background,foreground:t.topBarConfirmButton.foreground,debugName:"cropping-screen-apply",disabled:r})}),T.default.createElement(P.Box,{style:{flexGrow:1,width:"100%"},ref:n,id:"sb-cropping-container"}),T.default.createElement(P.Box,{style:{backgroundColor:_.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:80,width:"100%",display:"flex",justifyContent:"center"}},T.default.createElement(P.Box,{style:{maxWidth:400,display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1,padding:"0 20px"}},T.default.createElement(H,{enabled:!r,config:t.bottomBar.detectButton,icon:({color:e})=>T.default.createElement(L.a,{style:{color:e}}),onClick:()=>$m(this,void 0,void 0,(function*(){var e;o(!0),yield null===(e=i.current)||void 0===e?void 0:e.detect(),o(!1)})),debugName:"retake"}),T.default.createElement(H,{enabled:!r,config:t.bottomBar.rotateButton,icon:({color:e})=>T.default.createElement(L.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.rotate(1)},debugName:"retake"}),T.default.createElement(H,{enabled:!r,config:t.bottomBar.resetButton,icon:({color:e})=>T.default.createElement(L.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.resetPolygon()},debugName:"retake"}))))):null}var th=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class nh{get id(){return this.data.id}getData(){return this.data}constructor(e,t){this.document=e,this.data=t,this._finalImageUrl=null,this.data.rotations=t.rotations||0}sdk(){return Jh.instance}loadOriginalImage(){return th(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(this.data.originalImageId)}))}loadDocumentImage(){return th(this,void 0,void 0,(function*(){return null===this.data.documentImageId?null:yield this.sdk().storage.getSBPageImage(this.data.documentImageId)}))}getPolygon(){var e;return 4===(null===(e=this.data.polygon)||void 0===e?void 0:e.length)?this.data.polygon:nh.FULL_SIZE_POLYGON}cropData(){return th(this,void 0,void 0,(function*(){return{crop:this.getPolygon(),rotations:this.data.rotations,image:yield this.loadOriginalImage()}}))}finalRawImage(){return th(this,void 0,void 0,(function*(){if(null===this.data.documentImageId){let e=yield this.loadOriginalImage();const t=this.document.data.documentImageSizeLimit,n=yield this.sdk().createImageProcessor();0!==t?(e=(yield n.resize(e,t,"COPY_IMAGE")).result,e=(yield n.crop(e,this.getPolygon(),"CONSUME_IMAGE")).result):e=(yield n.crop(e,this.getPolygon(),"COPY_IMAGE")).result;const i=this.data.filters||[];for(let t of i)e=(yield n.applyFilter(e,t,"CONSUME_IMAGE")).result;const r=nh.ROTATIONS[this.data.rotations%4];e=(yield n.rotate(e,r,"CONSUME_IMAGE")).result;const o=yield this.sdk().storage.insertSBPageImage(e);return ph._internal_updateProperty(this.data,"documentImageId",o),yield this.document.updateStorageDocument(),e}return yield this.loadDocumentImage()}))}finalImageUrl(){return null===this._finalImageUrl&&(this._finalImageUrl=(()=>th(this,void 0,void 0,(function*(){const e=yield this.finalRawImage(),t=yield this.sdk().imageToJpeg(e,"CONSUME_IMAGE");return URL.createObjectURL(new Blob([t],{type:"image/jpeg"}))})))()),this._finalImageUrl}invalidateImage(){return th(this,void 0,void 0,(function*(){null!==this.data.documentImageId&&(yield this.sdk().storage.deleteImageById(this.data.documentImageId),ph._internal_updateProperty(this.data,"documentImageId",null)),yield this.document.updateStorageDocument(),URL.revokeObjectURL(yield this._finalImageUrl),this._finalImageUrl=null}))}}nh.ROTATIONS=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],nh.FULL_SIZE_POLYGON=[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];class ih{constructor(e){this.name="SBStorageError",this.message=e}}var rh=n(5),oh=n(59),ah=n(30);const sh=["UNDEFINED","MANUAL_SNAP","AUTO_SNAP","IMPORTED"];var ch=n(81);class uh extends rh.a{constructor(e={}){super(),this.filters=null,this.polygon=[],this.documentDetectionStatus=null,this.documentQuality=null,this.source=null,this.id=null,this.originalImageId=null,this.documentImageId=null,void 0!==e.filters&&(this.filters=null!=e.filters?e.filters.map((e=>ch.a.From(e))):null),void 0!==e.polygon&&(this.polygon=e.polygon.map((e=>({x:e.x,y:e.y})))),void 0!==e.documentDetectionStatus&&(this.documentDetectionStatus=null!=e.documentDetectionStatus&&oh.a.includes(e.documentDetectionStatus)?e.documentDetectionStatus:null),void 0!==e.documentQuality&&(this.documentQuality=null!=e.documentQuality&&ah.d.includes(e.documentQuality)?e.documentQuality:null),void 0!==e.source&&(this.source=null!=e.source&&sh.includes(e.source)?e.source:null),void 0!==e.id&&(this.id=null!=e.id?e.id:null),void 0!==e.originalImageId&&(this.originalImageId=null!=e.originalImageId?e.originalImageId:null),void 0!==e.documentImageId&&(this.documentImageId=null!=e.documentImageId?e.documentImageId:null)}}class lh extends rh.a{constructor(e={}){if(super(),this.documentImageSizeLimit=0,this.id=null,this.pdfId=null,this.tiffId=null,void 0===e.creationTimestamp)throw new Error("creationTimestamp must be present in constructor argument");if(this.creationTimestamp=e.creationTimestamp,void 0===e.pages)throw new Error("pages must be present in constructor argument");this.pages=e.pages.map((e=>new uh(e))),void 0!==e.documentImageSizeLimit&&(this.documentImageSizeLimit=e.documentImageSizeLimit),void 0!==e.id&&(this.id=null!=e.id?e.id:null),void 0!==e.pdfId&&(this.pdfId=null!=e.pdfId?e.pdfId:null),void 0!==e.tiffId&&(this.tiffId=null!=e.tiffId?e.tiffId:null)}}class dh extends lh{constructor(){super(...arguments),this.pages=[]}}class mh extends uh{}var hh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class fh{get documentImageSizeLimit(){return this.configuration.outputSettings.documentImageSizeLimit}get cleanSession(){return this.configuration.cleanScanningSession}get filters(){const e=this.configuration.outputSettings;return e.defaultFilter?[e.defaultFilter]:[]}constructor(e){this.configuration=e.config,this.documentId=null==e?void 0:e.documentId}loadFromStorage(){return void 0!==this.documentId}}class ph{getData(){return this.data}get isDraft(){return this.data.id===ph.DOCUMENT_DRAFT_ID}constructor(e){var t;this._pages=[],this.data=e;for(let e=0;e<(null===(t=this.data.pages)||void 0===t?void 0:t.length);e++)this.syncPage(e)}syncPage(e){this._pages[e]=new nh(this,this.data.pages[e])}get pages(){return this._pages}splicePage(e,t,...n){return this.data.pages.splice(e,t,...n),this._pages.splice(e,t,...n.map((e=>new nh(this,e))))}sdk(){return Jh.instance}get pageCount(){return this.pages.length}pageAtIndex(e){return this.pages[e]}movePage(e,t){return hh(this,void 0,void 0,(function*(){const n=this.splicePage(e,1);if(1!==n.length)throw new Error("Unable to move page: It does not seem to exist.");this.splicePage(t,0,n[0].getData()),yield this.updateStorageDocument()}))}static loadFromStorage(e){return hh(this,void 0,void 0,(function*(){const t=yield Jh.instance.storage.getSBDocumentData(e);if(void 0===t)throw new ih("Document not found in database.");return new ph(t)}))}static create(e){return hh(this,void 0,void 0,(function*(){const t=Jh.instance;let n;if(e.loadFromStorage())n=yield ph.loadFromStorage(e.documentId);else{const i=yield t.storage.getSBDocumentData(ph.DOCUMENT_DRAFT_ID),r=void 0!==i;if(e.cleanSession&&r){for(const e of i.pages)yield t.storage.deleteImages(e);ph._internal_updateProperty(i,"pages",[])}const o=r?i:new dh({id:ph.DOCUMENT_DRAFT_ID,creationTimestamp:Date.now(),pages:[],documentImageSizeLimit:e.documentImageSizeLimit});n=new ph(o)}return n.data.filters=e.filters,yield n.updateStorageDocument(),n}))}updateStorageDocument(){return hh(this,void 0,void 0,(function*(){return yield this.sdk().storage.insertSBDocument(this)}))}delete(){return hh(this,void 0,void 0,(function*(){yield this.sdk().storage.deleteSBDocument(this);for(const e of this.pages)yield this.sdk().storage.deleteImages(e)}))}addPage(e,t,n,i){return hh(this,void 0,void 0,(function*(){void 0===i&&(i=this.pages.length);const r=e.result.detectionResult,o=new mh({id:Math.round(1e6*Math.random()),polygon:r.pointsNormalized,documentDetectionStatus:r.status,originalImageId:-1,source:n,documentQuality:t,filters:this.data.filters}),a=yield this.sdk().storage.insertSBPageImage(e.originalImage);ph._internal_updateProperty(o,"originalImageId",a),this.splicePage(i,0,o),yield this.updateStorageDocument()}))}deleteFromPosition(e){return hh(this,void 0,void 0,(function*(){const t=this.splicePage(e,1);yield this.sdk().storage.deleteImages(t[0]),yield this.updateStorageDocument()}))}deletePage(e){return hh(this,void 0,void 0,(function*(){const t=this.pages.indexOf(e);if(-1===t)throw new Error("Page not found in document.");yield this.deleteFromPosition(t)}))}deleteAllPages(){return hh(this,void 0,void 0,(function*(){for(;this.pages.length>0;)yield this.deleteFromPosition(0)}))}cropAndRotateAtIndex(e,t,n){return hh(this,void 0,void 0,(function*(){const i=this.pageAtIndex(e);yield this.cropAndRotatePage(i,t,n)}))}cropAndRotatePage(e,t,n){return hh(this,void 0,void 0,(function*(){const i=this.data.pages[this.pages.indexOf(e)];4===(null==t?void 0:t.length)&&ph._internal_updateProperty(i,"polygon",t),null!=n&&(i.rotations+=n),yield e.invalidateImage(),yield this.updateStorageDocument()}))}updateDataProperty(e,t){ph._internal_updateProperty(this.data,e,t)}static _internal_updateProperty(e,t,n){e[t]=n}deleteId(){delete this.data.id}convertToFinalVersion(){return hh(this,void 0,void 0,(function*(){if(this.isDraft){this.deleteId();const e=yield this.updateStorageDocument();ph._internal_updateProperty(this.data,"id",e),yield this.sdk().storage.deleteSBDocument(ph.DOCUMENT_DRAFT_ID)}return this}))}insertRenderedBuffer(e,t){return hh(this,void 0,void 0,(function*(){const n=yield this.sdk().storage.insertBuffer(e);return ph._internal_updateProperty(this.data,t,n),e}))}createPdf(e){return hh(this,void 0,void 0,(function*(){const t=yield this.sdk().beginPdf(e);yield t.addPages(this,e.runOcr);const n=yield t.complete();return yield this.saveRenderedPdf(n),n}))}createTiff(e={},t={}){return hh(this,void 0,void 0,(function*(){const n=yield this.sdk().beginTiff(e);yield n.addPages(this,t);const i=yield n.complete();return yield this.saveRenderedTiff(i),i}))}loadPdf(){return hh(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.pdfId)}))}loadTiff(){return hh(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.tiffId)}))}loadBuffer(e){return hh(this,void 0,void 0,(function*(){return yield this.sdk().storage.getBuffer(e)}))}saveRenderedPdf(e){return hh(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"pdfId")}))}saveRenderedTiff(e){return hh(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"tiffId")}))}deletePdf(){return hh(this,void 0,void 0,(function*(){return yield this.sdk().storage.deleteImageById(this.data.pdfId)}))}deleteTiff(){return hh(this,void 0,void 0,(function*(){return yield this.sdk().storage.deleteImageById(this.data.tiffId)}))}}ph.DOCUMENT_DRAFT_ID=-1;var gh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};function vh(e){var t;Object(T.useMemo)((()=>{_.b.setPalette(e.configuration.palette),_.b.setLocalization(e.configuration.localization)}),[e.configuration]);const n=Fc(),[i,r]=Object(T.useState)(null);Object(T.useEffect)((()=>{const t=new fh({config:e.configuration,documentId:e.documentId});ph.create(t).then((t=>{var n;t instanceof ph?r(t):null===(n=e.onError)||void 0===n||n.call(e,t)}))}),[]);const[o,a]=T.default.useState({screen:"camera",insertMode:{name:"insert back"}}),s="acknowledgment"===o.screen?o:null;return Object(T.useEffect)((()=>{const t=e.configuration.screens.camera.timeouts.autoCancelTimeout;if(0!==t){const n=setTimeout(e.onClose,t);return()=>clearTimeout(n)}}),[]),T.default.createElement(T.default.Fragment,null,T.default.createElement(M,null),T.default.createElement(al,null,T.default.createElement(gl,{visible:"acknowledgment"===o.screen,configuration:e.configuration,sdk:e.sdk,croppedDetectionResult:null==s?void 0:s.croppedDetectionResult,onAccept:(t,r)=>{if(!s)throw new Error("Internal error: Invalid routing state");let o;const c=[],u=e.configuration.outputSettings.pagesScanLimit;if("insert back"===s.insertMode.name){const e=i.addPage(t.value,r,t.source);c.push(e),o=u>0&&i.pages.length+1===u?{screen:"review",position:i.pages.length}:{screen:"camera",insertMode:{name:"insert back"}}}else{const e=s.insertMode.position,n=i.addPage(t.value,r,t.source,e);c.push(n),o={screen:"review",position:e},"replace"===s.insertMode.name&&c.push((()=>gh(this,void 0,void 0,(function*(){yield i.deleteFromPosition(e),yield n})))())}Promise.all(c).then((()=>{n.current&&a((e=>"acknowledgment"===e.screen?o:e))}))},onReject:()=>{var e;return a({screen:"camera",insertMode:null!==(e=null==s?void 0:s.insertMode)&&void 0!==e?e:{name:"insert back"}})},onError:e.onError}),T.default.createElement(ol,{root:e.root,visible:["camera","acknowledgment"].includes(o.screen),scanningPaused:"camera"!==o.screen||null===i,configuration:e.configuration,onClose:()=>gh(this,void 0,void 0,(function*(){(null==i?void 0:i.isDraft)&&(yield i.delete()),e.onClose()})),onImageCaptured:e=>{if("camera"!==o.screen)throw new Error("Internal error: Invalid routing state");a({screen:"acknowledgment",croppedDetectionResult:e,insertMode:o.insertMode})},onReviewButtonClick:()=>a({screen:"review",position:Math.max(0,i.pageCount-1)}),sdk:e.sdk,pages:null!==(t=null==i?void 0:i.pages)&&void 0!==t?t:[],scanLimitReached:(()=>{var t;return!(e.configuration.outputSettings.pagesScanLimit<=0)&&(("camera"!==o.screen||"replace"!==o.insertMode.name)&&(null===(t=null==i?void 0:i.pages)||void 0===t?void 0:t.length)>=e.configuration.outputSettings.pagesScanLimit)})(),onError:e.onError}),T.default.createElement(gd,{document:i,currentPosition:"review"===o.screen?o.position:null,visible:"review"===o.screen,configuration:e.configuration,onClose:()=>a({screen:"camera",insertMode:{name:"insert back"}}),onSubmit:()=>gh(this,void 0,void 0,(function*(){const t=yield i.convertToFinalVersion(),n=new Uc(t);e.onSubmit(n)})),onGoToPage:e=>{a({screen:"review",position:e})},onRetakeImage:e=>a({screen:"camera",insertMode:{name:"replace",position:e}}),onInsertImage:e=>a({screen:"camera",insertMode:{name:"insert at",position:e}}),onZoomButtonClick:e=>a({screen:"zoom",position:e}),onCropButtonClick:e=>a({screen:"crop",position:e})}),T.default.createElement(xm,{visible:"zoom"===o.screen,page:"zoom"===o.screen?i.pageAtIndex(o.position):null,config:e.configuration.screens.review.zoomOverlay,onCloseButtonClick:()=>a({screen:"review",position:"zoom"===o.screen?o.position:0})}),T.default.createElement(eh,{sdk:e.sdk,page:"crop"===o.screen?i.pageAtIndex(o.position):null,config:e.configuration,onCloseButtonClick:()=>a({screen:"review",position:"crop"===o.screen?o.position:0}),onApplyCrop:(e,t)=>gh(this,void 0,void 0,(function*(){if("crop"!==o.screen)throw new Error("Internal error: Invalid routing state");yield i.cropAndRotateAtIndex(o.position,e,t),a({screen:"review",position:o.position})}))})))}var yh=n(78);class Ch extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new d.MrzScannerConfiguration,this.onMrzDetected=function(e){},this.finder.aspectRatio=new d.AspectRatio({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(e){var t;const n=new Ch;return this.mapValues(e,n,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(n,e),this.mapVideoConstraints(e,n),n.recognizerConfiguration=new d.MrzScannerConfiguration(null!==(t=e.recognizerConfiguration)&&void 0!==t?t:{}),n}}var bh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};ue.a;ue.b;class Ah extends Rs.b{constructor(e){super(e),this.shouldComputeSize=!0,this.updateDimensionsCallback=this.updateDimensions.bind(this)}get configuration(){return this._configuration||(this._configuration=Ch.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e){return bh(this,void 0,void 0,(function*(){const t=_s.a.findContainerOrThrow(e);return new Promise(((n,i)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(t),this.root.render(T.default.createElement(Ah,{root:this.root,container:t,configuration:e,onSuccess:n,onFailure:i}))}))}))}onSdkReady(){return bh(this,void 0,void 0,(function*(){this.handle=yield this.bridge.api.MrzScanner.create(this.configuration.recognizerConfiguration)}))}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return bh(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback)}))}componentWillUnmount(){var e;super.componentWillUnmount(),null===(e=this.handle)||void 0===e||e.destroy(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return bh(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}pauseDetection(){var e;super.pauseDetection(),null===(e=this.handle)||void 0===e||e.clearResult()}detect(){var e,t,n,i,r,o,a,s;return bh(this,void 0,void 0,(function*(){const c=this.shouldComputeSize;let u=!1;try{if(!this.enabled)return;if(this.paused)return;this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const a=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Ah.FRAME_RESOLUTION);if(!a||!this.handle)return;c&&this.forceUpdate();const s=yield null===(n=this.handle)||void 0===n?void 0:n.run(d.Image.fromImageData(a),"CONSUME_IMAGE");if(this.paused)return;if(!this.enabled)return;if(null===s)return void(null===(r=(i=this.props).onLicenseError)||void 0===r||r.call(i));this.camera.reusableImageBuffer=null==s?void 0:s.originalImage,s.result.success?(delete s.originalImage,u=!0,this.configuration.onMrzDetected(s.result)):this.configuration._onDetectionFailed&&(null===(o=this.configuration)||void 0===o||o._onDetectionFailed(s.originalImage))}catch(e){null===(s=(a=this.configuration).onError)||void 0===s||s.call(a,e)}finally{u?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}render(){return this.renderView(this.configuration)}}Ah.FRAME_RESOLUTION=1200,Ah.root=null;var Sh=Ah;function wh(e){var t,n,i;const r=[];if("TwoLineMRZFinderLayoutPreset"===e.config._type?(r.push(e.config.mrzTextLine1),r.push(e.config.mrzTextLine2)):"ThreeLineMRZFinderLayoutPreset"===e.config._type&&(r.push(e.config.mrzTextLine1),r.push(e.config.mrzTextLine2),r.push(e.config.mrzTextLine3)),!e.visible)return null;const o=null===(i=null===(n=null===(t=e.scanner)||void 0===t?void 0:t.current)||void 0===n?void 0:n.finder)||void 0===i?void 0:i.holeRect;if(!o)return null;const a=e.isTopBarGradient?o.y:o.y+e.top;return T.default.createElement("div",{style:{position:"absolute",top:a,left:o.x,width:o.width,height:o.height,justifyContent:"center",display:"flex",flexDirection:"column"}},r.map(((e,t)=>{let n=function(e,t,n="monospace",i=1,r=500){const o=document.createElement("canvas").getContext("2d");let a=i;for(;i<=r;){let c=Math.floor((i+r)/2);s=c,o.font=`${s}px ${n}`,o.measureText(e).width<=t?(a=c,i=c+1):r=c-1}var s;return a}(e,o.width-40,"Monospace");return n-=2,T.default.createElement(P.Box,{key:t,sx:{fontFamily:"Monospace",fontSize:n,fontWeight:"bold",textAlign:"center",letterSpacing:"0.1em"}},e)})))}function Eh(e,t){const n=new Ch;n.recognizerConfiguration=e.scannerConfiguration,n.userGuidance=e.finderViewUserGuidance,n.finder=e.viewFinder;const i=(new Ch).videoConstraints;return i.width.ideal=e.cameraConfiguration.idealPreviewResolution.width,i.height.ideal=e.cameraConfiguration.idealPreviewResolution.height,i.facingMode="FRONT"===e.cameraConfiguration.cameraModule?"user":"environment",n.videoConstraints=i,n.onMrzDetected=t,n}function Dh(e){if(!e.visible)return null;const t=Object(T.useMemo)((()=>"__sb_"+Math.random()),[]),n=Object(T.useRef)(),i=Object(T.useRef)(),r=e.config.cameraConfiguration,[o,a]=Object(T.useState)(void 0),[s,c]=Object(T.useState)(!0),u=Object(T.useRef)(null);Object(T.useEffect)((()=>{Jh.instance.createMrzScannerEngine(e.config.scannerConfiguration).then((t=>{i.current=t,e.onScannerReady(n);setTimeout((()=>{c(!1)}),3e3)}))}),[]);const l=Object(T.useContext)(Y),d=l.remainingVisibleBodyHeight;return T.default.createElement(T.default.Fragment,null,i&&T.default.createElement(P.Box,{id:t,sx:{width:"100%",height:d}},T.default.createElement(zs,{config:e.config.actionBar,scanner:n.current,capabilities:o,bottomPadding:16,torchEnabledInitially:r.flashEnabled,zoomSteps:r.zoomSteps,defaultZoomFactor:r.defaultZoomFactor,initialCameraModule:r.cameraModule}),T.default.createElement(Sh,{root:e.root,ref:n,configuration:Eh(e.config,(t=>{t.success&&null===u.current&&(u.current=t,e.onMrzDetected(t),setTimeout((()=>{u.current=null}),1500))})),onSuccess:()=>{Ws.setFromScanner(n,a)},onFailure:e.onCameraPermissionDenied,onLicenseError:e.onError}),T.default.createElement(bu,{config:e.config.topUserGuidance,style:{position:"absolute",width:"100%",top:l.height}}),T.default.createElement(wh,{visible:s,scanner:n,config:e.config.mrzExampleOverlay,isTopBarGradient:"GRADIENT"===e.config.topBar.mode,top:l.height})))}function xh(e){return T.default.createElement(tu,{isOpen:e.isOpen,onClose:e.onClose,backgroundColor:e.config.backgroundColor},T.default.createElement(P.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},T.default.createElement(N.a,{style:Object.assign({fontWeight:600,fontSize:16},q(1)),config:e.config.title}),T.default.createElement(P.Box,null,T.default.createElement(G,{onClick:e.onClose,foreground:new ne.g({color:e.config.title.color}),text:"",visible:!0,background:new ne.a({}),icon:T.default.createElement(L.a,{sx:{fontSize:22}}),buttonWidth:28,iconPosition:"right",debugName:"close-introduction"}))),T.default.createElement(eu,{source:e.config.image,fill:"transparent"}),T.default.createElement(N.a,{config:e.config.text,style:{fontSize:16,whiteSpace:"pre-wrap",paddingBottom:"10px",display:"block",overflowY:"scroll",maxWidth:"100%",wordWrap:"break-word",maxHeight:"250px"}}),T.default.createElement(P.Box,{sx:{paddingTop:"8px",borderTop:`1px solid ${_.b.getColorValue(e.config.dividerColor)}`}},T.default.createElement(G,Object.assign({},e.config.doneButton,{buttonWidth:"100%",styleOverrides:{justifyContent:"center",width:"100%",height:40},onClick:e.onClose}))))}function Bh(e){const t=_.b.getColorValue(e.color);return T.default.createElement("svg",{width:"74",height:"74",viewBox:"0 0 74 74",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T.default.createElement("g",{filter:"url(#filter0_d_1905_44393)"},T.default.createElement("path",{d:"M54.5 29L33 50.5L22 39.5",stroke:t,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})),T.default.createElement("g",{filter:"url(#filter1_d_1905_44393)"},T.default.createElement("circle",{cx:"36",cy:"36",r:"32",stroke:t,strokeWidth:"4",shapeRendering:"crispEdges"})),T.default.createElement("defs",null,T.default.createElement("filter",{id:"filter0_d_1905_44393",x:"18",y:"25",width:"42.5",height:"31.5",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},T.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),T.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),T.default.createElement("feOffset",{dx:"1",dy:"1"}),T.default.createElement("feGaussianBlur",{stdDeviation:"1.5"}),T.default.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),T.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),T.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1905_44393"}),T.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1905_44393",result:"shape"})),T.default.createElement("filter",{id:"filter1_d_1905_44393",x:"0",y:"0",width:"74",height:"74",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},T.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),T.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),T.default.createElement("feOffset",{dx:"1",dy:"1"}),T.default.createElement("feGaussianBlur",{stdDeviation:"1.5"}),T.default.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),T.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),T.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_1905_44393"}),T.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_1905_44393",result:"shape"}))))}function Ih(e){const t=_.b.getColorValue(e.configuration.overlayBackgroundColor);return T.default.createElement(L.a,{open:e.visible},T.default.createElement(P.Fade,{tabIndex:-1,"data-sb-screen-acknowledgment":!0,in:e.visible,timeout:{enter:500,exit:500},onAnimationEnd:()=>{console.log("animation end")},addEndListener:(t,n)=>{t.addEventListener("transitionend",(()=>{setTimeout((()=>{e.transitionComplete()}),e.configuration.timeout)}),!1)},style:{backdropFilter:"blur(10px)",position:"absolute",width:"100vw",height:`calc(100 * ${R})`,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",transitionDelay:"0s",top:0}},T.default.createElement(P.Box,{style:{display:e.visible?"flex":"none",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:t,zIndex:1e3}},T.default.createElement(Bh,{color:e.configuration.iconColor}),T.default.createElement("div",{style:{height:"5px"}}),T.default.createElement(N.a,{config:e.configuration.message}))))}function Th(e){const[t,n]=Object(T.useState)(!1),[i,r]=Object(T.useState)(e.configuration.introScreen.showAutomatically),[o,a]=Object(T.useState)(null),[s,c]=Object(T.useState)(null),u=e.configuration;Object(T.useMemo)((()=>{_.b.setPalette(e.configuration.palette),_.b.setLocalization(e.configuration.localization)}),[e.configuration]);const l=u.viewFinder.aspectRatio,m=-1===l.width&&-1===l.height;if("NoLayoutPreset"!==u.mrzExampleOverlay._type&&m){const e=u.mrzExampleOverlay.adjustedFinderAspectRatio;u.viewFinder.aspectRatio=new d.AspectRatio({width:e,height:1})}return T.default.createElement(T.default.Fragment,null,T.default.createElement(M,null),T.default.createElement(al,null,T.default.createElement(P.Box,{sx:{height:`100 * ${R}`,width:"100vw",backgroundColor:_.b.getColorValue(e.configuration.backgroundColor)}},T.default.createElement(Q,Object.assign({cameraPermissionDenied:t,onBackPress:e.onClose},e.configuration.topBar,{rightItem:T.default.createElement("div",{style:{float:"right"}},T.default.createElement(G,Object.assign({icon:T.default.createElement(L.a,{sx:{fontSize:24,color:u.topBarOpenIntroScreenButton.color}})},e.configuration.topBarOpenIntroScreenButton,{text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{iconVisible:!0,useShadow:!1,color:"white"},onClick:()=>{r(!0)}})))}),T.default.createElement(Dh,{root:e.root,visible:!t,config:u,onError:e.onError,onCameraPermissionDenied:()=>{n(!0)},onMrzDetected:t=>{var n;null===(n=null==s?void 0:s.current)||void 0===n||n.pauseDetection();const i=new yh.a({rawMRZ:t.rawMRZ,mrzDocument:t.document});ae.INSTANCE.beep(e.configuration.sound),ce.INSTANCE.vibrate(e.configuration.vibration),a(i)},onScannerReady:e=>{c(e)}}),T.default.createElement(zc,{visible:t,onCloseClick:e.onClose,config:u.cameraPermission})),T.default.createElement(xh,{config:e.configuration.introScreen,isOpen:i,onClose:()=>{r(!1)}}),T.default.createElement(Ih,{visible:null!==o,configuration:e.configuration.successOverlay,transitionComplete:()=>{var t;e.onSubmit(o),a(null),null===(t=null==s?void 0:s.current)||void 0===t||t.dispose()}}))))}var Oh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class kh{constructor(){this.cancelFunctionPromise=new Promise((e=>{this.cancelFunctionPromiseResolve=e}))}invokeCancelFunction(){return Oh(this,void 0,void 0,(function*(){yield(yield this.cancelFunctionPromise)()}))}setCancelFunction(e){this.cancelFunctionPromiseResolve(e)}}var Ph=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Lh{static abortScanner(){return Ph(this,void 0,void 0,(function*(){if(!this.scannerAbortHandler)throw new Error("No scanner is currently running.");yield this.scannerAbortHandler.invokeCancelFunction()}))}static createDocumentScanner(e,t){return Ph(this,void 0,void 0,(function*(){return this.createScanner(vh,{documentId:t,sdk:Jh.instance},e)}))}static createBarcodeScanner(e){return Ph(this,void 0,void 0,(function*(){return this.createScanner(Hc,{},e,(()=>ae.INSTANCE.initialize(e.sound)))}))}static createMrzScanner(e){return Ph(this,void 0,void 0,(function*(){return this.createScanner(Th,{},e,(()=>ae.INSTANCE.initialize(e.sound)))}))}static createScanner(e,t,n,i=(()=>Promise.resolve())){return Ph(this,void 0,void 0,(function*(){return this.scannerAbortHandler=new kh,yield i(),new Promise(((i,r)=>{const{root:o,unmount:a}=this.createRoot(),s=e=>Ph(this,void 0,void 0,(function*(){yield a(),r(e),this.scannerAbortHandler=null})),c=e=>Ph(this,void 0,void 0,(function*(){yield a(),i(e),this.scannerAbortHandler=null}));this.scannerAbortHandler.setCancelFunction((()=>c(null))),o.render(T.default.createElement(e,Object.assign({root:o,configuration:n,onClose:()=>c(null),onSubmit:c,onError:s},t))),this.checkLicense(s)}))}))}static checkLicense(e){(()=>{Ph(this,void 0,void 0,(function*(){try{const t=yield Jh.instance.getLicenseInfo();t.isValid()||e(new x(t))}catch(t){e(t)}}))})()}static createRoot(){const e=Lh.createContainer("scanbot-rtu-ui-controller"),t=Object(O.createRoot)(e);return{unmount:()=>Ph(this,void 0,void 0,(function*(){return new Promise((n=>{window.setTimeout((()=>{t.unmount(),document.body.removeChild(e),n()}),0)}))})),root:t}}static createContainer(e){const t=document.createElement("div");return t.id=e,t.style.position="fixed",t.style.width="100%",t.style.height=`calc(100 * ${R})`,t.style.zIndex="1000",t.style.top="0",t.style.left="0",t.style.backgroundColor="rgba(0, 0, 0, 0.5)",document.body.appendChild(t),t}}Lh.SBDocument=ph,Lh.Config=k,Lh.scannerAbortHandler=null;var _h=Lh,Rh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};ue.a;ue.b;class Mh extends Rs.b{constructor(e){super(e),this.shouldComputeSize=!0,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this.props.configuration}get enabled(){return!this.disposed}static create(e){return Rh(this,void 0,void 0,(function*(){const t=_s.a.findContainerOrThrow(e);return new Promise(((n,i)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(t),this.root.render(T.default.createElement(Mh,{root:this.root,container:t,configuration:e,onSuccess:n,onFailure:i}))}))}))}onSdkReady(){return Rh(this,void 0,void 0,(function*(){if(this.configuration instanceof D)this.scanner=yield this.bridge.api.VinScanner.create(this.configuration.detectionConfiguration);else{if(!(this.configuration instanceof E))throw new Error(`Configuration type not supported: ${this.configuration}. \n Must be either VinScannerViewConfiguration or TextPatternScannerViewConfiguration`);this.scanner=yield this.bridge.api.TextPatternScanner.create(this.configuration.ocrConfiguration)}}))}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Rh(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback)}))}componentWillUnmount(){var e;super.componentWillUnmount(),null===(e=this.scanner)||void 0===e||e.destroy(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return Rh(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}pauseDetection(){var e;super.pauseDetection(),null===(e=this.scanner)||void 0===e||e.cleanRecognitionQueue()}detect(){var e,t,n,i,r;return Rh(this,void 0,void 0,(function*(){const o=this.shouldComputeSize;let a=!1;try{if(!this.enabled)return;if(this.paused)return;this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const i=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Mh.FRAME_RESOLUTION);if(!i)return;o&&this.forceUpdate();const r=yield null===(n=this.scanner)||void 0===n?void 0:n.run(d.Image.fromImageData(i));if(!this.enabled)return;if(null===r)return;if(r){if(a=!0,this.configuration instanceof D){const e=r;""===e.result.textResult.rawText&&""===e.result.barcodeResult.extractedVIN||this.configuration.onVinDetected(e)}else if(this.configuration instanceof E){const e=r;this.configuration.onTextDetected(e)}this.camera.reusableImageBuffer=r.originalImage}}catch(e){null===(r=(i=this.configuration).onError)||void 0===r||r.call(i,e)}finally{a?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){return this.renderView(this.configuration)}}Mh.FRAME_RESOLUTION=1200,Mh.root=null;var Fh=Mh,Nh=n(60),Vh=n(41);var Wh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class jh{constructor(){this.tokenCounter=0,this.taskMap=new Map,this.worker=function(){const e=n(91).default.replace("data:application/javascript;charset=utf-8;base64,",""),t=atob(e),i=new Blob([t],{type:"application/javascript"}),r=URL.createObjectURL(i);return new Worker(r)}(),this.worker.onmessage=e=>{const t=e.data,n=t.token;if(this.taskMap.has(n)){(0,this.taskMap.get(n).resolve)(t.data),this.taskMap.delete(n)}else console.error("Unknown token:",n)},this.worker.onerror=e=>{const t=JSON.parse(e.message.replace("Uncaught Error: ","")),n=t.token;if(console.log("Error processed:",t),this.taskMap.has(n)){(0,this.taskMap.get(n).reject)(t),this.taskMap.delete(n)}else console.error("Unknown token:",n)}}generateUniqueToken(){return this.tokenCounter++,"token_"+this.tokenCounter+"_"+Math.random().toString(36).substr(2,9)}query(e){return Wh(this,void 0,void 0,(function*(){const t=this.generateUniqueToken();return this.worker.postMessage({token:t,query:e}),new Promise(((e,n)=>{this.taskMap.set(t,{resolve:e,reject:n})}))}))}destroy(){this.worker.terminate()}}var zh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Hh{persist(){return zh(this,void 0,void 0,(function*(){const e=yield navigator.storage.persist();return e?console.log("Storage will not be cleared except by explicit user action"):console.log("Storage may be cleared by the UA under storage pressure."),e}))}estimate(){return zh(this,void 0,void 0,(function*(){yield navigator.storage.estimate();return!0}))}}var Uh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Zh{constructor(){this.utils=new Hh,this.db=new jh}clear(){return Uh(this,void 0,void 0,(function*(){yield this.db.query({type:"clear"})}))}delete(){return Uh(this,void 0,void 0,(function*(){yield this.db.query({type:"delete"})}))}getDocumentScannerResponses(e=!0){return Uh(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getDocumentScannerResponses"});if(!e)return t;const n=t.map((e=>e.id)),i=yield this.getDocumentScannerResponseImages(n);for(const e of t)this.mapImages(e,i);return t}))}getDocumentScannerResponse(e){return Uh(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getDocumentScannerResponse",data:e}),n=yield this.getDocumentScannerResponseImage(e);return this.mapImages(t,n),t}))}mapImages(e,t){const n=n=>{var i;const r=null===(i=t.find((t=>t.documentId===e.id&&t.type===n)))||void 0===i?void 0:i.data;return r?d.Image.fromWrappedImage(r):null};e.originalImage=n("original"),e.result&&(e.result.croppedImage=n("cropped"))}getDocumentScannerResponseImages(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:e})}))}getDocumentScannerResponseImage(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:[e]})}))}storeDocumentScannerResponse(e){var t;return Uh(this,void 0,void 0,(function*(){const n=JSON.parse(JSON.stringify(e));n.result.croppedImage=null,n.originalImage=null;const i=yield this.db.query({type:"storeDocumentScannerResponse",data:n}),r=[{documentId:i,data:e.originalImage.__image_data,type:"original"}];return(null===(t=e.result)||void 0===t?void 0:t.croppedImage)&&r.push({documentId:i,data:e.result.croppedImage.__image_data,type:"cropped"}),yield this.db.query({type:"storeImages",data:r}),i}))}getSBDocumentIds(){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocumentIds"})}))}getSBDocumentData(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocument",data:e})}))}insertSBDocument(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"insertSBDocument",data:e.getData()})}))}deleteSBDocument(e){return Uh(this,void 0,void 0,(function*(){const t="number"==typeof e?e:e.getData().id;return yield this.db.query({type:"deleteSBDocument",data:t})}))}insertSBPageImage(e){return Uh(this,void 0,void 0,(function*(){const t={data:e.__image_data};return yield this.db.query({type:"insertSBPageImage",data:t})}))}getSBPageImage(e){return Uh(this,void 0,void 0,(function*(){const t=yield this.db.query({type:"getSBPageImage",data:e});return d.Image.fromWrappedImage(t.data)}))}insertBuffer(e){return Uh(this,void 0,void 0,(function*(){const t={data:e};return yield this.db.query({type:"insertImageBuffer",data:t})}))}getBuffer(e){return Uh(this,void 0,void 0,(function*(){return(yield this.db.query({type:"getImageBuffer",data:e})).data}))}deleteImageById(e){return Uh(this,void 0,void 0,(function*(){return yield this.db.query({type:"deleteSBPageImages",data:[e]})}))}deleteImages(e){return Uh(this,void 0,void 0,(function*(){const t=e instanceof nh?e.getData():e,n=[t.originalImageId];t.documentImageId&&n.push(t.documentImageId),yield this.db.query({type:"deleteSBPageImages",data:n})}))}destroy(){this.db.destroy()}}class Gh extends w.a{constructor(){super(S.a.DEFAULT_VIDEO_RESOLUTION_HD),this.scannerConfiguration=new d.CheckScannerConfiguration,this.onCheckDetected=function(e){},this.finder.aspectRatio=new d.AspectRatio({width:1.5,height:1}),this.userGuidance.title.text="Please hold the device over a check to start scanning"}static fromJson(e){var t;const n=new Gh;return this.mapValues(e,n,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(n,e),this.mapVideoConstraints(e,n),n.scannerConfiguration=new d.CheckScannerConfiguration(null!==(t=e.scannerConfiguration)&&void 0!==t?t:{}),n}}var Yh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};Rs.a;class Qh extends Rs.b{constructor(e){super(e),this.configuration=e.configuration}static create(e,t){return Yh(this,void 0,void 0,(function*(){const n=_s.a.findContainerOrThrow(t);return t=Gh.fromJson(t),new Promise(((i,r)=>{this.root&&this.root.unmount(),this.root=Object(O.createRoot)(n),this.root.render(T.default.createElement(Qh,{root:this.root,container:n,configuration:t,onSuccess:i,onFailure:r,sdk:e}))}))}))}onSdkReady(){return Yh(this,void 0,void 0,(function*(){this.handle=yield this.bridge.api.CheckScanner.create(this.props.configuration.scannerConfiguration)}))}componentWillUnmount(){var e;super.componentWillUnmount(),null===(e=this.handle)||void 0===e||e.destroy()}get enabled(){return!this.disposed&&!this.paused}detect(){var e,t,n,i,r,o,a,s,c;return Yh(this,void 0,void 0,(function*(){if(!this.enabled)return;let u=!1;try{const s=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(Qh.FRAME_RESOLUTION);if(!s||!this.handle)return;const c=yield null===(t=this.handle)||void 0===t?void 0:t.run(d.Image.fromImageData(s),"CONSUME_IMAGE");if(null===c)return void(null===(i=(n=this.props).onLicenseError)||void 0===i||i.call(n));if(!this.enabled)return;this.camera.reusableImageBuffer=null==c?void 0:c.originalImage;const l=null===(r=null==c?void 0:c.result)||void 0===r?void 0:r.status;"SUCCESS"!==l&&"INCOMPLETE_VALIDATION"!==l||(u=!0,null===(a=(o=this.props.configuration).onCheckDetected)||void 0===a||a.call(o,c.result))}catch(e){null===(c=(s=this.configuration).onError)||void 0===c||c.call(s,e)}finally{u?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}render(){return this.renderView(this.configuration)}}Qh.FRAME_RESOLUTION=1200,Qh.root=null;var qh=Qh,Xh=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Kh{constructor(){this.storage=new Zh}static get UI(){if(!i.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return Kh._ui2}static initialize(e){var t;return Xh(this,void 0,void 0,(function*(){const n=new Kh,i=e.enginePath||Kh.defaultEnginePath,r=!!e.allowThreads,o=null!==(t=e.requestSuffix)&&void 0!==t?t:`?${n.version}`;if(!i)throw new Error("To initialize the ScanbotSDK, please specify the enginePath option. This option should specify the location of the accompanying WASM and JS files in the bundle folder. It can either point to your server or a CDN. Please note that this option has been renamed from engine -> enginePath recently. Please see our documentation for more details on how to set up the enginePath correctly.");const a=[e.licenseKey,i,window.location.hostname,{captureConsole:!1,allowThreads:r,requestSuffix:o}];return n.bridge=new u(i,{allowSimd:!0,allowThreads:r,requestSuffix:o},a),n.bridge.awaitInitialized().then((()=>{var t;null===(t=e.onComplete)||void 0===t||t.call(e)})).catch((t=>{var n;null===(n=e.onComplete)||void 0===n||n.call(e,t)})),Kh.instance=n,window.scanbotSdk=n,I.a.initialize(e.verboseLogging),e.allowThreads&&!Object(l.a)()&&(I.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&I.a.debugWarn("The site is not cross-origin isolated. This prevents multithreading in the ScanbotSDK. To enable multithreading, you need to set the 'Cross-Origin-Opener-Policy' and 'Cross-Origin-Embedder-Policy' http headers. See our documentation for details.")),this.cameras.initialize(null==e?void 0:e.bestCameraDetectionStrategy),n}))}createDocumentScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return t=yield Ju.create(e,this),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createMrzScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return t=yield Sh.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createBarcodeScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return t=yield Ns.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createCheckScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return t=yield qh.create(this,e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}openCroppingView(e){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield Jm.create(e,this)}))}createTextPatternScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return e=E.fromJson(e),t=yield Fh.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createVinScanner(e){return Xh(this,void 0,void 0,(function*(){let t;try{return e=D.fromJson(e),t=yield Fh.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createDocumentQualityAnalyzer(e){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.api.DocumentQualityAnalyzer.create(e)}))}createDocumentDataExtractor(e){return Xh(this,void 0,void 0,(function*(){let t;try{const i=n(92).default;return t=yield i.create(this,e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}toDataUrl(e){return Xh(this,void 0,void 0,(function*(){return B.throwIfMissingBuffer(e),yield b.toDataUrl(e)}))}detectDocument(e,t={},n="COPY_IMAGE"){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(e);const i=new d.DocumentScannerConfiguration({parameters:t}),r=yield this.bridge.api.DocumentScanner.create(i);return(yield r.scan(e,n)).result}))}detectAndCropDocument(e,t="COPY_IMAGE"){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(e);const n=new d.DocumentScannerConfiguration,i=yield this.bridge.api.DocumentScanner.create(n),r=yield i.scan(e,t);return yield i.destroy(),r}))}detectBarcodes(e,t={},n="COPY_IMAGE"){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(e),"string"==typeof e&&(e=d.Image.fromImageData(yield b.loadFromUrl(e)));const i=Object.assign({},t),r=yield this.bridge.api.BarcodeScanner.create(i);return yield r.run(e,n)}))}parseBarcodeDocument(e,t){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck();const n=yield this.bridge.api.BarcodeDocumentParser.create(e);return yield n.parse(t)}))}createMrzScannerEngine(e){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),e||(e=new d.MrzScannerConfiguration({frameAccumulationConfiguration:{maximumNumberOfAccumulatedFrames:0}})),yield this.bridge.api.MrzScanner.create(e)}))}createOcrEngine(){return Xh(this,void 0,void 0,(function*(){return yield this.bridge.api.OcrEngine.create()}))}createImageProcessor(){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.api.ImageProcessor.create()}))}getLicenseInfo(){return Xh(this,void 0,void 0,(function*(){return new m(yield this.bridge.copyArgs.getLicenseInfo())}))}beginPdf(e){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new f(this,yield this.bridge.copyArgs.beginPdf(e))}))}beginTiff(e={}){return Xh(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new g(this,yield this.bridge.copyArgs.beginTiff(e))}))}imageToJpeg(e,t="COPY_IMAGE"){return Xh(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(t).encodeJpeg(e)}))}get version(){return i.VERSION}get utils(){return this._utils||(this._utils=new A),this._utils}getBridge(e){return"CONSUME_IMAGE"===e?this.bridge.transferArgs:this.bridge.copyArgs}licenseCheck(){return Xh(this,void 0,void 0,(function*(){const e=yield this.getLicenseInfo();if(!e.isValid())throw console.error(`LicenseError: ${e.status}`),new x(e)}))}}Kh.defaultEnginePath="",Kh._ui2=i.BUILD_WITH_UI?_h:void 0,Kh.cameras=Vh.a.INSTANCE,Kh.Config=d,Kh._stats=Nh.a.INSTANCE;var Jh=t.a=Kh},function(e,t,n){"use strict";var i=n(88),r=n.n(i)()((function(e){return e[1]}));r.push([e.i,"\n.scanbot-shutter-fade-in {\n opacity: 1;\n}\n\n.scanbot-shutter-fade-out {\n opacity: 0;\n}\n\n.scanbot-shutter-rotate {\n animation: scanbot-shutter-rotating linear infinite;\n}\n\n.scanbot-shutter-pulse-fast {\n animation: scanbot-shutter-pulsing 1s ease-in-out infinite;\n}\n\n.scanbot-shutter-button {\n position: relative;\n width: 64px;\n height: 64px;\n left: 50%;\n bottom: 18px;\n transform: translate(-50%, -100%);\n z-index: 1000;\n}\n\n.scanbot-shutter-button-part {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n transition: opacity 0.5s ease-in-out;\n}\n\n@keyframes scanbot-shutter-rotating {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes scanbot-shutter-pulsing {\n 0% {\n opacity: 0.25;\n }\n 50% {\n opacity: 0.8;\n }\n 100% {\n opacity: 0.25;\n }\n}\n",""]),t.a=r},function(e,t){var n,i,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c,u=[],l=!1,d=-1;function m(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!l){var e=s(m);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new f(e,t)),1!==u.length||l||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t){e.exports=function(e,t,n,i){var r=n?n.call(i,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<o.length;c++){var u=o[c];if(!s(u))return!1;var l=e[u],d=t[u];if(!1===(r=n?n.call(i,l,d,u):void 0)||void 0===r&&l!==d)return!1}return!0}},function(e,t,n){"use strict";t.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(e,t,n){"use strict";var i,r=function(){return"undefined"==typeof i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var e={};return function(t){if("undefined"==typeof e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},i=[],r=0;r<e.length;r++){var o=e[r],c=t.base?o[0]+t.base:o[0],u=n[c]||0,l="".concat(c," ").concat(u);n[c]=u+1;var d=s(l),m={css:o[1],media:o[2],sourceMap:o[3]};-1!==d?(a[d].references++,a[d].updater(m)):a.push({identifier:l,updater:g(m,t),references:1}),i.push(l)}return i}function u(e){var t=document.createElement("style"),i=e.attributes||{};if("undefined"==typeof i.nonce){var r=n.nc;r&&(i.nonce=r)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var l,d=(l=[],function(e,t){return l[e]=t,l.filter(Boolean).join("\n")});function m(e,t,n,i){var r=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=d(t,r);else{var o=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function h(e,t,n){var i=n.css,r=n.media,o=n.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var f=null,p=0;function g(e,t){var n,i,r;if(t.singleton){var o=p++;n=f||(f=u(t)),i=m.bind(null,n,o,!1),r=m.bind(null,n,o,!0)}else n=u(t),i=h.bind(null,n,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<n.length;i++){var r=s(n[i]);a[r].references--}for(var o=c(e,t),u=0;u<n.length;u++){var l=s(n[u]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}n=o}}}},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(i)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(r[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);i&&r[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},function(e,t,n){"use strict";function i(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,"a",(function(){return o}));var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=i((function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},function(e,t,n){"use strict";n.r(t),n.d(t,"ScanbotSDK",(function(){return i}));const i=n(82).a},function(e,t,n){"use strict";n.r(t),t.default="data:application/javascript;charset=utf-8;base64,InVzZSBzdHJpY3QiOwoKY29uc3QgREJfTkFNRSA9ICJTQlNES0Jhc2UiOwoKY29uc3QgU1RPUkVTID0gewogICAgRE9DVU1FTlRfU0NBTk5FUl9SRVNQT05TRVM6ICJkb2N1bWVudFNjYW5uZXJSZXN1bHRzIiwKICAgIFNCX0RPQ1VNRU5UUzogIlNCRG9jdW1lbnRzIiwKICAgIElNQUdFUzogImltYWdlcyIKCiAgICAvKioKICAgICAqIEBwYXJhbSB7c3RyaW5nfSB0b2tlbgogICAgICogQHBhcmFtIHt7IHR5cGU6IHN0cmluZywgZGF0YTogYW55IH19IHF1ZXJ5CiAgICAgKiBAcGFyYW0ge0V2ZW50fSBldmVudAogICAgICogKi8KCn07c2VsZi5hZGRFdmVudExpc3RlbmVyKCd1bmhhbmRsZWRyZWplY3Rpb24nLCBmdW5jdGlvbiAoZXZlbnQpIHsKICAgIC8vIFRoZSB3YXkgdG8gcHJvcGVybHkgdHJpZ2dlciB3b3JrZXIgZXJyb3JzIGlzIHRvIGNhdGNoIHRoZSB1bmhhbmRsZWQgcmVqZWN0aW9uIGZpcnN0LCB0aGVuIHRocm93OgogICAgLy8gaHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMvMjgwMDE3MjIvaG93LXRvLWNhdGNoLXVuY2F1Z2h0LWV4Y2VwdGlvbi1pbi1wcm9taXNlCiAgICAvLyBUaGlzIGV2ZW50IG9iamVjdCBoYXMgdHdvIHNwZWNpYWwgcHJvcGVydGllczoKICAgIC8vIGV2ZW50LnByb21pc2UgLSB0aGUgcHJvbWlzZSB0aGF0IGdlbmVyYXRlZCB0aGUgZXJyb3IKICAgIC8vIGV2ZW50LnJlYXNvbiAgLSB0aGUgdW5oYW5kbGVkIGVycm9yIG9iamVjdAogICAgdGhyb3cgZXZlbnQucmVhc29uOwp9KTsKCmZ1bmN0aW9uIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCBldmVudCkgewogICAgZXZlbnQub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IGV2ZW50LnRhcmdldC5yZXN1bHQgfSk7CiAgICB9OwogICAgZXZlbnQub25lcnJvciA9IGV2ZW50ID0+IHsKICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksICJFcnJvciBpbiBJbmRleGVkREIgcmVxdWVzdDogIiArIGV2ZW50LnRhcmdldC5lcnJvcik7CiAgICB9Owp9CgovKioKICogQHJldHVybnMge1Byb21pc2U8SURCRGF0YWJhc2U+fQogKi8KZnVuY3Rpb24gb3BlbkRCKCkgewogICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKCiAgICAgICAgLyoqIE5CISBVcGRhdGUgdmVyc2lvbiB3aGVuIERCIG1vZGVsIGNoYW5nZXMgKi8KICAgICAgICBjb25zdCBEQl9WRVJTSU9OID0gNjsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gaW5kZXhlZERCLm9wZW4oREJfTkFNRSwgREJfVkVSU0lPTik7CgogICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgICAgICByZXNvbHZlKGV2ZW50LnRhcmdldFsicmVzdWx0Il0pOwogICAgICAgIH07CiAgICAgICAgcmVxdWVzdC5vbmVycm9yID0gZXZlbnQgPT4gewogICAgICAgICAgICBjb25zdCBjb2RlID0gZXZlbnQudGFyZ2V0ID8gZXZlbnQudGFyZ2V0WyJlcnJvckNvZGUiXSA6ICJVbmtub3duIGVycm9yIGNvZGUiOwogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIkVycm9yIG9wZW5pbmcgZGF0YWJhc2U6ICIgKyBjb2RlKTsKICAgICAgICB9OwogICAgICAgIHJlcXVlc3Qub251cGdyYWRlbmVlZGVkID0gZXZlbnQgPT4gewogICAgICAgICAgICAvLyBUT0RPOiAnb251cGdyYWRlbmVlZGVkJyBpcyBvbmx5IGNhbGxlZCB3aGVuIEZJUlNUIG9wZW5pbmcgdGhlIGRhdGFiYXNlCiAgICAgICAgICAgIC8vICBBTkQgd2hlbiB0aGUgdmVyc2lvbiBudW1iZXIgaXMgaW5jcmVhc2VkLiBXaGF0IGVsc2UgbmVlZHMgdG8gYmUgZG9uZSBoZXJlPwogICAgICAgICAgICBjb25zdCBkYiA9IGV2ZW50LnRhcmdldCAvKiBhcyBJREJPcGVuREJSZXF1ZXN0Ki8ucmVzdWx0OwoKICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gU1RPUkVTKSB7CiAgICAgICAgICAgICAgICBjb25zdCBuYW1lID0gU1RPUkVTW2tleV07CiAgICAgICAgICAgICAgICAvLyBUT0RPIGNhbid0IGp1c3QgZGVsZXRlIGluIHByb2R1Y3Rpb24sIG5lZWQgdG8gbWlncmF0ZSBkYXRhCiAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgIGRiLmRlbGV0ZU9iamVjdFN0b3JlKG5hbWUpOwogICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHsKICAgICAgICAgICAgICAgICAgICAvLyBDYW4ndCBkZWxldGUgb2JqZWN0IHN0b3JlIHRoYXQgZG9lc24ndCBleGlzdAogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCJFcnJvciBkZWxldGluZyBvYmplY3Qgc3RvcmU6ICIsIG5hbWUpOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGRiLmNyZWF0ZU9iamVjdFN0b3JlKG5hbWUsIHsga2V5UGF0aDogImlkIiwgYXV0b0luY3JlbWVudDogdHJ1ZSB9KTsKICAgICAgICAgICAgfQogICAgICAgIH07CiAgICB9KTsKfQoKLyoqCiAqIEBwYXJhbSB7c3RyaW5nW119IHN0b3JlTmFtZXMKICogQHJldHVybnMge1Byb21pc2U8SURCVHJhbnNhY3Rpb24+fQogKi8KYXN5bmMgZnVuY3Rpb24gZ2V0VHJhbnNhY3Rpb24oc3RvcmVOYW1lcykgewogICAgY29uc3QgZGIgPSBhd2FpdCBvcGVuREIoKTsKICAgIC8vIFRPRE8gaXMgaXQgZXZlciBhY3R1YWxseSBuZWNlc3NhcnkgdG8gd2FpdCBmb3IgYSB0cmFuc2FjdGlvbidzICdvbmNvbXBsZXRlJyBldmVudD8KICAgIHJldHVybiBkYi50cmFuc2FjdGlvbihzdG9yZU5hbWVzLCAicmVhZHdyaXRlIik7Cn0KCi8qKgogKiBAcGFyYW0ge3N0cmluZ30gbmFtZQogKiBAcmV0dXJucyB7UHJvbWlzZTxJREJPYmplY3RTdG9yZT59CiAqLwphc3luYyBmdW5jdGlvbiBnZXRTdG9yZShuYW1lKSB7CiAgICBjb25zdCB0cmFuc2FjdGlvbiA9IGF3YWl0IGdldFRyYW5zYWN0aW9uKFtuYW1lXSk7CiAgICByZXR1cm4gdHJhbnNhY3Rpb24ub2JqZWN0U3RvcmUobmFtZSk7Cn0KCi8qKgogKiBAcmV0dXJucyB7UHJvbWlzZTxJREJPYmplY3RTdG9yZT59CiAqLwphc3luYyBmdW5jdGlvbiBnZXREb2N1bWVudFNjYW5uZXJSZXNwb25zZVN0b3JlKCkgewogICAgcmV0dXJuIGdldFN0b3JlKFNUT1JFUy5ET0NVTUVOVF9TQ0FOTkVSX1JFU1BPTlNFUyk7Cn0KCi8qKgogKiBAcmV0dXJucyB7UHJvbWlzZTxJREJPYmplY3RTdG9yZT59CiAqLwphc3luYyBmdW5jdGlvbiBnZXRJbWFnZXNTdG9yZSgpIHsKICAgIHJldHVybiBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKfQoKYXN5bmMgZnVuY3Rpb24gY2xlYXIoKSB7CiAgICBmb3IgKGNvbnN0IGtleSBpbiBTVE9SRVMpIHsKICAgICAgICBjb25zdCBuYW1lID0gU1RPUkVTW2tleV07CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShuYW1lKTsKICAgICAgICBzdG9yZS5jbGVhcigpOwogICAgfQp9Cgphc3luYyBmdW5jdGlvbiBkZWxldGVEQigpIHsKICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IGluZGV4ZWREQi5kZWxldGVEYXRhYmFzZShEQl9OQU1FKTsKICAgICAgICByZXF1ZXN0Lm9uc3VjY2VzcyA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgcmVzb2x2ZShldmVudCk7CiAgICAgICAgfTsKICAgICAgICByZXF1ZXN0Lm9uZXJyb3IgPSBldmVudCA9PiB7CiAgICAgICAgICAgIHJlamVjdChldmVudCk7CiAgICAgICAgfTsKICAgIH0pOwp9CgovKioKICogQHBhcmFtIHtzdHJpbmd9IHRva2VuCiAqIEBwYXJhbSB7eyB0eXBlOiBzdHJpbmcsIGRhdGE6IGFueSB9fSBxdWVyeQogKiBAcGFyYW0ge3N0cmluZz99IG1lc3NhZ2UKICovCmZ1bmN0aW9uIHRocm93RXhjZXB0aW9uKHRva2VuLCBxdWVyeSwgbWVzc2FnZSkgewogICAgY29uc3QgcGF5bG9hZCA9IHsgdG9rZW46IHRva2VuLCBxdWVyeTogcXVlcnksIG1lc3NhZ2U6IG1lc3NhZ2UgfTsKICAgIGNvbnNvbGUubG9nKCJFcnJvciBpbiBTQkluZGV4ZWREQiB3b3JrZXI6ICIsIHBheWxvYWQpOwogICAgdGhyb3cgbmV3IEVycm9yKEpTT04uc3RyaW5naWZ5KHBheWxvYWQpKTsKfQoKLyoqCiAqIEBwYXJhbSB7TWVzc2FnZUV2ZW50fSBldmVudAogKiBAcmV0dXJucyB7UHJvbWlzZTx2b2lkPn0KICovCnNlbGYub25tZXNzYWdlID0gYXN5bmMgZXZlbnQgPT4gewoKICAgIGNvbnN0IHRva2VuID0gZXZlbnQuZGF0YS50b2tlbjsKICAgIGNvbnN0IHF1ZXJ5ID0gZXZlbnQuZGF0YS5xdWVyeTsKCiAgICBpZiAocXVlcnkudHlwZSA9PT0gJ2NsZWFyJykgewogICAgICAgIGF3YWl0IGNsZWFyKCk7CiAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gJ2RlbGV0ZScpIHsKICAgICAgICBhd2FpdCBkZWxldGVEQigpOwogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IHRydWUgfSk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdzdG9yZURvY3VtZW50U2Nhbm5lclJlc3BvbnNlJykgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0RG9jdW1lbnRTY2FubmVyUmVzcG9uc2VTdG9yZSgpOwogICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5wdXQocXVlcnkuZGF0YSk7CiAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcXVlcnksIHJlcXVlc3QpOwogICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZ2V0RG9jdW1lbnRTY2FubmVyUmVzcG9uc2VzJykgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0RG9jdW1lbnRTY2FubmVyUmVzcG9uc2VTdG9yZSgpOwogICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXRBbGwoKTsKICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCBxdWVyeSwgcmVxdWVzdCk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdnZXREb2N1bWVudFNjYW5uZXJSZXNwb25zZScpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldERvY3VtZW50U2Nhbm5lclJlc3BvbnNlU3RvcmUoKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0KHF1ZXJ5LmRhdGEpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gJ3N0b3JlSW1hZ2VzJykgewogICAgICAgIGNvbnN0IGltYWdlcyA9IHF1ZXJ5LmRhdGE7CiAgICAgICAgY29uc3QgdHJhbnNhY3Rpb24gPSBhd2FpdCBnZXRUcmFuc2FjdGlvbihbU1RPUkVTLklNQUdFU10pOwogICAgICAgIGZvciAoY29uc3QgaW1hZ2Ugb2YgaW1hZ2VzKSB7CiAgICAgICAgICAgIHRyYW5zYWN0aW9uLm9iamVjdFN0b3JlKFNUT1JFUy5JTUFHRVMpLmFkZChpbWFnZSk7CiAgICAgICAgfQogICAgICAgIHRyYW5zYWN0aW9uLm9uY29tcGxldGUgPSBldmVudCA9PiB7CiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IHRydWUgfSk7CiAgICAgICAgfTsKICAgICAgICB0cmFuc2FjdGlvbi5vbmVycm9yID0gKCkgPT4gewogICAgICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksICJFcnJvciBzdG9yaW5nIGltYWdlcyIpOwogICAgICAgIH07CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdnZXRJbWFnZXMnKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRJbWFnZXNTdG9yZSgpOwogICAgICAgIGNvbnN0IGRvY3VtZW50SWRzID0gcXVlcnkuZGF0YTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0QWxsKCk7CgogICAgICAgIC8vIFRPRE86IElmIHRoZXJlIGFyZSBtYW55IGltYWdlcywgY3Vyc29yLWJhc2VkIGl0ZXJhdGlvbiBtaWdodCBiZSBtb3JlIGVmZmljaWVudAogICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgICAgICBjb25zdCBpbWFnZXMgPSBldmVudC50YXJnZXRbInJlc3VsdCJdOwogICAgICAgICAgICBjb25zdCBmaWx0ZXJlZEltYWdlcyA9IGltYWdlcy5maWx0ZXIoaW1hZ2UgPT4gZG9jdW1lbnRJZHMuaW5jbHVkZXMoaW1hZ2UuZG9jdW1lbnRJZCkpOwogICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdG9rZW46IHRva2VuLCBkYXRhOiBmaWx0ZXJlZEltYWdlcyB9KTsKICAgICAgICB9OwogICAgICAgIHJlcXVlc3Qub25lcnJvciA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgdGhyb3dFeGNlcHRpb24odG9rZW4sIHF1ZXJ5LCAiRXJyb3IgZ2V0dGluZyBpbWFnZXMiKTsKICAgICAgICB9OwogICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAiZ2V0U0JEb2N1bWVudElkcyIpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5TQl9ET0NVTUVOVFMpOwogICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXRBbGxLZXlzKCk7CiAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcXVlcnksIHJlcXVlc3QpOwogICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAiaW5zZXJ0U0JEb2N1bWVudCIpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5TQl9ET0NVTUVOVFMpOwogICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5wdXQocXVlcnkuZGF0YSk7CiAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcXVlcnksIHJlcXVlc3QpOwogICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAiZGVsZXRlU0JEb2N1bWVudCIpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5TQl9ET0NVTUVOVFMpOwogICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5kZWxldGUocXVlcnkuZGF0YSk7CiAgICAgICAgcmVxdWVzdC5vbnN1Y2Nlc3MgPSBldmVudCA9PiB7CiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IHRydWUgfSk7CiAgICAgICAgfTsKICAgICAgICByZXF1ZXN0Lm9uZXJyb3IgPSBldmVudCA9PiB7CiAgICAgICAgICAgIHRocm93RXhjZXB0aW9uKHRva2VuLCBxdWVyeSwgIkVycm9yIGRlbGV0aW5nIFNCIGRvY3VtZW50Iik7CiAgICAgICAgfTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImdldFNCRG9jdW1lbnQiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0KHF1ZXJ5LmRhdGEpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImluc2VydFNCUGFnZUltYWdlIiB8fCBxdWVyeS50eXBlID09PSAiaW5zZXJ0SW1hZ2VCdWZmZXIiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUucHV0KHF1ZXJ5LmRhdGEpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImdldFNCUGFnZUltYWdlIiB8fCBxdWVyeS50eXBlID09PSAiZ2V0SW1hZ2VCdWZmZXIiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0KHF1ZXJ5LmRhdGEpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCUGFnZUltYWdlcyIpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5JTUFHRVMpOwogICAgICAgIGNvbnN0IGlkcyA9IHF1ZXJ5LmRhdGE7CiAgICAgICAgZm9yIChjb25zdCBpZCBvZiBpZHMpIHsKICAgICAgICAgICAgc3RvcmUuZGVsZXRlKGlkKTsKICAgICAgICB9CiAgICAgICAgLy8gV2UgY2FuJ3QgcmVhbGx5IGRvIGFueXRoaW5nIGlmIHRoZSBkZWxldGUgZmFpbHMsIHNvIGl0IGRvZXNuJ3QgbWFrZSBzZW5zZSB0byBhd2FpdCB0aGUgcmVzdWx0LgogICAgICAgIC8vIEp1c3QgYXNzdW1lIGl0IHdvcmtlZCBhbmQgcmV0dXJuIHRoZSByZXN1bHQgaW1tZWRpYXRlbHkuCiAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgIH0gZWxzZSB7CiAgICAgICAgdGhyb3dFeGNlcHRpb24odG9rZW4sIHF1ZXJ5LCAiVW5rbm93biBxdWVyeSB0eXBlIik7CiAgICB9Cn07"},function(e,t,n){"use strict";n.r(t);var i=n(0),r=n(21),o=n(14),a=n(8),s=n(17),c=n(26);class u extends c.a{constructor(){super(s.a.DEFAULT_VIDEO_RESOLUTION_HD),this.detectorParameters=new a.DocumentDataExtractorConfiguration({configurations:[]}),this.finder.aspectRatio={width:1.5,height:1},this.userGuidance.title.text="Please hold the device over a document to start scanning"}static fromJson(e){var t;const n=new u;return this.mapValues(e,n,["videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(n,e),this.mapVideoConstraints(e,n),e.detectorParameters&&e.detectorParameters.configurations&&(e.detectorParameters.configurations=[]),n.detectorParameters=new a.DocumentDataExtractorConfiguration(null!==(t=e.detectorParameters)&&void 0!==t?t:{configurations:[]}),n}}var l=n(33),d=n(13),m=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};o.a;class h extends l.b{constructor(e){super(e),this.configuration=e.configuration}static create(e,t){return m(this,void 0,void 0,(function*(){const n=d.a.findContainerOrThrow(t);return t=u.fromJson(t),new Promise(((o,a)=>{this.root&&this.root.unmount(),this.root=Object(r.createRoot)(n),this.root.render(i.default.createElement(h,{root:this.root,container:n,configuration:t,onSuccess:o,onFailure:a,sdk:e}))}))}))}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});var t;return m(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),null===(t=this.handle)||void 0===t||t.destroy()}))}get enabled(){return!this.disposed&&!this.paused}onSdkReady(){return m(this,void 0,void 0,(function*(){this.handle=yield this.props.sdk.bridge.api.DocumentDataExtractor.create(this.configuration.detectorParameters)}))}detect(){var e,t,n,i,r,s,c;return m(this,void 0,void 0,(function*(){try{if(!this.enabled)return;this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const s=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(o.c.DEFAULT_DETECTION_RESOLUTION);if(!s)return;const c=yield null===(n=this.handle)||void 0===n?void 0:n.run(new a.Image(s),"CONSUME_IMAGE");if(!c)return;if(!this.enabled)return;this.camera.reusableImageBuffer=c.originalImage,null===(r=(i=this.configuration).onDocumentDetected)||void 0===r||r.call(i,c.result)}catch(e){null===(c=(s=this.configuration).onError)||void 0===c||c.call(s,e)}finally{requestAnimationFrame((()=>this.detect()))}}))}render(){return this.renderView(this.configuration)}}h.root=null;t.default=h},function(e,t,n){"use strict";n.r(t);var i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.default=r}])}));
|