scanbot-web-sdk 7.0.0 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/interfaces/i-document-scanner-handle.d.ts +1 -1
- package/@types/scanbot-sdk.d.ts +1 -1
- package/bundle/ScanbotSDK.min.js +3 -3
- package/bundle/ScanbotSDK.ui2.min.js +6 -6
- 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(r,{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(27),c=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d 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 u}get bridge(){var e;return(null!==(e=this.props.sdk)&&void 0!==e?e:o.a.instance).bridge}dispose(){const{container:e}=this.props;e&&Object(i.render)(null,e)}componentDidMount(){this.disposed=!1,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(e){this.camera.swapCameraFacing(e)}switchCamera(e,t){return c(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)}}d.DEFAULT_DETECTION_RESOLUTION=600,d.DETECTION_RESULTION_4K=3840},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 extends Error{constructor(e,t,n){super(t),this.name="",this.name=e,this.message=t,this.webApiError=n}static mediaDevicesUndefined(){return new o(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 o(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 o(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 o(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",e)}static unknown(e){return new o(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.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?o.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===e.name?o.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:o.unknown(null==e?void 0:e.message)}}o.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},o.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,"a",(function(){return o}));var i=n(39);class o 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)}}o.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},o.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},o.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,o.DEFAULT_ACCEPTED_ANGLE_SCORE=75,o.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(e,t,n){"use strict";n.r(t),n.d(t,"SingleScanningMode",(function(){return l})),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 y})),n.d(t,"FindAndPickScanningMode",(function(){return b})),n.d(t,"BarcodeTextLocalization",(function(){return S})),n.d(t,"BarcodesExtensionFilterValues",(function(){return w})),n.d(t,"BarcodeScannerConfiguration",(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,"BarcodeScannerScreenConfiguration",(function(){return N})),n.d(t,"BarcodeScannerUiItem",(function(){return V})),n.d(t,"BarcodeScannerUiResult",(function(){return W})),n.d(t,"MultipleBarcodesScanningModeValues",(function(){return u})),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,"BarcodeItem",(function(){return M.a})),n.d(t,"BarcodeScannerEngineModeValues",(function(){return M.c})),n.d(t,"AcknowledgementModeValues",(function(){return z})),n.d(t,"AcknowledgementBottomBar",(function(){return j})),n.d(t,"AcknowledgementScreenConfiguration",(function(){return H})),n.d(t,"ShutterButton",(function(){return q})),n.d(t,"PreviewButton",(function(){return Y})),n.d(t,"ScanAssistanceOverlay",(function(){return K})),n.d(t,"PagePreviewMode",(function(){return J})),n.d(t,"TextButtonMode",(function(){return $})),n.d(t,"NoButtonMode",(function(){return ee})),n.d(t,"CameraBottomBar",(function(){return te})),n.d(t,"PageSnapFeedbackMode",(function(){return Q})),n.d(t,"PageSnapFunnelAnimation",(function(){return ne})),n.d(t,"PageSnapCheckMarkAnimation",(function(){return ie})),n.d(t,"PageSnapFeedbackNone",(function(){return oe})),n.d(t,"CaptureFeedback",(function(){return re})),n.d(t,"DocumentPolygonConfiguration",(function(){return ae})),n.d(t,"SelectCameraMenu",(function(){return se})),n.d(t,"CameraScreenConfiguration",(function(){return ce})),n.d(t,"CroppingBottomBar",(function(){return le})),n.d(t,"CroppingScreenConfiguration",(function(){return ue})),n.d(t,"DocumentScannerCameraConfiguration",(function(){return U})),n.d(t,"UserGuidanceVisibilityValues",(function(){return de})),n.d(t,"DocumentAnalysisModeValues",(function(){return he})),n.d(t,"DocumentScannerOutputSettings",(function(){return fe})),n.d(t,"DocumentScannerScreens",(function(){return ye})),n.d(t,"DocumentScannerTextLocalization",(function(){return be})),n.d(t,"UserGuidanceStates",(function(){return Z})),n.d(t,"DocumentScannerUserGuidance",(function(){return G})),n.d(t,"DocumentFlowAppearanceConfiguration",(function(){return Ae})),n.d(t,"DocumentScanningFlow",(function(){return Se})),n.d(t,"IntroListEntry",(function(){return X.g})),n.d(t,"IntroImage",(function(){return X.f})),n.d(t,"NoIntroImage",(function(){return X.j})),n.d(t,"ReceiptsIntroImage",(function(){return X.k})),n.d(t,"MedicalCertificateIntroImage",(function(){return X.i})),n.d(t,"DocumentIntroImage",(function(){return X.d})),n.d(t,"CheckIntroImage",(function(){return X.a})),n.d(t,"IdCardIntroImage",(function(){return X.e})),n.d(t,"CreditCardIntroImage",(function(){return X.b})),n.d(t,"CustomImage",(function(){return X.c})),n.d(t,"IntroductionScreenConfiguration",(function(){return X.h})),n.d(t,"ReviewBottomBarConfiguration",(function(){return pe})),n.d(t,"ReviewMorePopupMenu",(function(){return ge})),n.d(t,"ZoomOverlay",(function(){return ve})),n.d(t,"ReviewScreenConfiguration",(function(){return Ce})),n.d(t,"Resolution",(function(){return T})),n.d(t,"CameraModuleValues",(function(){return B})),n.d(t,"CameraConfiguration",(function(){return I})),n.d(t,"TopBarConfiguration",(function(){return R.a})),n.d(t,"TopBarModeValues",(function(){return R.b})),n.d(t,"ActionBarConfiguration",(function(){return x})),n.d(t,"ScanbotAlertDialog",(function(){return C})),n.d(t,"CameraPermissionScreen",(function(){return k})),n.d(t,"OcrResult",(function(){return we.h})),n.d(t,"FieldValidationStatusValues",(function(){return we.e})),n.d(t,"FieldDataFormatValues",(function(){return we.b})),n.d(t,"FieldParsedData",(function(){return we.c})),n.d(t,"FieldType",(function(){return we.d})),n.d(t,"Field",(function(){return we.a})),n.d(t,"GenericDocumentType",(function(){return we.g})),n.d(t,"GenericDocument",(function(){return we.f})),n.d(t,"Palette",(function(){return o.i})),n.d(t,"StyledText",(function(){return o.o})),n.d(t,"IconStyle",(function(){return o.h})),n.d(t,"IconButton",(function(){return o.g})),n.d(t,"PolygonStyle",(function(){return o.j})),n.d(t,"BackgroundStyle",(function(){return o.a})),n.d(t,"ForegroundStyle",(function(){return o.f})),n.d(t,"BadgeStyle",(function(){return o.b})),n.d(t,"RoundButton",(function(){return o.l})),n.d(t,"BadgedButton",(function(){return o.c})),n.d(t,"ButtonConfiguration",(function(){return o.e})),n.d(t,"PopupMenuItem",(function(){return o.k})),n.d(t,"BarButtonConfiguration",(function(){return o.d})),n.d(t,"SoundTypeValues",(function(){return o.n})),n.d(t,"Sound",(function(){return o.m})),n.d(t,"Vibration",(function(){return o.q})),n.d(t,"Timeouts",(function(){return o.p})),n.d(t,"ViewFinderConfiguration",(function(){return O})),n.d(t,"FinderStyle",(function(){return L})),n.d(t,"FinderCorneredStyle",(function(){return P})),n.d(t,"FinderStrokedStyle",(function(){return _})),n.d(t,"UserGuidanceConfiguration",(function(){return F.b})),n.d(t,"IconUserGuidanceConfiguration",(function(){return F.a})),n.d(t,"NavigationBarModeValues",(function(){return Ee}));var i=n(10),o=n(1),r=n(6);class a extends r.a{constructor(e={}){super(),this.title=new o.o({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new o.o({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 o.e({}),this.cancelButton=new o.e({}),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.subtitle&&(this.subtitle=new o.o(e.subtitle)),void 0!==e.retryButton&&(this.retryButton=new o.e(e.retryButton)),void 0!==e.cancelButton&&(this.cancelButton=new o.e(e.cancelButton))}}class s extends r.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 r.a{constructor(e={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new o.o({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 o.o(e.loadingMessage)),void 0!==e.errorState&&(this.errorState=new a(e.errorState))}}class l extends r.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 o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new o.o({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new o.e({visible:!0,text:"?sheetSubmitButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new o.e({visible:!0,text:"?singleModeConfirmationCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new c({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new o.o({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new o.o({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new o.e({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new o.e({text:"?barcodeInfoMappingErrorStateCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new i.b({visible:!1,counterBadge:new o.b({visible:!0,background:new o.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new i.c({visible:!0,deselected:new o.j({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new o.j({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new i.d({imageVisible:!0,titleSelected:new o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new o.o({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new o.o({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new o.j({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new o.j({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 o.o(e.barcodeTitle)),void 0!==e.barcodeSubtitle&&(this.barcodeSubtitle=new o.o(e.barcodeSubtitle)),void 0!==e.submitButton&&(this.submitButton=new o.e(e.submitButton)),void 0!==e.cancelButton&&(this.cancelButton=new o.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 u=["COUNTING","UNIQUE"],d=["BUTTON","COLLAPSED_SHEET"],m=["SMALL","LARGE"];class h extends r.a{constructor(e={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new o.c({}),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.collapsedVisibleHeight&&(this.collapsedVisibleHeight=e.collapsedVisibleHeight),void 0!==e.listButton&&(this.listButton=new o.c(e.listButton))}}class f extends r.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 r.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new o.o({text:"Update count",color:"?sbColorOnSurface"}),this.info=new o.o({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new o.e({visible:!0,text:"Update",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new o.e({visible:!0,text:"Cancel",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new o.h({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 o.o(e.title)),void 0!==e.info&&(this.info=new o.o(e.info)),void 0!==e.updateButton&&(this.updateButton=new o.e(e.updateButton)),void 0!==e.cancelButton&&(this.cancelButton=new o.e(e.cancelButton)),void 0!==e.clearTextButton&&(this.clearTextButton=new o.h(e.clearTextButton))}}class g extends r.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new o.o({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new o.e({visible:!0,text:"Clear all",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new o.o({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new o.o({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new o.e({visible:!0,text:"Submit",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new o.e({visible:!0,text:"Start scanning",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new o.o({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new o.o({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 o.h({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 o.o(e.title)),void 0!==e.clearAllButton&&(this.clearAllButton=new o.e(e.clearAllButton)),void 0!==e.barcodeItemTitle&&(this.barcodeItemTitle=new o.o(e.barcodeItemTitle)),void 0!==e.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new o.o(e.barcodeItemSubtitle)),void 0!==e.barcodeItemImageVisible&&(this.barcodeItemImageVisible=e.barcodeItemImageVisible),void 0!==e.submitButton&&(this.submitButton=new o.e(e.submitButton)),void 0!==e.startScanningButton&&(this.startScanningButton=new o.e(e.startScanningButton)),void 0!==e.placeholderTitle&&(this.placeholderTitle=new o.o(e.placeholderTitle)),void 0!==e.placeholderSubtitle&&(this.placeholderSubtitle=new o.o(e.placeholderSubtitle)),void 0!==e.placeholderIconBackground&&(this.placeholderIconBackground=e.placeholderIconBackground),void 0!==e.placeholderIcon&&(this.placeholderIcon=new o.h(e.placeholderIcon)),void 0!==e.swipeToDelete&&(this.swipeToDelete=new f(e.swipeToDelete))}}class v extends r.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 o.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 o.o({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new o.e({visible:!0,text:"?sheetClearAllButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new o.o({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new o.o({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new o.e({visible:!0,text:"?sheetSubmitButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new o.e({visible:!0,text:"?sheetStartScanningButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new o.o({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new o.o({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new o.h({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 o.o({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new o.o({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new o.e({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?manualCountEditDialogCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new o.h({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new c({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new o.o({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new o.o({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new o.e({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new i.b({visible:!1,counterBadge:new o.b({visible:!0,background:new o.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new i.c({visible:!0,deselected:new o.j({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new o.j({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new i.d({imageVisible:!0,titleSelected:new o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new o.o({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new o.o({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new o.o({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new o.j({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new o.j({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 C extends r.a{constructor(e={}){super(),this.title=new o.o({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new o.o({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",this.okButton=new o.e({background:new o.a({fillColor:"?sbColorPrimary"})}),this.actionButton=new o.e({visible:!1,background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),this.cancelButton=new o.e({visible:!0,background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.subtitle&&(this.subtitle=new o.o(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 o.e(e.okButton)),void 0!==e.actionButton&&(this.actionButton=new o.e(e.actionButton)),void 0!==e.cancelButton&&(this.cancelButton=new o.e(e.cancelButton))}}class y extends r.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 r.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 o.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 o.o({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new o.e({visible:!0,text:"?sheetResetButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new o.o({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new o.e({visible:!0,text:"?sheetSubmitButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new o.e({visible:!0,text:"?sheetStartScanningButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new o.o({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new o.o({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new o.h({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 o.o({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new o.o({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new o.e({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?manualCountEditDialogCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new o.h({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new i.a({visible:!0,automaticSelectionEnabled:!0,polygon:new i.f({partiallyScanned:new o.j({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new o.j({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new o.j({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new i.g({partiallyScanned:new o.b({visible:!0,background:new o.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new o.b({visible:!0,background:new o.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new o.b({visible:!0,background:new o.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new C({title:new o.o({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new o.e({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new C({title:new o.o({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new o.e({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({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 y(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 C(e.partialScannedAlertDialog)),void 0!==e.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=e.confirmationAlertDialogEnabled),void 0!==e.confirmationAlertDialog&&(this.confirmationAlertDialog=new C(e.confirmationAlertDialog))}}var A;(A||(A={})).From=function(e){const t=e._type;switch(t){case"SingleScanningMode":return new l(e);case"MultipleScanningMode":return new v(e);case"FindAndPickScanningMode":return new b(e);default:throw`Unknown child class name: ${t}`}};class S extends r.a{constructor(e={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",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.findAndPickCompleteAlertSubmitButton="Submit",void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),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.findAndPickCompleteAlertSubmitButton&&(this.findAndPickCompleteAlertSubmitButton=e.findAndPickCompleteAlertSubmitButton)}}const w=["NO_FILTER","ONLY_WITH_EXTENSIONS","ONLY_WITHOUT_EXTENSIONS"];class E extends r.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.barcodesExtensionFilter="NO_FILTER",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,void 0!==e.extractedDocumentFormats&&(this.extractedDocumentFormats=e.extractedDocumentFormats.map((e=>e))),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)}}class x extends r.a{constructor(e={}){super(),this.flashButton=new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==e.flashButton&&(this.flashButton=new o.l(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new o.l(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new o.l(e.flipCameraButton))}}var D=n(21);class T extends r.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 B=["FRONT","BACK"];class I extends r.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new T({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 T(e.idealPreviewResolution))}}class k extends r.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new o.h({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new o.e({text:"Close",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.enableCameraTitle=new o.o({text:"Camera permission denied!",color:"?sbColorOnSurface"}),this.enableCameraExplanation=new o.o({text:"Please allow the usage of the camera to start the scanning process.",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 o.h(e.icon)),void 0!==e.closeButton&&(this.closeButton=new o.e(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new o.o(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new o.o(e.enableCameraExplanation))}}class O extends r.a{constructor(e={}){super(),this.visible=!0,this.style=new P({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new D.a({width:1,height:1}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.style&&(this.style=L.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new D.a(e.aspectRatio))}}var L;!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new P(e);case"FinderStrokedStyle":return new _(e);default:throw`Unknown child class name: ${t}`}}}(L||(L={}));class P extends r.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 _ extends r.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 R=n(30),F=n(15);class N extends r.a{constructor(e={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new o.i({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 R.a({title:new o.o({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new o.e({visible:!0,text:"?topBarCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new x({flashButton:new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new O({visible:!0,style:new P({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new D.a({width:1,height:1})}),this.userGuidance=new F.b({visible:!0,title:new o.o({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new o.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new k({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new o.h({visible:!0,color:"?sbColorOnSurface"}),closeButton:new o.e({visible:!0,text:"?cameraPermissionCloseButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new o.o({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new o.o({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new I({}),this.scannerConfiguration=new E({}),this.useCase=new l({}),this.sound=new o.m({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new o.q({enabled:!0}),this.timeouts=new o.p({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 o.i(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 R.a(e.topBar)),void 0!==e.actionBar&&(this.actionBar=new x(e.actionBar)),void 0!==e.viewFinder&&(this.viewFinder=new O(e.viewFinder)),void 0!==e.userGuidance&&(this.userGuidance=new F.b(e.userGuidance)),void 0!==e.cameraPermission&&(this.cameraPermission=new k(e.cameraPermission)),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new I(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 o.m(e.sound)),void 0!==e.vibration&&(this.vibration=new o.q(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new o.p(e.timeouts))}}var M=n(36);class V extends r.a{constructor(e={}){if(super(),void 0===e.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new M.a(e.barcode),void 0===e.count)throw new Error("count must be present in constructor argument");this.count=e.count}}class W extends r.a{constructor(e={}){super(),this.items=[],void 0!==e.items&&(this.items=e.items.map((e=>new V(e))))}}const z=["BAD_QUALITY","ALWAYS","NONE"];class j extends r.a{constructor(e={}){super(),this.retakeButton=new o.d({title:new o.o({text:"?acknowledgementRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementRetakeButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.acceptWhenOkButton=new o.d({title:new o.o({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.acceptWhenNotOkButton=new o.d({title:new o.o({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),void 0!==e.retakeButton&&(this.retakeButton=new o.d(e.retakeButton)),void 0!==e.acceptWhenOkButton&&(this.acceptWhenOkButton=new o.d(e.acceptWhenOkButton)),void 0!==e.acceptWhenNotOkButton&&(this.acceptWhenNotOkButton=new o.d(e.acceptWhenNotOkButton))}}class H extends r.a{constructor(e={}){super(),this.topBarTitle=new o.o({visible:!1,text:"?acknowledgementTitle",color:"?sbColorOnPrimary"}),this.minimumQuality="POOR",this.acknowledgementMode="ALWAYS",this.badImageHint=new F.a({visible:!0,icon:new o.h({color:"?sbColorOnPrimary"}),title:new o.o({text:"?acknowledgementScreenBadDocumentHint",color:"?sbColorOnPrimary"}),background:new o.a({strokeColor:"?sbColorNegative",fillColor:"?sbColorNegative",strokeWidth:0})}),this.backgroundColor="?sbColorOutline",this.bottomBar=new j({}),void 0!==e.topBarTitle&&(this.topBarTitle=new o.o(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 F.a(e.badImageHint)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new j(e.bottomBar))}}class U extends r.a{constructor(e={}){super(),this.cameraModule="BACK",this.autoCropOnManualSnap=!0,this.flashEnabled=!1,this.idealPreviewResolution=new T({width:1920,height:1080}),this.acceptedAngleScore=.75,this.acceptedSizeScore=.75,this.autoSnappingSensitivity=.66,this.autoSnappingDelay=200,this.acceptedBrightnessThreshold=50,this.autoSnappingEnabled=!0,this.requiredAspectRatios=[],this.ignoreBadAspectRatio=!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 T(e.idealPreviewResolution)),void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.autoSnappingSensitivity&&(this.autoSnappingSensitivity=e.autoSnappingSensitivity),void 0!==e.autoSnappingDelay&&(this.autoSnappingDelay=e.autoSnappingDelay),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.autoSnappingEnabled&&(this.autoSnappingEnabled=e.autoSnappingEnabled),void 0!==e.requiredAspectRatios&&(this.requiredAspectRatios=e.requiredAspectRatios.map((e=>new D.a(e)))),void 0!==e.ignoreBadAspectRatio&&(this.ignoreBadAspectRatio=e.ignoreBadAspectRatio)}}class Z extends r.a{constructor(e={}){super(),this.noDocumentFound="?cameraUserGuidanceNoDocumentFound",this.badAspectRatio="?cameraUserGuidanceBadAspectRatio",this.badAngles="?cameraUserGuidanceBadAngles",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.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 G extends r.a{constructor(e={}){super(),this.visibility="ENABLED",this.title=new o.o({text:"?cameraUserGuidanceStart",color:"?sbColorOnPrimary"}),this.background=new o.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceHigh"}),this.statesTitles=new Z({}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.background&&(this.background=new o.a(e.background)),void 0!==e.statesTitles&&(this.statesTitles=new Z(e.statesTitles))}}var Y,Q,X=n(16);class q extends r.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 J(e);case"TextButtonMode":return new $(e);case"NoButtonMode":return new ee(e);default:throw`Unknown child class name: ${t}`}}}(Y||(Y={}));class K extends r.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 J extends r.a{constructor(e={}){super(),this._type="PagePreviewMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.imagePlaceholderColor="?sbColorOnSurfaceVariant",this.pageCounter=new o.b({visible:!0,background:new o.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 o.b(e.pageCounter))}}class $ extends r.a{constructor(e={}){super(),this._type="TextButtonMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.style=new o.o({text:"?cameraPreviewButtonTitle",color:"?sbColorOnPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.style&&(this.style=new o.o(e.style))}}class ee extends r.a{constructor(e={}){super(),this._type="NoButtonMode",this.visible=!1,void 0!==e.visible&&(this.visible=e.visible)}}class te extends r.a{constructor(e={}){super(),this.importButton=new o.d({title:new o.o({visible:!1,text:"?cameraImportButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraImportButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.autoSnappingModeButton=new o.d({title:new o.o({visible:!1,text:"?cameraAutoSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraAutoSnapButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.manualSnappingModeButton=new o.d({title:new o.o({visible:!1,text:"?cameraManualSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraManualSnapButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.shutterButton=new q({accessibilityDescription:"?accessibilityDescriptionCameraShutterButton"}),this.torchOnButton=new o.d({title:new o.o({visible:!1,text:"?cameraTorchOnButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOnButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.torchOffButton=new o.d({title:new o.o({visible:!1,text:"?cameraTorchOffButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOffButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.previewButton=new J({}),void 0!==e.importButton&&(this.importButton=new o.d(e.importButton)),void 0!==e.autoSnappingModeButton&&(this.autoSnappingModeButton=new o.d(e.autoSnappingModeButton)),void 0!==e.manualSnappingModeButton&&(this.manualSnappingModeButton=new o.d(e.manualSnappingModeButton)),void 0!==e.shutterButton&&(this.shutterButton=new q(e.shutterButton)),void 0!==e.torchOnButton&&(this.torchOnButton=new o.d(e.torchOnButton)),void 0!==e.torchOffButton&&(this.torchOffButton=new o.d(e.torchOffButton)),void 0!==e.previewButton&&(this.previewButton=Y.From(e.previewButton))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PageSnapFunnelAnimation":return new ne(e);case"PageSnapCheckMarkAnimation":return new ie(e);case"PageSnapFeedbackNone":return new oe(e);default:throw`Unknown child class name: ${t}`}}}(Q||(Q={}));class ne extends r.a{constructor(e={}){super(),this._type="PageSnapFunnelAnimation",this.overlayColor="?sbColorModalOverlay",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor)}}class ie extends r.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 oe extends r.a{constructor(e={}){super(),this._type="PageSnapFeedbackNone"}}class re extends r.a{constructor(e={}){super(),this.cameraBlinkEnabled=!0,this.snapFeedbackMode=new ne({}),void 0!==e.cameraBlinkEnabled&&(this.cameraBlinkEnabled=e.cameraBlinkEnabled),void 0!==e.snapFeedbackMode&&(this.snapFeedbackMode=Q.From(e.snapFeedbackMode))}}class ae extends r.a{constructor(e={}){super(),this.visibility="ENABLED",this.documentOk=new o.j({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2}),this.documentNotOk=new o.j({strokeColor:"?sbColorNegative",fillColor:"#00000000",strokeWidth:2}),this.autoSnapProgress=new o.j({strokeColor:"#40A9FF",fillColor:"#00000000",strokeWidth:2}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.documentOk&&(this.documentOk=new o.j(e.documentOk)),void 0!==e.documentNotOk&&(this.documentNotOk=new o.j(e.documentNotOk)),void 0!==e.autoSnapProgress&&(this.autoSnapProgress=new o.j(e.autoSnapProgress))}}class se extends r.a{constructor(e={}){super(),this.button=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraSelectButton"}),this.backgroundColor="?sbColorSurface",this.title=new o.o({text:"?cameraSelectCameraMenuTitle",color:"?sbColorOnSurfaceVariant"}),this.dividerColor="?sbColorOutline",this.menuEntry=new o.k({title:new o.o({color:"?sbColorOnSurface"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new o.h({color:"?sbColorOnSurface"})}),this.menuEntryActive=new o.k({title:new o.o({color:"?sbColorPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new o.h({color:"?sbColorPrimary"})}),void 0!==e.button&&(this.button=new o.g(e.button)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.menuEntry&&(this.menuEntry=new o.k(e.menuEntry)),void 0!==e.menuEntryActive&&(this.menuEntryActive=new o.k(e.menuEntryActive))}}class ce extends r.a{constructor(e={}){super(),this.acknowledgement=new H({}),this.introduction=new X.h({}),this.scanAssistanceOverlay=new K({}),this.cameraPermission=new k({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new o.h({visible:!0,color:"?sbColorOnSurface"}),closeButton:new o.e({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),enableCameraTitle:new o.o({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new o.o({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.topBarTitle=new o.o({text:"?cameraTopBarTitle",color:"?sbColorOnPrimary"}),this.topBarIntroButton=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraTopBarIntroButton"}),this.topBarBackButton=new o.e({visible:!0,text:"?cameraTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraTopBarCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarCameraSelect=new se({}),this.topUserGuidance=new F.b({title:new o.o({text:"?cameraTopGuidance",color:"?sbColorOnPrimary"})}),this.userGuidance=new G({}),this.backgroundColor="#000000FF",this.cameraConfiguration=new U({}),this.polygon=new ae({}),this.bottomBar=new te({}),this.viewFinder=new O({visible:!1,aspectRatio:new D.a({width:21,height:29})}),this.captureFeedback=new re({}),this.vibration=new o.q({enabled:!0}),this.timeouts=new o.p({autoCancelTimeout:0,initialScanDelay:0}),this.limitReachedAlertDialog=new C({title:new o.o({text:"?cameraLimitReachedAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?cameraLimitReachedAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new o.e({text:"?cameraLimitReachedOkButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraLimitReachedOkButton",background:new o.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),cancelButton:new o.e({visible:!1})}),this.cancelAlertDialog=new C({title:new o.o({text:"?cameraCancelAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?cameraCancelAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new o.e({text:"?cameraCancelYesButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelYesButton",background:new o.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),cancelButton:new o.e({text:"?cameraCancelNoButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelNoButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorPrimary"})})}),void 0!==e.acknowledgement&&(this.acknowledgement=new H(e.acknowledgement)),void 0!==e.introduction&&(this.introduction=new X.h(e.introduction)),void 0!==e.scanAssistanceOverlay&&(this.scanAssistanceOverlay=new K(e.scanAssistanceOverlay)),void 0!==e.cameraPermission&&(this.cameraPermission=new k(e.cameraPermission)),void 0!==e.topBarTitle&&(this.topBarTitle=new o.o(e.topBarTitle)),void 0!==e.topBarIntroButton&&(this.topBarIntroButton=new o.g(e.topBarIntroButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new o.e(e.topBarBackButton)),void 0!==e.topBarCameraSelect&&(this.topBarCameraSelect=new se(e.topBarCameraSelect)),void 0!==e.topUserGuidance&&(this.topUserGuidance=new F.b(e.topUserGuidance)),void 0!==e.userGuidance&&(this.userGuidance=new G(e.userGuidance)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new U(e.cameraConfiguration)),void 0!==e.polygon&&(this.polygon=new ae(e.polygon)),void 0!==e.bottomBar&&(this.bottomBar=new te(e.bottomBar)),void 0!==e.viewFinder&&(this.viewFinder=new O(e.viewFinder)),void 0!==e.captureFeedback&&(this.captureFeedback=new re(e.captureFeedback)),void 0!==e.vibration&&(this.vibration=new o.q(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new o.p(e.timeouts)),void 0!==e.limitReachedAlertDialog&&(this.limitReachedAlertDialog=new C(e.limitReachedAlertDialog)),void 0!==e.cancelAlertDialog&&(this.cancelAlertDialog=new C(e.cancelAlertDialog))}}class le extends r.a{constructor(e={}){super(),this.detectButton=new o.d({title:new o.o({text:"?croppingDetectButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingDetectButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.rotateButton=new o.d({title:new o.o({text:"?croppingRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingRotateButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.resetButton=new o.d({title:new o.o({text:"?croppingResetButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingResetButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),void 0!==e.detectButton&&(this.detectButton=new o.d(e.detectButton)),void 0!==e.rotateButton&&(this.rotateButton=new o.d(e.rotateButton)),void 0!==e.resetButton&&(this.resetButton=new o.d(e.resetButton))}}class ue extends r.a{constructor(e={}){super(),this.topBarBackButton=new o.e({visible:!0,text:"?croppingTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarTitle=new o.o({text:"?croppingScreenTitle",color:"?sbColorOnPrimary"}),this.topBarConfirmButton=new o.e({visible:!0,text:"?croppingTopBarConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarConfirmButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.backgroundColor="?sbColorOutline",this.croppingHandlerColor="?sbColorSurface",this.croppingPolygonColor="?sbColorSurface",this.croppingPolygonMagneticLineColor="?sbColorSurface",this.bottomBar=new le({}),void 0!==e.topBarBackButton&&(this.topBarBackButton=new o.e(e.topBarBackButton)),void 0!==e.topBarTitle&&(this.topBarTitle=new o.o(e.topBarTitle)),void 0!==e.topBarConfirmButton&&(this.topBarConfirmButton=new o.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 le(e.bottomBar))}}const de=["ENABLED","AUTO_CAPTURE_ONLY","DISABLED"];var me=n(40);const he=["FILTERED_DOCUMENT","UNFILTERED_DOCUMENT"];class fe extends r.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?me.a.From(e.defaultFilter):null)}}class pe extends r.a{constructor(e={}){super(),this.addButton=new o.d({title:new o.o({text:"?reviewScreenAddButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewAddButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.retakeButton=new o.d({title:new o.o({text:"?reviewScreenRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRetakeButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.cropButton=new o.d({title:new o.o({text:"?reviewScreenCropButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewCropButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.rotateButton=new o.d({title:new o.o({text:"?reviewScreenRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRotateButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.deleteButton=new o.d({title:new o.o({text:"?reviewScreenDeleteButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.submitButton=new o.e({text:"?reviewScreenSubmitButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewSubmitButton",background:new o.a({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnSurface"})}),void 0!==e.addButton&&(this.addButton=new o.d(e.addButton)),void 0!==e.retakeButton&&(this.retakeButton=new o.d(e.retakeButton)),void 0!==e.cropButton&&(this.cropButton=new o.d(e.cropButton)),void 0!==e.rotateButton&&(this.rotateButton=new o.d(e.rotateButton)),void 0!==e.deleteButton&&(this.deleteButton=new o.d(e.deleteButton)),void 0!==e.submitButton&&(this.submitButton=new o.e(e.submitButton))}}class ge extends r.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.deleteAll=new o.k({title:new o.o({text:"?reviewScreenDeleteAllButtonTitle",color:"?sbColorNegative"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllButton",icon:new o.h({color:"?sbColorNegative"})}),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.deleteAll&&(this.deleteAll=new o.k(e.deleteAll))}}class ve extends r.a{constructor(e={}){super(),this.overlayColor="?sbColorModalOverlay",this.closeButton=new o.e({text:"?zoomOverlayCancelButtonText",accessibilityDescription:"?accessibilityDescriptionZoomOverlayCancelButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.closeButton&&(this.closeButton=new o.e(e.closeButton))}}class Ce extends r.a{constructor(e={}){super(),this.enabled=!0,this.topBarTitle=new o.o({text:"?reviewScreenTitle",color:"?sbColorOnPrimary"}),this.topBarMoreButton=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewMoreButton"}),this.topBarBackButton=new o.e({visible:!0,text:"?reviewTopBarBackButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewTopBarBackButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.morePopup=new ge({}),this.zoomButton=new o.l({accessibilityDescription:"?accessibilityDescriptionReviewZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary"}),this.zoomOverlay=new ve({}),this.backgroundColor="?sbColorOnSurfaceVariant",this.bottomBar=new pe({}),this.switchNextPageButton=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewNextPageButton"}),this.switchPreviousPageButton=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewPreviousPageButton"}),this.pageCounter=new F.b({title:new o.o({text:"?reviewScreenPageCount",color:"?sbColorOnPrimary"}),background:new o.a({fillColor:"?sbColorSurfaceHigh",strokeWidth:0})}),this.deleteAllPagesAlertDialog=new C({title:new o.o({text:"?reviewDeleteAllPagesAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?reviewDeleteAllPagesAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new o.e({text:"?reviewDeleteAllPagesAlertDeleteButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton",background:new o.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),actionButton:new o.e({visible:!1}),cancelButton:new o.e({text:"?reviewDeleteAllPagesAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorPrimary"})})}),this.deletePageAlertDialog=new C({title:new o.o({text:"?reviewDeletePageAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?reviewDeletePageAlertSubTitle",color:"?sbColorOnSurfaceVariant"}),okButton:new o.e({text:"?reviewDeletePageAlertConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertConfirmButton",background:new o.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),actionButton:new o.e({text:"?reviewDeletePageAlertDeleteRetakeButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorPrimary"})}),cancelButton:new o.e({text:"?reviewDeletePageAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertCancelButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorPrimary"})})}),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.topBarTitle&&(this.topBarTitle=new o.o(e.topBarTitle)),void 0!==e.topBarMoreButton&&(this.topBarMoreButton=new o.g(e.topBarMoreButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new o.e(e.topBarBackButton)),void 0!==e.morePopup&&(this.morePopup=new ge(e.morePopup)),void 0!==e.zoomButton&&(this.zoomButton=new o.l(e.zoomButton)),void 0!==e.zoomOverlay&&(this.zoomOverlay=new ve(e.zoomOverlay)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new pe(e.bottomBar)),void 0!==e.switchNextPageButton&&(this.switchNextPageButton=new o.g(e.switchNextPageButton)),void 0!==e.switchPreviousPageButton&&(this.switchPreviousPageButton=new o.g(e.switchPreviousPageButton)),void 0!==e.pageCounter&&(this.pageCounter=new F.b(e.pageCounter)),void 0!==e.deleteAllPagesAlertDialog&&(this.deleteAllPagesAlertDialog=new C(e.deleteAllPagesAlertDialog)),void 0!==e.deletePageAlertDialog&&(this.deletePageAlertDialog=new C(e.deletePageAlertDialog))}}class ye extends r.a{constructor(e={}){super(),this.camera=new ce({}),this.review=new Ce({}),this.cropping=new ue({}),void 0!==e.camera&&(this.camera=new ce(e.camera)),void 0!==e.review&&(this.review=new Ce(e.review)),void 0!==e.cropping&&(this.cropping=new ue(e.cropping))}}class be extends r.a{constructor(e={}){super(),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.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.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.reorderPageTitle="Reorder Pages",this.acknowledgementTitle="Acknowledgement",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.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",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 regarding the 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",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.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.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.reorderPageTitle&&(this.reorderPageTitle=e.reorderPageTitle),void 0!==e.acknowledgementTitle&&(this.acknowledgementTitle=e.acknowledgementTitle),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.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton),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)}}class Ae extends r.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 Se extends r.a{constructor(e={}){super(),this.version="1.0",this.screen="DocumentScanner",this.palette=new o.i({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 be({}),this.appearance=new Ae({}),this.outputSettings=new fe({}),this.screens=new ye({}),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 o.i(e.palette)),void 0!==e.localization&&(this.localization=new be(e.localization)),void 0!==e.appearance&&(this.appearance=new Ae(e.appearance)),void 0!==e.outputSettings&&(this.outputSettings=new fe(e.outputSettings)),void 0!==e.screens&&(this.screens=new ye(e.screens)),void 0!==e.documentUuid&&(this.documentUuid=null!=e.documentUuid?e.documentUuid:null),void 0!==e.cleanScanningSession&&(this.cleanScanningSession=e.cleanScanningSession)}}var we=n(20);const Ee=["DARK","LIGHT","HIDDEN"]},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var i=n(1),o=n(6);class r extends o.a{constructor(e={}){super(),this.visible=!0,this.title=new i.o({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.o(e.title)),void 0!==e.background&&(this.background=new i.a(e.background))}}class a extends o.a{constructor(e={}){super(),this.visible=!0,this.icon=new i.h({color:"?sbColorOnPrimary"}),this.title=new i.o({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.h(e.icon)),void 0!==e.title&&(this.title=new i.o(e.title)),void 0!==e.background&&(this.background=new i.a(e.background))}}},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,"k",(function(){return c})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return f})),n.d(t,"h",(function(){return p}));var i,o=n(1),r=n(6);class a extends r.a{constructor(e={}){super(),this.image=new s({}),this.text=new o.o({text:"?cameraIntroDescription",color:"?sbColorOnSurface"}),void 0!==e.image&&(this.image=i.From(e.image)),void 0!==e.text&&(this.text=new o.o(e.text))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"NoIntroImage":return new s(e);case"ReceiptsIntroImage":return new c(e);case"MedicalCertificateIntroImage":return new l(e);case"DocumentIntroImage":return new u(e);case"CheckIntroImage":return new d(e);case"IdCardIntroImage":return new m(e);case"CreditCardIntroImage":return new h(e);case"CustomImage":return new f(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class s extends r.a{constructor(e={}){super(),this._type="NoIntroImage"}}class c extends r.a{constructor(e={}){super(),this._type="ReceiptsIntroImage"}}class l extends r.a{constructor(e={}){super(),this._type="MedicalCertificateIntroImage"}}class u extends r.a{constructor(e={}){super(),this._type="DocumentIntroImage"}}class d extends r.a{constructor(e={}){super(),this._type="CheckIntroImage"}}class m extends r.a{constructor(e={}){super(),this._type="IdCardIntroImage"}}class h extends r.a{constructor(e={}){super(),this._type="CreditCardIntroImage"}}class f extends r.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 p extends r.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.showAutomatically=!1,this.topBarDoneButton=new o.e({visible:!0,text:"?cameraIntroDoneButton",accessibilityDescription:"?accessibilityDescriptionCameraIntroDoneButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorPrimary",useShadow:!1})}),this.title=new o.o({text:"?cameraIntroTitle",color:"?sbColorOnSurface"}),this.subtitle=new o.o({text:"?cameraIntroSubtitle",color:"?sbColorOnSurface"}),this.items=[new a({image:new u({}),text:new o.o({text:"?cameraIntroItem1",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new o.o({text:"?cameraIntroItem2",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new o.o({text:"?cameraIntroItem3",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new o.o({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 o.e(e.topBarDoneButton)),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.subtitle&&(this.subtitle=new o.o(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,"h",(function(){return r})),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 l})),n.d(t,"a",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return m}));var i=n(38),o=n(5);class r extends o.a{constructor(e={}){if(super(),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","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 extends o.a{constructor(e={}){if(super(),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 l extends o.a{constructor(e={}){if(super(),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 u extends o.a{constructor(e={}){if(super(),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 l(e.type),void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=null!=e.value?new r(e.value):null,void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight),void 0!==e.image&&(this.image=null!=e.image?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 extends o.a{constructor(e={}){if(super(),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 extends o.a{constructor(e={}){if(super(),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 u(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?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.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var i=n(5);class o extends i.a{constructor(e={}){if(super(),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 extends i.a{constructor(e={}){if(super(),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 a extends i.a{constructor(e={}){super(),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,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var i=n(13),o=n(14),r=n(4);function a(){const e=new o.BarcodeScannerScreenConfiguration;return e.viewFinder.overlayColor=Object(r.d)(e.viewFinder.overlayColor,e.palette),e.viewFinder.style.strokeColor=Object(r.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 o.BarcodeScannerScreenConfiguration;return e.userGuidance.background.fillColor=Object(r.d)(e.userGuidance.background.fillColor,e.palette),e.userGuidance.title.color=Object(r.d)(e.userGuidance.title.color,e.palette),e.userGuidance.title.text=Object(r.e)(e.userGuidance.title.text,[],e.localization),e.userGuidance}()}static mapFinderConfiguration(e,t){var n,o;i.a.mapValuesDeep(null!==(n=t.finder)&&void 0!==n?n:{},e.finder),i.a.mapValuesDeep(null!==(o=t.userGuidance)&&void 0!==o?o:{},e.userGuidance)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(9);class o{constructor(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}scaleDown(e){return new o(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 o(0,0,e,t)}static empty(){return new o(0,0,0,0)}static fromRect(e){return e?new o(e.x,e.y,e.width,e.height):o.empty()}static fromPoint(e,t){return new o(e.x-t/2,e.y-t/2,t,t)}static fromDOMRect(e){return new o(e.x,e.y,e.width,e.height)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(0),o=n(23),r=n(4),a=n(8);class s extends i.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(e){super(e),this.holePosition=o.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=e=>{var t,n,i,o;(null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)===(null===(n=e.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(i=this.props.padding)||void 0===i?void 0:i.minBottomPadding)===(null===(o=e.padding)||void 0===o?void 0:o.minBottomPadding)&&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){var 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,i,o;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,c=Math.max(20,(r-s)/2),l=Math.min(s,r-2*c),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=l,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-l/2;const d=(null===(e=this.guidanceText)||void 0===e?void 0:e.clientHeight)+this.guidanceTextTopPadding||0,m=Math.max(10,null!==(n=null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)&&void 0!==n?n:0),h=a-m-Math.max(10,null!==(o=null===(i=this.props.padding)||void 0===i?void 0:i.minBottomPadding)&&void 0!==o?o:0)-d;this.holePosition.height>h?(this.holePosition.height=h,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=m):this.holePosition.y=m+(h-this.holePosition.height)/1.9;const f=this.holeCanvas.getContext("2d");f.save(),this.drawBackground(f),f.globalCompositeOperation="destination-out",this.drawHole();const p=this.crosshairCanvas.getContext("2d");p.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),f.restore(),p.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=r.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,o=this.holePosition.width,r=this.holePosition.height;e.beginPath(),e.fillStyle="black",e.moveTo(n+t,i),e.arcTo(n+o,i,n+o,i+r,t),e.arcTo(n+o,i+r,n,i+r,t),e.arcTo(n,i+r,n,i,t),e.arcTo(n,i,n+o,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,o=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+o,c),e.lineTo(t+i,n+a),e.moveTo(t+i,n+o-a),e.arcTo(t+i,n+o,t,n+o,c),e.lineTo(t+i-a,n+o),e.moveTo(t,n+o-a),e.arcTo(t,n+o,t+i,n+o,c),e.lineTo(t+a,n+o),e.strokeStyle=r.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,o=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+o,a),e.moveTo(t+i,n+a),e.arcTo(t+i,n+o,t,n+o,a),e.moveTo(t+i-a,n+o),e.arcTo(t,n+o,t,n,a),e.moveTo(t,n+o-a),e.arcTo(t,n,t+i,n,a),e.strokeStyle=r.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:r.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:r.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},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(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var i=n(0),o=n(12),r=n(27),a=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 o.a.enumerateDevicesFailed()}else{const i={user:"front",environment:"back"},o=(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 o&&o in i){yield r.a.INSTANCE.load();const t=r.a.INSTANCE.getMainCamera(i[o]);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,r,s,c,l;return a(this,void 0,void 0,(function*(){if(o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())null===(t=(e=this.props).onError)||void 0===t||t.call(e,o.a.permissionDenied());else try{const e={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};if(!navigator.mediaDevices){const e=o.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,o;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(o=(i=this.props).onReady)||void 0===o||o.call(i)}))}catch(e){const t=o.a.mediaDeviceNotFound();return null===(s=(r=this.props).onError)||void 0===s||s.call(r,t),void console.error(t)}}catch(e){const t=o.a.createFromDOMException(e);return null===(l=(c=this.props).onError)||void 0===l||l.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(9),l=n(23),u=n(17),d=n(37);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 o=this.program=e.createProgram();e.attachShader(o,n),e.attachShader(o,i),e.linkProgram(o),e.useProgram(o),e.uniform1i(e.getUniformLocation(o,"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,o,r,a,s){let c,l;if(r=Math.floor(r),a=Math.floor(a),t=Math.floor(t),n=Math.floor(n),i=Math.floor(i),o=Math.floor(o),e instanceof HTMLVideoElement)[l,c]=[e.videoWidth,e.videoHeight];else{if(!(e instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[l,c]=[e.width,e.height]}(l<t+i||c<n+o)&&u.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=r,this.canvas.height=a,m.viewport(0,0,r,a);const h=[i/(r*l),o/(a*c)],f=[t/l,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)!==r*a*4&&(s=new Uint8ClampedArray(r*a*4),d.a.INSTANCE.values.set("WebGLNumBufferAllocations",(d.a.INSTANCE.values.get("WebGLNumBufferAllocations")||0)+1)),m.readPixels(0,0,r,a,m.RGBA,m.UNSIGNED_BYTE,s),new ImageData(s,r,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,o,r,a,s){return this.canvas.width=r,this.canvas.height=a,this.ctx.drawImage(e,t,n,i,o,0,0,r,a),this.ctx.getImageData(0,0,r,a)}}var f=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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){this._reusableImageBuffer=e}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);u.a.debug("Bitmap size: "+t.width*t.height);const i=this.windowSize(),o=t.height/(i.height+i.y),r=i.width*o,a=i.height*o,s=t.width/2-r/2,c=i.y*o,d=new l.a(s,c,r,a);return u.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:o}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const c=this.finderFrame||new l.a(0,0,r,a);if(c.width<=0||c.height<=0)return;const d=this.zoom(),m=(i-r/d)/2,h=(o-a/d)/2,f=c.x/s+m,p=c.y/s+h,g=this.finderFrame?s:d,v=c.width/g,C=c.height/g,y=this.calculateFrameSize(e,v,C);return n.getImageData(this.video,f,p,v,C,y.width,y.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 l.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:e,videoHeight:t}=this.video,n=this.video.getBoundingClientRect(),i=e,o=t,r=1;return n.width/n.height<=e/t?(r=n.height/t,r>0&&(i=n.width/r)):(r=n.width/e,r>0&&(o=n.height/r)),{clientVideoWidth:i,clientVideoHeight:o,coef:r}}calculateFrameSize(e,t,n){let i=t,o=n;if(e>0&&0!=t&&0!=n){const r=t/n;t>n?(i=t>e?e:t,o=i/r):(o=n>e?e:n,i=o*r)}return new c.a(i,o)}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=r.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";(function(e){n.d(t,"a",(function(){return Ge})),n.d(t,"b",(function(){return Ye}));var i=n(3),o=(n(49),n(0)),r=n(45),a=n.n(r),s=n(28),c=n(46),l="undefined"!=typeof e&&void 0!==e.env&&(e.env.REACT_APP_SC_ATTR||e.env.SC_ATTR)||"data-styled",u="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 C(e,t,n){return void 0===n&&(n=v),e.theme!==n.theme&&e.theme||t||n.theme}var y=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 x(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 D,T=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},B=function(e){return T(5381,e)};function I(e){return x(B(e)>>>0)}function k(e){return e.displayName||e.name||"Component"}function O(e){return"string"==typeof e&&!0}var L="function"==typeof Symbol&&Symbol.for,P=L?Symbol.for("react.memo"):60115,_=L?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},F={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},N={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},M=((D={})[_]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},D[P]=N,D);function V(e){return("type"in(t=e)&&t.type.$$typeof)===P?N:"$$typeof"in e?M[e.$$typeof]:R;var t}var W=Object.defineProperty,z=Object.getOwnPropertyNames,j=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 o=z(t);j&&(o=o.concat(j(t)));for(var r=V(e),a=V(t),s=0;s<o.length;++s){var c=o[s];if(!(c in F||n&&n[c]||a&&c in a||r&&c in r)){var l=H(t,c);try{W(e,c,l)}catch(e){}}}}return e}function Y(e){return"function"==typeof e}function Q(e){return"object"==typeof e&&"styledComponentId"in e}function X(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function q(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,o=i;e>=o;)if((o<<=1)<0)throw ee(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var r=i;r<o;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(e+1),s=(r=0,t.length);r<s;r++)this.tag.insertRule(a,t[r])&&(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 o=n;o<i;o++)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),o=i+n,r=i;r<o;r++)t+="".concat(this.tag.getRule(r)).concat(h);return t},e}(),ne=new Map,ie=new Map,oe=1,re=function(e){if(ne.has(e))return ne.get(e);for(;ie.has(oe);)oe++;var t=oe++;return ne.set(e,t),ie.set(t,e),t},ae=function(e,t){oe=t+1,ne.set(e,t),ie.set(t,e)},se="style[".concat(l,"][").concat(d,'="').concat(m,'"]'),ce=new RegExp("^".concat(l,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),le=function(e,t,n){for(var i,o=n.split(","),r=0,a=o.length;r<a;r++)(i=o[r])&&e.registerName(t,i)},ue=function(e,t){for(var n,i=(null!==(n=t.textContent)&&void 0!==n?n:"").split(h),o=[],r=0,a=i.length;r<a;r++){var s=i[r].trim();if(s){var c=s.match(ce);if(c){var l=0|parseInt(c[1],10),u=c[2];0!==l&&(ae(u,l),le(e,u,c[3]),e.getTag().insertRules(l,o)),o.length=0}else o.push(s)}}};function de(){return n.nc}var me=function(e){var t=document.head,n=e||t,i=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(l,"]")));return t[t.length-1]}(n),r=void 0!==o?o.nextSibling:null;i.setAttribute(l,u),i.setAttribute(d,m);var a=de();return a&&i.setAttribute("nonce",a),n.insertBefore(i,r),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 o=t[n];if(o.ownerNode===e)return o}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},Ce=function(){function e(e,t,n){void 0===e&&(e=v),void 0===t&&(t={});var o=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 o=t[n];o&&o.getAttribute(l)!==u&&(ue(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this)),$(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,i="",o=function(n){var o=function(e){return ie.get(e)}(n);if(void 0===o)return"continue";var r=e.names.get(o),a=t.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(l,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==r&&r.forEach((function(e){e.length>0&&(c+="".concat(e,","))})),i+="".concat(a).concat(s,'{content:"').concat(c,'"}').concat(h)},r=0;r<n;r++)o(r);return i}(o)}))}return e.registerId=function(e){return re(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(re(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(re(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(re(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),ye=/&/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,o=void 0===e?v:e,r=o.options,a=void 0===r?v:r,c=o.plugins,l=void 0===c?g:c,u=function(e,i,o){return o.startsWith(n)&&o.endsWith(n)&&o.replaceAll(n,"").length>0?".".concat(t):e},d=l.slice();d.push((function(e){e.type===s.a&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(ye,n).replace(i,u))})),a.prefix&&d.push(s.d),d.push(s.g);var m=function(e,o,r,c){void 0===o&&(o=""),void 0===r&&(r=""),void 0===c&&(c="&"),t=c,n=o,i=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(be,""),u=s.b(r||o?"".concat(r," ").concat(o," { ").concat(l," }"):l);a.namespace&&(u=Ae(u,a.namespace));var m=[];return s.f(u,s.c(d.concat(s.e((function(e){return m.push(e)}))))),m};return m.hash=l.length?l.reduce((function(e,t){return t.name||ee(15),T(e,t.name)}),5381).toString():"",m}var we=new Ce,Ee=Se(),xe=o.default.createContext({shouldForwardProp:void 0,styleSheet:we,stylis:Ee}),De=(xe.Consumer,o.default.createContext(void 0));function Te(){return Object(o.useContext)(xe)}function Be(e){var t=Object(o.useState)(e.stylisPlugins),n=t[0],i=t[1],r=Te().styleSheet,s=Object(o.useMemo)((function(){var t=r;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,r]),c=Object(o.useMemo)((function(){return Se({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);Object(o.useEffect)((function(){a()(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]);var l=Object(o.useMemo)((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:s,stylis:c}}),[e.shouldForwardProp,s,c]);return o.default.createElement(xe.Provider,{value:l},o.default.createElement(De.Provider,{value:c},e.children))}var Ie=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}(),ke=function(e){return e>="A"&&e<="Z"};function Oe(e){for(var t="",n=0;n<e.length;n++){var i=e[n];if(1===n&&"-"===i&&"-"===e[0])return e;ke(i)?t+="-"+i.toLowerCase():t+=i}return t.startsWith("ms-")?"-"+t:t}var Le=function(e){return null==e||!1===e||""===e},Pe=function(e){var t,n,o=[];for(var r in e){var a=e[r];e.hasOwnProperty(r)&&!Le(a)&&(Array.isArray(a)&&a.isCss||Y(a)?o.push("".concat(Oe(r),":"),a,";"):K(a)?o.push.apply(o,Object(i.e)(Object(i.e)(["".concat(r," {")],Pe(a),!1),["}"],!1)):o.push("".concat(Oe(r),": ").concat((t=r,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 o};function _e(e,t,n,i){return Le(e)?[]:Q(e)?[".".concat(e.styledComponentId)]:Y(e)?!Y(o=e)||o.prototype&&o.prototype.isReactComponent||!t?[e]:_e(e(t),t,n,i):e instanceof Ie?n?(e.inject(n,i),[e.getName(i)]):[e]:K(e)?Pe(e):Array.isArray(e)?Array.prototype.concat.apply(g,e.map((function(e){return _e(e,t,n,i)}))):[e.toString()];var o}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 Fe=B(m),Ne=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=T(Fe,t),this.baseStyle=n,Ce.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=X(i,this.staticRulesId);else{var o=q(_e(this.rules,e,t,n)),r=x(T(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,r)){var a=n(o,".".concat(r),void 0,this.componentId);t.insertRules(this.componentId,r,a)}i=X(i,r),this.staticRulesId=r}else{for(var s=T(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u;else if(u){var d=q(_e(u,e,t,n));s=T(s,d+l),c+=d}}if(c){var m=x(s>>>0);t.hasNameForId(this.componentId,m)||t.insertRules(this.componentId,m,n(c,".".concat(m),void 0,this.componentId)),i=X(i,m)}}return i},e}(),Me=o.default.createContext(void 0);Me.Consumer;var Ve={};new Set;function We(e,t,n){var r=Q(e),a=e,s=!O(e),c=t.attrs,l=void 0===c?g:c,u=t.componentId,d=void 0===u?function(e,t){var n="string"!=typeof e?"sc":S(e);Ve[n]=(Ve[n]||0)+1;var i="".concat(n,"-").concat(I(m+n+Ve[n]));return t?"".concat(t,"-").concat(i):i}(t.displayName,t.parentComponentId):u,h=t.displayName,f=void 0===h?function(e){return O(e)?"styled.".concat(e):"Styled(".concat(k(e),")")}(e):h,p=t.displayName&&t.componentId?"".concat(S(t.displayName),"-").concat(t.componentId):t.componentId||d,b=r&&a.attrs?a.attrs.concat(l).filter(Boolean):l,A=t.shouldForwardProp;if(r&&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 x=new Ne(n,p,r?a.componentStyle:void 0);function D(e,t){return function(e,t,n){var r=e.attrs,a=e.componentStyle,s=e.defaultProps,c=e.foldedComponentIds,l=e.styledComponentId,u=e.target,d=o.default.useContext(Me),m=Te(),h=e.shouldForwardProp||m.shouldForwardProp,f=C(t,d,s)||v,p=function(e,t,n){for(var o,r=Object(i.a)(Object(i.a)({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var s=Y(o=e[a])?o(r):o;for(var c in s)r[c]="className"===c?X(r[c],s[c]):"style"===c?Object(i.a)(Object(i.a)({},r[c]),s[c]):s[c]}return t.className&&(r.className=X(r.className,t.className)),r}(r,t,f),g=p.as||u,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=Te();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(a,p),w=X(c,l);return S&&(w+=" "+S),p.className&&(w+=" "+p.className),b[O(g)&&!y.has(g)?"class":"className"]=w,b.ref=n,Object(o.createElement)(g,b)}(T,e,t)}D.displayName=f;var T=o.default.forwardRef(D);return T.attrs=b,T.componentStyle=x,T.displayName=f,T.shouldForwardProp=A,T.foldedComponentIds=r?X(a.foldedComponentIds,a.styledComponentId):"",T.styledComponentId=p,T.target=r?a.target:e,Object.defineProperty(T,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=r?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0,o=t;i<o.length;i++)J(e,o[i],!0);return e}({},a.defaultProps,e):e}}),$(T,(function(){return".".concat(T.styledComponentId)})),s&&G(T,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),T}function ze(e,t){for(var n=[e[0]],i=0,o=t.length;i<o;i+=1)n.push(t[i],e[i+1]);return n}var je=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 je(_e(ze(g,Object(i.e)([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?_e(o):je(_e(ze(o,t)))}function Ue(e,t,n){if(void 0===n&&(n=v),!t)throw ee(1,t);var o=function(o){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return e(t,n,He.apply(void 0,Object(i.e)([o],r,!1)))};return o.attrs=function(o){return Ue(e,t,Object(i.a)(Object(i.a)({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return Ue(e,t,Object(i.a)(Object(i.a)({},n),o))},o}var Ze=function(e){return Ue(We,e)},Ge=Ze;y.forEach((function(e){Ge[e]=Ze(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Re(e),Ce.registerId(this.componentId+1)}e.prototype.createStyles=function(e,t,n,i){var o=i(q(_e(this.rules,t,n,i)),""),r=this.componentId+e;n.insertRules(r,r,o)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,i){e>2&&Ce.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 o=q(He.apply(void 0,Object(i.e)([e],t,!1))),r=I(o);return new Ie(r,o)}(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=de(),i=q([n&&'nonce="'.concat(n,'"'),"".concat(l,'="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={})[l]="",t[d]=m,t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=de();return r&&(n.nonce=r),[o.default.createElement("style",Object(i.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Ce({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw ee(2);return o.default.createElement(Be,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw ee(3)}})(),"__sc-".concat(l,"__")}).call(this,n(43))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(12),o=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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{static get INSTANCE(){return r._INSTANCE||(r._INSTANCE=new r),r._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 o(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||(()=>o(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(r.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((e=>setTimeout(e,0)))}}return e})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>o(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){const n=r.guessparseCameraLabelFacingMode(t.label),i=r.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,o,r,a;return null!==(a=null===(r=null===(o=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===o?void 0:o[0])||void 0===r?void 0:r.camera)&&void 0!==a?a:null}getVideoDevices(){return o(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 o(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,o,r,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),l=e.label;let u=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!==(o=null===(i=null==s?void 0:s.facingMode)||void 0===i?void 0:i[0])&&void 0!==o?o:c.facingMode);"unknown"===u&&(u=this.guessparseCameraLabelFacingMode(l));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(l));return{facingMode:u,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(r=null==s?void 0:s.torch)&&void 0!==r?r:"torch"in c)&&void 0!==a&&a,label:l,deviceId:c.deviceId}})).sort(((e,t)=>t.maxNumPixels-e.maxNumPixels)))||void 0===t?void 0:t[0]}getUserMedia(e){return o(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";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-",o="-moz-",r="-webkit-",a="comm",s="rule",c="decl",l="@keyframes",u=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 C(e,t,n){return e.slice(t,n)}function y(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,x=1,D=0,T=0,B=0,I="";function k(e,t,n,i,o,r,a,s){return{value:e,root:t,parent:n,type:i,props:o,children:r,line:E,column:x,length:a,return:"",siblings:s}}function O(e,t){return m(k("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function L(e){for(;e.root;)e=O(e.root,{children:[e]});A(e,e.siblings)}function P(){return B=T<D?v(I,T++):0,x++,10===B&&(x=1,E++),B}function _(){return v(I,T)}function R(){return T}function F(e,t){return C(I,e,t)}function N(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 M(e){return E=x=1,D=y(I=e),T=0,[]}function V(e){return I="",e}function W(e){return h(F(T-1,H(91===e?e+2:40===e?e+1:e)))}function z(e){for(;(B=_())&&B<33;)P();return N(e)>2||N(B)>3?"":" "}function j(e,t){for(;--t&&P()&&!(B<48||B>102||B>57&&B<65||B>70&&B<97););return F(e,R()+(t<6&&32==_()&&32==P()))}function H(e){for(;P();)switch(B){case e:return T;case 34:case 39:34!==e&&39!==e&&H(B);break;case 40:41===e&&H(e);break;case 92:P()}return T}function U(e,t){for(;P()&&e+B!==57&&(e+B!==84||47!==_()););return"/*"+F(t,T-1)+"*"+d(47===e?e:P())}function Z(e){for(;!N(_());)P();return F(e,T)}function G(e){return V(Y("",null,null,null,[""],e=M(e),0,[0],e))}function Y(e,t,n,i,o,r,a,s,c){for(var l=0,m=0,h=a,f=0,C=0,b=0,S=1,w=1,D=1,k=0,O="",L=o,F=r,N=i,M=O;w;)switch(b=k,k=P()){case 40:if(108!=b&&58==v(M,h-1)){-1!=g(M+=p(W(k),"&","&\f"),"&\f",u(l?s[l-1]:0))&&(D=-1);break}case 34:case 39:case 91:M+=W(k);break;case 9:case 10:case 13:case 32:M+=z(b);break;case 92:M+=j(R()-1,7);continue;case 47:switch(_()){case 42:case 47:A(X(U(P(),R()),t,n,c),c);break;default:M+="/"}break;case 123*S:s[l++]=y(M)*D;case 125*S:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+m:-1==D&&(M=p(M,/\f/g,"")),C>0&&y(M)-h&&A(C>32?q(M+";",i,n,h-1,c):q(p(M," ","")+";",i,n,h-2,c),c);break;case 59:M+=";";default:if(A(N=Q(M,t,n,l,m,o,s,O,L=[],F=[],h,r),r),123===k)if(0===m)Y(M,t,N,N,L,r,h,s,F);else switch(99===f&&110===v(M,3)?100:f){case 100:case 108:case 109:case 115:Y(e,N,N,i&&A(Q(e,N,N,0,0,o,s,O,o,L=[],h,F),F),o,F,h,s,i?L:F);break;default:Y(M,N,N,N,[""],F,0,s,F)}}l=m=C=0,S=D=1,O=M="",h=a;break;case 58:h=1+y(M),C=b;default:if(S<1)if(123==k)--S;else if(125==k&&0==S++&&125==(B=T>0?v(I,--T):0,x--,10===B&&(x=1,E--),B))continue;switch(M+=d(k),k*S){case 38:D=m>0?1:(M+="\f",-1);break;case 44:s[l++]=(y(M)-1)*D,D=1;break;case 64:45===_()&&(M+=W(P())),f=_(),m=h=y(O=M+=Z(R())),k++;break;case 45:45===b&&2==y(M)&&(S=0)}}return r}function Q(e,t,n,i,o,r,a,c,l,d,m,f){for(var g=o-1,v=0===o?r:[""],y=b(v),A=0,S=0,w=0;A<i;++A)for(var E=0,x=C(e,g+1,g=u(S=a[A])),D=e;E<y;++E)(D=h(S>0?v[E]+" "+x:p(x,/&\f/g,v[E])))&&(l[w++]=D);return k(e,t,n,0===o?s:c,l,d,m,f)}function X(e,t,n,i){return k(e,t,n,a,d(B),C(e,2,-2),0,i)}function q(e,t,n,i,o){return k(e,t,n,c,C(e,0,i),C(e,i+1,-1),i,o)}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 r+"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 r+e+e;case 4789:return o+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return r+e+o+e+i+e+e;case 5936:switch(v(e,t+11)){case 114:return r+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return r+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return r+e+i+p(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return r+e+i+e+e;case 6165:return r+e+i+"flex-"+e+e;case 5187:return r+e+p(e,/(\w+).+(:[^]+)/,r+"box-$1$2"+i+"flex-$1$2")+e;case 5443:return r+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 r+e+i+"flex-line-pack"+p(e,/align-content|flex-|-self/g,"")+e;case 5548:return r+e+i+p(e,"shrink","negative")+e;case 5292:return r+e+i+p(e,"basis","preferred-size")+e;case 6060:return r+"box-"+p(e,"-grow","")+r+e+i+p(e,"grow","positive")+e;case 4554:return r+p(e,/([^-])(transform)/g,"$1"+r+"$2")+e;case 6187:return p(p(p(e,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),e,"")+e;case 5495:case 3959:return p(e,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return p(p(e,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+i+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+e+e;case 4200:if(!f(e,/flex-|baseline/))return i+"grid-column-align"+C(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(.+)/,r+"$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(y(e)-1-t>6)switch(v(e,t+1)){case 109:if(45!==v(e,t+4))break;case 102:return p(e,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+o+(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,o,r,a,s,c){return i+n+":"+o+c+(r?i+n+"-span:"+(a?s:+s-+o)+c:"")+e}));case 4949:if(121===v(e,t+6))return p(e,":",":"+r)+e;break;case 6444:switch(v(e,45===v(e,14)?18:11)){case 120:return p(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(e,14)?"inline-":"")+"box$3$1"+r+"$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 l:return e.return=e.value+"{"+J(e.children,i)+"}";case s:if(!y(e.value=e.props.join(",")))return""}return y(n=J(e.children,i))?e.return=e.value+"{"+n+"}":""}function ee(e){var t=b(e);return function(n,i,o,r){for(var a="",s=0;s<t;s++)a+=e[s](n,i,o,r)||"";return a}}function te(e){return function(t){t.root||(t=t.return)&&e(t)}}function ne(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case c:return void(e.return=K(e.value,e.length,n));case l:return J([O(e,{value:p(e.value,"@","@"+r)})],o);case s:if(e.length)return S(n=e.props,(function(t){switch(f(t,o=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":L(O(e,{props:[p(t,/:(read-\w+)/,":-moz-$1")]})),L(O(e,{props:[t]})),m(e,{props:w(n,o)});break;case"::placeholder":L(O(e,{props:[p(t,/:(plac\w+)/,":"+r+"input-$1")]})),L(O(e,{props:[p(t,/:(plac\w+)/,":-moz-$1")]})),L(O(e,{props:[p(t,/:(plac\w+)/,i+"input-$1")]})),L(O(e,{props:[t]})),m(e,{props:w(n,o)})}return""}))}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}));var i=n(1),o=n(6);class r extends o.a{constructor(e={}){super(),this.title=new i.o({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.f({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new i.o(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 o})),n.d(t,"b",(function(){return r}));var i=n(7);function o(e,t,n){return Math.min(Math.max(e,t),n)}function r(e,t,n){return new i.a(o(e.x,-t/2,n.width-t/2),o(e.y,-t/2,n.height-t/2))}},function(e,t,n){"use strict";n.d(t,"h",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"i",(function(){return a})),n.d(t,"j",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"f",(function(){return m})),n.d(t,"g",(function(){return h})),n.d(t,"k",(function(){return f}));var i=n(5);const o=["BINARY","ANTIALIASED"],r=["PRESET_1","PRESET_2","PRESET_3","PRESET_4","PRESET_5"];var a;!function(e){e.From=function(e){const t=e._type;switch(t){case"ScanbotBinarizationFilter":return new s(e);case"CustomBinarizationFilter":return new c(e);case"ColorDocumentFilter":return new l(e);case"BrightnessFilter":return new u(e);case"ContrastFilter":return new d(e);case"GrayscaleFilter":return new m(e);case"LegacyFilter":return new h(e);case"WhiteBlackPointFilter":return new f(e);default:throw`Unknown child class name: ${t}`}}}(a||(a={}));class s extends i.a{constructor(e={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class c extends i.a{constructor(e={}){super(),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 l extends i.a{constructor(e={}){super(),this._type="ColorDocumentFilter"}}class u extends i.a{constructor(e={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class d extends i.a{constructor(e={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class m extends i.a{constructor(e={}){super(),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 h extends i.a{constructor(e={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class f extends i.a{constructor(e={}){super(),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)}}},function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"z",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return l})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"o",(function(){return m})),n.d(t,"p",(function(){return h})),n.d(t,"q",(function(){return f})),n.d(t,"u",(function(){return p})),n.d(t,"J",(function(){return g})),n.d(t,"y",(function(){return v})),n.d(t,"H",(function(){return C})),n.d(t,"B",(function(){return y})),n.d(t,"G",(function(){return b})),n.d(t,"c",(function(){return S})),n.d(t,"D",(function(){return w})),n.d(t,"A",(function(){return E})),n.d(t,"x",(function(){return x})),n.d(t,"r",(function(){return D})),n.d(t,"w",(function(){return T})),n.d(t,"s",(function(){return A})),n.d(t,"a",(function(){return B})),n.d(t,"b",(function(){return I})),n.d(t,"v",(function(){return k})),n.d(t,"E",(function(){return O})),n.d(t,"F",(function(){return L})),n.d(t,"I",(function(){return P})),n.d(t,"C",(function(){return _})),n.d(t,"t",(function(){return R})),n.d(t,"l",(function(){return F})),n.d(t,"m",(function(){return N})),n.d(t,"k",(function(){return M})),n.d(t,"j",(function(){return V}));var i,o,r=n(5);!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new a(e);case"BarcodeFormatCode11Configuration":return new s(e);case"BarcodeFormatCode39Configuration":return new c(e);case"BarcodeFormatCode93Configuration":return new l(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new m(e);case"BarcodeFormatDataBarExpandedConfiguration":return new h(e);case"BarcodeFormatDataBarLimitedConfiguration":return new f(e);case"BarcodeFormatITFConfiguration":return new p(e);case"BarcodeFormatMSIPlesseyConfiguration":return new v(e);case"BarcodeFormatUpcEanConfiguration":return new C(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);case"BarcodeFormatAztecConfiguration":return new S(e);case"BarcodeFormatQRCodeConfiguration":return new w(e);case"BarcodeFormatPDF417Configuration":return new E(e);case"BarcodeFormatMicroPDF417Configuration":return new x(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new T(e);case"BarcodeFormatAustraliaPostConfiguration":return new I(e);case"BarcodeFormatJapanPostConfiguration":return new k(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new L(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new _(e);case"BarcodeFormatGS1CompositeConfiguration":return new R(e);case"BarcodeFormatCommonOneDConfiguration":return new F(e);case"BarcodeFormatCommonTwoDConfiguration":return new N(e);case"BarcodeFormatCommonFourStateConfiguration":return new M(e);case"BarcodeFormatCommonConfiguration":return new V(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 a(e);case"BarcodeFormatCode11Configuration":return new s(e);case"BarcodeFormatCode39Configuration":return new c(e);case"BarcodeFormatCode93Configuration":return new l(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new m(e);case"BarcodeFormatDataBarExpandedConfiguration":return new h(e);case"BarcodeFormatDataBarLimitedConfiguration":return new f(e);case"BarcodeFormatITFConfiguration":return new p(e);case"BarcodeFormatMSIPlesseyConfiguration":return new v(e);case"BarcodeFormatUpcEanConfiguration":return new C(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={}));class a extends r.a{constructor(e={}){super(),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 s extends r.a{constructor(e={}){super(),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 c extends r.a{constructor(e={}){super(),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 l extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode93Configuration",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)}}class u extends r.a{constructor(e={}){super(),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 d extends r.a{constructor(e={}){super(),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 m extends r.a{constructor(e={}){super(),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 h extends r.a{constructor(e={}){super(),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 f extends r.a{constructor(e={}){super(),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 p extends r.a{constructor(e={}){super(),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 g=["MOD_10","MOD_11_IBM","MOD_11_NCR","MOD_10_10","MOD_11_10_IBM","MOD_11_10_NCR"];class v extends r.a{constructor(e={}){super(),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 C extends r.a{constructor(e={}){super(),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 extends r.a{constructor(e={}){super(),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 b,A;!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAztecConfiguration":return new S(e);case"BarcodeFormatQRCodeConfiguration":return new w(e);case"BarcodeFormatPDF417Configuration":return new E(e);case"BarcodeFormatMicroPDF417Configuration":return new x(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new T(e);default:throw`Unknown child class name: ${t}`}}}(b||(b={}));class S extends r.a{constructor(e={}){super(),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 w extends r.a{constructor(e={}){super(),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 E extends r.a{constructor(e={}){super(),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 x extends r.a{constructor(e={}){super(),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 extends r.a{constructor(e={}){super(),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 T extends r.a{constructor(e={}){super(),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 k(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new L(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new _(e);default:throw`Unknown child class name: ${t}`}}}(A||(A={}));const B=["NUMERIC","ALPHA_NUMERIC"];class I extends r.a{constructor(e={}){super(),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 k extends r.a{constructor(e={}){super(),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 extends r.a{constructor(e={}){super(),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 L extends r.a{constructor(e={}){super(),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 extends r.a{constructor(e={}){super(),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 _ extends r.a{constructor(e={}){super(),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 R extends r.a{constructor(e={}){super(),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 F extends r.a{constructor(e={}){super(),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.strictMode=!0,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.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class N extends r.a{constructor(e={}){super(),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 M extends r.a{constructor(e={}){super(),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 V extends r.a{constructor(e={}){super(),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){var i;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var r=typeof i;if("string"===r||"number"===r)e.push(i);else if(Array.isArray(i)){if(i.length){var a=o.apply(null,i);a&&e.push(a)}}else if("object"===r)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?(o.default=o,e.exports=o):void 0===(i=function(){return o}.apply(t,[]))||(e.exports=i)}()},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(t.constructor===Object)for(const n in t)t.hasOwnProperty(n)&&e(t[n])}(e),n}function o(e){return e.startsWith("http:")||e.startsWith("https:")}function r(){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{return 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]))}catch(e){return!1}}()){i+="-simd";n&&r()&&(i+="-threads")}return i}n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return a}))}).call(this,n(43))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return l}));var i=n(33),o=n(5),r=n(20);class a extends o.a{constructor(e={}){if(super(),this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,this.sizeScore=0,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,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.isUpsideDown&&(this.isUpsideDown=e.isUpsideDown),void 0!==e.sourceImage&&(this.sourceImage=null!=e.sourceImage?e.sourceImage:null),void 0===e.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=e.rawBytes,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}}const s=["LEGACY","NEXT_GEN_LOW_POWER","NEXT_GEN","NEXT_GEN_LOW_POWER_AR","NEXT_GEN_AR"];class c extends o.a{constructor(e={}){super(),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=!0,this.engineMode="NEXT_GEN_LOW_POWER",this.live=!0,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.live&&(this.live=e.live)}}class l extends o.a{constructor(e={}){if(super(),void 0===e.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=e.barcodes.map((e=>new a(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,"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 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 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((o=>{o in t&&n(e[o])&&n(t[o])?i.mapValuesDeep(e[o],t[o]):t[o]=e[o]}))}static _fromJson(e,t){return this.mapValuesDeep(t,e),e}}},function(e,t,n){"use strict";var i=n(32);n.d(t,"a",(function(){return i.i}))},function(e,t,n){"use strict";var i={};n.r(i),n.d(i,"BarcodeFormatConfigurationBase",(function(){return m.n})),n.d(i,"BarcodeFormatOneDConfigurationBase",(function(){return m.z})),n.d(i,"BarcodeFormatCodabarConfiguration",(function(){return m.d})),n.d(i,"BarcodeFormatCode11Configuration",(function(){return m.e})),n.d(i,"BarcodeFormatCode39Configuration",(function(){return m.h})),n.d(i,"BarcodeFormatCode93Configuration",(function(){return m.i})),n.d(i,"BarcodeFormatCode128Configuration",(function(){return m.f})),n.d(i,"BarcodeFormatCode2Of5Configuration",(function(){return m.g})),n.d(i,"BarcodeFormatDataBarConfiguration",(function(){return m.o})),n.d(i,"BarcodeFormatDataBarExpandedConfiguration",(function(){return m.p})),n.d(i,"BarcodeFormatDataBarLimitedConfiguration",(function(){return m.q})),n.d(i,"BarcodeFormatItfConfiguration",(function(){return m.u})),n.d(i,"MsiPlesseyChecksumAlgorithmValues",(function(){return m.J})),n.d(i,"BarcodeFormatMsiPlesseyConfiguration",(function(){return m.y})),n.d(i,"BarcodeFormatUpcEanConfiguration",(function(){return m.H})),n.d(i,"BarcodeFormatPharmaCodeConfiguration",(function(){return m.B})),n.d(i,"BarcodeFormatTwoDConfigurationBase",(function(){return m.G})),n.d(i,"BarcodeFormatAztecConfiguration",(function(){return m.c})),n.d(i,"BarcodeFormatQrCodeConfiguration",(function(){return m.D})),n.d(i,"BarcodeFormatPdf417Configuration",(function(){return m.A})),n.d(i,"BarcodeFormatMicroPdf417Configuration",(function(){return m.x})),n.d(i,"BarcodeFormatDataMatrixConfiguration",(function(){return m.r})),n.d(i,"BarcodeFormatMaxiCodeConfiguration",(function(){return m.w})),n.d(i,"BarcodeFormatFourStateConfigurationBase",(function(){return m.s})),n.d(i,"AustraliaPostCustomerFormatValues",(function(){return m.a})),n.d(i,"BarcodeFormatAustraliaPostConfiguration",(function(){return m.b})),n.d(i,"BarcodeFormatJapanPostConfiguration",(function(){return m.v})),n.d(i,"BarcodeFormatRoyalMailConfiguration",(function(){return m.E})),n.d(i,"BarcodeFormatRoyalTntPostConfiguration",(function(){return m.F})),n.d(i,"BarcodeFormatUspsIntelligentMailConfiguration",(function(){return m.I})),n.d(i,"BarcodeFormatPharmaCodeTwoTrackConfiguration",(function(){return m.C})),n.d(i,"BarcodeFormatGs1CompositeConfiguration",(function(){return m.t})),n.d(i,"BarcodeFormatCommonOneDConfiguration",(function(){return m.l})),n.d(i,"BarcodeFormatCommonTwoDConfiguration",(function(){return m.m})),n.d(i,"BarcodeFormatCommonFourStateConfiguration",(function(){return m.k})),n.d(i,"BarcodeFormatCommonConfiguration",(function(){return m.j})),n.d(i,"BarcodeItem",(function(){return h.a})),n.d(i,"BarcodeScannerEngineModeValues",(function(){return h.c})),n.d(i,"BarcodeScannerConfiguration",(function(){return h.b})),n.d(i,"BarcodeScannerResult",(function(){return h.d})),n.d(i,"BarcodeFormatValues",(function(){return p})),n.d(i,"BarcodeFormats",(function(){return g})),n.d(i,"Gs1HandlingValues",(function(){return C})),n.d(i,"UpcEanExtensionBehaviorValues",(function(){return y})),n.d(i,"BarcodeDocumentFormatValues",(function(){return b})),n.d(i,"BarcodeDocumentFormats",(function(){return A})),n.d(i,"CheckDocumentDetectionModeValues",(function(){return O})),n.d(i,"CheckRecognitionStatusValues",(function(){return L})),n.d(i,"CheckScanningResult",(function(){return P})),n.d(i,"CheckScannerConfiguration",(function(){return _})),n.d(i,"CommonFieldTypeValues",(function(){return R.a})),n.d(i,"DocumentScannerEngineModeValues",(function(){return E})),n.d(i,"DocumentScannerParameters",(function(){return x})),n.d(i,"DocumentScannerConfiguration",(function(){return D})),n.d(i,"DocumentDetectionStatusValues",(function(){return T})),n.d(i,"DocumentDetectionScores",(function(){return B})),n.d(i,"DocumentDetectionResult",(function(){return I})),n.d(i,"DocumentQualityValues",(function(){return F})),n.d(i,"DocumentQualityThreshold",(function(){return N})),n.d(i,"DocumentQualityAnalyzerConfiguration",(function(){return M})),n.d(i,"DocumentQualityAnalyzerResult",(function(){return V})),n.d(i,"EuropeanHealthInsuranceCardRecognitionResult",(function(){return W})),n.d(i,"EuropeanHealthInsuranceCardRecognizerConfiguration",(function(){return z})),n.d(i,"OcrResult",(function(){return k.h})),n.d(i,"FieldValidationStatusValues",(function(){return k.e})),n.d(i,"FieldDataFormatValues",(function(){return k.b})),n.d(i,"FieldParsedData",(function(){return k.c})),n.d(i,"FieldType",(function(){return k.d})),n.d(i,"Field",(function(){return k.a})),n.d(i,"GenericDocumentType",(function(){return k.g})),n.d(i,"GenericDocument",(function(){return k.f})),n.d(i,"DocumentDataExtractorConfigurationElement",(function(){return j})),n.d(i,"DateValidationConfiguration",(function(){return H})),n.d(i,"EuropeanHealthInsuranceCardIssuingCountryValues",(function(){return U})),n.d(i,"EuropeanHealthInsuranceCardConfiguration",(function(){return Z})),n.d(i,"MrzFallbackConfiguration",(function(){return G})),n.d(i,"DocumentDataExtractorCommonConfiguration",(function(){return Y})),n.d(i,"DocumentDataExtractionStatusValues",(function(){return K})),n.d(i,"DocumentDataExtractionResult",(function(){return J})),n.d(i,"DocumentDataExtractionModeValues",(function(){return $})),n.d(i,"DocumentDataFrameExtractionParameters",(function(){return ee})),n.d(i,"DocumentDataExtractorConfiguration",(function(){return te})),n.d(i,"WordBox",(function(){return ne})),n.d(i,"SymbolBox",(function(){return ie})),n.d(i,"TextPatternScannerResult",(function(){return oe})),n.d(i,"ContentValidator",(function(){return re})),n.d(i,"DefaultContentValidator",(function(){return ae})),n.d(i,"PatternContentValidator",(function(){return se})),n.d(i,"TextPatternScannerConfiguration",(function(){return ce})),n.d(i,"LineSegmentInt",(function(){return w.c})),n.d(i,"LineSegmentFloat",(function(){return w.b})),n.d(i,"AspectRatio",(function(){return w.a})),n.d(i,"LicensePlateScannerStrategyValues",(function(){return le})),n.d(i,"LicensePlateScannerConfiguration",(function(){return ue})),n.d(i,"LicensePlateScannerResult",(function(){return de})),n.d(i,"MedicalCertificateScanningParameters",(function(){return me})),n.d(i,"MedicalCertificateCheckBoxTypeValues",(function(){return he})),n.d(i,"MedicalCertificateCheckBox",(function(){return fe})),n.d(i,"MedicalCertificateDateRecordTypeValues",(function(){return pe})),n.d(i,"MedicalCertificateDateRecord",(function(){return ge})),n.d(i,"MedicalCertificatePatientInfoFieldTypeValues",(function(){return ve})),n.d(i,"MedicalCertificatePatientInfoField",(function(){return Ce})),n.d(i,"MedicalCertificatePatientInfoBox",(function(){return ye})),n.d(i,"MedicalCertificateFormTypeValues",(function(){return be})),n.d(i,"MedicalCertificateScanningResult",(function(){return Ae})),n.d(i,"MrzDocumentTypeValues",(function(){return Se})),n.d(i,"MrzScannerResult",(function(){return we})),n.d(i,"MrzIncompleteResultHandlingValues",(function(){return Ee})),n.d(i,"MrzScannerConfiguration",(function(){return xe})),n.d(i,"OcrElement",(function(){return De})),n.d(i,"Glyph",(function(){return Te})),n.d(i,"Word",(function(){return Be})),n.d(i,"Line",(function(){return Ie})),n.d(i,"Block",(function(){return ke})),n.d(i,"Page",(function(){return Oe})),n.d(i,"OutputModeValues",(function(){return Le.h})),n.d(i,"BinarizationFilterPresetValues",(function(){return Le.a})),n.d(i,"ParametricFilter",(function(){return Le.i})),n.d(i,"ScanbotBinarizationFilter",(function(){return Le.j})),n.d(i,"CustomBinarizationFilter",(function(){return Le.e})),n.d(i,"ColorDocumentFilter",(function(){return Le.c})),n.d(i,"BrightnessFilter",(function(){return Le.b})),n.d(i,"ContrastFilter",(function(){return Le.d})),n.d(i,"GrayscaleFilter",(function(){return Le.f})),n.d(i,"LegacyFilter",(function(){return Le.g})),n.d(i,"WhiteBlackPointFilter",(function(){return Le.k})),n.d(i,"PdfAttributes",(function(){return Pe})),n.d(i,"PageSizeValues",(function(){return _e})),n.d(i,"PageDirectionValues",(function(){return Re})),n.d(i,"PageFitValues",(function(){return Fe})),n.d(i,"ResamplingMethodValues",(function(){return Ne})),n.d(i,"PdfConfiguration",(function(){return Me})),n.d(i,"CompressionModeValues",(function(){return Ve})),n.d(i,"BinarizationValues",(function(){return We})),n.d(i,"UserFieldValue",(function(){return ze})),n.d(i,"UserFieldDoubleValue",(function(){return He})),n.d(i,"UserFieldStringValue",(function(){return Ue})),n.d(i,"UserFieldIntValue",(function(){return Ze})),n.d(i,"UserField",(function(){return Ge})),n.d(i,"TiffGeneratorParameters",(function(){return Ye})),n.d(i,"ConfirmationMethodValues",(function(){return Q})),n.d(i,"ResultAccumulationConfiguration",(function(){return X})),n.d(i,"AccumulatedResultsVerifierConfiguration",(function(){return q})),n.d(i,"ImageRotationValues",(function(){return Qe})),n.d(i,"VinBarcodeExtractionStatusValues",(function(){return Xe})),n.d(i,"VinBarcodeResult",(function(){return qe})),n.d(i,"VinScannerResult",(function(){return Ke})),n.d(i,"VinScannerConfiguration",(function(){return Je})),n.d(i,"MRZDocumentType",(function(){return $e})),n.d(i,"DeIdCardFrontDocumentType",(function(){return et})),n.d(i,"DeIdCardBackDocumentType",(function(){return tt})),n.d(i,"DePassportDocumentType",(function(){return nt})),n.d(i,"DeDriverLicenseFrontDocumentType",(function(){return it})),n.d(i,"DeDriverLicenseBackDocumentType",(function(){return ot})),n.d(i,"DeDriverLicenseBackCategoryDocumentType",(function(){return rt})),n.d(i,"DeDriverLicenseBackCategoriesDocumentType",(function(){return at})),n.d(i,"DeDriverLicenseBackCategoriesADocumentType",(function(){return st})),n.d(i,"DeDriverLicenseBackCategoriesA1DocumentType",(function(){return ct})),n.d(i,"DeDriverLicenseBackCategoriesA2DocumentType",(function(){return lt})),n.d(i,"DeDriverLicenseBackCategoriesAMDocumentType",(function(){return ut})),n.d(i,"DeDriverLicenseBackCategoriesBDocumentType",(function(){return dt})),n.d(i,"DeDriverLicenseBackCategoriesB1DocumentType",(function(){return mt})),n.d(i,"DeDriverLicenseBackCategoriesBEDocumentType",(function(){return ht})),n.d(i,"DeDriverLicenseBackCategoriesCDocumentType",(function(){return ft})),n.d(i,"DeDriverLicenseBackCategoriesC1DocumentType",(function(){return pt})),n.d(i,"DeDriverLicenseBackCategoriesC1EDocumentType",(function(){return gt})),n.d(i,"DeDriverLicenseBackCategoriesCEDocumentType",(function(){return vt})),n.d(i,"DeDriverLicenseBackCategoriesDDocumentType",(function(){return Ct})),n.d(i,"DeDriverLicenseBackCategoriesD1DocumentType",(function(){return yt})),n.d(i,"DeDriverLicenseBackCategoriesD1EDocumentType",(function(){return bt})),n.d(i,"DeDriverLicenseBackCategoriesDEDocumentType",(function(){return At})),n.d(i,"DeDriverLicenseBackCategoriesLDocumentType",(function(){return St})),n.d(i,"DeDriverLicenseBackCategoriesTDocumentType",(function(){return wt})),n.d(i,"DeResidencePermitFrontDocumentType",(function(){return Et})),n.d(i,"DeResidencePermitBackDocumentType",(function(){return xt})),n.d(i,"EuropeanHealthInsuranceCardDocumentType",(function(){return Dt})),n.d(i,"DeHealthInsuranceCardFrontDocumentType",(function(){return Tt})),n.d(i,"MRZ",(function(){return Bt})),n.d(i,"DeIdCardFront",(function(){return It})),n.d(i,"DeIdCardBack",(function(){return kt})),n.d(i,"DePassport",(function(){return Ot})),n.d(i,"DeDriverLicenseFront",(function(){return Lt})),n.d(i,"DeDriverLicenseBack",(function(){return Pt})),n.d(i,"DeResidencePermitFront",(function(){return _t})),n.d(i,"DeResidencePermitBack",(function(){return Rt})),n.d(i,"EuropeanHealthInsuranceCard",(function(){return Ft})),n.d(i,"DeHealthInsuranceCardFront",(function(){return Nt})),n.d(i,"BoardingPassDocumentType",(function(){return Mt})),n.d(i,"BoardingPassLegDocumentType",(function(){return Vt})),n.d(i,"SwissQRDocumentType",(function(){return Wt})),n.d(i,"DEMedicalPlanDocumentType",(function(){return zt})),n.d(i,"DEMedicalPlanPatientDocumentType",(function(){return jt})),n.d(i,"DEMedicalPlanDoctorDocumentType",(function(){return Ht})),n.d(i,"DEMedicalPlanSubheadingDocumentType",(function(){return Ut})),n.d(i,"DEMedicalPlanSubheadingMedicineDocumentType",(function(){return Zt})),n.d(i,"DEMedicalPlanSubheadingMedicineSubstanceDocumentType",(function(){return Gt})),n.d(i,"DEMedicalPlanSubheadingPrescriptionDocumentType",(function(){return Yt})),n.d(i,"IDCardPDF417DocumentType",(function(){return Qt})),n.d(i,"GS1DocumentType",(function(){return Xt})),n.d(i,"GS1ElementDocumentType",(function(){return qt})),n.d(i,"GS1ElementValidationErrorDocumentType",(function(){return Kt})),n.d(i,"SEPADocumentType",(function(){return Jt})),n.d(i,"MedicalCertificateDocumentType",(function(){return $t})),n.d(i,"VCardDocumentType",(function(){return en})),n.d(i,"VCardEntryDocumentType",(function(){return tn})),n.d(i,"VCardVersionDocumentType",(function(){return nn})),n.d(i,"VCardSourceDocumentType",(function(){return on})),n.d(i,"VCardKindDocumentType",(function(){return rn})),n.d(i,"VCardXMLDocumentType",(function(){return an})),n.d(i,"VCardNameDocumentType",(function(){return sn})),n.d(i,"VCardFirstNameDocumentType",(function(){return cn})),n.d(i,"VCardNicknameDocumentType",(function(){return ln})),n.d(i,"VCardBirthdayDocumentType",(function(){return un})),n.d(i,"VCardAnniversaryDocumentType",(function(){return dn})),n.d(i,"VCardGenderDocumentType",(function(){return mn})),n.d(i,"VCardDeliveryAddressDocumentType",(function(){return hn})),n.d(i,"VCardPhotoDocumentType",(function(){return fn})),n.d(i,"VCardTelephoneNumberDocumentType",(function(){return pn})),n.d(i,"VCardEmailDocumentType",(function(){return gn})),n.d(i,"VCardIMPPDocumentType",(function(){return vn})),n.d(i,"VCardLanguagesDocumentType",(function(){return Cn})),n.d(i,"VCardTimeZoneDocumentType",(function(){return yn})),n.d(i,"VCardGeoLocationDocumentType",(function(){return bn})),n.d(i,"VCardTitleDocumentType",(function(){return An})),n.d(i,"VCardRoleDocumentType",(function(){return Sn})),n.d(i,"VCardLogoDocumentType",(function(){return wn})),n.d(i,"VCardOrganisationDocumentType",(function(){return En})),n.d(i,"VCardMemberDocumentType",(function(){return xn})),n.d(i,"VCardRelatedDocumentType",(function(){return Dn})),n.d(i,"VCardCategoriesDocumentType",(function(){return Tn})),n.d(i,"VCardNoteDocumentType",(function(){return Bn})),n.d(i,"VCardProductIdDocumentType",(function(){return In})),n.d(i,"VCardRevisionDocumentType",(function(){return kn})),n.d(i,"VCardSoundDocumentType",(function(){return On})),n.d(i,"VCardUIDDocumentType",(function(){return Ln})),n.d(i,"VCardClientPIDMapDocumentType",(function(){return Pn})),n.d(i,"VCardURLDocumentType",(function(){return _n})),n.d(i,"VCardPublicKeyDocumentType",(function(){return Rn})),n.d(i,"VCardBusyTimeURLDocumentType",(function(){return Fn})),n.d(i,"VCardCalendarURIForRequestsDocumentType",(function(){return Nn})),n.d(i,"VCardCalendarURIDocumentType",(function(){return Mn})),n.d(i,"VCardCustomDocumentType",(function(){return Vn})),n.d(i,"AAMVADocumentType",(function(){return Wn})),n.d(i,"AAMVATitleDataDocumentType",(function(){return zn})),n.d(i,"AAMVARegistrationDataDocumentType",(function(){return jn})),n.d(i,"AAMVAMotorCarrierDataDocumentType",(function(){return Hn})),n.d(i,"AAMVARegistrantAndVehicleDataDocumentType",(function(){return Un})),n.d(i,"AAMVAVehicleOwnerDataDocumentType",(function(){return Zn})),n.d(i,"AAMVAVehicleDataDocumentType",(function(){return Gn})),n.d(i,"AAMVAVehicleSafetyInspectionDataDocumentType",(function(){return Yn})),n.d(i,"AAMVADLIDDocumentType",(function(){return Qn})),n.d(i,"AAMVADriverLicenseDocumentType",(function(){return Xn})),n.d(i,"AAMVAIDCardDocumentType",(function(){return qn})),n.d(i,"AAMVAEnhancedDriverLicenseDocumentType",(function(){return Kn})),n.d(i,"AAMVARawDocumentDocumentType",(function(){return Jn})),n.d(i,"HIBCDocumentType",(function(){return $n})),n.d(i,"BoardingPass",(function(){return ei})),n.d(i,"SwissQR",(function(){return ti})),n.d(i,"DEMedicalPlan",(function(){return ni})),n.d(i,"IDCardPDF417",(function(){return ii})),n.d(i,"GS1",(function(){return oi})),n.d(i,"SEPA",(function(){return ri})),n.d(i,"MedicalCertificate",(function(){return ai})),n.d(i,"VCard",(function(){return si})),n.d(i,"AAMVA",(function(){return ci})),n.d(i,"HIBC",(function(){return li})),n.d(i,"CheckDocumentType",(function(){return ui})),n.d(i,"USACheckDocumentType",(function(){return di})),n.d(i,"UAECheckDocumentType",(function(){return mi})),n.d(i,"FRACheckDocumentType",(function(){return hi})),n.d(i,"ISRCheckDocumentType",(function(){return fi})),n.d(i,"KWTCheckDocumentType",(function(){return pi})),n.d(i,"AUSCheckDocumentType",(function(){return gi})),n.d(i,"INDCheckDocumentType",(function(){return vi})),n.d(i,"CANCheckDocumentType",(function(){return Ci})),n.d(i,"UnknownCheckDocumentType",(function(){return yi})),n.d(i,"Check",(function(){return bi})),n.d(i,"USACheck",(function(){return Ai})),n.d(i,"UAECheck",(function(){return Si})),n.d(i,"FRACheck",(function(){return wi})),n.d(i,"ISRCheck",(function(){return Ei})),n.d(i,"KWTCheck",(function(){return xi})),n.d(i,"AUSCheck",(function(){return Di})),n.d(i,"INDCheck",(function(){return Ti})),n.d(i,"CANCheck",(function(){return Bi})),n.d(i,"UnknownCheck",(function(){return Ii})),n.d(i,"CreditCardDocumentType",(function(){return ki})),n.d(i,"CreditCard",(function(){return Oi})),n.d(i,"LicenseStatusValues",(function(){return Li})),n.d(i,"SdkLicenseInfo",(function(){return Pi})),n.d(i,"PartiallyConstructible",(function(){return f.a}));class o{}o.VERSION="7.0.0",o.BUILD_WITH_UI=!1;var r=n(35);class a{constructor(e,t){this.errorInWorker=null,this.createProxy=e=>new Proxy({},{get:(t,n,i)=>(...t)=>this.post(n,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");const{requestSuffix:n=""}=t||{},i=Object(r.c)(t),o=`${e}${e.endsWith("/")?"":"/"}ScanbotSDK.Core${i}.js${n}`;if(Object(r.d)(o)){const e=new Blob([`importScripts("${o}")`]);this.instance=new Worker(URL.createObjectURL(e))}else this.instance=new Worker(o);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:o,recoverableError:r,unrecoverableError:a}=e.data,s=this.continuations[i];if(!s)return;const{resolve:c,reject:l}=s;delete this.continuations[i],a?(l(a),this.handleUnrecoverableError(a)):r?l(r):c(o)},this.instance.onerror=e=>{this.handleUnrecoverableError(e.error)}}post(e,t,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((i,o)=>{const a=Object(r.b)(t,"copy"==n),s=this.nextTicketId++;this.continuations[s]={resolve:i,reject:o},this.instance.postMessage({command:e,args:t,ticket:s},a)}))}destroy(){this.instance.terminate()}}var s=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Error{}class l extends Error{}class u extends Error{}class d{constructor(e,t,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),this.core=new a(e,t),this.coreInitializationSuccessful=(()=>s(this,void 0,void 0,(function*(){let t=!1;try{t=yield this.core.copyArgs.initialize(...n)}catch(e){return new l('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.')}if(t){let t;try{t=yield this.core.copyArgs.version()}catch(e){t="Error"}const n=o.VERSION;return t!==n?new u(`Version mismatch! \nVersion of ScanbotSDK.(ui2.)min.js is "${n}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${t}". \nThe ScanbotSDK.Core*.js file was loaded from ${e}.`):"OK"}return new c("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")})))()}awaitInitialized(){return s(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(e){return new Proxy({},{get:(t,n,i)=>(...t)=>s(this,void 0,void 0,(function*(){const i=yield this.getCoreForCommand(n),o="copy"===e?i.copyArgs:i.transferArgs;return yield o[n](...t)}))})}getCoreForCommand(e=""){return s(this,void 0,void 0,(function*(){const t=yield this.coreInitializationSuccessful;if("OK"===t||"getLicenseInfo"===e&&t instanceof c)return this.core;throw t}))}destroy(){this.core.destroy(),this.core=void 0}}var m=n(33),h=n(36),f=n(5);const p=["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 g extends f.a{constructor(e={}){super()}}var v;(v=g||(g={})).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"],v.twod=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],v.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],v.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN_7","PZN_8"],v.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"],v.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"];const C=["PARSE","VALIDATE_STRUCTURE","DECODE_STRUCTURE","VALIDATE_FULL","DECODE_FULL"],y=["REQUIRE_2","REQUIRE_5","REQUIRE_ANY","IGNORE","ALLOW_2","ALLOW_5","ALLOW_ANY"],b=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"];class A extends f.a{constructor(e={}){super()}}var S;(S=A||(A={})).all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],S.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"],VCARD:["QR_CODE"],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"]};var w=n(21);const E=["ML","LEGACY"];class x extends f.a{constructor(e={}){super(),this.isLive=!1,this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.acceptedAspectRatioScore=85,this.aspectRatios=[],this.ignoreOrientationMismatch=!1,void 0!==e.isLive&&(this.isLive=e.isLive),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 w.a(e)))),void 0!==e.ignoreOrientationMismatch&&(this.ignoreOrientationMismatch=e.ignoreOrientationMismatch)}}class D extends f.a{constructor(e={}){super(),this.engineMode="ML",this.parameters=new x({}),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.parameters&&(this.parameters=new x(e.parameters))}}const T=["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 B extends f.a{constructor(e={}){if(super(),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 I extends f.a{constructor(e={}){if(super(),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 B(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 w.c(e))),void 0===e.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=e.verticalLines.map((e=>new w.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 w.b(e))),void 0===e.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=e.verticalLinesNormalized.map((e=>new w.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)}}var k=n(20);const O=["DISABLED","DETECT_DOCUMENT","DETECT_AND_CROP_DOCUMENT"],L=["SUCCESS","VALIDATION_FAILED","FAIL"];class P extends f.a{constructor(e={}){if(super(),this.status="FAIL",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 k.f(e.check):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=null!=e.documentDetectionResult?new I(e.documentDetectionResult):null,void 0===e.croppedImage)throw new Error("croppedImage must be present in constructor argument");this.croppedImage=null!=e.croppedImage?e.croppedImage:null}}class _ extends f.a{constructor(e={}){super(),this.documentDetectionMode="DISABLED",void 0!==e.documentDetectionMode&&(this.documentDetectionMode=e.documentDetectionMode)}}var R=n(38);const F=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"];class N extends f.a{constructor(e={}){if(super(),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 M extends f.a{constructor(e={}){super(),this.qualityThresholds=[new N({symbolQuality:.5,symbolRatio:.5}),new N({symbolQuality:.7,symbolRatio:.3}),new N({symbolQuality:.85,symbolRatio:.3}),new N({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.detectOrientation=!1,this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,void 0!==e.qualityThresholds&&(this.qualityThresholds=e.qualityThresholds.map((e=>new N(e)))),void 0!==e.qualityIndices&&(this.qualityIndices=e.qualityIndices.map((e=>e))),void 0!==e.detectOrientation&&(this.detectOrientation=e.detectOrientation),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)}}class V extends f.a{constructor(e={}){if(super(),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&&F.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");this.cumulativeQualityHistogram=e.cumulativeQualityHistogram.map((e=>e))}}class W extends f.a{constructor(e={}){if(super(),this.status="FAILED_DETECTION",void 0===e.fields)throw new Error("fields must be present in constructor argument");this.fields=e.fields.map((e=>new W.Field(e))),void 0!==e.status&&(this.status=e.status)}}!function(e){e.RecognitionStatusValues=["SUCCESS","FAILED_DETECTION","INCOMPLETE_VALIDATION"];class t extends f.a{constructor(e={}){if(super(),this.validationStatus="NOT_VALIDATED",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.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=e.confidence,void 0!==e.validationStatus&&(this.validationStatus=e.validationStatus)}}e.Field=t,function(e){e.ValidationStatusValues=["NOT_VALIDATED","FAILURE","SUCCESS","CONFIRMED"],e.FieldTypeValues=["SURNAME","GIVEN_NAME","DATE_OF_BIRTH","PERSONAL_IDENTIFICATION_NUMBER","INSTITUTION_NUMBER","INSTITUTION_NAME","CARD_NUMBER","CARD_EXPIRATION_DATE","COUNTRY"]}(t=e.Field||(e.Field={}))}(W||(W={}));class z extends f.a{constructor(e={}){super(),this.allowedCountries=[],this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.maxCountryDetectionAttempts=5,this.minEqualFrameCount=4,this.maxAccumulatedFrameCount=10,void 0!==e.allowedCountries&&(this.allowedCountries=e.allowedCountries.map((e=>e))),void 0!==e.minBirthYear&&(this.minBirthYear=e.minBirthYear),void 0!==e.maxBirthYear&&(this.maxBirthYear=e.maxBirthYear),void 0!==e.minExpirationYear&&(this.minExpirationYear=e.minExpirationYear),void 0!==e.maxExpirationYear&&(this.maxExpirationYear=e.maxExpirationYear),void 0!==e.maxCountryDetectionAttempts&&(this.maxCountryDetectionAttempts=e.maxCountryDetectionAttempts),void 0!==e.minEqualFrameCount&&(this.minEqualFrameCount=e.minEqualFrameCount),void 0!==e.maxAccumulatedFrameCount&&(this.maxAccumulatedFrameCount=e.maxAccumulatedFrameCount)}}var j;!function(e){e.From=function(e){const t=e._type;switch(t){case"DateValidationConfiguration":return new H(e);case"EuropeanHealthInsuranceCardConfiguration":return new Z(e);case"MRZFallbackConfiguration":return new G(e);case"DocumentDataExtractorCommonConfiguration":return new Y(e);default:throw`Unknown child class name: ${t}`}}}(j||(j={}));class H extends f.a{constructor(e={}){if(super(),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}}const U=["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 Z extends f.a{constructor(e={}){super(),this._type="EuropeanHealthInsuranceCardConfiguration",this.expectedCountry=null,void 0!==e.expectedCountry&&(this.expectedCountry=null!=e.expectedCountry&&U.includes(e.expectedCountry)?e.expectedCountry:null)}}class G extends f.a{constructor(e={}){super(),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 Y extends f.a{constructor(e={}){if(super(),this._type="DocumentDataExtractorCommonConfiguration",void 0===e.acceptedDocumentTypes)throw new Error("acceptedDocumentTypes must be present in constructor argument");this.acceptedDocumentTypes=e.acceptedDocumentTypes.map((e=>e))}}const Q=["EXACT","INTERPOLATE"];class X extends f.a{constructor(e={}){super(),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 q extends f.a{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult)}}const K=["SUCCESS","ERROR_NOTHING_FOUND","ERROR_BAD_CROP","ERROR_UNKNOWN_DOCUMENT","ERROR_UNACCEPTABLE_DOCUMENT","INCOMPLETE_VALIDATION"];class J extends f.a{constructor(e={}){if(super(),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 k.f(e.document):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=new I(e.documentDetectionResult),void 0===e.croppedImage)throw new Error("croppedImage must be present in constructor argument");this.croppedImage=null!=e.croppedImage?e.croppedImage:null}}const $=["LIVE","SINGLE_SHOT"];class ee extends f.a{constructor(e={}){super(),this.mode="LIVE",void 0!==e.mode&&(this.mode=e.mode)}}class te extends f.a{constructor(e={}){if(super(),this.resultAccumulationConfig=new X({}),this.fieldExcludeList=[],void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new X(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=>j.From(e)))}}class ne extends f.a{constructor(e={}){if(super(),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 ie extends f.a{constructor(e={}){if(super(),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 oe extends f.a{constructor(e={}){if(super(),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 ne(e))),void 0===e.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=e.symbolBoxes.map((e=>new ie(e))),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful)}}var re;!function(e){e.From=function(e){const t=e._type;switch(t){case"DefaultContentValidator":return new ae(e);case"PatternContentValidator":return new se(e);default:throw`Unknown child class name: ${t}`}}}(re||(re={}));class ae extends f.a{constructor(e={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters)}}class se extends f.a{constructor(e={}){if(super(),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 ce extends f.a{constructor(e={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.validator=new ae({}),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=re.From(e.validator))}}const le=["CLASSIC","ML"];class ue extends f.a{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.scannerStrategy="ML",void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult),void 0!==e.scannerStrategy&&(this.scannerStrategy=e.scannerStrategy)}}class de extends f.a{constructor(e={}){if(super(),this.confidence=0,this.validationSuccessful=!1,this.croppedImage=null,void 0===e.countryCode)throw new Error("countryCode must be present in constructor argument");if(this.countryCode=e.countryCode,void 0===e.licensePlate)throw new Error("licensePlate must be present in constructor argument");if(this.licensePlate=e.licensePlate,void 0===e.rawText)throw new Error("rawText must be present in constructor argument");this.rawText=e.rawText,void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?e.croppedImage:null)}}class me extends f.a{constructor(e={}){super(),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 he=["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 fe extends f.a{constructor(e={}){if(super(),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 pe=["INCAPABLE_OF_WORK_SINCE","INCAPABLE_OF_WORK_UNTIL","DIAGNOSED_ON","DOCUMENT_DATE","BIRTH_DATE","CHILD_NEEDS_CARE_FROM","CHILD_NEEDS_CARE_UNTIL","UNDEFINED"];class ge extends f.a{constructor(e={}){if(super(),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 ve=["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 Ce extends f.a{constructor(e={}){if(super(),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 ye extends f.a{constructor(e={}){if(super(),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 Ce(e))),void 0!==e.hasContents&&(this.hasContents=e.hasContents)}}const be=["UNKNOWN","FORM_1A","FORM_1B","FORM_1C","FORM_1D","FORM_21A","FORM_21A_BACK","FORM_1B_CUSTOM"];class Ae extends f.a{constructor(e={}){if(super(),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 ye(e.patientInfoBox),void 0===e.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=e.checkBoxes.map((e=>new fe(e))),void 0===e.dates)throw new Error("dates must be present in constructor argument");if(this.dates=e.dates.map((e=>new ge(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?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(e.documentDetectionResult):null}}const Se=["UNKNOWN","CREW_MEMBER_CERTIFICATE","ID_CARD","PASSPORT","VISA","CH_DRIVING_LICENSE"];class we extends f.a{constructor(e={}){if(super(),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 k.f(e.document):null}}const Ee=["ACCEPT","REJECT"];class xe extends f.a{constructor(e={}){super(),this.frameAccumulationConfiguration=new q({}),this.enableDetection=!0,this.incompleteResultHandling="ACCEPT",void 0!==e.frameAccumulationConfiguration&&(this.frameAccumulationConfiguration=new q(e.frameAccumulationConfiguration)),void 0!==e.enableDetection&&(this.enableDetection=e.enableDetection),void 0!==e.incompleteResultHandling&&(this.incompleteResultHandling=e.incompleteResultHandling)}}var De;!function(e){e.From=function(e){const t=e._type;switch(t){case"Glyph":return new Te(e);case"Word":return new Be(e);case"Line":return new Ie(e);case"Block":return new ke(e);case"Page":return new Oe(e);default:throw`Unknown child class name: ${t}`}}}(De||(De={}));class Te extends f.a{constructor(e={}){if(super(),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 Be extends f.a{constructor(e={}){if(super(),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 Te(e)))}}class Ie extends f.a{constructor(e={}){if(super(),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 Be(e)))}}class ke extends f.a{constructor(e={}){if(super(),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 Ie(e)))}}class Oe extends f.a{constructor(e={}){if(super(),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 ke(e)))}}var Le=n(32);class Pe extends f.a{constructor(e={}){super(),this.author="Created with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==e.author&&(this.author=e.author),void 0!==e.creator&&(this.creator=e.creator),void 0!==e.title&&(this.title=e.title),void 0!==e.subject&&(this.subject=e.subject),void 0!==e.keywords&&(this.keywords=e.keywords)}}const _e=["LETTER","LEGAL","A3","A4","A5","B4","B5","EXECUTIVE","US4x6","US4x8","US5x7","COMM10","CUSTOM"],Re=["PORTRAIT","LANDSCAPE","AUTO"],Fe=["FIT_IN","FILL_IN","STRETCH","NONE"],Ne=["NONE","NEAREST","LINEAR","CUBIC","LANCZOS4","AREA"];class Me extends f.a{constructor(e={}){super(),this.attributes=new Pe({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",void 0!==e.attributes&&(this.attributes=new Pe(e.attributes)),void 0!==e.pageSize&&(this.pageSize=e.pageSize),void 0!==e.pageDirection&&(this.pageDirection=e.pageDirection),void 0!==e.pageFit&&(this.pageFit=e.pageFit),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.resamplingMethod&&(this.resamplingMethod=e.resamplingMethod)}}const Ve=["NONE","CCITTRLE","CCITT_T4","CCITT_T6","LZW","JPEG","CCITTRLEW","PACKBITS","DEFLATE","ADOBE_DEFLATE"],We=["DISABLED","ENABLED","ENABLED_IF_BINARIZATION_FILTER_SET"];var ze,je;!function(e){e.From=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new He(e);case"UserFieldStringValue":return new Ue(e);case"UserFieldIntValue":return new Ze(e);default:throw`Unknown child class name: ${t}`}}}(ze||(ze={}));class He extends f.a{constructor(e={}){if(super(),this._type="UserFieldDoubleValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Ue extends f.a{constructor(e={}){if(super(),this._type="UserFieldStringValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Ze extends f.a{constructor(e={}){if(super(),this._type="UserFieldIntValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Ge extends f.a{constructor(e={}){if(super(),void 0===e.tag)throw new Error("tag must be present in constructor argument");if(this.tag=e.tag,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=ze.From(e.value)}}class Ye extends f.a{constructor(e={}){super(),this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==e.compression&&(this.compression=e.compression),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.zipCompressionLevel&&(this.zipCompressionLevel=e.zipCompressionLevel),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.userFields&&(this.userFields=e.userFields.map((e=>new Ge(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?Le.i.From(e.binarizationFilter):null)}}(je=Ye||(Ye={})).defaultCompression="LZW",je.binaryDocumentOptimizedCompression="CCITT_T6";const Qe=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],Xe=["SUCCESS","BARCODE_WITHOUT_VIN","NO_BARCODE_FOUND","BARCODE_EXTRACTION_DISABLED"];class qe extends f.a{constructor(e={}){if(super(),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 Ke extends f.a{constructor(e={}){if(super(),void 0===e.textResult)throw new Error("textResult must be present in constructor argument");if(this.textResult=new oe(e.textResult),void 0===e.barcodeResult)throw new Error("barcodeResult must be present in constructor argument");this.barcodeResult=new qe(e.barcodeResult)}}class Je extends f.a{constructor(e={}){super(),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)}}const $e="MRZ",et="DeIdCardFront",tt="DeIdCardBack",nt="DePassport",it="DeDriverLicenseFront",ot="DeDriverLicenseBack",rt="Category",at="Categories",st="A",ct="A1",lt="A2",ut="AM",dt="B",mt="B1",ht="BE",ft="C",pt="C1",gt="C1E",vt="CE",Ct="D",yt="D1",bt="D1E",At="DE",St="L",wt="T",Et="DeResidencePermitFront",xt="DeResidencePermitBack",Dt="EuropeanHealthInsuranceCard",Tt="DeHealthInsuranceCardFront";class Bt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return $e}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get checkDigitBirthDate(){return this.document.fields.find((e=>"CheckDigitBirthDate"===e.type.name))}get checkDigitDocumentNumber(){return this.document.fields.find((e=>"CheckDigitDocumentNumber"===e.type.name))}get checkDigitExpiryDate(){return this.document.fields.find((e=>"CheckDigitExpiryDate"===e.type.name))}get checkDigitGeneral(){return this.document.fields.find((e=>"CheckDigitGeneral"===e.type.name))}get checkDigitPersonalNumber(){return this.document.fields.find((e=>"CheckDigitPersonalNumber"===e.type.name))}get dateOfIssuance(){return this.document.fields.find((e=>"DateOfIssuance"===e.type.name))}get documentNumber(){return this.document.fields.find((e=>"DocumentNumber"===e.type.name))}get documentType(){return this.document.fields.find((e=>"DocumentType"===e.type.name))}get documentTypeCode(){return this.document.fields.find((e=>"DocumentTypeCode"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get languageCode(){return this.document.fields.find((e=>"LanguageCode"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get officeOfIssuance(){return this.document.fields.find((e=>"OfficeOfIssuance"===e.type.name))}get optional1(){return this.document.fields.find((e=>"Optional1"===e.type.name))}get optional2(){return this.document.fields.find((e=>"Optional2"===e.type.name))}get pinCode(){return this.document.fields.find((e=>"PINCode"===e.type.name))}get personalNumber(){return this.document.fields.find((e=>"PersonalNumber"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}get travelDocType(){return this.document.fields.find((e=>"TravelDocType"===e.type.name))}get travelDocTypeVariant(){return this.document.fields.find((e=>"TravelDocTypeVariant"===e.type.name))}get unknown(){return this.document.fields.find((e=>"Unknown"===e.type.name))}get versionNumber(){return this.document.fields.find((e=>"VersionNumber"===e.type.name))}get visaOptional(){return this.document.fields.find((e=>"VisaOptional"===e.type.name))}}class It{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return et}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get cardAccessNumber(){return this.document.fields.find((e=>"CardAccessNumber"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get maidenName(){return this.document.fields.find((e=>"MaidenName"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}}class kt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return tt}get address(){return this.document.fields.find((e=>"Address"===e.type.name))}get eyeColor(){return this.document.fields.find((e=>"EyeColor"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get issueDate(){return this.document.fields.find((e=>"IssueDate"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get pseudonym(){return this.document.fields.find((e=>"Pseudonym"===e.type.name))}get rawMRZ(){return this.document.fields.find((e=>"RawMRZ"===e.type.name))}get mrz(){const e=this.document.children.find((e=>"MRZ"===e.type.name));return new Bt(e)}}class Ot{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return nt}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get countryCode(){return this.document.fields.find((e=>"CountryCode"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get issueDate(){return this.document.fields.find((e=>"IssueDate"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get maidenName(){return this.document.fields.find((e=>"MaidenName"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get passportType(){return this.document.fields.find((e=>"PassportType"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get rawMRZ(){return this.document.fields.find((e=>"RawMRZ"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}get mrz(){const e=this.document.children.find((e=>"MRZ"===e.type.name));return new Bt(e)}}class Lt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return it}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get issueDate(){return this.document.fields.find((e=>"IssueDate"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get licenseCategories(){return this.document.fields.find((e=>"LicenseCategories"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get serialNumber(){return this.document.fields.find((e=>"SerialNumber"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}}class Pt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return ot}get restrictions(){return this.document.fields.find((e=>"Restrictions"===e.type.name))}get categories(){const e=this.document.children.find((e=>"Categories"===e.type.name));return new Pt.Categories(e)}}!function(e){class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get restrictions(){return this.document.fields.find((e=>"Restrictions"===e.type.name))}get validFrom(){return this.document.fields.find((e=>"ValidFrom"===e.type.name))}get validUntil(){return this.document.fields.find((e=>"ValidUntil"===e.type.name))}}e.Category=t;class n{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return at}get a(){const t=this.document.children.find((e=>"A"===e.type.name));return new e.Categories.A(t)}get a1(){const t=this.document.children.find((e=>"A1"===e.type.name));return new e.Categories.A1(t)}get a2(){const t=this.document.children.find((e=>"A2"===e.type.name));return new e.Categories.A2(t)}get am(){const t=this.document.children.find((e=>"AM"===e.type.name));return new e.Categories.AM(t)}get b(){const t=this.document.children.find((e=>"B"===e.type.name));return new e.Categories.B(t)}get b1(){const t=this.document.children.find((e=>"B1"===e.type.name));return t?new e.Categories.B1(t):void 0}get be(){const t=this.document.children.find((e=>"BE"===e.type.name));return new e.Categories.BE(t)}get c(){const t=this.document.children.find((e=>"C"===e.type.name));return new e.Categories.C(t)}get c1(){const t=this.document.children.find((e=>"C1"===e.type.name));return new e.Categories.C1(t)}get c1E(){const t=this.document.children.find((e=>"C1E"===e.type.name));return new e.Categories.C1E(t)}get ce(){const t=this.document.children.find((e=>"CE"===e.type.name));return new e.Categories.CE(t)}get d(){const t=this.document.children.find((e=>"D"===e.type.name));return new e.Categories.D(t)}get d1(){const t=this.document.children.find((e=>"D1"===e.type.name));return new e.Categories.D1(t)}get d1E(){const t=this.document.children.find((e=>"D1E"===e.type.name));return new e.Categories.D1E(t)}get de(){const t=this.document.children.find((e=>"DE"===e.type.name));return new e.Categories.DE(t)}get l(){const t=this.document.children.find((e=>"L"===e.type.name));return new e.Categories.L(t)}get t(){const t=this.document.children.find((e=>"T"===e.type.name));return new e.Categories.T(t)}}e.Categories=n,function(e){e.A=class extends t{constructor(e){super(e)}requiredDocumentType(){return st}};e.A1=class extends t{constructor(e){super(e)}requiredDocumentType(){return ct}};e.A2=class extends t{constructor(e){super(e)}requiredDocumentType(){return lt}};e.AM=class extends t{constructor(e){super(e)}requiredDocumentType(){return ut}};e.B=class extends t{constructor(e){super(e)}requiredDocumentType(){return dt}};e.B1=class extends t{constructor(e){super(e)}requiredDocumentType(){return mt}};e.BE=class extends t{constructor(e){super(e)}requiredDocumentType(){return ht}};e.C=class extends t{constructor(e){super(e)}requiredDocumentType(){return ft}};e.C1=class extends t{constructor(e){super(e)}requiredDocumentType(){return pt}};e.C1E=class extends t{constructor(e){super(e)}requiredDocumentType(){return gt}};e.CE=class extends t{constructor(e){super(e)}requiredDocumentType(){return vt}};e.D=class extends t{constructor(e){super(e)}requiredDocumentType(){return Ct}};e.D1=class extends t{constructor(e){super(e)}requiredDocumentType(){return yt}};e.D1E=class extends t{constructor(e){super(e)}requiredDocumentType(){return bt}};e.DE=class extends t{constructor(e){super(e)}requiredDocumentType(){return At}};e.L=class extends t{constructor(e){super(e)}requiredDocumentType(){return St}};e.T=class extends t{constructor(e){super(e)}requiredDocumentType(){return wt}}}(n=e.Categories||(e.Categories={}))}(Pt||(Pt={}));class _t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Et}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get cardAccessNumber(){return this.document.fields.find((e=>"CardAccessNumber"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get placeOfIssue(){return this.document.fields.find((e=>"PlaceOfIssue"===e.type.name))}get remarks(){return this.document.fields.find((e=>"Remarks"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}get titleType(){return this.document.fields.find((e=>"TitleType"===e.type.name))}get validFrom(){return this.document.fields.find((e=>"ValidFrom"===e.type.name))}}class Rt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return xt}get address(){return this.document.fields.find((e=>"Address"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get eyeColor(){return this.document.fields.find((e=>"EyeColor"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get rawMRZ(){return this.document.fields.find((e=>"RawMRZ"===e.type.name))}get remarks(){return this.document.fields.find((e=>"Remarks"===e.type.name))}get mrz(){const e=this.document.children.find((e=>"MRZ"===e.type.name));return new Bt(e)}}class Ft{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Dt}get barcode(){return this.document.fields.find((e=>"Barcode"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get cardNumber(){return this.document.fields.find((e=>"CardNumber"===e.type.name))}get countryCode(){return this.document.fields.find((e=>"CountryCode"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get issuerName(){return this.document.fields.find((e=>"IssuerName"===e.type.name))}get issuerNumber(){return this.document.fields.find((e=>"IssuerNumber"===e.type.name))}get personalNumber(){return this.document.fields.find((e=>"PersonalNumber"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}}class Nt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Tt}get cardAccessNumber(){return this.document.fields.find((e=>"CardAccessNumber"===e.type.name))}get issuerName(){return this.document.fields.find((e=>"IssuerName"===e.type.name))}get issuerNumber(){return this.document.fields.find((e=>"IssuerNumber"===e.type.name))}get name(){return this.document.fields.find((e=>"Name"===e.type.name))}get personalNumber(){return this.document.fields.find((e=>"PersonalNumber"===e.type.name))}}const Mt="BoardingPass",Vt="Leg",Wt="SwissQR",zt="DEMedicalPlan",jt="Patient",Ht="Doctor",Ut="Subheading",Zt="Medicine",Gt="Substance",Yt="Prescription",Qt="IDCardPDF417",Xt="GS1",qt="Element",Kt="ValidationError",Jt="SEPA",$t="MedicalCertificate",en="VCard",tn="Entry",nn="Version",on="Source",rn="Kind",an="XML",sn="Name",cn="FirstName",ln="Nickname",un="Birthday",dn="Anniversary",mn="Gender",hn="DeliveryAddress",fn="Photo",pn="TelephoneNumber",gn="Email",vn="IMPP",Cn="Languages",yn="TimeZone",bn="GeoLocation",An="Title",Sn="Role",wn="Logo",En="Organisation",xn="Member",Dn="Related",Tn="Categories",Bn="Note",In="ProductId",kn="Revision",On="Sound",Ln="UID",Pn="ClientPIDMap",_n="URL",Rn="PublicKey",Fn="BusyTimeURL",Nn="CalendarURIForRequests",Mn="CalendarURI",Vn="Custom",Wn="AAMVA",zn="TitleData",jn="RegistrationData",Hn="MotorCarrierData",Un="RegistrantAndVehicleData",Zn="VehicleOwnerData",Gn="VehicleData",Yn="VehicleSafetyInspectionData",Qn="DLID",Xn="DriverLicense",qn="IDCard",Kn="EnhancedDriverLicense",Jn="RawDocument",$n="HIBC";class ei{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Mt}get electronicTicket(){return this.document.fields.find((e=>"ElectronicTicket"===e.type.name))}get name(){return this.document.fields.find((e=>"Name"===e.type.name))}get numberOfLegs(){return this.document.fields.find((e=>"NumberOfLegs"===e.type.name))}get securityData(){return this.document.fields.find((e=>"SecurityData"===e.type.name))}get legs(){return this.document.children.filter((e=>"Leg"===e.type.name)).map((e=>new ei.Leg(e)))}}!function(e){e.Leg=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Vt}get airlineDesignatorOfBoardingPassIssuer(){return this.document.fields.find((e=>"AirlineDesignatorOfBoardingPassIssuer"===e.type.name))}get airlineNumericCode(){return this.document.fields.find((e=>"AirlineNumericCode"===e.type.name))}get baggageTagLicensePlateNumbers(){return this.document.fields.find((e=>"BaggageTagLicensePlateNumbers"===e.type.name))}get checkInSequenceNumber(){return this.document.fields.find((e=>"CheckInSequenceNumber"===e.type.name))}get compartmentCode(){return this.document.fields.find((e=>"CompartmentCode"===e.type.name))}get dateOfBoardingPassIssuanceJulian(){return this.document.fields.find((e=>"DateOfBoardingPassIssuanceJulian"===e.type.name))}get dateOfFlightJulian(){return this.document.fields.find((e=>"DateOfFlightJulian"===e.type.name))}get departureAirportCode(){return this.document.fields.find((e=>"DepartureAirportCode"===e.type.name))}get destinationAirportCode(){return this.document.fields.find((e=>"DestinationAirportCode"===e.type.name))}get documentFormSerialNumber(){return this.document.fields.find((e=>"DocumentFormSerialNumber"===e.type.name))}get documentType(){return this.document.fields.find((e=>"DocumentType"===e.type.name))}get fastTrack(){return this.document.fields.find((e=>"FastTrack"===e.type.name))}get firstNonConsecutiveBaggageTagLicensePlateNumber(){return this.document.fields.find((e=>"FirstNonConsecutiveBaggageTagLicensePlateNumber"===e.type.name))}get flightNumber(){return this.document.fields.find((e=>"FlightNumber"===e.type.name))}get forIndividualAirlineUse(){return this.document.fields.find((e=>"ForIndividualAirlineUse"===e.type.name))}get freeBaggageAllowance(){return this.document.fields.find((e=>"FreeBaggageAllowance"===e.type.name))}get frequentFlyerAirlineDesignator(){return this.document.fields.find((e=>"FrequentFlyerAirlineDesignator"===e.type.name))}get frequentFlyerNumber(){return this.document.fields.find((e=>"FrequentFlyerNumber"===e.type.name))}get idadIndicator(){return this.document.fields.find((e=>"IDADIndicator"===e.type.name))}get internationalDocumentationVerification(){return this.document.fields.find((e=>"InternationalDocumentationVerification"===e.type.name))}get marketingCarrierDesignator(){return this.document.fields.find((e=>"MarketingCarrierDesignator"===e.type.name))}get operatingCarrierDesignator(){return this.document.fields.find((e=>"OperatingCarrierDesignator"===e.type.name))}get operatingCarrierPNRCode(){return this.document.fields.find((e=>"OperatingCarrierPNRCode"===e.type.name))}get passengerDescription(){return this.document.fields.find((e=>"PassengerDescription"===e.type.name))}get passengerStatus(){return this.document.fields.find((e=>"PassengerStatus"===e.type.name))}get seatNumber(){return this.document.fields.find((e=>"SeatNumber"===e.type.name))}get secondNonConsecutiveBaggageTagLicensePlateNumber(){return this.document.fields.find((e=>"SecondNonConsecutiveBaggageTagLicensePlateNumber"===e.type.name))}get selecteeIndicator(){return this.document.fields.find((e=>"SelecteeIndicator"===e.type.name))}get sourceOfBoardingPassIssuance(){return this.document.fields.find((e=>"SourceOfBoardingPassIssuance"===e.type.name))}get sourceOfCheckIn(){return this.document.fields.find((e=>"SourceOfCheckIn"===e.type.name))}get versionNumber(){return this.document.fields.find((e=>"VersionNumber"===e.type.name))}}}(ei||(ei={}));class ti{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Wt}get additionalBillingInformation(){return this.document.fields.find((e=>"AdditionalBillingInformation"===e.type.name))}get additionalInfoTrailer(){return this.document.fields.find((e=>"AdditionalInfoTrailer"===e.type.name))}get additionalInfoUnstructured(){return this.document.fields.find((e=>"AdditionalInfoUnstructured"===e.type.name))}get alternativeProcedureParameter(){return this.document.fields.find((e=>"AlternativeProcedureParameter"===e.type.name))}get amount(){return this.document.fields.find((e=>"Amount"===e.type.name))}get currency(){return this.document.fields.find((e=>"Currency"===e.type.name))}get debtorAddressType(){return this.document.fields.find((e=>"DebtorAddressType"===e.type.name))}get debtorBuildingOrAddressLine2(){return this.document.fields.find((e=>"DebtorBuildingOrAddressLine2"===e.type.name))}get debtorCountry(){return this.document.fields.find((e=>"DebtorCountry"===e.type.name))}get debtorName(){return this.document.fields.find((e=>"DebtorName"===e.type.name))}get debtorPlace(){return this.document.fields.find((e=>"DebtorPlace"===e.type.name))}get debtorPostalCode(){return this.document.fields.find((e=>"DebtorPostalCode"===e.type.name))}get debtorStreetOrAddressLine1(){return this.document.fields.find((e=>"DebtorStreetOrAddressLine1"===e.type.name))}get dueDate(){return this.document.fields.find((e=>"DueDate"===e.type.name))}get encoding(){return this.document.fields.find((e=>"Encoding"===e.type.name))}get finalPayeeAddressType(){return this.document.fields.find((e=>"FinalPayeeAddressType"===e.type.name))}get finalPayeeBuildingOrAddressLine2(){return this.document.fields.find((e=>"FinalPayeeBuildingOrAddressLine2"===e.type.name))}get finalPayeeCountry(){return this.document.fields.find((e=>"FinalPayeeCountry"===e.type.name))}get finalPayeeName(){return this.document.fields.find((e=>"FinalPayeeName"===e.type.name))}get finalPayeePlace(){return this.document.fields.find((e=>"FinalPayeePlace"===e.type.name))}get finalPayeePostalCode(){return this.document.fields.find((e=>"FinalPayeePostalCode"===e.type.name))}get finalPayeeStreetOrAddressLine1(){return this.document.fields.find((e=>"FinalPayeeStreetOrAddressLine1"===e.type.name))}get iban(){return this.document.fields.find((e=>"IBAN"===e.type.name))}get majorVersion(){return this.document.fields.find((e=>"MajorVersion"===e.type.name))}get payeeAddressType(){return this.document.fields.find((e=>"PayeeAddressType"===e.type.name))}get payeeBuildingOrAddressLine2(){return this.document.fields.find((e=>"PayeeBuildingOrAddressLine2"===e.type.name))}get payeeCountry(){return this.document.fields.find((e=>"PayeeCountry"===e.type.name))}get payeeName(){return this.document.fields.find((e=>"PayeeName"===e.type.name))}get payeePlace(){return this.document.fields.find((e=>"PayeePlace"===e.type.name))}get payeePostalCode(){return this.document.fields.find((e=>"PayeePostalCode"===e.type.name))}get payeeStreetOrAddressLine1(){return this.document.fields.find((e=>"PayeeStreetOrAddressLine1"===e.type.name))}get paymentReference(){return this.document.fields.find((e=>"PaymentReference"===e.type.name))}get paymentReferenceType(){return this.document.fields.find((e=>"PaymentReferenceType"===e.type.name))}}class ni{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return zt}get currentPage(){return this.document.fields.find((e=>"CurrentPage"===e.type.name))}get documentVersionNumber(){return this.document.fields.find((e=>"DocumentVersionNumber"===e.type.name))}get guid(){return this.document.fields.find((e=>"GUID"===e.type.name))}get languageCountryCode(){return this.document.fields.find((e=>"LanguageCountryCode"===e.type.name))}get patchVersionNumber(){return this.document.fields.find((e=>"PatchVersionNumber"===e.type.name))}get totalNumberOfPages(){return this.document.fields.find((e=>"TotalNumberOfPages"===e.type.name))}get patient(){const e=this.document.children.find((e=>"Patient"===e.type.name));return new ni.Patient(e)}get doctor(){const e=this.document.children.find((e=>"Doctor"===e.type.name));return new ni.Doctor(e)}get subheadings(){return this.document.children.filter((e=>"Subheading"===e.type.name)).map((e=>new ni.Subheading(e)))}}!function(e){e.Patient=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return jt}get allergiesAndIntolerances(){return this.document.fields.find((e=>"AllergiesAndIntolerances"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get breastFeeding(){return this.document.fields.find((e=>"BreastFeeding"===e.type.name))}get creatinineValue(){return this.document.fields.find((e=>"CreatinineValue"===e.type.name))}get firstName(){return this.document.fields.find((e=>"FirstName"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get lastName(){return this.document.fields.find((e=>"LastName"===e.type.name))}get patientFreeText(){return this.document.fields.find((e=>"PatientFreeText"===e.type.name))}get patientID(){return this.document.fields.find((e=>"PatientID"===e.type.name))}get preName(){return this.document.fields.find((e=>"PreName"===e.type.name))}get pregnant(){return this.document.fields.find((e=>"Pregnant"===e.type.name))}get suffix(){return this.document.fields.find((e=>"Suffix"===e.type.name))}get title(){return this.document.fields.find((e=>"Title"===e.type.name))}get weight(){return this.document.fields.find((e=>"Weight"===e.type.name))}};e.Doctor=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Ht}get doctorNumber(){return this.document.fields.find((e=>"DoctorNumber"===e.type.name))}get email(){return this.document.fields.find((e=>"Email"===e.type.name))}get hospitalID(){return this.document.fields.find((e=>"HospitalID"===e.type.name))}get issuerName(){return this.document.fields.find((e=>"IssuerName"===e.type.name))}get issuingDateAndTime(){return this.document.fields.find((e=>"IssuingDateAndTime"===e.type.name))}get pharmacyID(){return this.document.fields.find((e=>"PharmacyID"===e.type.name))}get place(){return this.document.fields.find((e=>"Place"===e.type.name))}get postalCode(){return this.document.fields.find((e=>"PostalCode"===e.type.name))}get street(){return this.document.fields.find((e=>"Street"===e.type.name))}get telephoneNumber(){return this.document.fields.find((e=>"TelephoneNumber"===e.type.name))}};class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Ut}get generalNotes(){return this.document.fields.filter((e=>"GeneralNote"===e.type.name))}get keyWords(){return this.document.fields.find((e=>"KeyWords"===e.type.name))}get subheadingFreeText(){return this.document.fields.find((e=>"SubheadingFreeText"===e.type.name))}get medicines(){return this.document.children.filter((e=>"Medicine"===e.type.name)).map((t=>new e.Subheading.Medicine(t)))}get prescriptions(){return this.document.children.filter((e=>"Prescription"===e.type.name)).map((t=>new e.Subheading.Prescription(t)))}}e.Subheading=t,function(t){class n{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Zt}get dosageForm(){return this.document.fields.find((e=>"DosageForm"===e.type.name))}get dosageFormFreeText(){return this.document.fields.find((e=>"DosageFormFreeText"===e.type.name))}get dosageFreeText(){return this.document.fields.find((e=>"DosageFreeText"===e.type.name))}get dosingUnit(){return this.document.fields.find((e=>"DosingUnit"===e.type.name))}get dosingUnitFreeText(){return this.document.fields.find((e=>"DosingUnitFreeText"===e.type.name))}get drugName(){return this.document.fields.find((e=>"DrugName"===e.type.name))}get evening(){return this.document.fields.find((e=>"Evening"===e.type.name))}get generalNotes(){return this.document.fields.find((e=>"GeneralNotes"===e.type.name))}get midday(){return this.document.fields.find((e=>"Midday"===e.type.name))}get morning(){return this.document.fields.find((e=>"Morning"===e.type.name))}get night(){return this.document.fields.find((e=>"Night"===e.type.name))}get pharmaceuticalNumber(){return this.document.fields.find((e=>"PharmaceuticalNumber"===e.type.name))}get reasonForTreatment(){return this.document.fields.find((e=>"ReasonForTreatment"===e.type.name))}get relevantInfo(){return this.document.fields.find((e=>"RelevantInfo"===e.type.name))}get substances(){return this.document.children.filter((e=>"Substance"===e.type.name)).map((t=>new e.Subheading.Medicine.Substance(t)))}}t.Medicine=n,function(e){e.Substance=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Gt}get activeSubstance(){return this.document.fields.find((e=>"ActiveSubstance"===e.type.name))}get potency(){return this.document.fields.find((e=>"Potency"===e.type.name))}}}(n=t.Medicine||(t.Medicine={}));t.Prescription=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Yt}get generalInformation(){return this.document.fields.find((e=>"GeneralInformation"===e.type.name))}get prescriptionFreeText(){return this.document.fields.find((e=>"PrescriptionFreeText"===e.type.name))}}}(t=e.Subheading||(e.Subheading={}))}(ni||(ni={}));class ii{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Qt}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get dateExpired(){return this.document.fields.find((e=>"DateExpired"===e.type.name))}get dateIssued(){return this.document.fields.find((e=>"DateIssued"===e.type.name))}get documentCode(){return this.document.fields.find((e=>"DocumentCode"===e.type.name))}get firstName(){return this.document.fields.find((e=>"FirstName"===e.type.name))}get lastName(){return this.document.fields.find((e=>"LastName"===e.type.name))}get optional(){return this.document.fields.find((e=>"Optional"===e.type.name))}}class oi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Xt}get elements(){return this.document.children.filter((e=>"Element"===e.type.name)).map((e=>new oi.Element(e)))}}!function(e){class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return qt}get applicationIdentifier(){return this.document.fields.find((e=>"ApplicationIdentifier"===e.type.name))}get dataTitle(){return this.document.fields.find((e=>"DataTitle"===e.type.name))}get elementDescription(){return this.document.fields.find((e=>"ElementDescription"===e.type.name))}get rawValue(){return this.document.fields.find((e=>"RawValue"===e.type.name))}get validationErrors(){return this.document.children.filter((e=>"ValidationError"===e.type.name)).map((t=>new e.Element.ValidationError(t)))}}e.Element=t,function(e){e.ValidationError=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Kt}get code(){return this.document.fields.find((e=>"Code"===e.type.name))}get reason(){return this.document.fields.find((e=>"Reason"===e.type.name))}}}(t=e.Element||(e.Element={}))}(oi||(oi={}));class ri{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Jt}get amount(){return this.document.fields.find((e=>"Amount"===e.type.name))}get characterSet(){return this.document.fields.find((e=>"CharacterSet"===e.type.name))}get identification(){return this.document.fields.find((e=>"Identification"===e.type.name))}get information(){return this.document.fields.find((e=>"Information"===e.type.name))}get purpose(){return this.document.fields.find((e=>"Purpose"===e.type.name))}get receiverBIC(){return this.document.fields.find((e=>"ReceiverBIC"===e.type.name))}get receiverIBAN(){return this.document.fields.find((e=>"ReceiverIBAN"===e.type.name))}get receiverName(){return this.document.fields.find((e=>"ReceiverName"===e.type.name))}get remittance(){return this.document.fields.find((e=>"Remittance"===e.type.name))}get serviceTag(){return this.document.fields.find((e=>"ServiceTag"===e.type.name))}get version(){return this.document.fields.find((e=>"Version"===e.type.name))}}class ai{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return $t}get accident(){return this.document.fields.find((e=>"Accident"===e.type.name))}get assignedToAccidentInsuranceDoctor(){return this.document.fields.find((e=>"AssignedToAccidentInsuranceDoctor"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get childNeedsCareFrom(){return this.document.fields.find((e=>"ChildNeedsCareFrom"===e.type.name))}get childNeedsCareUntil(){return this.document.fields.find((e=>"ChildNeedsCareUntil"===e.type.name))}get diagnose(){return this.document.fields.find((e=>"Diagnose"===e.type.name))}get diagnosedOn(){return this.document.fields.find((e=>"DiagnosedOn"===e.type.name))}get doctorNumber(){return this.document.fields.find((e=>"DoctorNumber"===e.type.name))}get documentDate(){return this.document.fields.find((e=>"DocumentDate"===e.type.name))}get firstName(){return this.document.fields.find((e=>"FirstName"===e.type.name))}get healthInsuranceNumber(){return this.document.fields.find((e=>"HealthInsuranceNumber"===e.type.name))}get incapableOfWorkSince(){return this.document.fields.find((e=>"IncapableOfWorkSince"===e.type.name))}get incapableOfWorkUntil(){return this.document.fields.find((e=>"IncapableOfWorkUntil"===e.type.name))}get initialCertificate(){return this.document.fields.find((e=>"InitialCertificate"===e.type.name))}get insuredPersonNumber(){return this.document.fields.find((e=>"InsuredPersonNumber"===e.type.name))}get lastName(){return this.document.fields.find((e=>"LastName"===e.type.name))}get placeOfOperationNumber(){return this.document.fields.find((e=>"PlaceOfOperationNumber"===e.type.name))}get renewedCertificate(){return this.document.fields.find((e=>"RenewedCertificate"===e.type.name))}get requiresCare(){return this.document.fields.find((e=>"RequiresCare"===e.type.name))}get status(){return this.document.fields.find((e=>"Status"===e.type.name))}get workAccident(){return this.document.fields.find((e=>"WorkAccident"===e.type.name))}}class si{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return en}get version(){const e=this.document.children.find((e=>"Version"===e.type.name));return new si.Version(e)}get source(){const e=this.document.children.find((e=>"Source"===e.type.name));return e?new si.Source(e):void 0}get kind(){const e=this.document.children.find((e=>"Kind"===e.type.name));return e?new si.Kind(e):void 0}get xml(){const e=this.document.children.find((e=>"XML"===e.type.name));return e?new si.XML(e):void 0}get name(){const e=this.document.children.find((e=>"Name"===e.type.name));return e?new si.Name(e):void 0}get firstName(){const e=this.document.children.find((e=>"FirstName"===e.type.name));return e?new si.FirstName(e):void 0}get nickname(){const e=this.document.children.find((e=>"Nickname"===e.type.name));return e?new si.Nickname(e):void 0}get birthday(){const e=this.document.children.find((e=>"Birthday"===e.type.name));return e?new si.Birthday(e):void 0}get anniversary(){const e=this.document.children.find((e=>"Anniversary"===e.type.name));return e?new si.Anniversary(e):void 0}get gender(){const e=this.document.children.find((e=>"Gender"===e.type.name));return e?new si.Gender(e):void 0}get deliveryAddress(){const e=this.document.children.find((e=>"DeliveryAddress"===e.type.name));return e?new si.DeliveryAddress(e):void 0}get photo(){const e=this.document.children.find((e=>"Photo"===e.type.name));return e?new si.Photo(e):void 0}get telephoneNumber(){const e=this.document.children.find((e=>"TelephoneNumber"===e.type.name));return e?new si.TelephoneNumber(e):void 0}get email(){const e=this.document.children.find((e=>"Email"===e.type.name));return e?new si.Email(e):void 0}get impp(){const e=this.document.children.find((e=>"IMPP"===e.type.name));return e?new si.IMPP(e):void 0}get languages(){const e=this.document.children.find((e=>"Languages"===e.type.name));return e?new si.Languages(e):void 0}get timeZone(){const e=this.document.children.find((e=>"TimeZone"===e.type.name));return e?new si.TimeZone(e):void 0}get geoLocation(){const e=this.document.children.find((e=>"GeoLocation"===e.type.name));return e?new si.GeoLocation(e):void 0}get title(){const e=this.document.children.find((e=>"Title"===e.type.name));return e?new si.Title(e):void 0}get role(){const e=this.document.children.find((e=>"Role"===e.type.name));return e?new si.Role(e):void 0}get logo(){const e=this.document.children.find((e=>"Logo"===e.type.name));return e?new si.Logo(e):void 0}get organisation(){const e=this.document.children.find((e=>"Organisation"===e.type.name));return e?new si.Organisation(e):void 0}get member(){const e=this.document.children.find((e=>"Member"===e.type.name));return e?new si.Member(e):void 0}get related(){const e=this.document.children.find((e=>"Related"===e.type.name));return e?new si.Related(e):void 0}get categories(){const e=this.document.children.find((e=>"Categories"===e.type.name));return e?new si.Categories(e):void 0}get note(){const e=this.document.children.find((e=>"Note"===e.type.name));return e?new si.Note(e):void 0}get productId(){const e=this.document.children.find((e=>"ProductId"===e.type.name));return e?new si.ProductId(e):void 0}get revision(){const e=this.document.children.find((e=>"Revision"===e.type.name));return e?new si.Revision(e):void 0}get sound(){const e=this.document.children.find((e=>"Sound"===e.type.name));return e?new si.Sound(e):void 0}get uid(){const e=this.document.children.find((e=>"UID"===e.type.name));return e?new si.UID(e):void 0}get clientPIDMap(){const e=this.document.children.find((e=>"ClientPIDMap"===e.type.name));return e?new si.ClientPIDMap(e):void 0}get url(){const e=this.document.children.find((e=>"URL"===e.type.name));return e?new si.URL(e):void 0}get publicKey(){const e=this.document.children.find((e=>"PublicKey"===e.type.name));return e?new si.PublicKey(e):void 0}get busyTimeURL(){const e=this.document.children.find((e=>"BusyTimeURL"===e.type.name));return e?new si.BusyTimeURL(e):void 0}get calendarURIForRequests(){const e=this.document.children.find((e=>"CalendarURIForRequests"===e.type.name));return e?new si.CalendarURIForRequests(e):void 0}get calendarURI(){const e=this.document.children.find((e=>"CalendarURI"===e.type.name));return e?new si.CalendarURI(e):void 0}get customs(){return this.document.children.filter((e=>"Custom"===e.type.name)).map((e=>new si.Custom(e)))}}!function(e){class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get rawValue(){return this.document.fields.find((e=>"RawValue"===e.type.name))}get typeModifiers(){return this.document.fields.filter((e=>"TypeModifier"===e.type.name))}get values(){return this.document.fields.filter((e=>"Value"===e.type.name))}}e.Entry=t;e.Version=class extends t{constructor(e){super(e)}requiredDocumentType(){return nn}};e.Source=class extends t{constructor(e){super(e)}requiredDocumentType(){return on}};e.Kind=class extends t{constructor(e){super(e)}requiredDocumentType(){return rn}};e.XML=class extends t{constructor(e){super(e)}requiredDocumentType(){return an}};e.Name=class extends t{constructor(e){super(e)}requiredDocumentType(){return sn}};e.FirstName=class extends t{constructor(e){super(e)}requiredDocumentType(){return cn}};e.Nickname=class extends t{constructor(e){super(e)}requiredDocumentType(){return ln}};e.Birthday=class extends t{constructor(e){super(e)}requiredDocumentType(){return un}};e.Anniversary=class extends t{constructor(e){super(e)}requiredDocumentType(){return dn}};e.Gender=class extends t{constructor(e){super(e)}requiredDocumentType(){return mn}};e.DeliveryAddress=class extends t{constructor(e){super(e)}requiredDocumentType(){return hn}};e.Photo=class extends t{constructor(e){super(e)}requiredDocumentType(){return fn}};e.TelephoneNumber=class extends t{constructor(e){super(e)}requiredDocumentType(){return pn}};e.Email=class extends t{constructor(e){super(e)}requiredDocumentType(){return gn}};e.IMPP=class extends t{constructor(e){super(e)}requiredDocumentType(){return vn}};e.Languages=class extends t{constructor(e){super(e)}requiredDocumentType(){return Cn}};e.TimeZone=class extends t{constructor(e){super(e)}requiredDocumentType(){return yn}};e.GeoLocation=class extends t{constructor(e){super(e)}requiredDocumentType(){return bn}};e.Title=class extends t{constructor(e){super(e)}requiredDocumentType(){return An}};e.Role=class extends t{constructor(e){super(e)}requiredDocumentType(){return Sn}};e.Logo=class extends t{constructor(e){super(e)}requiredDocumentType(){return wn}};e.Organisation=class extends t{constructor(e){super(e)}requiredDocumentType(){return En}};e.Member=class extends t{constructor(e){super(e)}requiredDocumentType(){return xn}};e.Related=class extends t{constructor(e){super(e)}requiredDocumentType(){return Dn}};e.Categories=class extends t{constructor(e){super(e)}requiredDocumentType(){return Tn}};e.Note=class extends t{constructor(e){super(e)}requiredDocumentType(){return Bn}};e.ProductId=class extends t{constructor(e){super(e)}requiredDocumentType(){return In}};e.Revision=class extends t{constructor(e){super(e)}requiredDocumentType(){return kn}};e.Sound=class extends t{constructor(e){super(e)}requiredDocumentType(){return On}};e.UID=class extends t{constructor(e){super(e)}requiredDocumentType(){return Ln}};e.ClientPIDMap=class extends t{constructor(e){super(e)}requiredDocumentType(){return Pn}};e.URL=class extends t{constructor(e){super(e)}requiredDocumentType(){return _n}};e.PublicKey=class extends t{constructor(e){super(e)}requiredDocumentType(){return Rn}};e.BusyTimeURL=class extends t{constructor(e){super(e)}requiredDocumentType(){return Fn}};e.CalendarURIForRequests=class extends t{constructor(e){super(e)}requiredDocumentType(){return Nn}};e.CalendarURI=class extends t{constructor(e){super(e)}requiredDocumentType(){return Mn}};e.Custom=class extends t{constructor(e){super(e)}requiredDocumentType(){return Vn}}}(si||(si={}));class ci{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Wn}get issuerIdentificationNumber(){return this.document.fields.find((e=>"IssuerIdentificationNumber"===e.type.name))}get jurisdictionVersionNumber(){return this.document.fields.find((e=>"JurisdictionVersionNumber"===e.type.name))}get version(){return this.document.fields.find((e=>"Version"===e.type.name))}get titleData(){const e=this.document.children.find((e=>"TitleData"===e.type.name));return e?new ci.TitleData(e):void 0}get registrationData(){const e=this.document.children.find((e=>"RegistrationData"===e.type.name));return e?new ci.RegistrationData(e):void 0}get motorCarrierData(){const e=this.document.children.find((e=>"MotorCarrierData"===e.type.name));return e?new ci.MotorCarrierData(e):void 0}get registrantAndVehicleData(){const e=this.document.children.find((e=>"RegistrantAndVehicleData"===e.type.name));return e?new ci.RegistrantAndVehicleData(e):void 0}get vehicleOwnerData(){const e=this.document.children.find((e=>"VehicleOwnerData"===e.type.name));return e?new ci.VehicleOwnerData(e):void 0}get vehicleData(){const e=this.document.children.find((e=>"VehicleData"===e.type.name));return e?new ci.VehicleData(e):void 0}get vehicleSafetyInspectionData(){const e=this.document.children.find((e=>"VehicleSafetyInspectionData"===e.type.name));return e?new ci.VehicleSafetyInspectionData(e):void 0}get driverLicense(){const e=this.document.children.find((e=>"DriverLicense"===e.type.name));return e?new ci.DriverLicense(e):void 0}get idCard(){const e=this.document.children.find((e=>"IDCard"===e.type.name));return e?new ci.IDCard(e):void 0}get enhancedDriverLicense(){const e=this.document.children.find((e=>"EnhancedDriverLicense"===e.type.name));return e?new ci.EnhancedDriverLicense(e):void 0}get rawDocument(){const e=this.document.children.find((e=>"RawDocument"===e.type.name));return new ci.RawDocument(e)}}!function(e){e.TitleData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return zn}get addressCity(){return this.document.fields.find((e=>"AddressCity"===e.type.name))}get addressJurisdictionCode(){return this.document.fields.find((e=>"AddressJurisdictionCode"===e.type.name))}get addressStreet(){return this.document.fields.find((e=>"AddressStreet"===e.type.name))}get addressZipCode(){return this.document.fields.find((e=>"AddressZipCode"===e.type.name))}get businessName(){return this.document.fields.find((e=>"BusinessName"===e.type.name))}get familyName(){return this.document.fields.find((e=>"FamilyName"===e.type.name))}get firstLienHolderId(){return this.document.fields.find((e=>"FirstLienHolderId"===e.type.name))}get firstLienHolderName(){return this.document.fields.find((e=>"FirstLienHolderName"===e.type.name))}get givenName(){return this.document.fields.find((e=>"GivenName"===e.type.name))}get newUsedIndicator(){return this.document.fields.find((e=>"NewUsedIndicator"===e.type.name))}get odometerDate(){return this.document.fields.find((e=>"OdometerDate"===e.type.name))}get odometerDisclosure(){return this.document.fields.find((e=>"OdometerDisclosure"===e.type.name))}get odometerReadingKilometers(){return this.document.fields.find((e=>"OdometerReadingKilometers"===e.type.name))}get odometerReadingMileage(){return this.document.fields.find((e=>"OdometerReadingMileage"===e.type.name))}get previousTitleNumber(){return this.document.fields.find((e=>"PreviousTitleNumber"===e.type.name))}get previousTitlingJurisdiction(){return this.document.fields.find((e=>"PreviousTitlingJurisdiction"===e.type.name))}get titleBrand(){return this.document.fields.find((e=>"TitleBrand"===e.type.name))}get titleIssueDate(){return this.document.fields.find((e=>"TitleIssueDate"===e.type.name))}get titleNumber(){return this.document.fields.find((e=>"TitleNumber"===e.type.name))}get titlingJurisdiction(){return this.document.fields.find((e=>"TitlingJurisdiction"===e.type.name))}get vehicleBodyStyle(){return this.document.fields.find((e=>"VehicleBodyStyle"===e.type.name))}get vehicleColor(){return this.document.fields.find((e=>"VehicleColor"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModel(){return this.document.fields.find((e=>"VehicleModel"===e.type.name))}get vehicleModelYear(){return this.document.fields.find((e=>"VehicleModelYear"===e.type.name))}get vehiclePurchaseDate(){return this.document.fields.find((e=>"VehiclePurchaseDate"===e.type.name))}};e.RegistrationData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return jn}get addressCity(){return this.document.fields.find((e=>"AddressCity"===e.type.name))}get addressJurisdictionCode(){return this.document.fields.find((e=>"AddressJurisdictionCode"===e.type.name))}get addressStreet(){return this.document.fields.find((e=>"AddressStreet"===e.type.name))}get addressZipCode(){return this.document.fields.find((e=>"AddressZipCode"===e.type.name))}get axles(){return this.document.fields.find((e=>"Axles"===e.type.name))}get businessName(){return this.document.fields.find((e=>"BusinessName"===e.type.name))}get fuel(){return this.document.fields.find((e=>"Fuel"===e.type.name))}get grossVehicleWeight(){return this.document.fields.find((e=>"GrossVehicleWeight"===e.type.name))}get registrantFamilyName(){return this.document.fields.find((e=>"RegistrantFamilyName"===e.type.name))}get registrantGivenName(){return this.document.fields.find((e=>"RegistrantGivenName"===e.type.name))}get registrationExpiryDate(){return this.document.fields.find((e=>"RegistrationExpiryDate"===e.type.name))}get registrationIssueDate(){return this.document.fields.find((e=>"RegistrationIssueDate"===e.type.name))}get registrationPlateNumber(){return this.document.fields.find((e=>"RegistrationPlateNumber"===e.type.name))}get registrationWindowStickerDecal(){return this.document.fields.find((e=>"RegistrationWindowStickerDecal"===e.type.name))}get registrationYear(){return this.document.fields.find((e=>"RegistrationYear"===e.type.name))}get vehicleBodyStyle(){return this.document.fields.find((e=>"VehicleBodyStyle"===e.type.name))}get vehicleColor(){return this.document.fields.find((e=>"VehicleColor"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModel(){return this.document.fields.find((e=>"VehicleModel"===e.type.name))}get vehicleModelYear(){return this.document.fields.find((e=>"VehicleModelYear"===e.type.name))}get vehicleUse(){return this.document.fields.find((e=>"VehicleUse"===e.type.name))}};e.MotorCarrierData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Hn}get carrierName(){return this.document.fields.find((e=>"CarrierName"===e.type.name))}get city(){return this.document.fields.find((e=>"City"===e.type.name))}get jurisdiction(){return this.document.fields.find((e=>"Jurisdiction"===e.type.name))}get streetAddress(){return this.document.fields.find((e=>"StreetAddress"===e.type.name))}get usdotNumber(){return this.document.fields.find((e=>"USDOTNumber"===e.type.name))}get zip(){return this.document.fields.find((e=>"Zip"===e.type.name))}};e.RegistrantAndVehicleData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Un}get address(){return this.document.fields.find((e=>"Address"===e.type.name))}get baseJurisdictionRegisteredWeight(){return this.document.fields.find((e=>"BaseJurisdictionRegisteredWeight"===e.type.name))}get carrierNameRegistrant(){return this.document.fields.find((e=>"CarrierNameRegistrant"===e.type.name))}get city(){return this.document.fields.find((e=>"City"===e.type.name))}get grossVehicleWeight(){return this.document.fields.find((e=>"GrossVehicleWeight"===e.type.name))}get jurisdiction(){return this.document.fields.find((e=>"Jurisdiction"===e.type.name))}get modelYear(){return this.document.fields.find((e=>"ModelYear"===e.type.name))}get numberOfSeats(){return this.document.fields.find((e=>"NumberOfSeats"===e.type.name))}get registrationDecalNumber(){return this.document.fields.find((e=>"RegistrationDecalNumber"===e.type.name))}get registrationEnforcementDate(){return this.document.fields.find((e=>"RegistrationEnforcementDate"===e.type.name))}get registrationExpirationDate(){return this.document.fields.find((e=>"RegistrationExpirationDate"===e.type.name))}get registrationIssueDate(){return this.document.fields.find((e=>"RegistrationIssueDate"===e.type.name))}get registrationPlateNumber(){return this.document.fields.find((e=>"RegistrationPlateNumber"===e.type.name))}get registrationYear(){return this.document.fields.find((e=>"RegistrationYear"===e.type.name))}get typeOfVehicle(){return this.document.fields.find((e=>"TypeOfVehicle"===e.type.name))}get unitNumber(){return this.document.fields.find((e=>"UnitNumber"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get zipCode(){return this.document.fields.find((e=>"ZipCode"===e.type.name))}};e.VehicleOwnerData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Zn}get firstOwnerIdNumber(){return this.document.fields.find((e=>"FirstOwnerIdNumber"===e.type.name))}get firstOwnerLastName(){return this.document.fields.find((e=>"FirstOwnerLastName"===e.type.name))}get firstOwnerLegalStatus(){return this.document.fields.find((e=>"FirstOwnerLegalStatus"===e.type.name))}get firstOwnerMiddleName(){return this.document.fields.find((e=>"FirstOwnerMiddleName"===e.type.name))}get firstOwnerName(){return this.document.fields.find((e=>"FirstOwnerName"===e.type.name))}get firstOwnerTotalName(){return this.document.fields.find((e=>"FirstOwnerTotalName"===e.type.name))}get mailingAddress1(){return this.document.fields.find((e=>"MailingAddress1"===e.type.name))}get mailingAddress2(){return this.document.fields.find((e=>"MailingAddress2"===e.type.name))}get mailingCity(){return this.document.fields.find((e=>"MailingCity"===e.type.name))}get mailingJurisdictionCode(){return this.document.fields.find((e=>"MailingJurisdictionCode"===e.type.name))}get mailingZipCode(){return this.document.fields.find((e=>"MailingZipCode"===e.type.name))}get residenceAddress1(){return this.document.fields.find((e=>"ResidenceAddress1"===e.type.name))}get residenceAddress2(){return this.document.fields.find((e=>"ResidenceAddress2"===e.type.name))}get residenceCity(){return this.document.fields.find((e=>"ResidenceCity"===e.type.name))}get residenceJurisdictionCode(){return this.document.fields.find((e=>"ResidenceJurisdictionCode"===e.type.name))}get residenceZipCode(){return this.document.fields.find((e=>"ResidenceZipCode"===e.type.name))}get secondOwnerIdNumber(){return this.document.fields.find((e=>"SecondOwnerIdNumber"===e.type.name))}get secondOwnerLastName(){return this.document.fields.find((e=>"SecondOwnerLastName"===e.type.name))}get secondOwnerLegalStatus(){return this.document.fields.find((e=>"SecondOwnerLegalStatus"===e.type.name))}get secondOwnerMiddleName(){return this.document.fields.find((e=>"SecondOwnerMiddleName"===e.type.name))}get secondOwnerName(){return this.document.fields.find((e=>"SecondOwnerName"===e.type.name))}get secondOwnerTotalName(){return this.document.fields.find((e=>"SecondOwnerTotalName"===e.type.name))}};e.VehicleData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Gn}get bodyStyle(){return this.document.fields.find((e=>"BodyStyle"===e.type.name))}get dateJunked(){return this.document.fields.find((e=>"DateJunked"===e.type.name))}get dateRecovered(){return this.document.fields.find((e=>"DateRecovered"===e.type.name))}get dateStolen(){return this.document.fields.find((e=>"DateStolen"===e.type.name))}get engineDisplacement(){return this.document.fields.find((e=>"EngineDisplacement"===e.type.name))}get engineSize(){return this.document.fields.find((e=>"EngineSize"===e.type.name))}get fuelType(){return this.document.fields.find((e=>"FuelType"===e.type.name))}get horsepower(){return this.document.fields.find((e=>"Horsepower"===e.type.name))}get iftaIndicator(){return this.document.fields.find((e=>"IFTAIndicator"===e.type.name))}get irpIndicator(){return this.document.fields.find((e=>"IRPIndicator"===e.type.name))}get junkedIndicator(){return this.document.fields.find((e=>"JunkedIndicator"===e.type.name))}get msrp(){return this.document.fields.find((e=>"MSRP"===e.type.name))}get majorCode(){return this.document.fields.find((e=>"MajorCode"===e.type.name))}get makeYear(){return this.document.fields.find((e=>"MakeYear"===e.type.name))}get manufactureGrossWeight(){return this.document.fields.find((e=>"ManufactureGrossWeight"===e.type.name))}get minorCode(){return this.document.fields.find((e=>"MinorCode"===e.type.name))}get numberOfAxles(){return this.document.fields.find((e=>"NumberOfAxles"===e.type.name))}get numberOfCylinders(){return this.document.fields.find((e=>"NumberOfCylinders"===e.type.name))}get numberOfDoors(){return this.document.fields.find((e=>"NumberOfDoors"===e.type.name))}get stolenIndicator(){return this.document.fields.find((e=>"StolenIndicator"===e.type.name))}get transmissionCode(){return this.document.fields.find((e=>"TransmissionCode"===e.type.name))}get unladenWeight(){return this.document.fields.find((e=>"UnladenWeight"===e.type.name))}get vltClacFromDate(){return this.document.fields.find((e=>"VLTClacFromDate"===e.type.name))}get vehicleIdNumber(){return this.document.fields.find((e=>"VehicleIdNumber"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModel(){return this.document.fields.find((e=>"VehicleModel"===e.type.name))}get vehicleStatusCode(){return this.document.fields.find((e=>"VehicleStatusCode"===e.type.name))}get vehicleTypeCode(){return this.document.fields.find((e=>"VehicleTypeCode"===e.type.name))}};e.VehicleSafetyInspectionData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Yn}get inspectionAddress(){return this.document.fields.find((e=>"InspectionAddress"===e.type.name))}get inspectionAirPollutionDeviceConditions(){return this.document.fields.find((e=>"InspectionAirPollutionDeviceConditions"===e.type.name))}get inspectionFacilityIdentifier(){return this.document.fields.find((e=>"InspectionFacilityIdentifier"===e.type.name))}get inspectionFormOrStickerNumberCurrent(){return this.document.fields.find((e=>"InspectionFormOrStickerNumberCurrent"===e.type.name))}get inspectionFormOrStickerNumberPrevious(){return this.document.fields.find((e=>"InspectionFormOrStickerNumberPrevious"===e.type.name))}get inspectionSmogCertificateIndicator(){return this.document.fields.find((e=>"InspectionSmogCertificateIndicator"===e.type.name))}get inspectionStationNumber(){return this.document.fields.find((e=>"InspectionStationNumber"===e.type.name))}get inspectorIdentificationNumber(){return this.document.fields.find((e=>"InspectorIdentificationNumber"===e.type.name))}get odometerReadingAtInspection(){return this.document.fields.find((e=>"OdometerReadingAtInspection"===e.type.name))}get vehicleBodyType(){return this.document.fields.find((e=>"VehicleBodyType"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModelYear(){return this.document.fields.find((e=>"VehicleModelYear"===e.type.name))}};class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get addressCity(){return this.document.fields.find((e=>"AddressCity"===e.type.name))}get addressJurisdictionCode(){return this.document.fields.find((e=>"AddressJurisdictionCode"===e.type.name))}get addressPostalCode(){return this.document.fields.find((e=>"AddressPostalCode"===e.type.name))}get addressStreet1(){return this.document.fields.find((e=>"AddressStreet1"===e.type.name))}get addressStreet2(){return this.document.fields.find((e=>"AddressStreet2"===e.type.name))}get adultInformation(){return this.document.fields.find((e=>"AdultInformation"===e.type.name))}get aliasFamilyName(){return this.document.fields.find((e=>"AliasFamilyName"===e.type.name))}get aliasGivenName(){return this.document.fields.find((e=>"AliasGivenName"===e.type.name))}get aliasMiddleName(){return this.document.fields.find((e=>"AliasMiddleName"===e.type.name))}get aliasPrefixName(){return this.document.fields.find((e=>"AliasPrefixName"===e.type.name))}get aliasSuffixName(){return this.document.fields.find((e=>"AliasSuffixName"===e.type.name))}get cardRevisionDate(){return this.document.fields.find((e=>"CardRevisionDate"===e.type.name))}get complianceType(){return this.document.fields.find((e=>"ComplianceType"===e.type.name))}get countryIdentification(){return this.document.fields.find((e=>"CountryIdentification"===e.type.name))}get customerFamilyName(){return this.document.fields.find((e=>"CustomerFamilyName"===e.type.name))}get customerFirstName(){return this.document.fields.find((e=>"CustomerFirstName"===e.type.name))}get customerGivenNames(){return this.document.fields.find((e=>"CustomerGivenNames"===e.type.name))}get customerIdNumber(){return this.document.fields.find((e=>"CustomerIdNumber"===e.type.name))}get customerMiddleName(){return this.document.fields.find((e=>"CustomerMiddleName"===e.type.name))}get dateOfBirth(){return this.document.fields.find((e=>"DateOfBirth"===e.type.name))}get documentDiscriminator(){return this.document.fields.find((e=>"DocumentDiscriminator"===e.type.name))}get documentExpirationDate(){return this.document.fields.find((e=>"DocumentExpirationDate"===e.type.name))}get documentIssueDate(){return this.document.fields.find((e=>"DocumentIssueDate"===e.type.name))}get driverAliasDateOfBirthField(){return this.document.fields.find((e=>"DriverAliasDateOfBirthField"===e.type.name))}get driverAliasFirstName(){return this.document.fields.find((e=>"DriverAliasFirstName"===e.type.name))}get driverAliasLastName(){return this.document.fields.find((e=>"DriverAliasLastName"===e.type.name))}get driverAliasSocialSecurityNumber(){return this.document.fields.find((e=>"DriverAliasSocialSecurityNumber"===e.type.name))}get driverLastName(){return this.document.fields.find((e=>"DriverLastName"===e.type.name))}get driverLicenseClassificationCode(){return this.document.fields.find((e=>"DriverLicenseClassificationCode"===e.type.name))}get driverLicenseEndorsementsCode(){return this.document.fields.find((e=>"DriverLicenseEndorsementsCode"===e.type.name))}get driverLicenseName(){return this.document.fields.find((e=>"DriverLicenseName"===e.type.name))}get driverLicenseRestrictionCode(){return this.document.fields.find((e=>"DriverLicenseRestrictionCode"===e.type.name))}get driverNamePrefix(){return this.document.fields.find((e=>"DriverNamePrefix"===e.type.name))}get driverNameSuffix(){return this.document.fields.find((e=>"DriverNameSuffix"===e.type.name))}get driverPermitClassificationCode(){return this.document.fields.find((e=>"DriverPermitClassificationCode"===e.type.name))}get driverPermitEndorsementCode(){return this.document.fields.find((e=>"DriverPermitEndorsementCode"===e.type.name))}get driverPermitIssueDate(){return this.document.fields.find((e=>"DriverPermitIssueDate"===e.type.name))}get driverPermitRestrictionCode(){return this.document.fields.find((e=>"DriverPermitRestrictionCode"===e.type.name))}get driverResidenceCity(){return this.document.fields.find((e=>"DriverResidenceCity"===e.type.name))}get driverResidenceJurisdictionCode(){return this.document.fields.find((e=>"DriverResidenceJurisdictionCode"===e.type.name))}get driverResidencePostalCode(){return this.document.fields.find((e=>"DriverResidencePostalCode"===e.type.name))}get driverResidenceStreetAddress1(){return this.document.fields.find((e=>"DriverResidenceStreetAddress1"===e.type.name))}get driverResidenceStreetAddress2(){return this.document.fields.find((e=>"DriverResidenceStreetAddress2"===e.type.name))}get familyNameTruncation(){return this.document.fields.find((e=>"FamilyNameTruncation"===e.type.name))}get federalCommercialVehicleCodes(){return this.document.fields.find((e=>"FederalCommercialVehicleCodes"===e.type.name))}get firstNameTruncation(){return this.document.fields.find((e=>"FirstNameTruncation"===e.type.name))}get hazmatEndorsementExpirationDate(){return this.document.fields.find((e=>"HAZMATEndorsementExpirationDate"===e.type.name))}get hairColor(){return this.document.fields.find((e=>"HairColor"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get inventoryControlNumber(){return this.document.fields.find((e=>"InventoryControlNumber"===e.type.name))}get issueTimeStamp(){return this.document.fields.find((e=>"IssueTimeStamp"===e.type.name))}get jurisdictionSpecificEndorsementCodeDescription(){return this.document.fields.find((e=>"JurisdictionSpecificEndorsementCodeDescription"===e.type.name))}get jurisdictionSpecificEndorsementCodes(){return this.document.fields.find((e=>"JurisdictionSpecificEndorsementCodes"===e.type.name))}get jurisdictionSpecificRestrictionCodeDescription(){return this.document.fields.find((e=>"JurisdictionSpecificRestrictionCodeDescription"===e.type.name))}get jurisdictionSpecificRestrictionCodes(){return this.document.fields.find((e=>"JurisdictionSpecificRestrictionCodes"===e.type.name))}get jurisdictionSpecificVehicleClass(){return this.document.fields.find((e=>"JurisdictionSpecificVehicleClass"===e.type.name))}get jurisdictionSpecificVehicleClassificationDescription(){return this.document.fields.find((e=>"JurisdictionSpecificVehicleClassificationDescription"===e.type.name))}get limitedDurationDocumentIndicator(){return this.document.fields.find((e=>"LimitedDurationDocumentIndicator"===e.type.name))}get middleNameTruncation(){return this.document.fields.find((e=>"MiddleNameTruncation"===e.type.name))}get nameSuffix(){return this.document.fields.find((e=>"NameSuffix"===e.type.name))}get nonResidentIndicator(){return this.document.fields.find((e=>"NonResidentIndicator"===e.type.name))}get numberOfDuplicates(){return this.document.fields.find((e=>"NumberOfDuplicates"===e.type.name))}get organDonor(){return this.document.fields.find((e=>"OrganDonor"===e.type.name))}get organDonorIndicator(){return this.document.fields.find((e=>"OrganDonorIndicator"===e.type.name))}get permitExpirationDate(){return this.document.fields.find((e=>"PermitExpirationDate"===e.type.name))}get permitIdentifier(){return this.document.fields.find((e=>"PermitIdentifier"===e.type.name))}get physicalDescriptionEyeColor(){return this.document.fields.find((e=>"PhysicalDescriptionEyeColor"===e.type.name))}get physicalDescriptionHeight(){return this.document.fields.find((e=>"PhysicalDescriptionHeight"===e.type.name))}get physicalDescriptionSex(){return this.document.fields.find((e=>"PhysicalDescriptionSex"===e.type.name))}get physicalDescriptionWeightRange(){return this.document.fields.find((e=>"PhysicalDescriptionWeightRange"===e.type.name))}get placeOfBirth(){return this.document.fields.find((e=>"PlaceOfBirth"===e.type.name))}get raceEthnicity(){return this.document.fields.find((e=>"RaceEthnicity"===e.type.name))}get socialSecurityNumber(){return this.document.fields.find((e=>"SocialSecurityNumber"===e.type.name))}get standardEndorsementCode(){return this.document.fields.find((e=>"StandardEndorsementCode"===e.type.name))}get standardRestrictionCode(){return this.document.fields.find((e=>"StandardRestrictionCode"===e.type.name))}get standardVehicleClassification(){return this.document.fields.find((e=>"StandardVehicleClassification"===e.type.name))}get under18Until(){return this.document.fields.find((e=>"Under18Until"===e.type.name))}get under19Until(){return this.document.fields.find((e=>"Under19Until"===e.type.name))}get under21Until(){return this.document.fields.find((e=>"Under21Until"===e.type.name))}get uniqueCustomerIdentifier(){return this.document.fields.find((e=>"UniqueCustomerIdentifier"===e.type.name))}get veteranIndicator(){return this.document.fields.find((e=>"VeteranIndicator"===e.type.name))}get weightKilograms(){return this.document.fields.find((e=>"WeightKilograms"===e.type.name))}get weightPounds(){return this.document.fields.find((e=>"WeightPounds"===e.type.name))}}e.DLID=t;e.DriverLicense=class extends t{constructor(e){super(e)}requiredDocumentType(){return Xn}};e.IDCard=class extends t{constructor(e){super(e)}requiredDocumentType(){return qn}};e.EnhancedDriverLicense=class extends t{constructor(e){super(e)}requiredDocumentType(){return Kn}};e.RawDocument=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Jn}}}(ci||(ci={}));class li{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return $n}get dateOfManufacture(){return this.document.fields.find((e=>"DateOfManufacture"===e.type.name))}get expiryDateDay(){return this.document.fields.find((e=>"ExpiryDateDay"===e.type.name))}get expiryDateHour(){return this.document.fields.find((e=>"ExpiryDateHour"===e.type.name))}get expiryDateJulianDay(){return this.document.fields.find((e=>"ExpiryDateJulianDay"===e.type.name))}get expiryDateMonth(){return this.document.fields.find((e=>"ExpiryDateMonth"===e.type.name))}get expiryDateYear(){return this.document.fields.find((e=>"ExpiryDateYear"===e.type.name))}get hasPrimaryData(){return this.document.fields.find((e=>"HasPrimaryData"===e.type.name))}get hasSecondaryData(){return this.document.fields.find((e=>"HasSecondaryData"===e.type.name))}get labelerIdentificationCode(){return this.document.fields.find((e=>"LabelerIdentificationCode"===e.type.name))}get labelersProductOrCatalogNumber(){return this.document.fields.find((e=>"LabelersProductOrCatalogNumber"===e.type.name))}get linkCharacter(){return this.document.fields.find((e=>"LinkCharacter"===e.type.name))}get lotNumber(){return this.document.fields.find((e=>"LotNumber"===e.type.name))}get quantity(){return this.document.fields.find((e=>"Quantity"===e.type.name))}get serialNumber(){return this.document.fields.find((e=>"SerialNumber"===e.type.name))}get unitOfMeasureID(){return this.document.fields.find((e=>"UnitOfMeasureID"===e.type.name))}}const ui="Check",di="USACheck",mi="UAECheck",hi="FRACheck",fi="ISRCheck",pi="KWTCheck",gi="AUSCheck",vi="INDCheck",Ci="CANCheck",yi="UnknownCheck";class bi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get fontType(){return this.document.fields.find((e=>"FontType"===e.type.name))}get rawString(){return this.document.fields.find((e=>"RawString"===e.type.name))}}class Ai extends bi{constructor(e){super(e)}requiredDocumentType(){return di}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get auxiliaryOnUs(){return this.document.fields.find((e=>"AuxiliaryOnUs"===e.type.name))}get transitNumber(){return this.document.fields.find((e=>"TransitNumber"===e.type.name))}}class Si extends bi{constructor(e){super(e)}requiredDocumentType(){return mi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get routingNumber(){return this.document.fields.find((e=>"RoutingNumber"===e.type.name))}}class wi extends bi{constructor(e){super(e)}requiredDocumentType(){return hi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get routingNumber(){return this.document.fields.find((e=>"RoutingNumber"===e.type.name))}}class Ei extends bi{constructor(e){super(e)}requiredDocumentType(){return fi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get bankNumber(){return this.document.fields.find((e=>"BankNumber"===e.type.name))}get branchNumber(){return this.document.fields.find((e=>"BranchNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}}class xi extends bi{constructor(e){super(e)}requiredDocumentType(){return pi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get sortCode(){return this.document.fields.find((e=>"SortCode"===e.type.name))}}class Di extends bi{constructor(e){super(e)}requiredDocumentType(){return gi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get auxDomestic(){return this.document.fields.find((e=>"AuxDomestic"===e.type.name))}get bsb(){return this.document.fields.find((e=>"BSB"===e.type.name))}get extraAuxDomestic(){return this.document.fields.find((e=>"ExtraAuxDomestic"===e.type.name))}get transactionCode(){return this.document.fields.find((e=>"TransactionCode"===e.type.name))}}class Ti extends bi{constructor(e){super(e)}requiredDocumentType(){return vi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get serialNumber(){return this.document.fields.find((e=>"SerialNumber"===e.type.name))}get sortNumber(){return this.document.fields.find((e=>"SortNumber"===e.type.name))}get transactionCode(){return this.document.fields.find((e=>"TransactionCode"===e.type.name))}}class Bi extends bi{constructor(e){super(e)}requiredDocumentType(){return Ci}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get bankNumber(){return this.document.fields.find((e=>"BankNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get designationNumber(){return this.document.fields.find((e=>"DesignationNumber"===e.type.name))}get transactionCode(){return this.document.fields.find((e=>"TransactionCode"===e.type.name))}get transitNumber(){return this.document.fields.find((e=>"TransitNumber"===e.type.name))}}class Ii extends bi{constructor(e){super(e)}requiredDocumentType(){return yi}}const ki="CreditCard";class Oi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return ki}get cardNumber(){return this.document.fields.find((e=>"CardNumber"===e.type.name))}get cardholderName(){return this.document.fields.find((e=>"CardholderName"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}}const Li=["OKAY","TRIAL","FAILURE_NOT_SET","FAILURE_CORRUPTED","FAILURE_WRONG_OS","FAILURE_APP_ID_MISMATCH","FAILURE_EXPIRED"];class Pi extends f.a{constructor(e={}){if(super(),void 0===e.status)throw new Error("status must be present in constructor argument");if(this.status=e.status,void 0===e.licenseStatusMessage)throw new Error("licenseStatusMessage must be present in constructor argument");if(this.licenseStatusMessage=e.licenseStatusMessage,void 0===e.expirationDateString)throw new Error("expirationDateString must be present in constructor argument");this.expirationDateString=e.expirationDateString}}class _i extends Pi{isValid(){return"OKAY"===this.status||"TRIAL"===this.status}constructor(e){super(e)}}var Ri=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Fi{constructor(e,t){this._sdk=e,this._pdfOperation=t}addPage(e,t={}){return Ri(this,void 0,void 0,(function*(){const{consumeImage:n="COPY_IMAGE"}=t,i=this._sdk.getBridge(n);yield i.addPageToPdf(this._pdfOperation,e)}))}addPages(e){return Ri(this,void 0,void 0,(function*(){for(const t of e.pages){const e=yield t.finalRawImage();yield this.addPage(e)}}))}complete(){return Ri(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var Ni=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Mi{constructor(e,t){this._sdk=e,this._tiffOperation=t}addPage(e,t={}){return Ni(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:i="COPY_IMAGE"}=t,o=this._sdk.getBridge(i);yield o.addPageToTiff(this._tiffOperation,e,n)}))}addPages(e,t={}){return Ni(this,void 0,void 0,(function*(){for(const n of e.pages){const e=yield n.finalRawImage();yield this.addPage(e,t)}}))}complete(){return Ni(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var Vi=n(23);class Wi{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 zi=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 ji{static toDataUrl(e){return new Promise(((t,n)=>{const i=new Blob([e],{type:"image/jpeg"}),o=new FileReader;o.onload=()=>t(o.result),o.onerror=()=>n(o.error),o.readAsDataURL(i)}))}static getObjectFitSize(e,t,n=!0){const i=t.width/t.height,o=e.width/e.height;let r=0,a=0;(n?i>o:i<o)?(r=e.width,a=r/i):(a=e.height,r=a*i);const s=(e.width-r)/2,c=(e.height-a)/2;return new Vi.a(s,c,r,a)}static loadFromUrl(e){return new Promise(((t,n)=>{const i=document.createElement("img");i.src=e,i.onload=()=>zi(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 o=n.getImageData(0,0,i.width,i.height);t(o)})),i.onerror=n}))}static saveImageData(e){const t=this.createImageDataCanvas(e),n=" ("+e.width+"x"+e.height+")";t.toBlob((e=>this.saveBlob(e,Wi.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 ji.createImageDataCanvas(ji.convertImageDataWrapperToImageData(e)).toDataURL("image/png")}static toBase64(e,t=!0){return zi(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 zi(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const i=document.createElement("canvas"),o=document.createElement("img");o.src=e,o.onload=()=>zi(this,void 0,void 0,(function*(){i.width=o.width,i.height=o.height;const e=i.getContext("2d");e.drawImage(o,0,0);const n=e.getImageData(0,0,o.width,o.height);t(n)})),o.onerror=n}))}))}}class Hi{saveImageAsJpeg(e,t){if(!e||0===e.length)return void console.log("Data cannot be null or empty");t||(t=Wi.uuid()+".jpeg");let n=new Blob([e],{type:"image/jpeg"});ji.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 Ui=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Zi{constructor(e,t){this._sdk=e,this._mrzRecognizerToken=t}recognize(e,t="COPY_IMAGE"){return Ui(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanMRZ(yield this._mrzRecognizerToken,e)}))}recognizeURL(e){return Ui(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),i=document.createElement("img");i.src=e,i.onload=()=>Ui(this,void 0,void 0,(function*(){n.width=i.width,n.height=i.height;const e=n.getContext("2d");e.drawImage(i,0,0);const o=e.getImageData(0,0,i.width,i.height),r=yield this.recognize(o);t(r||void 0)}))}))}))}release(){return Ui(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var Gi=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Yi{constructor(e,t){this._sdk=e,this._OcrEngineToken=t}performOcr(e,t="COPY_IMAGE"){return Gi(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.performOcr(this._OcrEngineToken,e)}))}recognizeURL(e){return Gi(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),i=document.createElement("img");i.src=e,i.onload=()=>Gi(this,void 0,void 0,(function*(){n.width=i.width,n.height=i.height;const e=n.getContext("2d");e.drawImage(i,0,0);const o=e.getImageData(0,0,i.width,i.height),r=yield this.performOcr(o);t(r)}))}))}))}release(){return Gi(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var Qi=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Xi{constructor(e,t){this._sdk=e,this._textPatternScannerToken=t}recognize(e,t="COPY_IMAGE"){return Qi(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanTextLine(yield this._textPatternScannerToken,e)}))}cleanRecognitionQueue(){return Qi(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanTextLineScanningQueue(yield this._textPatternScannerToken)}))}recognizeURL(e){return Qi(this,void 0,void 0,(function*(){return this.recognize(yield ji.imageUrlToImageData(e))}))}release(){return Qi(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textPatternScannerToken)}))}}var qi=n(13),Ki=n(22);class Ji extends Ki.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new ce,this.onTextDetected=function(e){},this.finder.aspectRatio=new w.a({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(e){const t=new Ji;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class $i extends Ki.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_HD),this.detectionConfiguration=new Je,this.onVinDetected=function(e){},this.finder.aspectRatio=new w.a({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 $i;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class eo extends Error{constructor(e){super(e.licenseStatusMessage),this.name="LicenseError"}}class to{static throwIfMissingBuffer(e){to.throwIfMissing(e,"ImageBuffer may not be null")}static throwIfMissing(e,t){if(!e)throw new Error(t)}}var no=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 io{constructor(e,t){this._sdk=e,this._token=t}analyze(e,t="COPY_IMAGE"){return no(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const n=this._sdk.getBridge(t);return yield n.documentQualityAnalyzerAnalyze(this._token,e)}))}release(){return no(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var oo=n(17),ro=n(0),ao=n(44),so=n(14),co=n(2),lo=n.n(co),uo=n(4);const mo="var(--1-sb-dvh, 1vh)";function ho(){const e=Object(ro.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(ro.useEffect)((()=>{if(t(),!e)return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}})),null}var fo=n(30),po=n(8),go=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function vo(e){const{polygonConfig:t}=e,n=go(e,["polygonConfig"]),i=Object.assign(Object.assign({},e.style),{backgroundColor:uo.b.getColorValue(t.fillColor),borderColor:uo.b.getColorValue(t.strokeColor),borderWidth:t.strokeWidth,borderRadius:t.cornerRadius,borderStyle:"solid"});return ro.default.createElement(co.Box,Object.assign({},n,{style:i}))}function Co(e){return e=uo.b.getColorValue(e),Object.assign(Object.assign({},function(e){return{color:e=uo.b.getColorValue(e),"&:hover":{textDecoration:"underline !important",backgroundColor:"transparent !important"}}}(e)),yo(e))}function yo(e){return{"&:focus-visible":{outlineColor:`${e=uo.b.getColorValue(e)} !important`,outlineWidth:"2px !important",outlineStyle:"solid !important"}}}function bo(e){var t;const n=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{};return ro.default.createElement(ro.default.Fragment,null,e.config.visible&&ro.default.createElement(co.IconButton,Object.assign({disabled:!e.enabled,component:null!==(t=e.iconButtonComponent)&&void 0!==t?t:"button","aria-label":uo.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign({opacity:e.enabled?1:.5,backgroundColor:uo.b.getColorValue(e.config.background.fillColor),borderWidth:e.config.background.strokeWidth,borderColor:uo.b.getColorValue(e.config.background.strokeColor),borderStyle:"solid",borderRadius:"4px",visibility:e.config.visible?"visible":"hidden",flexDirection:"column"},Co(e.config.title.color)),onClick:e.onClick},n),e.config.icon.visible&&ro.default.createElement(e.icon,{color:uo.b.getColorValue(e.config.icon.color)}),e.children,ro.default.createElement(po.a,{config:e.config.title,style:{fontSize:12,marginTop:8}})))}const Ao=new Map;function So(e){const t=function(e){if(!Ao.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 Ao.set(e,null),null;n.fillRect(0,0,1,1);const o=[...n.getImageData(0,0,1,1).data];Ao.set(e,{r:o[0],g:o[1],b:o[2],a:o[3]})}return Ao.get(e)}(e);return 0===(null==t?void 0:t.a)}function wo(e){var t,n;if(!e.visible)return ro.default.createElement("div",{style:{display:"flex",flex:1}});const i=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{},o="right"===(null!==(t=e.iconPosition)&&void 0!==t?t:"left");let r={};return So(uo.b.getColorValue(e.background.fillColor))&&(r={textDecoration:"underline"}),ro.default.createElement(co.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(po.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":r,"&:focus-visible > div":{outlineColor:uo.b.getColorValue(e.foreground.color),outlineWidth:2,outlineStyle:"solid"},px:0},e.buttonWidth?{width:`${e.buttonWidth}px`,minWidth:0}:{}),disableRipple:!0},i),ro.default.createElement(vo,{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&&!o&&e.icon,uo.b.getLocalizedText(e.text),e.foreground.iconVisible&&o&&e.icon))}fo.a;const Eo=ro.default.createContext(null);function xo(e){const t=e.mode,n="HIDDEN"===t?0:48;Object(ro.useEffect)((()=>{if("HIDDEN"===t)return;const n=document.createElement("meta");return n.name="theme-color",n.content=uo.b.getColorValue(e.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[t]);const i="SOLID"===t?0:n,o={height:n,remainingVisibleBodyHeight:"SOLID"===t?`calc(100 * ${mo} - ${n}px)`:`calc(100 * ${mo})`,minTopPaddingForContent:i,minTopPaddingForViewFinder:10+i},r="SOLID"===t?{backgroundColor:uo.b.getColorValue(e.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${uo.b.getColorValue(e.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return ro.default.createElement(ro.default.Fragment,null,"HIDDEN"!==t&&ro.default.createElement(co.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},ro.default.createElement(co.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},ro.default.createElement(co.Box,{sx:{flex:1}},e.cancelButton.visible&&ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(wo,Object.assign({onClick:e.onBackPress,icon:e.cancelButton.foreground.iconVisible&&ro.default.createElement(lo.a,{sx:{fontSize:12,mr:"5px"}})},e.cancelButton)))),ro.default.createElement(co.Box,null,ro.default.createElement(co.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},ro.default.createElement(po.a,{config:e.title}))),ro.default.createElement(co.Box,{sx:{flex:1}}))),ro.default.createElement(Eo.Provider,{value:o},e.children))}function Do(e){return{textOverflow:"ellipsis",WebkitBoxOrient:"vertical",WebkitLineClamp:`${e}`,overflow:"hidden",whiteSpace:e>1?"normal":"nowrap",display:e>1?"-webkit-box":"block"}}function To(e){if(e.loading)return ro.default.createElement(co.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 ro.default.createElement(co.Box,{sx:t})}const t={width:e.imageSize,height:e.imageSize,borderRadius:8};return ro.default.createElement("img",{src:e.data.barcodeImage,alt:e.data.title,style:t})}function Bo(e){var t,n;const i=(null===(t=e.barcodeMappedData)||void 0===t?void 0:t.state)||"LOADING",o=(null===(n=e.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!e||"LOADED"!==i,a=e.imageSize,s=e.barcodeTitle.visible||e.barcodeSubtitle.visible||e.counterForm,c=e.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:uo.b.getColorValue(e.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}},l=Object(ro.useRef)(),[u,d]=Object(ro.useState)("100%");return Object(ro.useEffect)((()=>{var t;const n=e.readonlyCount?.87:.97,i=null===(t=l.current)||void 0===t?void 0:t.parentNode,o=i&&i.clientWidth>0?i.clientWidth*n:"100%";d(o)})),ro.default.createElement(co.Box,{ref:l,sx:{display:"flex",maxWidth:u},"data-sb-barcode-info":"1"},e.barcodeImageVisible&&ro.default.createElement(co.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},ro.default.createElement(To,{data:o,imageSize:a,loading:r})),s&&ro.default.createElement(co.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},e.barcodeTitle.visible&&ro.default.createElement(co.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},ro.default.createElement(co.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign(Object.assign({},Do(e.maxNumberOfTitleLines)),Object(po.b)(e.barcodeTitle)),{textOverflow:"ellipsis",overflow:"hidden",display:"inline-block"})},r?ro.default.createElement(co.Skeleton,{variant:"text"}):o.title),e.displayRightArrow&&!r&&ro.default.createElement(lo.a,{sx:{fontSize:16,fontWeight:"bold",color:uo.b.getColorValue(e.barcodeTitle.color)}})),e.barcodeSubtitle.visible&&ro.default.createElement(co.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},Do(e.maxNumberOfSubtitleLines)),Object(po.b)(e.barcodeSubtitle))},r?ro.default.createElement(co.Skeleton,{variant:"text"}):o.subtitle),e.counterForm&&ro.default.createElement(co.ButtonGroup,{variant:"outlined"},ro.default.createElement(co.Button,{disabled:!e.counterForm.removeButtonEnabled,sx:c,style:{opacity:e.counterForm.removeButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter-1),disableRipple:!0},ro.default.createElement(lo.a,{sx:{color:uo.b.getColorValue(e.counterForm.manualCountChangeColor)}})),ro.default.createElement(co.Button,{sx:Object.assign(Object.assign({},c),{color:uo.b.getColorValue(e.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:e.counterForm.onNumberClick,disableRipple:!0},e.counterForm.counter),ro.default.createElement(co.Button,{disabled:!e.counterForm.addButtonEnabled,sx:c,style:{opacity:e.counterForm.addButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter+1),disableRipple:!0},ro.default.createElement(lo.a,{sx:{color:uo.b.getColorValue(e.counterForm.manualCountChangeColor)}})))))}so.ButtonConfiguration;function Io(e){var t;if(!e.visible)return null;const n={["data-sb-button-"+e.debugName]:!0};return ro.default.createElement(co.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:uo.b.getColorValue(e.background.strokeColor),borderWidth:e.background.strokeWidth,backgroundColor:uo.b.getColorValue(e.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},n),e.foreground.iconVisible&&e.icon&&ro.default.createElement(e.icon,{sx:{color:uo.b.getColorValue(e.foreground.color),pr:2}}),ro.default.createElement(po.a,{config:{visible:!0,text:e.text,color:e.foreground.color,useShadow:e.foreground.useShadow}}))}var ko=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function Oo(e){var t,{modalOverlayColor:n}=e,i=ko(e,["modalOverlayColor"]);const o={backdrop:{style:{backgroundColor:uo.b.getColorValue(n)}}},r=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 ro.default.createElement(co.Dialog,Object.assign({},i,{componentsProps:o,PaperProps:r}))}function Lo(e){const t=Object(ro.useContext)(uo.a).getColorValue,n=!e.barcodeMappedData||"LOADED"!==e.barcodeMappedData.state,i={backgroundColor:t(n?e.sheetColorLoading:e.sheetColorLoaded)},[o,r]=ro.default.useState(),a=Object(ro.useRef)((()=>{}));Object(ro.useEffect)((()=>{e.open&&r(!1)}),[e.open]);const s=()=>{a.current=e.handleCancel,r(!0)};return ro.default.createElement(Oo,{modalOverlayColor:e.modalOverlayColor,open:e.open&&!o,fullWidth:!0,TransitionProps:{onExited:()=>{o&&a.current()}},onClose:()=>{n||s()}},ro.default.createElement(co.DialogContent,{style:i},ro.default.createElement(Bo,Object.assign({},e,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),ro.default.createElement(co.DialogActions,{style:i},ro.default.createElement(lo.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},ro.default.createElement(lo.a,{item:!0,xs:12},ro.default.createElement(lo.a,{color:t(e.dividerColor)})),n?ro.default.createElement(lo.a,{item:!0,xs:12,sx:{textAlign:"center"}},ro.default.createElement(co.Box,null,ro.default.createElement(co.CircularProgress,{sx:{color:t(e.loadingMessage.color),verticalAlign:"middle",mr:2}}),ro.default.createElement(po.a,{config:e.loadingMessage}))):ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},onClick:s},e.cancelButton))),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},onClick:()=>{a.current=e.handleSubmit,r(!0)}},e.submitButton)))))))}var Po=n(1);Po.l;function _o(e){if(!1===e.visible)return null;const t={backgroundColor:e.active?uo.b.getColorValue(e.activeBackgroundColor):uo.b.getColorValue(e.backgroundColor),color:e.active?uo.b.getColorValue(e.activeForegroundColor):uo.b.getColorValue(e.foregroundColor)};return ro.default.createElement(co.IconButton,{sx:Object.assign(Object.assign({},t),{"&:hover, &:focus":Object.assign({outline:"none"},t),width:48,height:48}),onClick:e.onClick},e.text&&ro.default.createElement("span",{style:{fontSize:15}},uo.b.getLocalizedText(e.text)),e.icon&&ro.default.createElement(e.icon,{style:{padding:7}}))}var Ro=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Fo{constructor(){this.audioFile=new Audio}initialize(e){return Ro(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 Ro(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(e){}}))}}Fo.INSTANCE=new Fo;var No=Fo;class Mo{constructor(){this.DURATION=200}vibrate(e){e.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}Mo.INSTANCE=new Mo;var Vo=Mo,Wo=n(11),zo=n(25),jo=n(24),Ho=n(26);class Uo extends ro.default.Component{constructor(e){super(e),this.state={base64Image:void 0}}render(){const e="x"+this.props.barcode.count;return ro.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},ro.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},ro.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},ro.default.createElement("div",{style:{flex:1}},this.props.barcode.text),ro.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},e)),ro.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}function Zo(e,t){return e.format===t.format&&e.text===t.text}function Go(e){return e.text+e.format}class Yo extends ro.default.Component{constructor(e){super(e),this.state={barcodes:this.toUniqueListWithDuplicateCounter(e.barcodes)}}toUniqueListWithDuplicateCounter(e){const t=[];return e.forEach((e=>{const n=t.findIndex((t=>Zo(t,e)));-1===n?(e.count=1,t.push(e)):t[n].count++})),t}update(e){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(e)})}render(){return ro.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((e,t)=>ro.default.createElement(Uo,{key:t,barcode:e,onClick:this.props.onClick}))))}}class Qo{}Qo.ScanbotPrimary="#c8193c",Qo.LightGray="#F5F5F5",Qo.Gray="#808080",Qo.DarkGray="#333333",Qo.Orange="#FF5533",Qo.White="#FFFFFF",Qo.TransparentGreen="rgba(0, 255, 0, 0.5)",Qo.TransparentGray="rgba(50, 50, 50, 0.5)",Qo.TransparentBlack="rgba(0, 0, 0, 0.3)",Qo.SBNegative="#FF3737";var Xo,qo=Qo;!function(e){e[e.None=0]="None",e[e.PushRight=1]="PushRight",e[e.PushBottom=2]="PushBottom",e[e.Pop=3]="Pop"}(Xo||(Xo={}));class Ko extends ro.default.Component{constructor(e){super(e),this._isVisible=!1,this.state={animation:{type:Xo.None},elements:[]}}containerStyle(e){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:e,overflow:"scroll"}}render(){var e,t,n;if(this.state.animation.type===Xo.None)return null;const i=this.animation(this.state.animation.type),o=this.to(this.state.animation.type);this.previousDestination=o;const r=this.props.style;return ro.default.createElement(i,{style:this.containerStyle(`${o}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:e=>{this.reset()}},ro.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:e=>{e.stopPropagation()}},ro.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:qo.ScanbotPrimary}},ro.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},ro.default.createElement("div",{style:{backgroundColor:qo.White,height:3,width:33,borderRadius:5}})),ro.default.createElement("div",{style:{display:"flex",height:50}},ro.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:qo.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),ro.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:qo.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(t=null===(e=this.barcodes)||void 0===e?void 0:e.length)&&void 0!==t?t:0)+" Codes"),ro.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:qo.White,justifyContent:"right",alignItems:"center",paddingRight:10}},ro.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:e=>{e.stopPropagation(),this.reset()}},"×")))),ro.default.createElement(Yo,{ref:e=>{null!==e&&(this.list=e)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(e,t){this._isVisible=!0,this.barcodes=t,this.updateAnimationType(e)}update(e){this.barcodes=e,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(Xo.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===Xo.Pop&&this.updateAnimationType(Xo.None)}updateAnimationType(e,t){this.setState({animation:{type:e}},t)}animation(e){let t=this.from(e),n=this.to(e);this.previousDestination===n&&(t=this.previousDestination,n=this.previousDestination);const i=Ho.b`from {transform: ${t};} to {transform: ${n};}`;return Ho.a.div`animation: ${i} 0.5s;`}from(e){if(e===Xo.PushRight)return this.translate("X",100);if(e===Xo.PushBottom)return this.translate("Y",100);if(e===Xo.Pop){const e=this.pushType===Xo.PushRight?"X":"Y";return this.translate(e,0)}}to(e){if(e===Xo.PushRight)return this.translate("X",0);if(e===Xo.PushBottom)return this.translate("Y",0);if(e===Xo.Pop){const e=this.pushType===Xo.PushRight?"X":"Y";return this.translate(e,100)}}translate(e,t){return"translate"+e+"("+t+"%)"}componentWillUnmount(){this._isVisible=!1}}var Jo=n(3),$o=function(e){return{isEnabled:function(t){return e.some((function(e){return!!t[e]}))}}},er={measureLayout:$o(["layout","layoutId","drag","_layoutResetTransform"]),animation:$o(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:$o(["exit"]),drag:$o(["drag","dragControls"]),focus:$o(["whileFocus"]),hover:$o(["whileHover","onHoverStart","onHoverEnd"]),tap:$o(["whileTap","onTap","onTapStart","onTapCancel"]),pan:$o(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:$o(["layout","layoutId"])};var tr=Object(ro.createContext)({strict:!1}),nr=Object.keys(er),ir=nr.length;var or=Object(ro.createContext)({transformPagePoint:function(e){return e},isStatic:!1}),rr=Object(ro.createContext)({});var ar=Object(ro.createContext)(null);function sr(e){var t=Object(ro.useRef)(null);return null===t.current&&(t.current=e()),t.current}function cr(){var e=Object(ro.useContext)(ar);if(null===e)return[!0,null];var t=e.isPresent,n=e.onExitComplete,i=e.register,o=mr();Object(ro.useEffect)((function(){return i(o)}),[]);return!t&&n?[!1,function(){return null==n?void 0:n(o)}]:[!0]}function lr(e){return null===e||e.isPresent}var ur=0,dr=function(){return ur++},mr=function(){return sr(dr)},hr=Object(ro.createContext)(null),fr="undefined"!=typeof window,pr=fr?ro.useLayoutEffect:ro.useEffect;function gr(e,t,n,i){var o=Object(ro.useContext)(or),r=Object(ro.useContext)(tr),a=Object(ro.useContext)(rr).visualElement,s=Object(ro.useContext)(ar),c=function(e){var t=e.layoutId,n=Object(ro.useContext)(hr);return n&&void 0!==t?n+"-"+t:t}(n),l=Object(ro.useRef)(void 0);i||(i=r.renderer),!l.current&&i&&(l.current=i(e,{visualState:t,parent:a,props:Object(Jo.a)(Object(Jo.a)({},n),{layoutId:c}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=l.current;return pr((function(){u&&(u.setProps(Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},o),n),{layoutId:c})),u.isPresent=lr(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(ro.useEffect)((function(){var e;u&&(null===(e=u.animationState)||void 0===e||e.animateChanges())})),pr((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function vr(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Cr(e){return Array.isArray(e)}function yr(e){return"string"==typeof e||Cr(e)}function br(e,t,n,i,o){var r;return void 0===i&&(i={}),void 0===o&&(o={}),"string"==typeof t&&(t=null===(r=e.variants)||void 0===r?void 0:r[t]),"function"==typeof t?t(null!=n?n:e.custom,i,o):t}function Ar(e,t,n){var i=e.getProps();return br(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 Sr(e){var t;return"function"==typeof(null===(t=e.animate)||void 0===t?void 0:t.start)||yr(e.initial)||yr(e.animate)||yr(e.whileHover)||yr(e.whileDrag)||yr(e.whileTap)||yr(e.whileFocus)||yr(e.exit)}function wr(e){return Boolean(Sr(e)||e.variants)}function Er(e,t){var n=function(e,t){if(Sr(e)){var n=e.initial,i=e.animate;return{initial:!1===n||yr(n)?n:void 0,animate:yr(i)?i:void 0}}return!1!==e.inherit?t:{}}(e,Object(ro.useContext)(rr)),i=n.initial,o=n.animate;return Object(ro.useMemo)((function(){return{initial:i,animate:o}}),t?[xr(i),xr(o)]:[])}function xr(e){return Array.isArray(e)?e.join(" "):e}function Dr(e){var t=e.preloadedFeatures,n=e.createVisualElement,i=e.useRender,o=e.useVisualState,r=e.Component;return t&&function(e){for(var t in e){var n=e[t];null!==n&&(er[t].Component=n)}}(t),Object(ro.forwardRef)((function(e,t){var a=Object(ro.useContext)(or).isStatic,s=null,c=Er(e,a),l=o(e,a);return!a&&fr&&(c.visualElement=gr(r,l,e,n),s=function(e,t,n){var i=[];if(Object(ro.useContext)(tr),!t)return null;for(var o=0;o<ir;o++){var r=nr[o],a=er[r],s=a.isEnabled,c=a.Component;s(e)&&c&&i.push(ro.createElement(c,Object(Jo.a)({key:r},e,{visualElement:t})))}return i}(e,c.visualElement)),ro.createElement(ro.Fragment,null,ro.createElement(rr.Provider,{value:c},i(r,e,function(e,t,n){return Object(ro.useCallback)((function(i){var o;i&&(null===(o=e.mount)||void 0===o||o.call(e,i)),t&&(i?t.mount(i):t.unmount()),n&&("function"==typeof n?n(i):vr(n)&&(n.current=i))}),[t])}(l,c.visualElement,t),l,a)),s)}))}function Tr(e){function t(t,n){return void 0===n&&(n={}),Dr(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 Br=["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 Ir(e){return"string"==typeof e&&!e.includes("-")&&!!(Br.indexOf(e)>-1||/[A-Z]/.test(e))}var kr={};var Or=["","X","Y","Z"],Lr=["transformPerspective","x","y","z"];function Pr(e,t){return Lr.indexOf(e)-Lr.indexOf(t)}["translate","scale","rotate","skew"].forEach((function(e){return Or.forEach((function(t){return Lr.push(e+t)}))}));var _r=new Set(Lr);function Rr(e){return _r.has(e)}var Fr=new Set(["originX","originY","originZ"]);function Nr(e){return Fr.has(e)}function Mr(e,t){var n=t.layout,i=t.layoutId;return Rr(e)||Nr(e)||(n||void 0!==i)&&(!!kr[e]||"opacity"===e)}var Vr=function(e){return null!==e&&"object"==typeof e&&e.getVelocity},Wr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function zr(e){return e.startsWith("--")}var jr=function(e,t){return t&&"number"==typeof e?t.transform(e):e},Hr=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},Ur=function(e){return e%1?Number(e.toFixed(5)):e},Zr=/(-)?([\d]*\.?[\d])+/g,Gr=/(#[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,Yr=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function Qr(e){return"string"==typeof e}var Xr=function(e){return{test:function(t){return Qr(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},qr=Xr("deg"),Kr=Xr("%"),Jr=Xr("px"),$r=Xr("vh"),ea=Xr("vw"),ta=Object(Jo.a)(Object(Jo.a)({},Kr),{parse:function(e){return Kr.parse(e)/100},transform:function(e){return Kr.transform(100*e)}}),na={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},ia=Object(Jo.a)(Object(Jo.a)({},na),{transform:Hr(0,1)}),oa=Object(Jo.a)(Object(Jo.a)({},na),{default:1}),ra=Object(Jo.a)(Object(Jo.a)({},na),{transform:Math.round}),aa={borderWidth:Jr,borderTopWidth:Jr,borderRightWidth:Jr,borderBottomWidth:Jr,borderLeftWidth:Jr,borderRadius:Jr,radius:Jr,borderTopLeftRadius:Jr,borderTopRightRadius:Jr,borderBottomRightRadius:Jr,borderBottomLeftRadius:Jr,width:Jr,maxWidth:Jr,height:Jr,maxHeight:Jr,size:Jr,top:Jr,right:Jr,bottom:Jr,left:Jr,padding:Jr,paddingTop:Jr,paddingRight:Jr,paddingBottom:Jr,paddingLeft:Jr,margin:Jr,marginTop:Jr,marginRight:Jr,marginBottom:Jr,marginLeft:Jr,rotate:qr,rotateX:qr,rotateY:qr,rotateZ:qr,scale:oa,scaleX:oa,scaleY:oa,scaleZ:oa,skew:qr,skewX:qr,skewY:qr,distance:Jr,translateX:Jr,translateY:Jr,translateZ:Jr,x:Jr,y:Jr,z:Jr,perspective:Jr,transformPerspective:Jr,opacity:ia,originX:ta,originY:ta,originZ:Jr,zIndex:ra,fillOpacity:ia,strokeOpacity:ia,numOctaves:ra};function sa(e,t,n,i,o,r,a,s){var c,l=e.style,u=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 C=t[v];if(zr(v))u[v]=C;else{var y=aa[v],b=jr(C,y);if(Rr(v)){if(f=!0,d[v]=b,m.push(v),!g)continue;C!==(null!==(c=y.default)&&void 0!==c?c:0)&&(g=!1)}else if(Nr(v))h[v]=b,p=!0;else if((null==n?void 0:n.isHydrated)&&(null==i?void 0:i.isHydrated)&&kr[v]){var A=kr[v].process(C,i,n),S=kr[v].applyTo;if(S)for(var w=S.length,E=0;E<w;E++)l[S[E]]=A;else l[v]=A}else l[v]=b}}i&&n&&a&&s?(l.transform=a(i.deltaFinal,i.treeScale,f?d:void 0),r&&(l.transform=r(d,l.transform)),l.transformOrigin=s(i)):(f&&(l.transform=function(e,t,n,i){var o=e.transform,r=e.transformKeys,a=t.enableHardwareAcceleration,s=void 0===a||a,c=t.allowTransformNone,l=void 0===c||c,u="";r.sort(Pr);for(var d=!1,m=r.length,h=0;h<m;h++){var f=r[h];u+=(Wr[f]||f)+"("+o[f]+") ","z"===f&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),i?u=i(o,n?"":u):l&&n&&(u="none"),u}(e,o,g,r)),p&&(l.transformOrigin=function(e){var t=e.originX,n=void 0===t?"50%":t,i=e.originY,o=void 0===i?"50%":i,r=e.originZ;return n+" "+o+" "+(void 0===r?0:r)}(h)))}var ca=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function la(e,t,n){for(var i in t)Vr(t[i])||Mr(i,n)||(e[i]=t[i])}function ua(e,t,n){var i={};return la(i,e.style||{},e),Object.assign(i,function(e,t,n){var i=e.transformTemplate;return Object(ro.useMemo)((function(){var e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};sa(e,t,void 0,void 0,{enableHardwareAcceleration:!n},i);var o=e.vars,r=e.style;return Object(Jo.a)(Object(Jo.a)({},o),r)}),[t])}(e,t,n)),e.transformValues&&(i=e.transformValues(i)),i}function da(e,t,n){var i={},o=ua(e,t,n);return Boolean(e.drag)&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),i.style=o,i}var ma=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 ha(e){return ma.has(e)}var fa=function(e){return!ha(e)};try{var pa=n(53).default;fa=function(e){return e.startsWith("on")?!ha(e):pa(e)}}catch(e){}function ga(e,t,n){return"string"==typeof e?e:Jr.transform(t+n*e)}var va=function(e,t){return Jr.transform(e*t)},Ca={offset:"stroke-dashoffset",array:"stroke-dasharray"},ya={offset:"strokeDashoffset",array:"strokeDasharray"};function ba(e,t,n,i,o,r,a,s){var c=t.attrX,l=t.attrY,u=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;sa(e,Object(Jo.d)(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,i,o,r,a,s),e.attrs=e.style,e.style={};var v=e.attrs,C=e.style,y=e.dimensions,b=e.totalPathLength;v.transform&&(y&&(C.transform=v.transform),delete v.transform),y&&(void 0!==u||void 0!==d||C.transform)&&(C.transformOrigin=function(e,t,n){return ga(t,e.x,e.width)+" "+ga(n,e.y,e.height)}(y,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==c&&(v.x=c),void 0!==l&&(v.y=l),void 0!==b&&void 0!==m&&function(e,t,n,i,o,r){void 0===i&&(i=1),void 0===o&&(o=0),void 0===r&&(r=!0);var a=r?Ca:ya;e[a.offset]=va(-o,t);var s=va(n,t),c=va(i,t);e[a.array]=s+" "+c}(v,b,m,f,g,!1)}var Aa=function(){return Object(Jo.a)(Object(Jo.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Sa(e,t){var n=Object(ro.useMemo)((function(){var n=Aa();return ba(n,t,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Object(Jo.a)(Object(Jo.a)({},n.attrs),{style:Object(Jo.a)({},n.style)})}),[t]);if(e.style){var i={};la(i,e.style,e),n.style=Object(Jo.a)(Object(Jo.a)({},i),n.style)}return n}function wa(e){void 0===e&&(e=!1);return function(t,n,i,o,r){var a=o.latestValues,s=(Ir(t)?Sa:da)(n,a,r),c=function(e,t,n){var i={};for(var o in e)(fa(o)||!0===n&&ha(o)||!t&&!ha(o))&&(i[o]=e[o]);return i}(n,"string"==typeof t,e),l=Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},c),s),{ref:i});return Object(ro.createElement)(t,l)}}var Ea=/([a-z])([A-Z])/g,xa=function(e){return e.replace(Ea,"$1-$2").toLowerCase()};function Da(e,t){var n=t.style,i=t.vars;for(var o in Object.assign(e.style,n),i)e.style.setProperty(o,i[o])}var Ta=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function Ba(e,t){for(var n in Da(e,t),t.attrs)e.setAttribute(Ta.has(n)?n:xa(n),t.attrs[n])}function Ia(e){var t=e.style,n={};for(var i in t)(Vr(t[i])||Mr(i,e))&&(n[i]=t[i]);return n}function ka(e){var t=Ia(e);for(var n in e){if(Vr(e[n]))t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function Oa(e){return"object"==typeof e&&"function"==typeof e.start}var La=function(e){return Array.isArray(e)};function Pa(e){var t,n=Vr(e)?e.get():e;return t=n,Boolean(t&&"object"==typeof t&&t.mix&&t.toValue)?n.toValue():n}function _a(e,t,n,i){var o=e.scrapeMotionValuesFromProps,r=e.createRenderState,a=e.onMount,s={latestValues:Fa(t,n,i,o),renderState:r()};return a&&(s.mount=function(e){return a(t,e,s)}),s}var Ra=function(e){return function(t,n){var i=Object(ro.useContext)(rr),o=Object(ro.useContext)(ar);return n?_a(e,t,i,o):sr((function(){return _a(e,t,i,o)}))}};function Fa(e,t,n,i){var o={},r=!1===(null==n?void 0:n.initial),a=i(e);for(var s in a)o[s]=Pa(a[s]);var c=e.initial,l=e.animate,u=Sr(e),d=wr(e);t&&d&&!u&&!1!==e.inherit&&(null!=c||(c=t.initial),null!=l||(l=t.animate));var m=r||!1===c?l:c;m&&"boolean"!=typeof m&&!Oa(m)&&(Array.isArray(m)?m:[m]).forEach((function(t){var n=br(e,t);if(n){var i=n.transitionEnd;n.transition;var r=Object(Jo.d)(n,["transitionEnd","transition"]);for(var a in r)o[a]=r[a];for(var a in i)o[a]=i[a]}}));return o}var Na={useVisualState:Ra({scrapeMotionValuesFromProps:ka,createRenderState:Aa,onMount:function(e,t,n){var i=n.renderState,o=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()),ba(i,o,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Ba(t,i)}})};var Ma,Va={useVisualState:Ra({scrapeMotionValuesFromProps:Ia,createRenderState:ca})};function Wa(e,t,n,i){var o=t.forwardMotionProps,r=void 0!==o&&o,a=Ir(e)?Na:Va;return Object(Jo.a)(Object(Jo.a)({},a),{preloadedFeatures:n,useRender:wa(r),createVisualElement:i,Component:e})}function za(e,t,n,i){return e.addEventListener(t,n,i),function(){return e.removeEventListener(t,n,i)}}function ja(e,t,n,i){Object(ro.useEffect)((function(){var o=e.current;if(n&&o)return za(o,t,n,i)}),[e,t,n,i])}function Ha(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function Ua(e){return!!e.touches}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.Exit="exit"}(Ma||(Ma={}));var Za={pageX:0,pageY:0};function Ga(e,t){void 0===t&&(t="page");var n=e.touches[0]||e.changedTouches[0]||Za;return{x:n[t+"X"],y:n[t+"Y"]}}function Ya(e,t){return void 0===t&&(t="page"),{x:e[t+"X"],y:e[t+"Y"]}}function Qa(e,t){return void 0===t&&(t="page"),{point:Ua(e)?Ga(e,t):Ya(e,t)}}var Xa=function(e,t){void 0===t&&(t=!1);var n,i=function(t){return e(t,Qa(t))};return t?(n=i,function(e){var t=e instanceof MouseEvent;(!t||t&&0===e.button)&&n(e)}):i},qa={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Ka={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Ja(e){return fr&&null===window.onpointerdown?e:fr&&null===window.ontouchstart?Ka[e]:fr&&null===window.onmousedown?qa[e]:e}function $a(e,t,n,i){return za(e,Ja(t),Xa(n,"pointerdown"===t),i)}function es(e,t,n,i){return ja(e,Ja(t),n&&Xa(n,"pointerdown"===t),i)}function ts(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var ns=ts("dragHorizontal"),is=ts("dragVertical");function os(e){var t=!1;if("y"===e)t=is();else if("x"===e)t=ns();else{var n=ns(),i=is();n&&i?t=function(){n(),i()}:(n&&n(),i&&i())}return t}function rs(){var e=os(!0);return!e||(e(),!1)}function as(e,t,n){return function(i,o){var r;Ha(i)&&!rs()&&(null==n||n(i,o),null===(r=e.animationState)||void 0===r||r.setActive(Ma.Hover,t))}}var ss=function(e,t){return!!t&&(e===t||ss(e,t.parentElement))};function cs(e){return Object(ro.useEffect)((function(){return function(){return e()}}),[])}var ls=function(e,t){return function(n){return t(e(n))}},us=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(ls)};var ds=function(e){return function(t){return e(t),null}},ms={tap:ds((function(e){var t=e.onTap,n=e.onTapStart,i=e.onTapCancel,o=e.whileTap,r=e.visualElement,a=t||n||i||o,s=Object(ro.useRef)(!1),c=Object(ro.useRef)(null);function l(){var e;null===(e=c.current)||void 0===e||e.call(c),c.current=null}function u(){var e;return l(),s.current=!1,null===(e=r.animationState)||void 0===e||e.setActive(Ma.Tap,!1),!rs()}function d(e,n){u()&&(ss(r.getInstance(),e.target)?null==t||t(e,n):null==i||i(e,n))}function m(e,t){u()&&(null==i||i(e,t))}es(r,"pointerdown",a?function(e,t){var i;l(),s.current||(s.current=!0,c.current=us($a(window,"pointerup",d),$a(window,"pointercancel",m)),null==n||n(e,t),null===(i=r.animationState)||void 0===i||i.setActive(Ma.Tap,!0))}:void 0),cs(l)})),focus:ds((function(e){var t=e.whileFocus,n=e.visualElement;ja(n,"focus",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Ma.Focus,!0)}:void 0),ja(n,"blur",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Ma.Focus,!1)}:void 0)})),hover:ds((function(e){var t=e.onHoverStart,n=e.onHoverEnd,i=e.whileHover,o=e.visualElement;es(o,"pointerenter",t||i?as(o,!0,t):void 0),es(o,"pointerleave",n||i?as(o,!1,n):void 0)}))};function hs(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 fs=function(e,t,n){return Math.min(Math.max(n,e),t)},ps=.001;function gs(e){var t,n,i=e.duration,o=void 0===i?800:i,r=e.bounce,a=void 0===r?.25:r,s=e.velocity,c=void 0===s?0:s,l=e.mass,u=void 0===l?1:l,d=1-a;d=fs(.05,1,d),o=fs(.01,10,o/1e3),d<1?(t=function(e){var t=e*d,n=t*o,i=t-c,r=vs(e,d),a=Math.exp(-n);return ps-i/r*a},n=function(e){var n=e*d*o,i=n*c+c,r=Math.pow(d,2)*Math.pow(e,2)*o,a=Math.exp(-n),s=vs(Math.pow(e,2),d);return(-t(e)+ps>0?-1:1)*((i-r)*a)/s}):(t=function(e){return Math.exp(-e*o)*((e-c)*o+1)-.001},n=function(e){return Math.exp(-e*o)*(o*o*(c-e))});var m=function(e,t,n){for(var i=n,o=1;o<12;o++)i-=e(i)/t(i);return i}(t,n,5/o);if(o*=1e3,isNaN(m))return{stiffness:100,damping:10,duration:o};var h=Math.pow(m,2)*u;return{stiffness:h,damping:2*d*Math.sqrt(u*h),duration:o}}function vs(e,t){return e*Math.sqrt(1-t*t)}var Cs=["duration","bounce"],ys=["stiffness","damping","mass"];function bs(e,t){return t.some((function(t){return void 0!==e[t]}))}function As(e){var t=e.from,n=void 0===t?0:t,i=e.to,o=void 0===i?1:i,r=e.restSpeed,a=void 0===r?2:r,s=e.restDelta,c=Object(Jo.d)(e,["from","to","restSpeed","restDelta"]),l={done:!1,value:n},u=function(e){var t=Object(Jo.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!bs(e,ys)&&bs(e,Cs)){var n=gs(e);(t=Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(c),d=u.stiffness,m=u.damping,h=u.mass,f=u.velocity,p=u.duration,g=u.isResolvedFromDuration,v=Ss,C=Ss;function y(){var e=f?-f/1e3:0,t=o-n,i=m/(2*Math.sqrt(d*h)),r=Math.sqrt(d/h)/1e3;if(null!=s||(s=Math.abs(o-n)<=1?.01:.4),i<1){var a=vs(r,i);v=function(n){var s=Math.exp(-i*r*n);return o-s*((e+i*r*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},C=function(n){var o=Math.exp(-i*r*n);return i*r*o*(Math.sin(a*n)*(e+i*r*t)/a+t*Math.cos(a*n))-o*(Math.cos(a*n)*(e+i*r*t)-a*t*Math.sin(a*n))}}else if(1===i)v=function(n){return o-Math.exp(-r*n)*(t+(e+r*t)*n)};else{var c=r*Math.sqrt(i*i-1);v=function(n){var a=Math.exp(-i*r*n),s=Math.min(c*n,300);return o-a*((e+i*r*t)*Math.sinh(s)+c*t*Math.cosh(s))/c}}}return y(),{next:function(e){var t=v(e);if(g)l.done=e>=p;else{var n=1e3*C(e),i=Math.abs(n)<=a,r=Math.abs(o-t)<=s;l.done=i&&r}return l.value=l.done?o:t,l},flipTarget:function(){var e;f=-f,n=(e=[o,n])[0],o=e[1],y()}}}As.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var Ss=function(e){return 0},ws=function(e,t,n){var i=t-e;return 0===i?1:(n-e)/i},Es=function(e,t,n){return-n*e+n*t+e},xs=function(e,t){return function(n){return Boolean(Qr(n)&&Yr.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},Ds=function(e,t,n){return function(i){var o;if(!Qr(i))return i;var r=i.match(Zr),a=r[0],s=r[1],c=r[2],l=r[3];return(o={})[e]=parseFloat(a),o[t]=parseFloat(s),o[n]=parseFloat(c),o.alpha=void 0!==l?parseFloat(l):1,o}},Ts=Hr(0,255),Bs=Object(Jo.a)(Object(Jo.a)({},na),{transform:function(e){return Math.round(Ts(e))}}),Is={test:xs("rgb","red"),parse:Ds("red","green","blue"),transform:function(e){var t=e.red,n=e.green,i=e.blue,o=e.alpha,r=void 0===o?1:o;return"rgba("+Bs.transform(t)+", "+Bs.transform(n)+", "+Bs.transform(i)+", "+Ur(ia.transform(r))+")"}};var ks={test:xs("#"),parse:function(e){var t="",n="",i="",o="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),i=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),i=e.substr(3,1),o=e.substr(4,1),t+=t,n+=n,i+=i,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:Is.transform},Os={test:xs("hsl","hue"),parse:Ds("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,i=e.lightness,o=e.alpha,r=void 0===o?1:o;return"hsla("+Math.round(t)+", "+Kr.transform(Ur(n))+", "+Kr.transform(Ur(i))+", "+Ur(ia.transform(r))+")"}},Ls=function(e,t,n){var i=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-i)+i))},Ps=[ks,Is,Os],_s=function(e){return Ps.find((function(t){return t.test(e)}))},Rs=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},Fs=function(e,t){var n=_s(e),i=_s(t);Rs(e),Rs(t),n.transform,i.transform;var o=n.parse(e),r=i.parse(t),a=Object(Jo.a)({},o),s=n===Os?Es:Ls;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(o[t],r[t],e));return a.alpha=Es(o.alpha,r.alpha,e),n.transform(a)}},Ns={test:function(e){return Is.test(e)||ks.test(e)||Os.test(e)},parse:function(e){return Is.test(e)?Is.parse(e):Os.test(e)?Os.parse(e):ks.parse(e)},transform:function(e){return Qr(e)?e:e.hasOwnProperty("red")?Is.transform(e):Os.transform(e)}},Ms="${c}",Vs="${n}";function Ws(e){var t=[],n=0,i=e.match(Gr);i&&(n=i.length,e=e.replace(Gr,Ms),t.push.apply(t,i.map(Ns.parse)));var o=e.match(Zr);return o&&(e=e.replace(Zr,Vs),t.push.apply(t,o.map(na.parse))),{values:t,numColors:n,tokenised:e}}function zs(e){return Ws(e).values}function js(e){var t=Ws(e),n=t.values,i=t.numColors,o=t.tokenised,r=n.length;return function(e){for(var t=o,n=0;n<r;n++)t=t.replace(n<i?Ms:Vs,n<i?Ns.transform(e[n]):Ur(e[n]));return t}}var Hs=function(e){return"number"==typeof e?0:e};var Us={test:function(e){var t,n,i,o;return isNaN(e)&&Qr(e)&&(null!==(n=null===(t=e.match(Zr))||void 0===t?void 0:t.length)&&void 0!==n?n:0)+(null!==(o=null===(i=e.match(Gr))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:zs,createTransformer:js,getAnimatableNone:function(e){var t=zs(e);return js(e)(t.map(Hs))}},Zs=function(e){return"number"==typeof e};function Gs(e,t){return Zs(e)?function(n){return Es(e,t,n)}:Ns.test(e)?Fs(e,t):qs(e,t)}var Ys=function(e,t){var n=Object(Jo.e)([],e),i=n.length,o=e.map((function(e,n){return Gs(e,t[n])}));return function(e){for(var t=0;t<i;t++)n[t]=o[t](e);return n}},Qs=function(e,t){var n=Object(Jo.a)(Object(Jo.a)({},e),t),i={};for(var o in n)void 0!==e[o]&&void 0!==t[o]&&(i[o]=Gs(e[o],t[o]));return function(e){for(var t in i)n[t]=i[t](e);return n}};function Xs(e){for(var t=Us.parse(e),n=t.length,i=0,o=0,r=0,a=0;a<n;a++)i||"number"==typeof t[a]?i++:void 0!==t[a].hue?r++:o++;return{parsed:t,numNumbers:i,numRGB:o,numHSL:r}}var qs=function(e,t){var n=Us.createTransformer(t),i=Xs(e),o=Xs(t);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&(i.numNumbers,o.numNumbers),us(Ys(i.parsed,o.parsed),n)},Ks=function(e,t){return function(n){return Es(e,t,n)}};function Js(e,t,n){for(var i,o=[],r=n||("number"==typeof(i=e[0])?Ks:"string"==typeof i?Ns.test(i)?Fs:qs:Array.isArray(i)?Ys:"object"==typeof i?Qs:void 0),a=e.length-1,s=0;s<a;s++){var c=r(e[s],e[s+1]);if(t){var l=Array.isArray(t)?t[s]:t;c=us(l,c)}o.push(c)}return o}function $s(e,t,n){var i=void 0===n?{}:n,o=i.clamp,r=void 0===o||o,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 l=Js(t,a,s),u=2===c?function(e,t){var n=e[0],i=e[1],o=t[0];return function(e){return o(ws(n,i,e))}}(e,l):function(e,t){var n=e.length,i=n-1;return function(o){var r=0,a=!1;if(o<=e[0]?a=!0:o>=e[i]&&(r=i-1,a=!0),!a){for(var s=1;s<n&&!(e[s]>o||s===i);s++);r=s-1}var c=ws(e[r],e[r+1],o);return t[r](c)}}(e,l);return r?function(t){return u(fs(e[0],e[c-1],t))}:u}var ec,tc=function(e){return function(t){return 1-e(1-t)}},nc=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},ic=function(e){return function(t){return t*t*((e+1)*t-e)}},oc=function(e){return e},rc=(ec=2,function(e){return Math.pow(e,ec)}),ac=tc(rc),sc=nc(rc),cc=function(e){return 1-Math.sin(Math.acos(e))},lc=tc(cc),uc=nc(lc),dc=ic(1.525),mc=tc(dc),hc=nc(dc),fc=function(e){var t=ic(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),pc=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},gc=tc(pc);function vc(e,t){return e.map((function(){return t||sc})).splice(0,e.length-1)}function Cc(e){var t=e.from,n=void 0===t?0:t,i=e.to,o=void 0===i?1:i,r=e.ease,a=e.offset,s=e.duration,c=void 0===s?300:s,l={done:!1,value:n},u=Array.isArray(o)?o:[n,o],d=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===u.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(u),c);function m(){return $s(d,u,{ease:Array.isArray(r)?r:vc(u,r)})}var h=m();return{next:function(e){return l.value=h(e),l.done=e>=c,l},flipTarget:function(){u.reverse(),h=m()}}}var yc={keyframes:Cc,spring:As,decay:function(e){var t=e.velocity,n=void 0===t?0:t,i=e.from,o=void 0===i?0:i,r=e.power,a=void 0===r?.8:r,s=e.timeConstant,c=void 0===s?350:s,l=e.restDelta,u=void 0===l?.5:l,d=e.modifyTarget,m={done:!1,value:o},h=a*n,f=o+h,p=void 0===d?f:d(f);return p!==f&&(h=p-o),{next:function(e){var t=-h*Math.exp(-e/c);return m.done=!(t>u||t<-u),m.value=m.done?p:p+t,m},flipTarget:function(){}}}};var bc=1/60*1e3,Ac="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Sc="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(Ac())}),bc)};var wc=!0,Ec=!1,xc=!1,Dc={delta:0,timestamp:0},Tc=["read","update","preRender","render","postRender"],Bc=Tc.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],i=0,o=!1,r=new WeakSet,a={schedule:function(e,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var c=s&&o,l=c?t:n;return a&&r.add(e),-1===l.indexOf(e)&&(l.push(e),c&&o&&(i=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),r.delete(e)},process:function(s){var c;if(o=!0,t=(c=[n,t])[0],(n=c[1]).length=0,i=t.length)for(var l=0;l<i;l++){var u=t[l];u(s),r.has(u)&&(a.schedule(u),e())}o=!1}};return a}((function(){return Ec=!0})),e}),{}),Ic=Tc.reduce((function(e,t){var n=Bc[t];return e[t]=function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!1),Ec||_c(),n.schedule(e,t,i)},e}),{}),kc=Tc.reduce((function(e,t){return e[t]=Bc[t].cancel,e}),{}),Oc=Tc.reduce((function(e,t){return e[t]=function(){return Bc[t].process(Dc)},e}),{}),Lc=function(e){return Bc[e].process(Dc)},Pc=function(e){Ec=!1,Dc.delta=wc?bc:Math.max(Math.min(e-Dc.timestamp,40),1),Dc.timestamp=e,xc=!0,Tc.forEach(Lc),xc=!1,Ec&&(wc=!1,Sc(Pc))},_c=function(){Ec=!0,wc=!0,xc||Sc(Pc)},Rc=function(){return Dc},Fc=Ic;function Nc(e,t,n){return void 0===n&&(n=0),e-t-n}var Mc=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return Fc.update(t,!0)},stop:function(){return kc.update(t)}}};function Vc(e){var t,n,i,o,r,a=e.from,s=e.autoplay,c=void 0===s||s,l=e.driver,u=void 0===l?Mc:l,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,C=void 0===v?0:v,y=e.onPlay,b=e.onStop,A=e.onComplete,S=e.onRepeat,w=e.onUpdate,E=Object(Jo.d)(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),x=E.to,D=0,T=E.duration,B=!1,I=!0,k=function(e){if(Array.isArray(e.to))return Cc;if(yc[e.type])return yc[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Cc:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?As:Cc}(E);(null===(n=(t=k).needsInterpolation)||void 0===n?void 0:n.call(t,a,x))&&(r=$s([0,100],[a,x],{clamp:!1}),a=0,x=100);var O=k(Object(Jo.a)(Object(Jo.a)({},E),{from:a,to:x}));function L(){D++,"reverse"===g?m=function(e,t,n,i){return void 0===n&&(n=0),void 0===i&&(i=!0),i?Nc(t+-e,t,n):t-(e-t)+n}(m,T,C,I=D%2==0):(m=Nc(m,T,C),"mirror"===g&&O.flipTarget()),B=!1,S&&S()}function P(e){if(I||(e=-e),m+=e,!B){var t=O.next(Math.max(0,m));o=t.value,r&&(o=r(o)),B=I?t.done:m<=0}null==w||w(o),B&&(0===D&&(null!=T||(T=m)),D<f?function(e,t,n,i){return i?e>=t+n:e<=-n}(m,T,C,I)&&L():(i.stop(),A&&A()))}return c&&(null==y||y(),(i=u(P)).start()),{stop:function(){null==b||b(),i.stop()}}}function Wc(e,t){return t?e*(1e3/t):0}var zc=function(e){return 1e3*e},jc=function(e,t){return 1-3*t+3*e},Hc=function(e,t){return 3*t-6*e},Uc=function(e){return 3*e},Zc=function(e,t,n){return((jc(t,n)*e+Hc(t,n))*e+Uc(t))*e},Gc=function(e,t,n){return 3*jc(t,n)*e*e+2*Hc(t,n)*e+Uc(t)};var Yc=.1;function Qc(e,t,n,i){if(e===t&&n===i)return oc;for(var o=new Float32Array(11),r=0;r<11;++r)o[r]=Zc(r*Yc,e,n);function a(t){for(var i=0,r=1;10!==r&&o[r]<=t;++r)i+=Yc;--r;var a=i+(t-o[r])/(o[r+1]-o[r])*Yc,s=Gc(a,e,n);return s>=.001?function(e,t,n,i){for(var o=0;o<8;++o){var r=Gc(t,n,i);if(0===r)return t;t-=(Zc(t,n,i)-e)/r}return t}(t,a,e,n):0===s?a:function(e,t,n,i,o){var r,a,s=0;do{(r=Zc(a=t+(n-t)/2,i,o)-e)>0?n=a:t=a}while(Math.abs(r)>1e-7&&++s<10);return a}(t,i,i+Yc,e,n)}return function(e){return 0===e||1===e?e:Zc(a(e),t,i)}}var Xc={linear:oc,easeIn:rc,easeInOut:sc,easeOut:ac,circIn:cc,circInOut:uc,circOut:lc,backIn:dc,backInOut:hc,backOut:mc,anticipate:fc,bounceIn:gc,bounceInOut:function(e){return e<.5?.5*(1-pc(1-2*e)):.5*pc(2*e-1)+.5},bounceOut:pc},qc=function(e){if(Array.isArray(e)){e.length;var t=Object(Jo.c)(e,4);return Qc(t[0],t[1],t[2],t[3])}return"string"==typeof e?Xc[e]:e},Kc=function(e,t){return"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Us.test(t)||t.startsWith("url(")))},Jc=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},$c=function(e){return{type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},el=function(){return{type:"keyframes",ease:"linear",duration:.3}},tl=function(e){return{type:"keyframes",duration:.8,values:e}},nl={x:Jc,y:Jc,z:Jc,rotate:Jc,rotateX:Jc,rotateY:Jc,rotateZ:Jc,scaleX:$c,scaleY:$c,scale:$c,opacity:el,backgroundColor:el,color:el,default:$c},il=new Set(["brightness","contrast","saturate","opacity"]);function ol(e){var t=e.slice(0,-1).split("("),n=t[0],i=t[1];if("drop-shadow"===n)return e;var o=(i.match(Zr)||[])[0];if(!o)return e;var r=i.replace(o,""),a=il.has(n)?1:0;return o!==i&&(a*=100),n+"("+a+r+")"}var rl=/([a-z-]*)\(.*?\)/g,al=Object(Jo.a)(Object(Jo.a)({},Us),{getAnimatableNone:function(e){var t=e.match(rl);return t?t.map(ol).join(" "):e}}),sl=Object(Jo.a)(Object(Jo.a)({},aa),{color:Ns,backgroundColor:Ns,outlineColor:Ns,fill:Ns,stroke:Ns,borderColor:Ns,borderTopColor:Ns,borderRightColor:Ns,borderBottomColor:Ns,borderLeftColor:Ns,filter:al,WebkitFilter:al}),cl=function(e){return sl[e]};function ll(e,t){var n,i=cl(e);return i!==al&&(i=Us),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,t)}function ul(e){var t=e.ease,n=e.times,i=e.yoyo,o=e.flip,r=e.loop,a=Object(Jo.d)(e,["ease","times","yoyo","flip","loop"]),s=Object(Jo.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=zc(a.duration)),a.repeatDelay&&(s.repeatDelay=zc(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!=typeof e[0]}(t)?t.map(qc):qc(t)),"tween"===a.type&&(s.type="keyframes"),(i||r||o)&&(!0,i?s.repeatType="reverse":r?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=r||i||o||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function dl(e,t,n){var i,o,r,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(Jo.e)([],Object(Jo.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(Jo.d)(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}(e)||(e=Object(Jo.a)(Object(Jo.a)({},e),(o=n,r=t.to,a=La(r)?tl:nl[o]||nl.default,Object(Jo.a)({to:r},a(r))))),Object(Jo.a)(Object(Jo.a)({},t),ul(e))}function ml(e,t,n,i,o){var r,a=pl(i,e),s=null!==(r=a.from)&&void 0!==r?r:t.get(),c=Kc(e,n);"none"===s&&c&&"string"==typeof n?s=ll(e,n):hl(s)&&"string"==typeof n?s=fl(n):!Array.isArray(n)&&hl(n)&&"string"==typeof s&&(n=fl(s));var l=Kc(e,s);return l&&c&&!1!==a.type?function(){var i={from:s,to:n,velocity:t.getVelocity(),onComplete:o,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,o=e.velocity,r=void 0===o?0:o,a=e.min,s=e.max,c=e.power,l=void 0===c?.8:c,u=e.timeConstant,d=void 0===u?750:u,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,C=e.modifyTarget,y=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=Vc(Object(Jo.a)(Object(Jo.a)({},e),{driver:y,onUpdate:function(t){var n;null==b||b(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:A}))}function x(e){E(Object(Jo.a)({type:"spring",stiffness:h,damping:p,restDelta:v},e))}if(S(i))x({from:i,velocity:r,to:w(i)});else{var D=l*r+i;"undefined"!=typeof C&&(D=C(D));var T,B,I=w(D),k=I===a?-1:1;E({type:"decay",from:i,velocity:r,timeConstant:d,power:l,restDelta:v,modifyTarget:C,onUpdate:S(D)?function(e){T=B,B=e,r=Wc(e-T,Rc().delta),(1===k&&e>I||-1===k&&e<I)&&x({from:e,to:I,velocity:r})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}}(Object(Jo.a)(Object(Jo.a)({},i),a)):Vc(Object(Jo.a)(Object(Jo.a)({},dl(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),o(),null===(e=null==a?void 0:a.onComplete)||void 0===e||e.call(a),{stop:function(){}}}}function hl(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function fl(e){return"number"==typeof e?0:ll("",e)}function pl(e,t){return e[t]||e.default||e}function gl(e,t,n,i){return void 0===i&&(i={}),t.start((function(o){var r,a,s=ml(e,t,n,i,o),c=function(e,t){var n;return null!==(n=(pl(e,t)||{}).delay)&&void 0!==n?n:0}(i,e),l=function(){return a=s()};return c?r=setTimeout(l,zc(c)):l(),function(){clearTimeout(r),null==a||a.stop()}}))}function vl(e,t){-1===e.indexOf(t)&&e.push(t)}function Cl(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var yl=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return vl(this.subscriptions,e),function(){return Cl(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 o=0;o<i;o++){var r=this.subscriptions[o];r&&r(e,t,n)}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),bl=function(){function e(e){var t,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new yl,this.velocityUpdateSubscribers=new yl,this.renderSubscribers=new yl,this.canTrackVelocity=!1,this.updateAndNotify=function(e,t){void 0===t&&(t=!0),n.prev=n.current,n.current=e;var i=Rc(),o=i.delta,r=i.timestamp;n.lastUpdated!==r&&(n.timeDelta=o,n.lastUpdated=r,Fc.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 Fc.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?Wc(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 Al(e){return new bl(e)}var Sl=function(e){return function(t){return t.test(e)}},wl=[na,Jr,Kr,qr,ea,$r,{test:function(e){return"auto"===e},parse:function(e){return e}}],El=function(e){return wl.find(Sl(e))},xl=Object(Jo.e)(Object(Jo.e)([],Object(Jo.c)(wl)),[Ns,Us]),Dl=function(e){return xl.find(Sl(e))};function Tl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Al(n))}function Bl(e,t){var n=Ar(e,t),i=n?e.makeTargetAnimatable(n,!1):{},o=i.transitionEnd,r=void 0===o?{}:o;i.transition;var a,s=Object(Jo.d)(i,["transitionEnd","transition"]);for(var c in s=Object(Jo.a)(Object(Jo.a)({},s),r)){Tl(e,c,(a=s[c],La(a)?a[a.length-1]||0:a))}}function Il(e,t){if(t)return(t[e]||t.default||t).from}function kl(e,t,n){var i;void 0===n&&(n={});var o=Ar(e,t,n.custom),r=(o||{}).transition,a=void 0===r?e.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=o?function(){return Ol(e,o,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 o=a.delayChildren,r=void 0===o?0:o,s=a.staggerChildren,c=a.staggerDirection;return function(e,t,n,i,o,r){void 0===n&&(n=0);void 0===i&&(i=0);void 0===o&&(o=1);var a=[],s=(e.variantChildren.size-1)*i,c=1===o?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(Ll).forEach((function(e,i){a.push(kl(e,t,Object(Jo.a)(Object(Jo.a)({},r),{delay:n+c(i)})).then((function(){return e.notifyAnimationComplete(t)})))})),Promise.all(a)}(e,t,r+i,s,c,n)}:function(){return Promise.resolve()},l=a.when;if(l){var u=Object(Jo.c)("beforeChildren"===l?[s,c]:[c,s],2),d=u[0],m=u[1];return d().then(m)}return Promise.all([s(),c(n.delay)])}function Ol(e,t,n){var i,o=void 0===n?{}:n,r=o.delay,a=void 0===r?0:r,s=o.transitionOverride,c=o.type,l=e.makeTargetAnimatable(t),u=l.transition,d=void 0===u?e.getDefaultTransition():u,m=l.transitionEnd,h=Object(Jo.d)(l,["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),C=h[g];if(!(!v||void 0===C||p&&Pl(p,g))){var y=gl(g,v,C,Object(Jo.a)({delay:a},d));f.push(y)}}return Promise.all(f).then((function(){m&&Bl(e,m)}))}function Ll(e,t){return e.sortNodePosition(t)}function Pl(e,t){var n=e.protectedKeys,i=e.needsAnimating,o=n.hasOwnProperty(t)&&!0!==i[t];return i[t]=!1,o}var _l=[Ma.Animate,Ma.Hover,Ma.Tap,Ma.Drag,Ma.Focus,Ma.Exit],Rl=Object(Jo.e)([],Object(Jo.c)(_l)).reverse(),Fl=_l.length;function Nl(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 o=t.map((function(t){return kl(e,t,n)}));i=Promise.all(o)}else if("string"==typeof t)i=kl(e,t,n);else{var r="function"==typeof t?Ar(e,t,n.custom):t;i=Ol(e,r,n)}return i.then((function(){return e.notifyAnimationComplete(t)}))}(e,n,i)})))}}function Ml(e){var t,n=Nl(e),i=((t={})[Ma.Animate]=Vl(!0),t[Ma.Hover]=Vl(),t[Ma.Tap]=Vl(),t[Ma.Drag]=Vl(),t[Ma.Focus]=Vl(),t[Ma.Exit]=Vl(),t),o={},r=!0,a=function(t,n){var i=Ar(e,n);if(i){i.transition;var o=i.transitionEnd,r=Object(Jo.d)(i,["transition","transitionEnd"]);t=Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},t),r),o)}return t};function s(t,s){for(var c,l=e.getProps(),u=e.getVariantContext(!0)||{},d=[],m=new Set,h={},f=1/0,p=function(n){var o=Rl[n],p=i[o],g=null!==(c=l[o])&&void 0!==c?c:u[o],v=yr(g),C=o===s?p.isActive:null;!1===C&&(f=n);var y=g===u[o]&&g!==l[o]&&v;if(y&&r&&e.manuallyAnimateOnMount&&(y=!1),p.protectedKeys=Object(Jo.a)({},h),!p.isActive&&null===C||!g&&!p.prevProp||Oa(g)||"boolean"==typeof g)return"continue";var b=function(e,t){if("string"==typeof t)return t!==e;if(Cr(t))return!hs(t,e);return!1}(p.prevProp,g)||o===s&&p.isActive&&!y&&v||n>f&&v,A=Array.isArray(g)?g:[g],S=A.reduce(a,{});!1===C&&(S={});var w=p.prevResolvedValues,E=void 0===w?{}:w,x=Object(Jo.a)(Object(Jo.a)({},E),S),D=function(e){b=!0,m.delete(e),p.needsAnimating[e]=!0};for(var T in x){var B=S[T],I=E[T];h.hasOwnProperty(T)||(B!==I?La(B)&&La(I)?hs(B,I)?p.protectedKeys[T]=!0:D(T):void 0!==B?D(T):m.add(T):void 0!==B&&m.has(T)?D(T):p.protectedKeys[T]=!0)}p.prevProp=g,p.prevResolvedValues=S,p.isActive&&(h=Object(Jo.a)(Object(Jo.a)({},h),S)),r&&e.blockInitialAnimation&&(b=!1),b&&!y&&d.push.apply(d,Object(Jo.e)([],Object(Jo.c)(A.map((function(e){return{animation:e,options:Object(Jo.a)({type:o},t)}})))))},g=0;g<Fl;g++)p(g);if(o=Object(Jo.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 C=Boolean(d.length);return r&&!1===l.initial&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,C?n(d):Promise.resolve()}return{isAnimated:function(e){return void 0!==o[e]},animateChanges:s,setActive:function(t,n,o){var r;return i[t].isActive===n?Promise.resolve():(null===(r=e.variantChildren)||void 0===r||r.forEach((function(e){var i;return null===(i=e.animationState)||void 0===i?void 0:i.setActive(t,n)})),i[t].isActive=n,s(o,t))},setAnimateFunction:function(t){n=t(e)},getState:function(){return i}}}function Vl(e){return void 0===e&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var Wl={animation:ds((function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=Ml(t)),Oa(n)&&Object(ro.useEffect)((function(){return n.subscribe(t)}),[n])})),exit:ds((function(e){var t=e.custom,n=e.visualElement,i=Object(Jo.c)(cr(),2),o=i[0],r=i[1],a=Object(ro.useContext)(ar);Object(ro.useEffect)((function(){var e,i,s=null===(e=n.animationState)||void 0===e?void 0:e.setActive(Ma.Exit,!o,{custom:null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:t});!o&&(null==s||s.then(r))}),[o])}))},zl=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},jl=function(e){return zl(e)&&e.hasOwnProperty("z")},Hl=function(e,t){return Math.abs(e-t)};function Ul(e,t){if(Zs(e)&&Zs(t))return Hl(e,t);if(zl(e)&&zl(t)){var n=Hl(e.x,t.x),i=Hl(e.y,t.y),o=jl(e)&&jl(t)?Hl(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}var Zl=function(){function e(e,t,n){var i=this,o=(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=Ql(i.lastMoveEventInfo,i.history),t=null!==i.startEvent,n=Ul(e.offset,{x:0,y:0})>=3;if(t||n){var o=e.point,r=Rc().timestamp;i.history.push(Object(Jo.a)(Object(Jo.a)({},o),{timestamp:r}));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=Gl(t,i.transformPagePoint),Ha(e)&&0===e.buttons?i.handlePointerUp(e,t):Fc.update(i.updatePoint,!0)},this.handlePointerUp=function(e,t){i.end();var n=i.handlers,o=n.onEnd,r=n.onSessionEnd,a=Ql(Gl(t,i.transformPagePoint),i.history);i.startEvent&&o&&o(e,a),r&&r(e,a)},!(Ua(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=o;var r=Gl(Qa(e),this.transformPagePoint),a=r.point,s=Rc().timestamp;this.history=[Object(Jo.a)(Object(Jo.a)({},a),{timestamp:s})];var c=t.onSessionStart;c&&c(e,Ql(r,this.history)),this.removeListeners=us($a(window,"pointermove",this.handlePointerMove),$a(window,"pointerup",this.handlePointerUp),$a(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),kc.update(this.updatePoint)},e}();function Gl(e,t){return t?{point:t(e.point)}:e}function Yl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ql(e,t){var n=e.point;return{point:n,delta:Yl(n,ql(t)),offset:Yl(n,Xl(t)),velocity:Kl(t,.1)}}function Xl(e){return e[0]}function ql(e){return e[e.length-1]}function Kl(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,i=null,o=ql(e);n>=0&&(i=e[n],!(o.timestamp-i.timestamp>zc(t)));)n--;if(!i)return{x:0,y:0};var r=(o.timestamp-i.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(o.x-i.x)/r,y:(o.y-i.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Jl(e){return e}function $l(e){var t=e.top;return{x:{min:e.left,max:e.right},y:{min:t,max:e.bottom}}}var eu={translate:0,scale:1,origin:0,originPoint:0};function tu(){return{x:Object(Jo.a)({},eu),y:Object(Jo.a)({},eu)}}function nu(e){return[e("x"),e("y")]}function iu(e,t,n){var i=t.min,o=t.max;return void 0!==i&&e<i?e=n?Es(i,e,n.min):Math.max(e,i):void 0!==o&&e>o&&(e=n?Es(o,e,n.max):Math.min(e,o)),e}function ou(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 ru(e,t){var n,i=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&(i=(n=Object(Jo.c)([o,i],2))[0],o=n[1]),{min:e.min+i,max:e.min+o}}function au(e,t,n){return{min:su(e,t),max:su(e,n)}}function su(e,t){var n;return"number"==typeof e?e:null!==(n=e[t])&&void 0!==n?n:0}function cu(e,t){return $l(function(e,t){var n=e.top,i=e.left,o=e.bottom,r=e.right;void 0===t&&(t=Jl);var a=t({x:i,y:n}),s=t({x:r,y:o});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(e.getBoundingClientRect(),t))}function lu(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=.01),Ul(e,t)<n}function uu(e){return e.max-e.min}function du(e,t){var n=.5,i=uu(e),o=uu(t);return o>i?n=ws(t.min,t.max-i,e.min):i>o&&(n=ws(e.min,e.max-o,t.min)),fs(0,1,n)}function mu(e,t,n,i){void 0===i&&(i=.5),e.origin=i,e.originPoint=Es(t.min,t.max,e.origin),e.scale=uu(n)/uu(t),lu(e.scale,1,1e-4)&&(e.scale=1),e.translate=Es(n.min,n.max,e.origin)-e.originPoint,lu(e.translate)&&(e.translate=0)}function hu(e,t,n,i){mu(e.x,t.x,n.x,fu(i.originX)),mu(e.y,t.y,n.y,fu(i.originY))}function fu(e){return"number"==typeof e?e:.5}function pu(e,t,n){e.min=n.min+t.min,e.max=e.min+uu(t)}var gu=function(e,t){return e.depth-t.depth};function vu(e){return e.projection.isEnabled||e.shouldResetTransform()}function Cu(e,t){void 0===t&&(t=[]);var n=e.parent;return n&&Cu(n,t),vu(e)&&t.push(e),t}function yu(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(Jo.a)({},t.x),y:Object(Jo.a)({},t.y)}),e.notifyLayoutMeasure(n.layout,e.prevViewportBox||n.layout),Fc.update((function(){return e.rebaseProjectionTarget()}))}}function bu(e,t){return{min:t.min-e.min,max:t.max-e.min}}function Au(e,t){return{x:bu(e.x,t.x),y:bu(e.y,t.y)}}function Su(e,t){var n=e.getLayoutId(),i=t.getLayoutId();return n!==i||void 0===i&&e!==t}function wu(e){var t=e.getProps(),n=t.drag,i=t._dragX;return n&&!i}function Eu(e,t){e.min=t.min,e.max=t.max}function xu(e,t,n){return n+t*(e-n)}function Du(e,t,n,i,o){return void 0!==o&&(e=xu(e,o,i)),xu(e,n,i)+t}function Tu(e,t,n,i,o){void 0===t&&(t=0),void 0===n&&(n=1),e.min=Du(e.min,t,n,i,o),e.max=Du(e.max,t,n,i,o)}function Bu(e,t){var n=t.x,i=t.y;Tu(e.x,n.translate,n.scale,n.originPoint),Tu(e.y,i.translate,i.scale,i.originPoint)}function Iu(e,t,n,i){var o=Object(Jo.c)(i,3),r=o[0],a=o[1],s=o[2];e.min=t.min,e.max=t.max;var c=void 0!==n[s]?n[s]:.5,l=Es(t.min,t.max,c);Tu(e,n[r],n[a],l,n.scale)}var ku=["x","scaleX","originX"],Ou=["y","scaleY","originY"];function Lu(e,t,n){Iu(e.x,t.x,n,ku),Iu(e.y,t.y,n,Ou)}function Pu(e,t,n,i,o){return e=xu(e-=t,1/n,i),void 0!==o&&(e=xu(e,1/o,i)),e}function _u(e,t,n){var i=Object(Jo.c)(n,3),o=i[0],r=i[1],a=i[2];!function(e,t,n,i,o){void 0===t&&(t=0),void 0===n&&(n=1),void 0===i&&(i=.5);var r=Es(e.min,e.max,i)-t;e.min=Pu(e.min,t,n,r,o),e.max=Pu(e.max,t,n,r,o)}(e,t[o],t[r],t[a],t.scale)}function Ru(e,t){_u(e.x,t,ku),_u(e.y,t,Ou)}var Fu=new Set;function Nu(e,t,n){e[n]||(e[n]=[]),e[n].push(t)}function Mu(e){return Fu.add(e),function(){return Fu.delete(e)}}function Vu(){if(Fu.size){var e=0,t=[[]],n=[],i=function(n){return Nu(t,n,e)},o=function(t){Nu(n,t,e),e++};Fu.forEach((function(t){t(i,o),e=0})),Fu.clear();for(var r=n.length,a=0;a<=r;a++)t[a]&&t[a].forEach(zu),n[a]&&n[a].forEach(zu)}}var Wu,zu=function(e){return e()},ju=new WeakMap,Hu=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(),ju.set(t,this)}return e.prototype.start=function(e,t){var n=this,i=void 0===t?{}:t,o=i.snapToCursor,r=void 0!==o&&o,a=i.cursorProgress,s=this.props.transformPagePoint;this.panSession=new Zl(e,{onSessionStart:function(e){var t;n.stopMotion();var i=function(e){return Qa(e,"client")}(e).point;null===(t=n.cancelLayout)||void 0===t||t.call(n),n.cancelLayout=Mu((function(e,t){var o=Cu(n.visualElement),s=function(e){var t=[],n=function(e){vu(e)&&t.push(e),e.children.forEach(n)};return e.children.forEach(n),t.sort(gu)}(n.visualElement),c=Object(Jo.e)(Object(Jo.e)([],Object(Jo.c)(o)),Object(Jo.c)(s)),l=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),t((function(){c.forEach((function(e){return e.resetTransform()}))})),e((function(){yu(n.visualElement),s.forEach(yu)})),t((function(){c.forEach((function(e){return e.restoreTransform()})),r&&(l=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;nu((function(t){if(!l){var o=e.target[t],r=o.min,s=o.max;n.cursorProgress[t]=a?a[t]:ws(r,s,i[t])}var c=n.getAxisMotionValue(t);c&&(n.originPoint[t]=c.get())}))})),t((function(){Oc.update(),Oc.preRender(),Oc.render(),Oc.postRender()})),e((function(){return n.resolveDragConstraints()}))}))},onStart:function(e,t){var i,o,r,a=n.props,s=a.drag,c=a.dragPropagation;(!s||c||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=os(s),n.openGlobalLock))&&(Vu(),n.isDragging=!0,n.currentDirection=null,null===(o=(i=n.props).onDragStart)||void 0===o||o.call(i,e,t),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(Ma.Drag,!0))},onMove:function(e,t){var i,o,r,a,s=n.props,c=s.dragPropagation,l=s.dragDirectionLock;if(c||n.openGlobalLock){var u=t.offset;if(l&&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}(u),void(null!==n.currentDirection&&(null===(o=(i=n.props).onDirectionLock)||void 0===o||o.call(i,n.currentDirection)));n.updateAxis("x",t.point,u),n.updateAxis("y",t.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,e,t),Wu=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,o=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(vr(n)?this.resolveRefConstraints(o,n):function(e,t){var n=t.top,i=t.left,o=t.bottom,r=t.right;return{x:ou(e.x,i,r),y:ou(e.y,n,o)}}(o,n)),this.elastic=function(e){return!1===e?e=0:!0===e&&(e=.35),{x:au(e,"left","right"),y:au(e,"top","bottom")}}(i),this.constraints&&!this.hasMutatedConstraints&&nu((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}(o[t],e.constraints[t]))}))},e.prototype.resolveRefConstraints=function(e,t){var n=this.props,i=n.onMeasureDragConstraints,o=n.transformPagePoint,r=t.current;this.constraintsBox=cu(r,o);var a=function(e,t){return{x:ru(e.x,t.x),y:ru(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=$l(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(Ma.Drag,!1)},e.prototype.stop=function(e,t){var n,i,o;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=t.velocity;this.animateDragEnd(a),null===(o=(i=this.props).onDragEnd)||void 0===o||o.call(i,e,t)}},e.prototype.snapToCursor=function(e){var t=this;return nu((function(n){if(Uu(n,t.props.drag,t.currentDirection)){var i=t.getAxisMotionValue(n);if(!i)return t.cursorProgress[n]=.5,!0;var o=t.visualElement.getLayoutState().layout,r=o[n].max-o[n].min,a=o[n].min+r/2,s=e[n]-a;t.originPoint[n]=e[n],i.set(s)}})).includes(!0)},e.prototype.updateAxis=function(e,t,n){if(Uu(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],o=this.constraints?iu(i,this.constraints[e],this.elastic[e]):i;n.set(o)}},e.prototype.updateVisualElementAxis=function(e,t){var n,i=this.visualElement.getLayoutState().layout[e],o=i.max-i.min,r=this.cursorProgress[e],a=function(e,t,n,i,o){var r=e-t*n;return i?iu(r,i,o):r}(t[e],o,r,null===(n=this.constraints)||void 0===n?void 0:n[e],this.elastic[e]);this.visualElement.setProjectionTargetAxis(e,a,a+o)},e.prototype.setProps=function(e){var t=e.drag,n=void 0!==t&&t,i=e.dragDirectionLock,o=void 0!==i&&i,r=e.dragPropagation,a=void 0!==r&&r,s=e.dragConstraints,c=void 0!==s&&s,l=e.dragElastic,u=void 0===l?.35:l,d=e.dragMomentum,m=void 0===d||d,h=Object(Jo.d)(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(Jo.a)({drag:n,dragDirectionLock:o,dragPropagation:a,dragConstraints:c,dragElastic:u,dragMomentum:m},h)},e.prototype.getAxisMotionValue=function(e){var t=this.props,n=t.layout,i=t.layoutId,o="_drag"+e.toUpperCase();return this.props[o]?this.props[o]: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,o=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(e,t){void 0===t&&(t=!0);var n,i=e.getProjectionParent();return!!i&&(t?Ru(n=Au(i.projection.target,e.projection.target),i.getLatestValues()):n=Au(i.getLayoutState().layout,e.getLayoutState().layout),nu((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 l=this.visualElement.getProjectionParent();if(l){var u=Au(l.projection.targetFinal,c);nu((function(e){var t=u[e],n=t.min,i=t.max;c[e]={min:isNaN(n)?void 0:n,max:isNaN(i)?void 0:i}}))}}var d=nu((function(n){var l;if(Uu(n,i,t.currentDirection)){var u=null!==(l=null==c?void 0:c[n])&&void 0!==l?l:{},d=r?200:1e6,m=r?40:1e7,h=Object(Jo.a)(Object(Jo.a)({type:"inertia",velocity:o?e[n]:0,bounceStiffness:d,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10},a),u);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;nu((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),gl(e,n,0,t)}},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.drag;if(vr(t.dragConstraints)&&this.constraintsBox){this.stopMotion();var i={x:0,y:0};nu((function(t){i[t]=du(e.visualElement.projection.target[t],e.constraintsBox[t])})),this.updateConstraints((function(){nu((function(t){if(Uu(t,n,null)){var o=function(e,t,n){var i=e.max-e.min,o=Es(t.min,t.max-i,n);return{min:o,max:o+i}}(e.visualElement.projection.target[t],e.constraintsBox[t],i[t]),r=o.min,a=o.max;e.visualElement.setProjectionTargetAxis(t,r,a)}}))})),setTimeout(Vu,1)}},e.prototype.updateConstraints=function(e){var t=this;this.cancelLayout=Mu((function(n,i){var o=Cu(t.visualElement);i((function(){return o.forEach((function(e){return e.resetTransform()}))})),n((function(){return yu(t.visualElement)})),i((function(){return o.forEach((function(e){return e.restoreTransform()}))})),n((function(){t.resolveDragConstraints()})),e&&i(e)}))},e.prototype.mount=function(e){var t=this,n=$a(e.getInstance(),"pointerdown",(function(e){var n=t.props,i=n.drag,o=n.dragListener;i&&(void 0===o||o)&&t.start(e)})),i=za(window,"resize",(function(){t.scalePoint()})),o=e.onLayoutUpdate((function(){t.isDragging&&t.resolveDragConstraints()})),r=e.prevDragCursor;return r&&this.start(Wu,{cursorProgress:r}),function(){null==n||n(),null==i||i(),null==o||o(),t.cancelDrag()}},e}();function Uu(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}var Zu,Gu,Yu={pan:ds((function(e){var t=e.onPan,n=e.onPanStart,i=e.onPanEnd,o=e.onPanSessionStart,r=e.visualElement,a=t||n||i||o,s=Object(ro.useRef)(null),c=Object(ro.useContext)(or).transformPagePoint,l={onSessionStart:o,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,i&&i(e,t)}};Object(ro.useEffect)((function(){null!==s.current&&s.current.updateHandlers(l)})),es(r,"pointerdown",a&&function(e){s.current=new Zl(e,l,{transformPagePoint:c})}),cs((function(){return s.current&&s.current.end()}))})),drag:ds((function(e){var t=e.dragControls,n=e.visualElement,i=Object(ro.useContext)(or).transformPagePoint,o=sr((function(){return new Hu({visualElement:n})}));o.setProps(Object(Jo.a)(Object(Jo.a)({},e),{transformPagePoint:i})),Object(ro.useEffect)((function(){return t&&t.subscribe(o)}),[o]),Object(ro.useEffect)((function(){return o.mount(n)}),[])}))};function Qu(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"}(Zu||(Zu={})),function(e){e[e.Hide=0]="Hide",e[e.Show=1]="Show"}(Gu||(Gu={}));var Xu=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function qu(e,t,n){void 0===n&&(n=1);var i=Object(Jo.c)(function(e){var t=Xu.exec(e);if(!t)return[,];var n=Object(Jo.c)(t,3);return[n[1],n[2]]}(e),2),o=i[0],r=i[1];if(o){var a=window.getComputedStyle(t).getPropertyValue(o);return a?a.trim():Qu(r)?qu(r,t,n+1):r}}function Ku(e,t){return e/(t.max-t.min)*100}var Ju="_$css";var $u={process:function(e,t,n){var i=n.target;if("string"==typeof e){if(!Jr.test(e))return e;e=parseFloat(e)}return Ku(e,i.x)+"% "+Ku(e,i.y)+"%"}},ed={borderRadius:Object(Jo.a)(Object(Jo.a)({},$u),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:$u,borderTopRightRadius:$u,borderBottomLeftRadius:$u,borderBottomRightRadius:$u,boxShadow:{process:function(e,t){var n=t.delta,i=t.treeScale,o=e,r=e.includes("var("),a=[];r&&(e=e.replace(Xu,(function(e){return a.push(e),Ju})));var s=Us.parse(e);if(s.length>5)return o;var c=Us.createTransformer(e),l="number"!=typeof s[0]?1:0,u=n.x.scale*i.x,d=n.y.scale*i.y;s[0+l]/=u,s[1+l]/=d;var m=Es(u,d,.5);"number"==typeof s[2+l]&&(s[2+l]/=m),"number"==typeof s[3+l]&&(s[3+l]/=m);var h=c(s);if(r){var f=0;h=h.replace(Ju,(function(){var e=a[f];return f++,e}))}return h}}},td=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 o=i.originBox,r=i.targetBox,a=i.visibilityAction,s=i.shouldStackAnimate,c=i.onComplete,l=i.prevParent,u=Object(Jo.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=o||n,e=r||e;var f=!1,p=m.getProjectionParent();if(p){var g=p.prevViewportBox,v=p.getLayoutState().layout;l&&(r&&(v=l.getLayoutState().layout),o&&!Su(l,p)&&l.prevViewportBox&&(g=l.prevViewportBox)),g&&sd(l,o,r)&&(f=!0,n=Au(g,n),e=Au(v,e))}var C=nd(n,e),y=nu((function(i){var o,r;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?C?t.animateAxis(i,e[i],n[i],Object(Jo.a)(Object(Jo.a)({},u),{isRelative:f})):(null===(r=(o=t.stopAxisAnimation)[i])||void 0===r||r.call(o),m.setProjectionTargetAxis(i,e[i].min,e[i].max,f)):void m.setVisibility(a===Gu.Show)}));return m.syncRender(),Promise.all(y).then((function(){t.isAnimatingTree=!1,c&&c(),m.notifyLayoutAnimationComplete()}))}},t}return Object(Jo.b)(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.visualElement;t.animateMotionValue=gl,t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate),t.layoutSafeToRemove=function(){return e.safeToRemove()},function(e){for(var t in e)kr[t]=e[t]}(ed)},t.prototype.componentWillUnmount=function(){var e=this;this.unsubLayoutReady(),nu((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 o,r,a=this,s=void 0===i?{}:i,c=s.transition,l=s.isRelative;if(!this.isAnimating[e]||!rd(t,this.currentAnimationTarget[e])){null===(r=(o=this.stopAxisAnimation)[e])||void 0===r||r.call(o),this.isAnimating[e]=!0;var u=this.props.visualElement,d=this.frameTarget[e],m=u.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=Es(t.min,n.min,i),e.max=Es(t.max,n.max,i)}(d,n,t,i),u.setProjectionTargetAxis(e,d.min,d.max,l)};h();var f=m.onChange(h);this.stopAxisAnimation[e]=function(){a.isAnimating[e]=!1,m.stop(),f()},this.currentAnimationTarget[e]=t;var p=c||u.getDefaultTransition()||ad;return gl("x"===e?"layoutX":"layoutY",m,1e3,p&&pl(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}(ro.Component);function nd(e,t){return!(od(e)||od(t)||rd(e.x,t.x)&&rd(e.y,t.y))}var id={min:0,max:0};function od(e){return rd(e.x,id)&&rd(e.y,id)}function rd(e,t){return e.min===t.min&&e.max===t.max}var ad={duration:.45,ease:[.4,0,.1,1]};function sd(e,t,n){return e||!e&&!(t||n)}var cd={layoutReady:function(e){return e.notifyLayoutReady()}};function ld(){var e=new Set;return{add:function(t){return e.add(t)},flush:function(t){var n=void 0===t?cd:t,i=n.layoutReady,o=n.parent;Mu((function(t,n){var r=Array.from(e).sort(gu),a=o?Cu(o):[];n((function(){Object(Jo.e)(Object(Jo.e)([],Object(Jo.c)(a)),Object(Jo.c)(r)).forEach((function(e){return e.resetTransform()}))})),t((function(){r.forEach(yu)})),n((function(){a.forEach((function(e){return e.restoreTransform()})),r.forEach(i)})),t((function(){r.forEach((function(e){e.isPresent&&(e.presence=Zu.Present)}))})),n((function(){Oc.preRender(),Oc.render()})),t((function(){Fc.postRender((function(){return r.forEach(ud)})),e.clear()}))})),Vu()}}}function ud(e){e.prevViewportBox=e.projection.target}var dd=Object(ro.createContext)(ld()),md=Object(ro.createContext)(ld());function hd(e){return!!e.forceUpdate}var fd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(Jo.b)(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.syncLayout,n=e.framerSyncLayout,i=e.visualElement;hd(t)&&t.register(i),hd(n)&&n.register(i),i.onUnmount((function(){hd(t)&&t.remove(i),hd(n)&&n.remove(i)}))},t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.syncLayout,n=e.visualElement;return hd(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;hd(e)||e.flush()},t.prototype.render=function(){return null},t}(ro.default.Component);var pd={measureLayout:function(e){var t=Object(ro.useContext)(dd),n=Object(ro.useContext)(md);return ro.default.createElement(fd,Object(Jo.a)({},e,{syncLayout:t,framerSyncLayout:n}))},layoutAnimation:function(e){var t=Object(Jo.c)(cr(),2)[1];return ro.createElement(td,Object(Jo.a)({},e,{safeToRemove:t}))}};function gd(){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:tu(),deltaFinal:tu(),deltaTransform:""}}var vd=gd();function Cd(e,t,n){var i=e.x,o=e.y,r="translate3d("+i.translate/t.x+"px, "+o.translate/t.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,c=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),c&&(r+="rotateY("+c+") ")}return r+="scale("+i.scale+", "+o.scale+")",n||r!==bd?r:""}function yd(e){var t=e.deltaFinal;return 100*t.x.origin+"% "+100*t.y.origin+"% 0"}var bd=Cd(vd.delta,vd.treeScale,{x:1,y:1}),Ad=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Sd(e,t,n,i){var o,r,a=e.delta,s=e.layout,c=e.layoutCorrected,l=e.treeScale,u=t.target;r=s,Eu((o=c).x,r.x),Eu(o.y,r.y),function(e,t,n){var i=n.length;if(i){var o,r;t.x=t.y=1;for(var a=0;a<i;a++)r=(o=n[a]).getLayoutState().delta,t.x*=r.x.scale,t.y*=r.y.scale,Bu(e,r),wu(o)&&Lu(e,e,o.getLatestValues())}}(c,l,n),hu(a,c,u,i)}var wd=function(){function e(){this.children=[],this.isDirty=!1}return e.prototype.add=function(e){vl(this.children,e),this.isDirty=!0},e.prototype.remove=function(e){Cl(this.children,e),this.isDirty=!0},e.prototype.forEach=function(e){this.isDirty&&this.children.sort(gu),this.isDirty=!1,this.children.forEach(e)},e}();var Ed=function(e){var t=e.treeType,n=void 0===t?"":t,i=e.build,o=e.getBaseTarget,r=e.makeTargetAnimatable,a=e.measureViewportBox,s=e.render,c=e.readValueFromInstance,l=e.resetTransform,u=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,C=e.visualState;void 0===t&&(t={});var y,b,A,S,w,E,x=C.latestValues,D=C.renderState,T=function(){var e=Ad.map((function(){return new yl})),t={},n={clearAllListeners:function(){return e.forEach((function(e){return e.clear()}))},updatePropListeners:function(e){return Ad.forEach((function(i){var o;null===(o=t[i])||void 0===o||o.call(t);var r="on"+i,a=e[r];a&&(t[i]=n[r](a))}))}};return e.forEach((function(e,t){n["on"+Ad[t]]=function(t){return e.add(t)},n["notify"+Ad[t]]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.notify.apply(e,Object(Jo.e)([],Object(Jo.c)(t)))}})),n}(),B={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}}},I=B,k=x,O=gd(),L=!1,P=new Map,_=new Map,R={},F=Object(Jo.a)({},x);function N(){y&&(G.isProjectionReady()&&(Lu(I.targetFinal,I.target,k),hu(O.deltaFinal,O.layoutCorrected,I.targetFinal,x)),M(),s(y,D))}function M(){var e=x;if(S&&S.isActive()){var n=S.getCrossfadeState(G);n&&(e=n)}i(G,D,e,I,O,t,p)}function V(){T.notifyUpdate(x)}function W(){G.layoutTree.forEach(Dd)}var z=h(p);for(var j in z){var H=z[j];void 0!==x[j]&&Vr(H)&&H.set(x[j],!1)}var U=Sr(p),Z=wr(p),G=Object(Jo.a)(Object(Jo.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(Jo.e)(Object(Jo.e)([],Object(Jo.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new wd,presenceId:g,projection:B,variantChildren:Z?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(y)},mount:function(e){y=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(){kc.update(V),kc.render(N),kc.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(),T.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 Fc.preRender(G.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return p.layoutId},getInstance:function(){return y},getStaticValue:function(e){return x[e]},setStaticValue:function(e,t){return x[e]=t},getLatestValues:function(){return x},setVisibility:function(e){G.isVisible!==e&&(G.isVisible=e,G.scheduleRender())},makeTargetAnimatable:function(e,t){return void 0===t&&(t=!0),r(G,e,p,t)},addValue:function(e,t){G.hasValue(e)&&G.removeValue(e),P.set(e,t),x[e]=t.get(),function(e,t){var n=t.onChange((function(t){x[e]=t,p.onUpdate&&Fc.update(V,!1,!0)})),i=t.onRenderRequest(G.scheduleRender);_.set(e,(function(){n(),i()}))}(e,t)},removeValue:function(e){var t;P.delete(e),null===(t=_.get(e))||void 0===t||t(),_.delete(e),delete x[e],d(e,D)},hasValue:function(e){return P.has(e)},getValue:function(e,t){var n=P.get(e);return void 0===n&&void 0!==t&&(n=Al(t),G.addValue(e,n)),n},forEachValue:function(e){return P.forEach(e)},readValue:function(e){var n;return null!==(n=x[e])&&void 0!==n?n:c(y,e,t)},setBaseTarget:function(e,t){F[e]=t},getBaseTarget:function(e){if(o){var t=o(p,e);if(void 0!==t&&!Vr(t))return t}return F[e]}},T),{build:function(){return M(),D},scheduleRender:function(){Fc.render(N,!1,!0)},syncRender:N,setProps:function(e){p=e,T.updatePropListeners(e),R=function(e,t,n){var i;for(var o in t){var r=t[o],a=n[o];if(Vr(r))e.addValue(o,r);else if(Vr(a))e.addValue(o,Al(r));else if(a!==r)if(e.hasValue(o)){var s=e.getValue(o);!s.hasAnimated&&s.set(r)}else e.addValue(o,Al(null!==(i=e.getStaticValue(o))&&void 0!==i?i:r))}for(var o in n)void 0===t[o]&&e.removeValue(o);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<Id;i++){var o=Bd[i],r=p[o];(yr(r)||!1===r)&&(n[o]=r)}return n},enableLayoutProjection:function(){B.isEnabled=!0,G.layoutTree.add(G)},lockProjectionTarget:function(){B.isTargetLocked=!0},unlockProjectionTarget:function(){G.stopLayoutAnimation(),B.isTargetLocked=!1},getLayoutState:function(){return O},setCrossfader:function(e){S=e},isProjectionReady:function(){return B.isEnabled&&B.isHydrated&&O.isHydrated},startLayoutAnimation:function(e,t,n){void 0===n&&(n=!1);var i=G.getProjectionAnimationProgress()[e],o=n?B.relativeTarget[e]:B.target[e],r=o.min,a=o.max-r;return i.clearListeners(),i.set(r),i.set(r),i.onChange((function(t){G.setProjectionTargetAxis(e,t,t+a,n)})),G.animateMotionValue(e,i,0,t)},stopLayoutAnimation:function(){nu((function(e){return G.getProjectionAnimationProgress()[e].stop()}))},measureViewportBox:function(e){void 0===e&&(e=!0);var n=a(y,t);return e||Ru(n,x),n},getProjectionAnimationProgress:function(){return w||(w={x:Al(0),y:Al(0)}),w},setProjectionTargetAxis:function(e,t,n,i){var o;void 0===i&&(i=!1),i?(B.relativeTarget||(B.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),o=B.relativeTarget[e]):(B.relativeTarget=void 0,o=B.target[e]),B.isHydrated=!0,o.min=t,o.max=n,L=!0,T.notifySetAxisTarget()},rebaseProjectionTarget:function(e,t){void 0===t&&(t=O.layout);var n=G.getProjectionAnimationProgress(),i=n.x,o=n.y,r=!(B.relativeTarget||B.isTargetLocked||i.isAnimating()||o.isAnimating());(e||r)&&nu((function(e){var n=t[e],i=n.min,o=n.max;G.setProjectionTargetAxis(e,i,o)}))},notifyLayoutReady:function(e){!function(e){var t=e.getProjectionParent();if(t){var n=Au(t.getLayoutState().layout,e.getLayoutState().layout);nu((function(t){e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)}))}else e.rebaseProjectionTarget()}(G),G.notifyLayoutUpdate(O.layout,G.prevViewportBox||O.layout,e)},resetTransform:function(){return l(G,y,p)},restoreTransform:function(){return u(y,D)},updateLayoutProjection:function(){if(G.isProjectionReady()){var e=O.delta,t=O.treeScale,n=t.x,i=t.y,o=O.deltaTransform;Sd(O,I,G.path,x),L&&G.notifyViewportBoxUpdate(I.target,e),L=!1;var r=Cd(e,t);r===o&&n===t.x&&i===t.y||G.scheduleRender(),O.deltaTransform=r}},updateTreeLayoutProjection:function(){G.layoutTree.forEach(xd),Fc.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(B.relativeTarget&&e&&(function(e,t){pu(e.target.x,e.relativeTarget.x,t.target.x),pu(e.target.y,e.relativeTarget.y,t.target.y)}(B,e.projection),wu(e))){var t=B.target;Lu(t,t,e.getLatestValues())}},shouldResetTransform:function(){return Boolean(p._layoutResetTransform)},pointTo:function(e){I=e.projection,k=e.getLatestValues(),null==A||A(),A=us(e.onSetAxisTarget(G.scheduleUpdateLayoutProjection),e.onLayoutAnimationComplete((function(){var e;G.isPresent?G.presence=Zu.Present:null===(e=G.layoutSafeToRemove)||void 0===e||e.call(G)})))},isPresent:!0,presence:Zu.Entering});return G}};function xd(e){e.resolveRelativeTargetBox()}function Dd(e){e.updateLayoutProjection()}var Td,Bd=Object(Jo.e)(["initial"],Object(Jo.c)(_l)),Id=Bd.length,kd=new Set(["width","height","top","left","right","bottom","x","y"]),Od=function(e){return kd.has(e)},Ld=function(e,t){e.set(t,!1),e.set(t)},Pd=function(e){return e===na||e===Jr};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(Td||(Td={}));var _d=function(e,t){return parseFloat(e.split(", ")[t])},Rd=function(e,t){return function(n,i){var o=i.transform;if("none"===o||!o)return 0;var r=o.match(/^matrix3d\((.+)\)$/);if(r)return _d(r[1],t);var a=o.match(/^matrix\((.+)\)$/);return a?_d(a[1],e):0}},Fd=new Set(["x","y","z"]),Nd=Lr.filter((function(e){return!Fd.has(e)}));var Md={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:Rd(4,13),y:Rd(5,14)},Vd=function(e,t,n,i){void 0===n&&(n={}),void 0===i&&(i={}),t=Object(Jo.a)({},t),i=Object(Jo.a)({},i);var o=Object.keys(t).filter(Od),r=[],a=!1,s=[];if(o.forEach((function(o){var c=e.getValue(o);if(e.hasValue(o)){var l,u=n[o],d=t[o],m=El(u);if(La(d))for(var h=d.length,f=null===d[0]?1:0;f<h;f++)l?El(d[f]):(l=El(d[f]))===m||Pd(m)&&Pd(l);else l=El(d);if(m!==l)if(Pd(m)&&Pd(l)){var p=c.get();"string"==typeof p&&c.set(parseFloat(p)),"string"==typeof d?t[o]=parseFloat(d):Array.isArray(d)&&l===Jr&&(t[o]=d.map(parseFloat))}else(null==m?void 0:m.transform)&&(null==l?void 0:l.transform)&&(0===u||0===d)?0===u?c.set(l.transform(u)):t[o]=m.transform(d):(a||(r=function(e){var t=[];return Nd.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(o),i[o]=void 0!==i[o]?i[o]:t[o],Ld(c,d))}})),s.length){var c=function(e,t,n){var i=t.measureViewportBox(),o=t.getInstance(),r=getComputedStyle(o),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&t.setStaticValue("display",e.display||"block"),t.syncRender();var c=t.measureViewportBox();return n.forEach((function(n){var o=t.getValue(n);Ld(o,Md[n](i,s)),e[n]=Md[n](c,r)})),e}(t,e,s);return r.length&&r.forEach((function(t){var n=Object(Jo.c)(t,2),i=n[0],o=n[1];e.getValue(i).set(o)})),e.syncRender(),{target:c,transitionEnd:i}}return{target:t,transitionEnd:i}};function Wd(e,t,n,i){return function(e){return Object.keys(e).some(Od)}(t)?Vd(e,t,n,i):{target:t,transitionEnd:i}}var zd=function(e,t,n,i){var o=function(e,t,n){var i,o=Object(Jo.d)(t,[]),r=e.getInstance();if(!(r instanceof HTMLElement))return{target:o,transitionEnd:n};for(var a in n&&(n=Object(Jo.a)({},n)),e.forEachValue((function(e){var t=e.get();if(Qu(t)){var n=qu(t,r);n&&e.set(n)}})),o){var s=o[a];if(Qu(s)){var c=qu(s,r);c&&(o[a]=c,n&&(null!==(i=n[a])&&void 0!==i||(n[a]=s)))}}return{target:o,transitionEnd:n}}(e,t,i);return Wd(e,t=o.target,n,i=o.transitionEnd)};var jd={treeType:"dom",readValueFromInstance:function(e,t){if(Rr(t)){var n=cl(t);return n&&n.default||0}var i,o=(i=e,window.getComputedStyle(i));return(zr(t)?o.getPropertyValue(t):o[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 cu(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 o=n.transformValues;void 0===i&&(i=!0);var r=t.transition,a=t.transitionEnd,s=Object(Jo.d)(t,["transition","transitionEnd"]),c=function(e,t,n){var i,o,r={};for(var a in e)r[a]=null!==(i=Il(a,t))&&void 0!==i?i:null===(o=n.getValue(a))||void 0===o?void 0:o.get();return r}(s,r||{},e);if(o&&(a&&(a=o(a)),s&&(s=o(s)),c&&(c=o(c))),i){!function(e,t,n){var i,o,r,a,s=Object.keys(t).filter((function(t){return!e.hasValue(t)})),c=s.length;if(c)for(var l=0;l<c;l++){var u=s[l],d=t[u],m=null;Array.isArray(d)&&(m=d[0]),null===m&&(m=null!==(o=null!==(i=n[u])&&void 0!==i?i:e.readValue(u))&&void 0!==o?o:t[u]),null!=m&&("string"==typeof m&&/^\-?\d*\.?\d+$/.test(m)?m=parseFloat(m):!Dl(m)&&Us.test(d)&&(m=ll(u,d)),e.addValue(u,Al(m)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=m),e.setBaseTarget(u,m))}}(e,s,c);var l=zd(e,s,c,a);a=l.transitionEnd,s=l.target}return Object(Jo.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:Ia,build:function(e,t,n,i,o,r,a){void 0!==e.isVisible&&(t.style.visibility=e.isVisible?"visible":"hidden");var s=i.isEnabled&&o.isHydrated;sa(t,n,i,o,r,a.transformTemplate,s?Cd:void 0,s?yd:void 0)},render:Da},Hd=Ed(jd),Ud=Ed(Object(Jo.a)(Object(Jo.a)({},jd),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var n;return Rr(t)?(null===(n=cl(t))||void 0===n?void 0:n.default)||0:(t=Ta.has(t)?t:xa(t),e.getAttribute(t))},scrapeMotionValuesFromProps:ka,build:function(e,t,n,i,o,r,a){var s=i.isEnabled&&o.isHydrated;ba(t,n,i,o,r,a.transformTemplate,s?Cd:void 0,s?yd:void 0)},render:Ba})),Zd=function(e,t){return Ir(e)?Ud(t,{enableHardwareAcceleration:!1}):Hd(t,{enableHardwareAcceleration:!0})},Gd=Object(Jo.a)(Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},Wl),ms),Yu),pd),Yd=Tr((function(e,t){return Wa(e,t,Gd,Zd)}));class Qd{constructor(e){this.highlighted=!1,this.code=e,this.points=[]}}var Xd=n(7);class qd{static now(){return Date.now()}}function Kd(e){var t=sr((function(){return Al(e)}));if(Object(ro.useContext)(or).isStatic){var n=Object(Jo.c)(Object(ro.useState)(e),2)[1];Object(ro.useEffect)((function(){return t.onChange(n)}),[])}return t}var Jd=function(e){return function(e){return"object"==typeof e&&e.mix}(e)?e.mix:void 0};function $d(e,t){var n=Kd(t()),i=function(){return n.set(t())};return i(),function(e,t){Object(ro.useEffect)((function(){var n=e.map((function(e){return e.onChange(t)}));return function(){return n.forEach((function(e){return e()}))}}))}(e,(function(){return Fc.update(i,!1,!0)})),n}function em(e,t,n,i){var o="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,o=e[0+i],r=e[1+i],a=e[2+i],s=e[3+i],c=$s(r,a,Object(Jo.a)({mixer:Jd(a[0])},s));return n?c(o):c}(t,n,i);return Array.isArray(e)?tm(e,o):tm([e],(function(e){var t=Object(Jo.c)(e,1)[0];return o(t)}))}function tm(e,t){var n=sr((function(){return[]}));return $d(e,(function(){n.length=0;for(var i=e.length,o=0;o<i;o++)n[o]=e[o].get();return t(n)}))}function nm(e,t,n){void 0===n&&(n={});var i=Vr(e)?e:Al(e);return gl("",i,t,n),{stop:function(){return i.stop()}}}var im=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};class om extends ro.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,o,r,a,s,c;const l=this.state.element,u=this.props.configuration.style;!l.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(l);const d=null!==(t=null===(e=this.customStyle)||void 0===e?void 0:e.fillColor)&&void 0!==t?t:l.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,m=null!==(i=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==i?i:l.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,h=null!==(r=null===(o=this.customStyle)||void 0===o?void 0:o.strokeWidth)&&void 0!==r?r:l.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:l.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,p=null!==(c=this.props.animateToPoints)&&void 0!==c?c:l.points;return ro.default.createElement(rm,{points:p,onClick:()=>{this.props.onClick&&this.props.onClick(l)},fill:d,stroke:m,strokeWidth:h,cornerRadius:f})}}function rm(e){var{points:t,cornerRadius:n}=e,i=im(e,["points","cornerRadius"]);const o=[t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y],r=o.map(Kd),a=em(r,(([e,t,i,o,r,a,s,c])=>{const l=[{x:e,y:t},{x:i,y:o},{x:r,y:a},{x:s,y:c}];return Xd.a.toSvgPathStringWithRoundedCorners(l,n)}));return Object(ro.useEffect)((()=>{const e=[];for(let t=0;t<o.length;t++)e.push(nm(r[t],o[t]));return()=>{e.forEach((e=>e.stop()))}}),[t]),ro.default.createElement(Yd.path,Object.assign({d:a},i))}class am{constructor(){this.detectedAt=0}update(e,t,n,i,o,r){this.polygon=e,this.polygonRef=t,this.label=n,this.labelRef=i,this.element=o,this.updatedAt=r}}class sm extends ro.default.Component{constructor(e){super(e),this.state={polygonElements:[]}}update(e,t,n,i){const o=[];(class{static keepOnlyCenterMostDuplicate(e,t){const n=new Map;e.forEach((e=>{const t=Go(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 o=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},r=t.width/2,a=n.reduce(((e,t)=>{const n=o(e.quad),i=o(t.quad);return Math.abs(r-n.x)<Math.abs(r-i.x)?e:t}));e.push(a)}))}}).keepOnlyCenterMostDuplicate(i,n),i.forEach((i=>{const r=new Qd(i);r.points=void 0===e?Xd.a.scaleListToHtmlElement(i.quad,n,t.video):i.quad.map((t=>{const i=new Xd.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})),r.points.forEach((e=>{t.state.mirrored&&this.container&&(e.x=this.container.clientWidth-e.x)})),o.push(r)}));const r=[];this.state.polygonElements.forEach((e=>{const t=o.find((t=>Zo(t.code,e.element.code)));let n=!1;const i=qd.now();void 0===t?e.updatedAt+1e3<i&&(n=!0):(e.element=t,e.polygon=ro.default.createElement(om,{key:Go(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=ro.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:Go(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||r.push(e)})),o.forEach((e=>{if(void 0===this.state.polygonElements.find((t=>Zo(t.element.code,e.code)))){let t,n;const i=new am,o=ro.default.createElement(om,{key:Go(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=ro.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:Go(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(o,t,a,n,e,qd.now()),r.push(i)}})),this.setState({polygonElements:r})}onPolygonClick(e){var t,n,i,o;let r;e.highlighted=!e.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((t=>{var n;const i=t.labelRef,o=t.label.props.element;Zo(o.code,e.code)&&(r=t),i&&Zo(o.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),r&&(r.detectedAt=qd.now())),null===(o=(i=this.props).onPolygonClick)||void 0===o||o.call(i,e.code)}render(){var e,t;return ro.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:e=>this.container=e},ro.default.createElement(Yd.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 cm=n(47),lm=n.n(cm),um=n(42),dm={insert:"head",singleton:!1},mm=(lm()(um.a,dm),um.a.locals,n(34)),hm=n.n(mm);class fm{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 pm extends ro.default.Component{constructor(){super(...arguments),this.inner1=new fm("scanbot-shutter-rotate"),this.inner2=new fm("scanbot-shutter-rotate")}render(){return ro.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,ro.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},ro.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},ro.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},ro.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},ro.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 ro.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:e})}svgBase(e,t,n){return ro.default.createElement("div",{className:hm()(e),ref:n},ro.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},t))}}class gm extends ro.default.Component{render(){return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_919_23088)"},ro.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}class vm extends ro.default.Component{render(){return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_919_23102)"},ro.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}class Cm extends ro.default.Component{constructor(e){super(e),this.state={barcodes:void 0}}update(e){this.setState({barcodes:e})}didScan(){return void 0!==this.state.barcodes}render(){var e,t;return ro.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:qo.ScanbotPrimary}},ro.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},ro.default.createElement(gm,null),ro.default.createElement("div",{style:{backgroundColor:qo.Orange,color:qo.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(t=null===(e=this.state.barcodes)||void 0===e?void 0:e.length)&&void 0!==t?t:0)),ro.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},ro.default.createElement(pm,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),ro.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},ro.default.createElement("div",{style:{fontSize:13,color:qo.White,marginRight:10}},"Scan More"),ro.default.createElement(vm,null)))}}class ym extends ro.default.Component{render(){const e=Xd.a.centerOf(this.props.points),t=Xd.a.smallerSizeOfQuad(this.props.points)/40;return ro.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:e.x-20,top:e.y-20,transform:`scale(${t})`}},ro.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},ro.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_910_20901)"},ro.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),ro.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}var bm=n(9);class Am extends ro.default.Component{constructor(e){super(e),this.state={elements:[],imageSize:bm.a.empty()}}update(e){const t=[];e.barcodes.forEach((n=>{const i=new Qd(n);i.points=Xd.a.scaleListToHtmlElement(n.quad,e.originalImageSize,this.image),t.push(i)})),this.setState({imageSize:bm.a.fromHtmlElement(this.image),elements:t})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:ro.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},ro.default.createElement("img",{style:{maxWidth:"100%"},ref:e=>this.image=e,src:`${this.props.image}`}),ro.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((e,t)=>ro.default.createElement(ym,{key:t,points:e.points})))))}}class Sm extends ro.default.Component{render(){if(!this.props.visible)return null;const e=Ho.a.svg`
|
|
31
|
+
`;var a=e=>i.default.createElement(r,{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(27),c=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d 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 u}get bridge(){var e;return(null!==(e=this.props.sdk)&&void 0!==e?e:o.a.instance).bridge}dispose(){const{container:e}=this.props;e&&Object(i.render)(null,e)}componentDidMount(){this.disposed=!1,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(e){this.camera.swapCameraFacing(e)}switchCamera(e,t){return c(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)}}d.DEFAULT_DETECTION_RESOLUTION=600,d.DETECTION_RESULTION_4K=3840},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 extends Error{constructor(e,t,n){super(t),this.name="",this.name=e,this.message=t,this.webApiError=n}static mediaDevicesUndefined(){return new o(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 o(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 o(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 o(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",e)}static unknown(e){return new o(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.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?o.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===e.name?o.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:o.unknown(null==e?void 0:e.message)}}o.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},o.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,"a",(function(){return o}));var i=n(39);class o 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)}}o.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},o.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},o.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,o.DEFAULT_ACCEPTED_ANGLE_SCORE=75,o.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(e,t,n){"use strict";n.r(t),n.d(t,"SingleScanningMode",(function(){return l})),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 y})),n.d(t,"FindAndPickScanningMode",(function(){return b})),n.d(t,"BarcodeTextLocalization",(function(){return S})),n.d(t,"BarcodesExtensionFilterValues",(function(){return w})),n.d(t,"BarcodeScannerConfiguration",(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,"BarcodeScannerScreenConfiguration",(function(){return N})),n.d(t,"BarcodeScannerUiItem",(function(){return V})),n.d(t,"BarcodeScannerUiResult",(function(){return W})),n.d(t,"MultipleBarcodesScanningModeValues",(function(){return u})),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,"BarcodeItem",(function(){return M.a})),n.d(t,"BarcodeScannerEngineModeValues",(function(){return M.c})),n.d(t,"AcknowledgementModeValues",(function(){return z})),n.d(t,"AcknowledgementBottomBar",(function(){return j})),n.d(t,"AcknowledgementScreenConfiguration",(function(){return H})),n.d(t,"ShutterButton",(function(){return q})),n.d(t,"PreviewButton",(function(){return Y})),n.d(t,"ScanAssistanceOverlay",(function(){return K})),n.d(t,"PagePreviewMode",(function(){return J})),n.d(t,"TextButtonMode",(function(){return $})),n.d(t,"NoButtonMode",(function(){return ee})),n.d(t,"CameraBottomBar",(function(){return te})),n.d(t,"PageSnapFeedbackMode",(function(){return Q})),n.d(t,"PageSnapFunnelAnimation",(function(){return ne})),n.d(t,"PageSnapCheckMarkAnimation",(function(){return ie})),n.d(t,"PageSnapFeedbackNone",(function(){return oe})),n.d(t,"CaptureFeedback",(function(){return re})),n.d(t,"DocumentPolygonConfiguration",(function(){return ae})),n.d(t,"SelectCameraMenu",(function(){return se})),n.d(t,"CameraScreenConfiguration",(function(){return ce})),n.d(t,"CroppingBottomBar",(function(){return le})),n.d(t,"CroppingScreenConfiguration",(function(){return ue})),n.d(t,"DocumentScannerCameraConfiguration",(function(){return U})),n.d(t,"UserGuidanceVisibilityValues",(function(){return de})),n.d(t,"DocumentAnalysisModeValues",(function(){return he})),n.d(t,"DocumentScannerOutputSettings",(function(){return fe})),n.d(t,"DocumentScannerScreens",(function(){return ye})),n.d(t,"DocumentScannerTextLocalization",(function(){return be})),n.d(t,"UserGuidanceStates",(function(){return Z})),n.d(t,"DocumentScannerUserGuidance",(function(){return G})),n.d(t,"DocumentFlowAppearanceConfiguration",(function(){return Ae})),n.d(t,"DocumentScanningFlow",(function(){return Se})),n.d(t,"IntroListEntry",(function(){return X.g})),n.d(t,"IntroImage",(function(){return X.f})),n.d(t,"NoIntroImage",(function(){return X.j})),n.d(t,"ReceiptsIntroImage",(function(){return X.k})),n.d(t,"MedicalCertificateIntroImage",(function(){return X.i})),n.d(t,"DocumentIntroImage",(function(){return X.d})),n.d(t,"CheckIntroImage",(function(){return X.a})),n.d(t,"IdCardIntroImage",(function(){return X.e})),n.d(t,"CreditCardIntroImage",(function(){return X.b})),n.d(t,"CustomImage",(function(){return X.c})),n.d(t,"IntroductionScreenConfiguration",(function(){return X.h})),n.d(t,"ReviewBottomBarConfiguration",(function(){return pe})),n.d(t,"ReviewMorePopupMenu",(function(){return ge})),n.d(t,"ZoomOverlay",(function(){return ve})),n.d(t,"ReviewScreenConfiguration",(function(){return Ce})),n.d(t,"Resolution",(function(){return T})),n.d(t,"CameraModuleValues",(function(){return B})),n.d(t,"CameraConfiguration",(function(){return I})),n.d(t,"TopBarConfiguration",(function(){return R.a})),n.d(t,"TopBarModeValues",(function(){return R.b})),n.d(t,"ActionBarConfiguration",(function(){return x})),n.d(t,"ScanbotAlertDialog",(function(){return C})),n.d(t,"CameraPermissionScreen",(function(){return k})),n.d(t,"OcrResult",(function(){return we.h})),n.d(t,"FieldValidationStatusValues",(function(){return we.e})),n.d(t,"FieldDataFormatValues",(function(){return we.b})),n.d(t,"FieldParsedData",(function(){return we.c})),n.d(t,"FieldType",(function(){return we.d})),n.d(t,"Field",(function(){return we.a})),n.d(t,"GenericDocumentType",(function(){return we.g})),n.d(t,"GenericDocument",(function(){return we.f})),n.d(t,"Palette",(function(){return o.i})),n.d(t,"StyledText",(function(){return o.o})),n.d(t,"IconStyle",(function(){return o.h})),n.d(t,"IconButton",(function(){return o.g})),n.d(t,"PolygonStyle",(function(){return o.j})),n.d(t,"BackgroundStyle",(function(){return o.a})),n.d(t,"ForegroundStyle",(function(){return o.f})),n.d(t,"BadgeStyle",(function(){return o.b})),n.d(t,"RoundButton",(function(){return o.l})),n.d(t,"BadgedButton",(function(){return o.c})),n.d(t,"ButtonConfiguration",(function(){return o.e})),n.d(t,"PopupMenuItem",(function(){return o.k})),n.d(t,"BarButtonConfiguration",(function(){return o.d})),n.d(t,"SoundTypeValues",(function(){return o.n})),n.d(t,"Sound",(function(){return o.m})),n.d(t,"Vibration",(function(){return o.q})),n.d(t,"Timeouts",(function(){return o.p})),n.d(t,"ViewFinderConfiguration",(function(){return O})),n.d(t,"FinderStyle",(function(){return L})),n.d(t,"FinderCorneredStyle",(function(){return P})),n.d(t,"FinderStrokedStyle",(function(){return _})),n.d(t,"UserGuidanceConfiguration",(function(){return F.b})),n.d(t,"IconUserGuidanceConfiguration",(function(){return F.a})),n.d(t,"NavigationBarModeValues",(function(){return Ee}));var i=n(10),o=n(1),r=n(6);class a extends r.a{constructor(e={}){super(),this.title=new o.o({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new o.o({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 o.e({}),this.cancelButton=new o.e({}),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.subtitle&&(this.subtitle=new o.o(e.subtitle)),void 0!==e.retryButton&&(this.retryButton=new o.e(e.retryButton)),void 0!==e.cancelButton&&(this.cancelButton=new o.e(e.cancelButton))}}class s extends r.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 r.a{constructor(e={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new o.o({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 o.o(e.loadingMessage)),void 0!==e.errorState&&(this.errorState=new a(e.errorState))}}class l extends r.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 o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new o.o({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new o.e({visible:!0,text:"?sheetSubmitButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new o.e({visible:!0,text:"?singleModeConfirmationCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new c({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new o.o({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new o.o({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new o.e({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new o.e({text:"?barcodeInfoMappingErrorStateCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new i.b({visible:!1,counterBadge:new o.b({visible:!0,background:new o.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new i.c({visible:!0,deselected:new o.j({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new o.j({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new i.d({imageVisible:!0,titleSelected:new o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new o.o({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new o.o({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new o.j({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new o.j({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 o.o(e.barcodeTitle)),void 0!==e.barcodeSubtitle&&(this.barcodeSubtitle=new o.o(e.barcodeSubtitle)),void 0!==e.submitButton&&(this.submitButton=new o.e(e.submitButton)),void 0!==e.cancelButton&&(this.cancelButton=new o.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 u=["COUNTING","UNIQUE"],d=["BUTTON","COLLAPSED_SHEET"],m=["SMALL","LARGE"];class h extends r.a{constructor(e={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new o.c({}),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.collapsedVisibleHeight&&(this.collapsedVisibleHeight=e.collapsedVisibleHeight),void 0!==e.listButton&&(this.listButton=new o.c(e.listButton))}}class f extends r.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 r.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new o.o({text:"Update count",color:"?sbColorOnSurface"}),this.info=new o.o({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new o.e({visible:!0,text:"Update",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new o.e({visible:!0,text:"Cancel",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new o.h({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 o.o(e.title)),void 0!==e.info&&(this.info=new o.o(e.info)),void 0!==e.updateButton&&(this.updateButton=new o.e(e.updateButton)),void 0!==e.cancelButton&&(this.cancelButton=new o.e(e.cancelButton)),void 0!==e.clearTextButton&&(this.clearTextButton=new o.h(e.clearTextButton))}}class g extends r.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new o.o({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new o.e({visible:!0,text:"Clear all",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new o.o({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new o.o({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new o.e({visible:!0,text:"Submit",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new o.e({visible:!0,text:"Start scanning",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new o.o({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new o.o({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 o.h({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 o.o(e.title)),void 0!==e.clearAllButton&&(this.clearAllButton=new o.e(e.clearAllButton)),void 0!==e.barcodeItemTitle&&(this.barcodeItemTitle=new o.o(e.barcodeItemTitle)),void 0!==e.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new o.o(e.barcodeItemSubtitle)),void 0!==e.barcodeItemImageVisible&&(this.barcodeItemImageVisible=e.barcodeItemImageVisible),void 0!==e.submitButton&&(this.submitButton=new o.e(e.submitButton)),void 0!==e.startScanningButton&&(this.startScanningButton=new o.e(e.startScanningButton)),void 0!==e.placeholderTitle&&(this.placeholderTitle=new o.o(e.placeholderTitle)),void 0!==e.placeholderSubtitle&&(this.placeholderSubtitle=new o.o(e.placeholderSubtitle)),void 0!==e.placeholderIconBackground&&(this.placeholderIconBackground=e.placeholderIconBackground),void 0!==e.placeholderIcon&&(this.placeholderIcon=new o.h(e.placeholderIcon)),void 0!==e.swipeToDelete&&(this.swipeToDelete=new f(e.swipeToDelete))}}class v extends r.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 o.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 o.o({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new o.e({visible:!0,text:"?sheetClearAllButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new o.o({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new o.o({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new o.e({visible:!0,text:"?sheetSubmitButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new o.e({visible:!0,text:"?sheetStartScanningButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new o.o({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new o.o({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new o.h({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 o.o({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new o.o({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new o.e({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?manualCountEditDialogCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new o.h({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new c({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new o.o({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new o.o({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new o.e({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new i.b({visible:!1,counterBadge:new o.b({visible:!0,background:new o.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new i.c({visible:!0,deselected:new o.j({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new o.j({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new i.d({imageVisible:!0,titleSelected:new o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new o.o({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new o.o({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new o.o({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new o.j({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new o.j({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 C extends r.a{constructor(e={}){super(),this.title=new o.o({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new o.o({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",this.okButton=new o.e({background:new o.a({fillColor:"?sbColorPrimary"})}),this.actionButton=new o.e({visible:!1,background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),this.cancelButton=new o.e({visible:!0,background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.subtitle&&(this.subtitle=new o.o(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 o.e(e.okButton)),void 0!==e.actionButton&&(this.actionButton=new o.e(e.actionButton)),void 0!==e.cancelButton&&(this.cancelButton=new o.e(e.cancelButton))}}class y extends r.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 r.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 o.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 o.o({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new o.e({visible:!0,text:"?sheetResetButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new o.o({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new o.o({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new o.e({visible:!0,text:"?sheetSubmitButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new o.e({visible:!0,text:"?sheetStartScanningButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new o.o({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new o.o({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new o.h({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 o.o({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new o.o({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new o.e({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?manualCountEditDialogCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new o.h({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new i.a({visible:!0,automaticSelectionEnabled:!0,polygon:new i.f({partiallyScanned:new o.j({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new o.j({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new o.j({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new i.g({partiallyScanned:new o.b({visible:!0,background:new o.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new o.b({visible:!0,background:new o.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new o.b({visible:!0,background:new o.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new C({title:new o.o({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new o.e({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new C({title:new o.o({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new o.e({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new o.e({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new o.f({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 y(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 C(e.partialScannedAlertDialog)),void 0!==e.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=e.confirmationAlertDialogEnabled),void 0!==e.confirmationAlertDialog&&(this.confirmationAlertDialog=new C(e.confirmationAlertDialog))}}var A;(A||(A={})).From=function(e){const t=e._type;switch(t){case"SingleScanningMode":return new l(e);case"MultipleScanningMode":return new v(e);case"FindAndPickScanningMode":return new b(e);default:throw`Unknown child class name: ${t}`}};class S extends r.a{constructor(e={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",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.findAndPickCompleteAlertSubmitButton="Submit",void 0!==e.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=e.cameraPermissionEnableCameraTitle),void 0!==e.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=e.cameraPermissionEnableCameraExplanation),void 0!==e.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=e.cameraPermissionCloseButton),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.findAndPickCompleteAlertSubmitButton&&(this.findAndPickCompleteAlertSubmitButton=e.findAndPickCompleteAlertSubmitButton)}}const w=["NO_FILTER","ONLY_WITH_EXTENSIONS","ONLY_WITHOUT_EXTENSIONS"];class E extends r.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.barcodesExtensionFilter="NO_FILTER",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,void 0!==e.extractedDocumentFormats&&(this.extractedDocumentFormats=e.extractedDocumentFormats.map((e=>e))),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)}}class x extends r.a{constructor(e={}){super(),this.flashButton=new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==e.flashButton&&(this.flashButton=new o.l(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new o.l(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new o.l(e.flipCameraButton))}}var D=n(21);class T extends r.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 B=["FRONT","BACK"];class I extends r.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new T({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 T(e.idealPreviewResolution))}}class k extends r.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new o.h({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new o.e({text:"Close",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.enableCameraTitle=new o.o({text:"Camera permission denied!",color:"?sbColorOnSurface"}),this.enableCameraExplanation=new o.o({text:"Please allow the usage of the camera to start the scanning process.",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 o.h(e.icon)),void 0!==e.closeButton&&(this.closeButton=new o.e(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new o.o(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new o.o(e.enableCameraExplanation))}}class O extends r.a{constructor(e={}){super(),this.visible=!0,this.style=new P({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new D.a({width:1,height:1}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.style&&(this.style=L.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new D.a(e.aspectRatio))}}var L;!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new P(e);case"FinderStrokedStyle":return new _(e);default:throw`Unknown child class name: ${t}`}}}(L||(L={}));class P extends r.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 _ extends r.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 R=n(30),F=n(15);class N extends r.a{constructor(e={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new o.i({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 R.a({title:new o.o({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new o.e({visible:!0,text:"?topBarCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new x({flashButton:new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new o.l({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new O({visible:!0,style:new P({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new D.a({width:1,height:1})}),this.userGuidance=new F.b({visible:!0,title:new o.o({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new o.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new k({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new o.h({visible:!0,color:"?sbColorOnSurface"}),closeButton:new o.e({visible:!0,text:"?cameraPermissionCloseButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new o.o({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new o.o({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new I({}),this.scannerConfiguration=new E({}),this.useCase=new l({}),this.sound=new o.m({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new o.q({enabled:!0}),this.timeouts=new o.p({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 o.i(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 R.a(e.topBar)),void 0!==e.actionBar&&(this.actionBar=new x(e.actionBar)),void 0!==e.viewFinder&&(this.viewFinder=new O(e.viewFinder)),void 0!==e.userGuidance&&(this.userGuidance=new F.b(e.userGuidance)),void 0!==e.cameraPermission&&(this.cameraPermission=new k(e.cameraPermission)),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new I(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 o.m(e.sound)),void 0!==e.vibration&&(this.vibration=new o.q(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new o.p(e.timeouts))}}var M=n(36);class V extends r.a{constructor(e={}){if(super(),void 0===e.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new M.a(e.barcode),void 0===e.count)throw new Error("count must be present in constructor argument");this.count=e.count}}class W extends r.a{constructor(e={}){super(),this.items=[],void 0!==e.items&&(this.items=e.items.map((e=>new V(e))))}}const z=["BAD_QUALITY","ALWAYS","NONE"];class j extends r.a{constructor(e={}){super(),this.retakeButton=new o.d({title:new o.o({text:"?acknowledgementRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementRetakeButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.acceptWhenOkButton=new o.d({title:new o.o({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.acceptWhenNotOkButton=new o.d({title:new o.o({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),void 0!==e.retakeButton&&(this.retakeButton=new o.d(e.retakeButton)),void 0!==e.acceptWhenOkButton&&(this.acceptWhenOkButton=new o.d(e.acceptWhenOkButton)),void 0!==e.acceptWhenNotOkButton&&(this.acceptWhenNotOkButton=new o.d(e.acceptWhenNotOkButton))}}class H extends r.a{constructor(e={}){super(),this.topBarTitle=new o.o({visible:!1,text:"?acknowledgementTitle",color:"?sbColorOnPrimary"}),this.minimumQuality="POOR",this.acknowledgementMode="ALWAYS",this.badImageHint=new F.a({visible:!0,icon:new o.h({color:"?sbColorOnPrimary"}),title:new o.o({text:"?acknowledgementScreenBadDocumentHint",color:"?sbColorOnPrimary"}),background:new o.a({strokeColor:"?sbColorNegative",fillColor:"?sbColorNegative",strokeWidth:0})}),this.backgroundColor="?sbColorOutline",this.bottomBar=new j({}),void 0!==e.topBarTitle&&(this.topBarTitle=new o.o(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 F.a(e.badImageHint)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new j(e.bottomBar))}}class U extends r.a{constructor(e={}){super(),this.cameraModule="BACK",this.autoCropOnManualSnap=!0,this.flashEnabled=!1,this.idealPreviewResolution=new T({width:1920,height:1080}),this.acceptedAngleScore=.75,this.acceptedSizeScore=.75,this.autoSnappingSensitivity=.66,this.autoSnappingDelay=200,this.acceptedBrightnessThreshold=50,this.autoSnappingEnabled=!0,this.requiredAspectRatios=[],this.ignoreBadAspectRatio=!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 T(e.idealPreviewResolution)),void 0!==e.acceptedAngleScore&&(this.acceptedAngleScore=e.acceptedAngleScore),void 0!==e.acceptedSizeScore&&(this.acceptedSizeScore=e.acceptedSizeScore),void 0!==e.autoSnappingSensitivity&&(this.autoSnappingSensitivity=e.autoSnappingSensitivity),void 0!==e.autoSnappingDelay&&(this.autoSnappingDelay=e.autoSnappingDelay),void 0!==e.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=e.acceptedBrightnessThreshold),void 0!==e.autoSnappingEnabled&&(this.autoSnappingEnabled=e.autoSnappingEnabled),void 0!==e.requiredAspectRatios&&(this.requiredAspectRatios=e.requiredAspectRatios.map((e=>new D.a(e)))),void 0!==e.ignoreBadAspectRatio&&(this.ignoreBadAspectRatio=e.ignoreBadAspectRatio)}}class Z extends r.a{constructor(e={}){super(),this.noDocumentFound="?cameraUserGuidanceNoDocumentFound",this.badAspectRatio="?cameraUserGuidanceBadAspectRatio",this.badAngles="?cameraUserGuidanceBadAngles",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.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 G extends r.a{constructor(e={}){super(),this.visibility="ENABLED",this.title=new o.o({text:"?cameraUserGuidanceStart",color:"?sbColorOnPrimary"}),this.background=new o.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceHigh"}),this.statesTitles=new Z({}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.background&&(this.background=new o.a(e.background)),void 0!==e.statesTitles&&(this.statesTitles=new Z(e.statesTitles))}}var Y,Q,X=n(16);class q extends r.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 J(e);case"TextButtonMode":return new $(e);case"NoButtonMode":return new ee(e);default:throw`Unknown child class name: ${t}`}}}(Y||(Y={}));class K extends r.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 J extends r.a{constructor(e={}){super(),this._type="PagePreviewMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.imagePlaceholderColor="?sbColorOnSurfaceVariant",this.pageCounter=new o.b({visible:!0,background:new o.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 o.b(e.pageCounter))}}class $ extends r.a{constructor(e={}){super(),this._type="TextButtonMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.style=new o.o({text:"?cameraPreviewButtonTitle",color:"?sbColorOnPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.style&&(this.style=new o.o(e.style))}}class ee extends r.a{constructor(e={}){super(),this._type="NoButtonMode",this.visible=!1,void 0!==e.visible&&(this.visible=e.visible)}}class te extends r.a{constructor(e={}){super(),this.importButton=new o.d({title:new o.o({visible:!1,text:"?cameraImportButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraImportButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.autoSnappingModeButton=new o.d({title:new o.o({visible:!1,text:"?cameraAutoSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraAutoSnapButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.manualSnappingModeButton=new o.d({title:new o.o({visible:!1,text:"?cameraManualSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraManualSnapButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.shutterButton=new q({accessibilityDescription:"?accessibilityDescriptionCameraShutterButton"}),this.torchOnButton=new o.d({title:new o.o({visible:!1,text:"?cameraTorchOnButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOnButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.torchOffButton=new o.d({title:new o.o({visible:!1,text:"?cameraTorchOffButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOffButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.previewButton=new J({}),void 0!==e.importButton&&(this.importButton=new o.d(e.importButton)),void 0!==e.autoSnappingModeButton&&(this.autoSnappingModeButton=new o.d(e.autoSnappingModeButton)),void 0!==e.manualSnappingModeButton&&(this.manualSnappingModeButton=new o.d(e.manualSnappingModeButton)),void 0!==e.shutterButton&&(this.shutterButton=new q(e.shutterButton)),void 0!==e.torchOnButton&&(this.torchOnButton=new o.d(e.torchOnButton)),void 0!==e.torchOffButton&&(this.torchOffButton=new o.d(e.torchOffButton)),void 0!==e.previewButton&&(this.previewButton=Y.From(e.previewButton))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PageSnapFunnelAnimation":return new ne(e);case"PageSnapCheckMarkAnimation":return new ie(e);case"PageSnapFeedbackNone":return new oe(e);default:throw`Unknown child class name: ${t}`}}}(Q||(Q={}));class ne extends r.a{constructor(e={}){super(),this._type="PageSnapFunnelAnimation",this.overlayColor="?sbColorModalOverlay",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor)}}class ie extends r.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 oe extends r.a{constructor(e={}){super(),this._type="PageSnapFeedbackNone"}}class re extends r.a{constructor(e={}){super(),this.cameraBlinkEnabled=!0,this.snapFeedbackMode=new ne({}),void 0!==e.cameraBlinkEnabled&&(this.cameraBlinkEnabled=e.cameraBlinkEnabled),void 0!==e.snapFeedbackMode&&(this.snapFeedbackMode=Q.From(e.snapFeedbackMode))}}class ae extends r.a{constructor(e={}){super(),this.visibility="ENABLED",this.documentOk=new o.j({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2}),this.documentNotOk=new o.j({strokeColor:"?sbColorNegative",fillColor:"#00000000",strokeWidth:2}),this.autoSnapProgress=new o.j({strokeColor:"#40A9FF",fillColor:"#00000000",strokeWidth:2}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.documentOk&&(this.documentOk=new o.j(e.documentOk)),void 0!==e.documentNotOk&&(this.documentNotOk=new o.j(e.documentNotOk)),void 0!==e.autoSnapProgress&&(this.autoSnapProgress=new o.j(e.autoSnapProgress))}}class se extends r.a{constructor(e={}){super(),this.button=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraSelectButton"}),this.backgroundColor="?sbColorSurface",this.title=new o.o({text:"?cameraSelectCameraMenuTitle",color:"?sbColorOnSurfaceVariant"}),this.dividerColor="?sbColorOutline",this.menuEntry=new o.k({title:new o.o({color:"?sbColorOnSurface"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new o.h({color:"?sbColorOnSurface"})}),this.menuEntryActive=new o.k({title:new o.o({color:"?sbColorPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new o.h({color:"?sbColorPrimary"})}),void 0!==e.button&&(this.button=new o.g(e.button)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.menuEntry&&(this.menuEntry=new o.k(e.menuEntry)),void 0!==e.menuEntryActive&&(this.menuEntryActive=new o.k(e.menuEntryActive))}}class ce extends r.a{constructor(e={}){super(),this.acknowledgement=new H({}),this.introduction=new X.h({}),this.scanAssistanceOverlay=new K({}),this.cameraPermission=new k({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new o.h({visible:!0,color:"?sbColorOnSurface"}),closeButton:new o.e({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new o.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),enableCameraTitle:new o.o({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new o.o({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.topBarTitle=new o.o({text:"?cameraTopBarTitle",color:"?sbColorOnPrimary"}),this.topBarIntroButton=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraTopBarIntroButton"}),this.topBarBackButton=new o.e({visible:!0,text:"?cameraTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraTopBarCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarCameraSelect=new se({}),this.topUserGuidance=new F.b({title:new o.o({text:"?cameraTopGuidance",color:"?sbColorOnPrimary"})}),this.userGuidance=new G({}),this.backgroundColor="#000000FF",this.cameraConfiguration=new U({}),this.polygon=new ae({}),this.bottomBar=new te({}),this.viewFinder=new O({visible:!1,aspectRatio:new D.a({width:21,height:29})}),this.captureFeedback=new re({}),this.vibration=new o.q({enabled:!0}),this.timeouts=new o.p({autoCancelTimeout:0,initialScanDelay:0}),this.limitReachedAlertDialog=new C({title:new o.o({text:"?cameraLimitReachedAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?cameraLimitReachedAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new o.e({text:"?cameraLimitReachedOkButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraLimitReachedOkButton",background:new o.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),cancelButton:new o.e({visible:!1})}),this.cancelAlertDialog=new C({title:new o.o({text:"?cameraCancelAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?cameraCancelAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new o.e({text:"?cameraCancelYesButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelYesButton",background:new o.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),cancelButton:new o.e({text:"?cameraCancelNoButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelNoButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorPrimary"})})}),void 0!==e.acknowledgement&&(this.acknowledgement=new H(e.acknowledgement)),void 0!==e.introduction&&(this.introduction=new X.h(e.introduction)),void 0!==e.scanAssistanceOverlay&&(this.scanAssistanceOverlay=new K(e.scanAssistanceOverlay)),void 0!==e.cameraPermission&&(this.cameraPermission=new k(e.cameraPermission)),void 0!==e.topBarTitle&&(this.topBarTitle=new o.o(e.topBarTitle)),void 0!==e.topBarIntroButton&&(this.topBarIntroButton=new o.g(e.topBarIntroButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new o.e(e.topBarBackButton)),void 0!==e.topBarCameraSelect&&(this.topBarCameraSelect=new se(e.topBarCameraSelect)),void 0!==e.topUserGuidance&&(this.topUserGuidance=new F.b(e.topUserGuidance)),void 0!==e.userGuidance&&(this.userGuidance=new G(e.userGuidance)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new U(e.cameraConfiguration)),void 0!==e.polygon&&(this.polygon=new ae(e.polygon)),void 0!==e.bottomBar&&(this.bottomBar=new te(e.bottomBar)),void 0!==e.viewFinder&&(this.viewFinder=new O(e.viewFinder)),void 0!==e.captureFeedback&&(this.captureFeedback=new re(e.captureFeedback)),void 0!==e.vibration&&(this.vibration=new o.q(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new o.p(e.timeouts)),void 0!==e.limitReachedAlertDialog&&(this.limitReachedAlertDialog=new C(e.limitReachedAlertDialog)),void 0!==e.cancelAlertDialog&&(this.cancelAlertDialog=new C(e.cancelAlertDialog))}}class le extends r.a{constructor(e={}){super(),this.detectButton=new o.d({title:new o.o({text:"?croppingDetectButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingDetectButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.rotateButton=new o.d({title:new o.o({text:"?croppingRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingRotateButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.resetButton=new o.d({title:new o.o({text:"?croppingResetButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingResetButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),void 0!==e.detectButton&&(this.detectButton=new o.d(e.detectButton)),void 0!==e.rotateButton&&(this.rotateButton=new o.d(e.rotateButton)),void 0!==e.resetButton&&(this.resetButton=new o.d(e.resetButton))}}class ue extends r.a{constructor(e={}){super(),this.topBarBackButton=new o.e({visible:!0,text:"?croppingTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarCancelButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarTitle=new o.o({text:"?croppingScreenTitle",color:"?sbColorOnPrimary"}),this.topBarConfirmButton=new o.e({visible:!0,text:"?croppingTopBarConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarConfirmButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.backgroundColor="?sbColorOutline",this.croppingHandlerColor="?sbColorSurface",this.croppingPolygonColor="?sbColorSurface",this.croppingPolygonMagneticLineColor="?sbColorSurface",this.bottomBar=new le({}),void 0!==e.topBarBackButton&&(this.topBarBackButton=new o.e(e.topBarBackButton)),void 0!==e.topBarTitle&&(this.topBarTitle=new o.o(e.topBarTitle)),void 0!==e.topBarConfirmButton&&(this.topBarConfirmButton=new o.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 le(e.bottomBar))}}const de=["ENABLED","AUTO_CAPTURE_ONLY","DISABLED"];var me=n(40);const he=["FILTERED_DOCUMENT","UNFILTERED_DOCUMENT"];class fe extends r.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?me.a.From(e.defaultFilter):null)}}class pe extends r.a{constructor(e={}){super(),this.addButton=new o.d({title:new o.o({text:"?reviewScreenAddButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewAddButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.retakeButton=new o.d({title:new o.o({text:"?reviewScreenRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRetakeButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.cropButton=new o.d({title:new o.o({text:"?reviewScreenCropButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewCropButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.rotateButton=new o.d({title:new o.o({text:"?reviewScreenRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRotateButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.deleteButton=new o.d({title:new o.o({text:"?reviewScreenDeleteButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new o.h({color:"?sbColorOnPrimary"})}),this.submitButton=new o.e({text:"?reviewScreenSubmitButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewSubmitButton",background:new o.a({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnSurface"})}),void 0!==e.addButton&&(this.addButton=new o.d(e.addButton)),void 0!==e.retakeButton&&(this.retakeButton=new o.d(e.retakeButton)),void 0!==e.cropButton&&(this.cropButton=new o.d(e.cropButton)),void 0!==e.rotateButton&&(this.rotateButton=new o.d(e.rotateButton)),void 0!==e.deleteButton&&(this.deleteButton=new o.d(e.deleteButton)),void 0!==e.submitButton&&(this.submitButton=new o.e(e.submitButton))}}class ge extends r.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.deleteAll=new o.k({title:new o.o({text:"?reviewScreenDeleteAllButtonTitle",color:"?sbColorNegative"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllButton",icon:new o.h({color:"?sbColorNegative"})}),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.deleteAll&&(this.deleteAll=new o.k(e.deleteAll))}}class ve extends r.a{constructor(e={}){super(),this.overlayColor="?sbColorModalOverlay",this.closeButton=new o.e({text:"?zoomOverlayCancelButtonText",accessibilityDescription:"?accessibilityDescriptionZoomOverlayCancelButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.closeButton&&(this.closeButton=new o.e(e.closeButton))}}class Ce extends r.a{constructor(e={}){super(),this.enabled=!0,this.topBarTitle=new o.o({text:"?reviewScreenTitle",color:"?sbColorOnPrimary"}),this.topBarMoreButton=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewMoreButton"}),this.topBarBackButton=new o.e({visible:!0,text:"?reviewTopBarBackButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewTopBarBackButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.morePopup=new ge({}),this.zoomButton=new o.l({accessibilityDescription:"?accessibilityDescriptionReviewZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary"}),this.zoomOverlay=new ve({}),this.backgroundColor="?sbColorOnSurfaceVariant",this.bottomBar=new pe({}),this.switchNextPageButton=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewNextPageButton"}),this.switchPreviousPageButton=new o.g({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewPreviousPageButton"}),this.pageCounter=new F.b({title:new o.o({text:"?reviewScreenPageCount",color:"?sbColorOnPrimary"}),background:new o.a({fillColor:"?sbColorSurfaceHigh",strokeWidth:0})}),this.deleteAllPagesAlertDialog=new C({title:new o.o({text:"?reviewDeleteAllPagesAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?reviewDeleteAllPagesAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new o.e({text:"?reviewDeleteAllPagesAlertDeleteButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton",background:new o.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),actionButton:new o.e({visible:!1}),cancelButton:new o.e({text:"?reviewDeleteAllPagesAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorPrimary"})})}),this.deletePageAlertDialog=new C({title:new o.o({text:"?reviewDeletePageAlertTitle",color:"?sbColorOnSurface"}),subtitle:new o.o({text:"?reviewDeletePageAlertSubTitle",color:"?sbColorOnSurfaceVariant"}),okButton:new o.e({text:"?reviewDeletePageAlertConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertConfirmButton",background:new o.a({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new o.f({color:"?sbColorOnPrimary"})}),actionButton:new o.e({text:"?reviewDeletePageAlertDeleteRetakeButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorPrimary"})}),cancelButton:new o.e({text:"?reviewDeletePageAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertCancelButton",background:new o.a({fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({color:"?sbColorPrimary"})})}),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.topBarTitle&&(this.topBarTitle=new o.o(e.topBarTitle)),void 0!==e.topBarMoreButton&&(this.topBarMoreButton=new o.g(e.topBarMoreButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new o.e(e.topBarBackButton)),void 0!==e.morePopup&&(this.morePopup=new ge(e.morePopup)),void 0!==e.zoomButton&&(this.zoomButton=new o.l(e.zoomButton)),void 0!==e.zoomOverlay&&(this.zoomOverlay=new ve(e.zoomOverlay)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new pe(e.bottomBar)),void 0!==e.switchNextPageButton&&(this.switchNextPageButton=new o.g(e.switchNextPageButton)),void 0!==e.switchPreviousPageButton&&(this.switchPreviousPageButton=new o.g(e.switchPreviousPageButton)),void 0!==e.pageCounter&&(this.pageCounter=new F.b(e.pageCounter)),void 0!==e.deleteAllPagesAlertDialog&&(this.deleteAllPagesAlertDialog=new C(e.deleteAllPagesAlertDialog)),void 0!==e.deletePageAlertDialog&&(this.deletePageAlertDialog=new C(e.deletePageAlertDialog))}}class ye extends r.a{constructor(e={}){super(),this.camera=new ce({}),this.review=new Ce({}),this.cropping=new ue({}),void 0!==e.camera&&(this.camera=new ce(e.camera)),void 0!==e.review&&(this.review=new Ce(e.review)),void 0!==e.cropping&&(this.cropping=new ue(e.cropping))}}class be extends r.a{constructor(e={}){super(),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.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.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.reorderPageTitle="Reorder Pages",this.acknowledgementTitle="Acknowledgement",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.accessibilityDescriptionCameraPermissionEnableCameraButton="Tap to grant camera permission",this.accessibilityDescriptionCameraPermissionCloseButton="Close screen without granting permission",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 regarding the 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",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.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.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.reorderPageTitle&&(this.reorderPageTitle=e.reorderPageTitle),void 0!==e.acknowledgementTitle&&(this.acknowledgementTitle=e.acknowledgementTitle),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.accessibilityDescriptionCameraPermissionEnableCameraButton&&(this.accessibilityDescriptionCameraPermissionEnableCameraButton=e.accessibilityDescriptionCameraPermissionEnableCameraButton),void 0!==e.accessibilityDescriptionCameraPermissionCloseButton&&(this.accessibilityDescriptionCameraPermissionCloseButton=e.accessibilityDescriptionCameraPermissionCloseButton),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)}}class Ae extends r.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 Se extends r.a{constructor(e={}){super(),this.version="1.0",this.screen="DocumentScanner",this.palette=new o.i({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 be({}),this.appearance=new Ae({}),this.outputSettings=new fe({}),this.screens=new ye({}),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 o.i(e.palette)),void 0!==e.localization&&(this.localization=new be(e.localization)),void 0!==e.appearance&&(this.appearance=new Ae(e.appearance)),void 0!==e.outputSettings&&(this.outputSettings=new fe(e.outputSettings)),void 0!==e.screens&&(this.screens=new ye(e.screens)),void 0!==e.documentUuid&&(this.documentUuid=null!=e.documentUuid?e.documentUuid:null),void 0!==e.cleanScanningSession&&(this.cleanScanningSession=e.cleanScanningSession)}}var we=n(20);const Ee=["DARK","LIGHT","HIDDEN"]},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var i=n(1),o=n(6);class r extends o.a{constructor(e={}){super(),this.visible=!0,this.title=new i.o({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.o(e.title)),void 0!==e.background&&(this.background=new i.a(e.background))}}class a extends o.a{constructor(e={}){super(),this.visible=!0,this.icon=new i.h({color:"?sbColorOnPrimary"}),this.title=new i.o({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.h(e.icon)),void 0!==e.title&&(this.title=new i.o(e.title)),void 0!==e.background&&(this.background=new i.a(e.background))}}},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,"k",(function(){return c})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return f})),n.d(t,"h",(function(){return p}));var i,o=n(1),r=n(6);class a extends r.a{constructor(e={}){super(),this.image=new s({}),this.text=new o.o({text:"?cameraIntroDescription",color:"?sbColorOnSurface"}),void 0!==e.image&&(this.image=i.From(e.image)),void 0!==e.text&&(this.text=new o.o(e.text))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"NoIntroImage":return new s(e);case"ReceiptsIntroImage":return new c(e);case"MedicalCertificateIntroImage":return new l(e);case"DocumentIntroImage":return new u(e);case"CheckIntroImage":return new d(e);case"IdCardIntroImage":return new m(e);case"CreditCardIntroImage":return new h(e);case"CustomImage":return new f(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class s extends r.a{constructor(e={}){super(),this._type="NoIntroImage"}}class c extends r.a{constructor(e={}){super(),this._type="ReceiptsIntroImage"}}class l extends r.a{constructor(e={}){super(),this._type="MedicalCertificateIntroImage"}}class u extends r.a{constructor(e={}){super(),this._type="DocumentIntroImage"}}class d extends r.a{constructor(e={}){super(),this._type="CheckIntroImage"}}class m extends r.a{constructor(e={}){super(),this._type="IdCardIntroImage"}}class h extends r.a{constructor(e={}){super(),this._type="CreditCardIntroImage"}}class f extends r.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 p extends r.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.showAutomatically=!1,this.topBarDoneButton=new o.e({visible:!0,text:"?cameraIntroDoneButton",accessibilityDescription:"?accessibilityDescriptionCameraIntroDoneButton",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.f({iconVisible:!0,color:"?sbColorPrimary",useShadow:!1})}),this.title=new o.o({text:"?cameraIntroTitle",color:"?sbColorOnSurface"}),this.subtitle=new o.o({text:"?cameraIntroSubtitle",color:"?sbColorOnSurface"}),this.items=[new a({image:new u({}),text:new o.o({text:"?cameraIntroItem1",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new o.o({text:"?cameraIntroItem2",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new o.o({text:"?cameraIntroItem3",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new o.o({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 o.e(e.topBarDoneButton)),void 0!==e.title&&(this.title=new o.o(e.title)),void 0!==e.subtitle&&(this.subtitle=new o.o(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,"h",(function(){return r})),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 l})),n.d(t,"a",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return m}));var i=n(38),o=n(5);class r extends o.a{constructor(e={}){if(super(),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","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 extends o.a{constructor(e={}){if(super(),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 l extends o.a{constructor(e={}){if(super(),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 u extends o.a{constructor(e={}){if(super(),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 l(e.type),void 0===e.value)throw new Error("value must be present in constructor argument");if(this.value=null!=e.value?new r(e.value):null,void 0!==e.confidenceWeight&&(this.confidenceWeight=e.confidenceWeight),void 0!==e.image&&(this.image=null!=e.image?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 extends o.a{constructor(e={}){if(super(),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 extends o.a{constructor(e={}){if(super(),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 u(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?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.d(t,"c",(function(){return o})),n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var i=n(5);class o extends i.a{constructor(e={}){if(super(),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 extends i.a{constructor(e={}){if(super(),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 a extends i.a{constructor(e={}){super(),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,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var i=n(13),o=n(14),r=n(4);function a(){const e=new o.BarcodeScannerScreenConfiguration;return e.viewFinder.overlayColor=Object(r.d)(e.viewFinder.overlayColor,e.palette),e.viewFinder.style.strokeColor=Object(r.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 o.BarcodeScannerScreenConfiguration;return e.userGuidance.background.fillColor=Object(r.d)(e.userGuidance.background.fillColor,e.palette),e.userGuidance.title.color=Object(r.d)(e.userGuidance.title.color,e.palette),e.userGuidance.title.text=Object(r.e)(e.userGuidance.title.text,[],e.localization),e.userGuidance}()}static mapFinderConfiguration(e,t){var n,o;i.a.mapValuesDeep(null!==(n=t.finder)&&void 0!==n?n:{},e.finder),i.a.mapValuesDeep(null!==(o=t.userGuidance)&&void 0!==o?o:{},e.userGuidance)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(9);class o{constructor(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}scaleDown(e){return new o(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 o(0,0,e,t)}static empty(){return new o(0,0,0,0)}static fromRect(e){return e?new o(e.x,e.y,e.width,e.height):o.empty()}static fromPoint(e,t){return new o(e.x-t/2,e.y-t/2,t,t)}static fromDOMRect(e){return new o(e.x,e.y,e.width,e.height)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(0),o=n(23),r=n(4),a=n(8);class s extends i.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(e){super(e),this.holePosition=o.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=e=>{var t,n,i,o;(null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)===(null===(n=e.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(i=this.props.padding)||void 0===i?void 0:i.minBottomPadding)===(null===(o=e.padding)||void 0===o?void 0:o.minBottomPadding)&&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){var 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,i,o;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,c=Math.max(20,(r-s)/2),l=Math.min(s,r-2*c),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=l,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-l/2;const d=(null===(e=this.guidanceText)||void 0===e?void 0:e.clientHeight)+this.guidanceTextTopPadding||0,m=Math.max(10,null!==(n=null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)&&void 0!==n?n:0),h=a-m-Math.max(10,null!==(o=null===(i=this.props.padding)||void 0===i?void 0:i.minBottomPadding)&&void 0!==o?o:0)-d;this.holePosition.height>h?(this.holePosition.height=h,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=m):this.holePosition.y=m+(h-this.holePosition.height)/1.9;const f=this.holeCanvas.getContext("2d");f.save(),this.drawBackground(f),f.globalCompositeOperation="destination-out",this.drawHole();const p=this.crosshairCanvas.getContext("2d");p.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),f.restore(),p.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=r.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,o=this.holePosition.width,r=this.holePosition.height;e.beginPath(),e.fillStyle="black",e.moveTo(n+t,i),e.arcTo(n+o,i,n+o,i+r,t),e.arcTo(n+o,i+r,n,i+r,t),e.arcTo(n,i+r,n,i,t),e.arcTo(n,i,n+o,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,o=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+o,c),e.lineTo(t+i,n+a),e.moveTo(t+i,n+o-a),e.arcTo(t+i,n+o,t,n+o,c),e.lineTo(t+i-a,n+o),e.moveTo(t,n+o-a),e.arcTo(t,n+o,t+i,n+o,c),e.lineTo(t+a,n+o),e.strokeStyle=r.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,o=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+o,a),e.moveTo(t+i,n+a),e.arcTo(t+i,n+o,t,n+o,a),e.moveTo(t+i-a,n+o),e.arcTo(t,n+o,t,n,a),e.moveTo(t,n+o-a),e.arcTo(t,n,t+i,n,a),e.strokeStyle=r.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:r.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:r.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},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(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var i=n(0),o=n(12),r=n(27),a=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 o.a.enumerateDevicesFailed()}else{const i={user:"front",environment:"back"},o=(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 o&&o in i){yield r.a.INSTANCE.load();const t=r.a.INSTANCE.getMainCamera(i[o]);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,r,s,c,l;return a(this,void 0,void 0,(function*(){if(o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())null===(t=(e=this.props).onError)||void 0===t||t.call(e,o.a.permissionDenied());else try{const e={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};if(!navigator.mediaDevices){const e=o.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,o;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(o=(i=this.props).onReady)||void 0===o||o.call(i)}))}catch(e){const t=o.a.mediaDeviceNotFound();return null===(s=(r=this.props).onError)||void 0===s||s.call(r,t),void console.error(t)}}catch(e){const t=o.a.createFromDOMException(e);return null===(l=(c=this.props).onError)||void 0===l||l.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(9),l=n(23),u=n(17),d=n(37);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 o=this.program=e.createProgram();e.attachShader(o,n),e.attachShader(o,i),e.linkProgram(o),e.useProgram(o),e.uniform1i(e.getUniformLocation(o,"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,o,r,a,s){let c,l;if(r=Math.floor(r),a=Math.floor(a),t=Math.floor(t),n=Math.floor(n),i=Math.floor(i),o=Math.floor(o),e instanceof HTMLVideoElement)[l,c]=[e.videoWidth,e.videoHeight];else{if(!(e instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[l,c]=[e.width,e.height]}(l<t+i||c<n+o)&&u.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=r,this.canvas.height=a,m.viewport(0,0,r,a);const h=[i/(r*l),o/(a*c)],f=[t/l,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)!==r*a*4&&(s=new Uint8ClampedArray(r*a*4),d.a.INSTANCE.values.set("WebGLNumBufferAllocations",(d.a.INSTANCE.values.get("WebGLNumBufferAllocations")||0)+1)),m.readPixels(0,0,r,a,m.RGBA,m.UNSIGNED_BYTE,s),new ImageData(s,r,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,o,r,a,s){return this.canvas.width=r,this.canvas.height=a,this.ctx.drawImage(e,t,n,i,o,0,0,r,a),this.ctx.getImageData(0,0,r,a)}}var f=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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){this._reusableImageBuffer=e}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);u.a.debug("Bitmap size: "+t.width*t.height);const i=this.windowSize(),o=t.height/(i.height+i.y),r=i.width*o,a=i.height*o,s=t.width/2-r/2,c=i.y*o,d=new l.a(s,c,r,a);return u.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:o}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const c=this.finderFrame||new l.a(0,0,r,a);if(c.width<=0||c.height<=0)return;const d=this.zoom(),m=(i-r/d)/2,h=(o-a/d)/2,f=c.x/s+m,p=c.y/s+h,g=this.finderFrame?s:d,v=c.width/g,C=c.height/g,y=this.calculateFrameSize(e,v,C);return n.getImageData(this.video,f,p,v,C,y.width,y.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 l.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:e,videoHeight:t}=this.video,n=this.video.getBoundingClientRect(),i=e,o=t,r=1;return n.width/n.height<=e/t?(r=n.height/t,r>0&&(i=n.width/r)):(r=n.width/e,r>0&&(o=n.height/r)),{clientVideoWidth:i,clientVideoHeight:o,coef:r}}calculateFrameSize(e,t,n){let i=t,o=n;if(e>0&&0!=t&&0!=n){const r=t/n;t>n?(i=t>e?e:t,o=i/r):(o=n>e?e:n,i=o*r)}return new c.a(i,o)}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=r.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";(function(e){n.d(t,"a",(function(){return Ge})),n.d(t,"b",(function(){return Ye}));var i=n(3),o=(n(49),n(0)),r=n(45),a=n.n(r),s=n(28),c=n(46),l="undefined"!=typeof e&&void 0!==e.env&&(e.env.REACT_APP_SC_ATTR||e.env.SC_ATTR)||"data-styled",u="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 C(e,t,n){return void 0===n&&(n=v),e.theme!==n.theme&&e.theme||t||n.theme}var y=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 x(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 D,T=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},B=function(e){return T(5381,e)};function I(e){return x(B(e)>>>0)}function k(e){return e.displayName||e.name||"Component"}function O(e){return"string"==typeof e&&!0}var L="function"==typeof Symbol&&Symbol.for,P=L?Symbol.for("react.memo"):60115,_=L?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},F={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},N={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},M=((D={})[_]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},D[P]=N,D);function V(e){return("type"in(t=e)&&t.type.$$typeof)===P?N:"$$typeof"in e?M[e.$$typeof]:R;var t}var W=Object.defineProperty,z=Object.getOwnPropertyNames,j=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 o=z(t);j&&(o=o.concat(j(t)));for(var r=V(e),a=V(t),s=0;s<o.length;++s){var c=o[s];if(!(c in F||n&&n[c]||a&&c in a||r&&c in r)){var l=H(t,c);try{W(e,c,l)}catch(e){}}}}return e}function Y(e){return"function"==typeof e}function Q(e){return"object"==typeof e&&"styledComponentId"in e}function X(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function q(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,o=i;e>=o;)if((o<<=1)<0)throw ee(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var r=i;r<o;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(e+1),s=(r=0,t.length);r<s;r++)this.tag.insertRule(a,t[r])&&(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 o=n;o<i;o++)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),o=i+n,r=i;r<o;r++)t+="".concat(this.tag.getRule(r)).concat(h);return t},e}(),ne=new Map,ie=new Map,oe=1,re=function(e){if(ne.has(e))return ne.get(e);for(;ie.has(oe);)oe++;var t=oe++;return ne.set(e,t),ie.set(t,e),t},ae=function(e,t){oe=t+1,ne.set(e,t),ie.set(t,e)},se="style[".concat(l,"][").concat(d,'="').concat(m,'"]'),ce=new RegExp("^".concat(l,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),le=function(e,t,n){for(var i,o=n.split(","),r=0,a=o.length;r<a;r++)(i=o[r])&&e.registerName(t,i)},ue=function(e,t){for(var n,i=(null!==(n=t.textContent)&&void 0!==n?n:"").split(h),o=[],r=0,a=i.length;r<a;r++){var s=i[r].trim();if(s){var c=s.match(ce);if(c){var l=0|parseInt(c[1],10),u=c[2];0!==l&&(ae(u,l),le(e,u,c[3]),e.getTag().insertRules(l,o)),o.length=0}else o.push(s)}}};function de(){return n.nc}var me=function(e){var t=document.head,n=e||t,i=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(l,"]")));return t[t.length-1]}(n),r=void 0!==o?o.nextSibling:null;i.setAttribute(l,u),i.setAttribute(d,m);var a=de();return a&&i.setAttribute("nonce",a),n.insertBefore(i,r),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 o=t[n];if(o.ownerNode===e)return o}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},Ce=function(){function e(e,t,n){void 0===e&&(e=v),void 0===t&&(t={});var o=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 o=t[n];o&&o.getAttribute(l)!==u&&(ue(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this)),$(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,i="",o=function(n){var o=function(e){return ie.get(e)}(n);if(void 0===o)return"continue";var r=e.names.get(o),a=t.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(l,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==r&&r.forEach((function(e){e.length>0&&(c+="".concat(e,","))})),i+="".concat(a).concat(s,'{content:"').concat(c,'"}').concat(h)},r=0;r<n;r++)o(r);return i}(o)}))}return e.registerId=function(e){return re(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(re(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(re(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(re(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),ye=/&/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,o=void 0===e?v:e,r=o.options,a=void 0===r?v:r,c=o.plugins,l=void 0===c?g:c,u=function(e,i,o){return o.startsWith(n)&&o.endsWith(n)&&o.replaceAll(n,"").length>0?".".concat(t):e},d=l.slice();d.push((function(e){e.type===s.a&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(ye,n).replace(i,u))})),a.prefix&&d.push(s.d),d.push(s.g);var m=function(e,o,r,c){void 0===o&&(o=""),void 0===r&&(r=""),void 0===c&&(c="&"),t=c,n=o,i=new RegExp("\\".concat(n,"\\b"),"g");var l=e.replace(be,""),u=s.b(r||o?"".concat(r," ").concat(o," { ").concat(l," }"):l);a.namespace&&(u=Ae(u,a.namespace));var m=[];return s.f(u,s.c(d.concat(s.e((function(e){return m.push(e)}))))),m};return m.hash=l.length?l.reduce((function(e,t){return t.name||ee(15),T(e,t.name)}),5381).toString():"",m}var we=new Ce,Ee=Se(),xe=o.default.createContext({shouldForwardProp:void 0,styleSheet:we,stylis:Ee}),De=(xe.Consumer,o.default.createContext(void 0));function Te(){return Object(o.useContext)(xe)}function Be(e){var t=Object(o.useState)(e.stylisPlugins),n=t[0],i=t[1],r=Te().styleSheet,s=Object(o.useMemo)((function(){var t=r;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,r]),c=Object(o.useMemo)((function(){return Se({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);Object(o.useEffect)((function(){a()(n,e.stylisPlugins)||i(e.stylisPlugins)}),[e.stylisPlugins]);var l=Object(o.useMemo)((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:s,stylis:c}}),[e.shouldForwardProp,s,c]);return o.default.createElement(xe.Provider,{value:l},o.default.createElement(De.Provider,{value:c},e.children))}var Ie=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}(),ke=function(e){return e>="A"&&e<="Z"};function Oe(e){for(var t="",n=0;n<e.length;n++){var i=e[n];if(1===n&&"-"===i&&"-"===e[0])return e;ke(i)?t+="-"+i.toLowerCase():t+=i}return t.startsWith("ms-")?"-"+t:t}var Le=function(e){return null==e||!1===e||""===e},Pe=function(e){var t,n,o=[];for(var r in e){var a=e[r];e.hasOwnProperty(r)&&!Le(a)&&(Array.isArray(a)&&a.isCss||Y(a)?o.push("".concat(Oe(r),":"),a,";"):K(a)?o.push.apply(o,Object(i.e)(Object(i.e)(["".concat(r," {")],Pe(a),!1),["}"],!1)):o.push("".concat(Oe(r),": ").concat((t=r,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 o};function _e(e,t,n,i){return Le(e)?[]:Q(e)?[".".concat(e.styledComponentId)]:Y(e)?!Y(o=e)||o.prototype&&o.prototype.isReactComponent||!t?[e]:_e(e(t),t,n,i):e instanceof Ie?n?(e.inject(n,i),[e.getName(i)]):[e]:K(e)?Pe(e):Array.isArray(e)?Array.prototype.concat.apply(g,e.map((function(e){return _e(e,t,n,i)}))):[e.toString()];var o}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 Fe=B(m),Ne=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=T(Fe,t),this.baseStyle=n,Ce.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=X(i,this.staticRulesId);else{var o=q(_e(this.rules,e,t,n)),r=x(T(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,r)){var a=n(o,".".concat(r),void 0,this.componentId);t.insertRules(this.componentId,r,a)}i=X(i,r),this.staticRulesId=r}else{for(var s=T(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u;else if(u){var d=q(_e(u,e,t,n));s=T(s,d+l),c+=d}}if(c){var m=x(s>>>0);t.hasNameForId(this.componentId,m)||t.insertRules(this.componentId,m,n(c,".".concat(m),void 0,this.componentId)),i=X(i,m)}}return i},e}(),Me=o.default.createContext(void 0);Me.Consumer;var Ve={};new Set;function We(e,t,n){var r=Q(e),a=e,s=!O(e),c=t.attrs,l=void 0===c?g:c,u=t.componentId,d=void 0===u?function(e,t){var n="string"!=typeof e?"sc":S(e);Ve[n]=(Ve[n]||0)+1;var i="".concat(n,"-").concat(I(m+n+Ve[n]));return t?"".concat(t,"-").concat(i):i}(t.displayName,t.parentComponentId):u,h=t.displayName,f=void 0===h?function(e){return O(e)?"styled.".concat(e):"Styled(".concat(k(e),")")}(e):h,p=t.displayName&&t.componentId?"".concat(S(t.displayName),"-").concat(t.componentId):t.componentId||d,b=r&&a.attrs?a.attrs.concat(l).filter(Boolean):l,A=t.shouldForwardProp;if(r&&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 x=new Ne(n,p,r?a.componentStyle:void 0);function D(e,t){return function(e,t,n){var r=e.attrs,a=e.componentStyle,s=e.defaultProps,c=e.foldedComponentIds,l=e.styledComponentId,u=e.target,d=o.default.useContext(Me),m=Te(),h=e.shouldForwardProp||m.shouldForwardProp,f=C(t,d,s)||v,p=function(e,t,n){for(var o,r=Object(i.a)(Object(i.a)({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var s=Y(o=e[a])?o(r):o;for(var c in s)r[c]="className"===c?X(r[c],s[c]):"style"===c?Object(i.a)(Object(i.a)({},r[c]),s[c]):s[c]}return t.className&&(r.className=X(r.className,t.className)),r}(r,t,f),g=p.as||u,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=Te();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(a,p),w=X(c,l);return S&&(w+=" "+S),p.className&&(w+=" "+p.className),b[O(g)&&!y.has(g)?"class":"className"]=w,b.ref=n,Object(o.createElement)(g,b)}(T,e,t)}D.displayName=f;var T=o.default.forwardRef(D);return T.attrs=b,T.componentStyle=x,T.displayName=f,T.shouldForwardProp=A,T.foldedComponentIds=r?X(a.foldedComponentIds,a.styledComponentId):"",T.styledComponentId=p,T.target=r?a.target:e,Object.defineProperty(T,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=r?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=0,o=t;i<o.length;i++)J(e,o[i],!0);return e}({},a.defaultProps,e):e}}),$(T,(function(){return".".concat(T.styledComponentId)})),s&&G(T,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),T}function ze(e,t){for(var n=[e[0]],i=0,o=t.length;i<o;i+=1)n.push(t[i],e[i+1]);return n}var je=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 je(_e(ze(g,Object(i.e)([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?_e(o):je(_e(ze(o,t)))}function Ue(e,t,n){if(void 0===n&&(n=v),!t)throw ee(1,t);var o=function(o){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return e(t,n,He.apply(void 0,Object(i.e)([o],r,!1)))};return o.attrs=function(o){return Ue(e,t,Object(i.a)(Object(i.a)({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return Ue(e,t,Object(i.a)(Object(i.a)({},n),o))},o}var Ze=function(e){return Ue(We,e)},Ge=Ze;y.forEach((function(e){Ge[e]=Ze(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Re(e),Ce.registerId(this.componentId+1)}e.prototype.createStyles=function(e,t,n,i){var o=i(q(_e(this.rules,t,n,i)),""),r=this.componentId+e;n.insertRules(r,r,o)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,i){e>2&&Ce.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 o=q(He.apply(void 0,Object(i.e)([e],t,!1))),r=I(o);return new Ie(r,o)}(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=de(),i=q([n&&'nonce="'.concat(n,'"'),"".concat(l,'="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={})[l]="",t[d]=m,t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=de();return r&&(n.nonce=r),[o.default.createElement("style",Object(i.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Ce({isServer:!0}),this.sealed=!1}e.prototype.collectStyles=function(e){if(this.sealed)throw ee(2);return o.default.createElement(Be,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw ee(3)}})(),"__sc-".concat(l,"__")}).call(this,n(43))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(12),o=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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{static get INSTANCE(){return r._INSTANCE||(r._INSTANCE=new r),r._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 o(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||(()=>o(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(r.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((e=>setTimeout(e,0)))}}return e})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>o(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){const n=r.guessparseCameraLabelFacingMode(t.label),i=r.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,o,r,a;return null!==(a=null===(r=null===(o=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===o?void 0:o[0])||void 0===r?void 0:r.camera)&&void 0!==a?a:null}getVideoDevices(){return o(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 o(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,o,r,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),l=e.label;let u=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!==(o=null===(i=null==s?void 0:s.facingMode)||void 0===i?void 0:i[0])&&void 0!==o?o:c.facingMode);"unknown"===u&&(u=this.guessparseCameraLabelFacingMode(l));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(l));return{facingMode:u,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(r=null==s?void 0:s.torch)&&void 0!==r?r:"torch"in c)&&void 0!==a&&a,label:l,deviceId:c.deviceId}})).sort(((e,t)=>t.maxNumPixels-e.maxNumPixels)))||void 0===t?void 0:t[0]}getUserMedia(e){return o(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";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-",o="-moz-",r="-webkit-",a="comm",s="rule",c="decl",l="@keyframes",u=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 C(e,t,n){return e.slice(t,n)}function y(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,x=1,D=0,T=0,B=0,I="";function k(e,t,n,i,o,r,a,s){return{value:e,root:t,parent:n,type:i,props:o,children:r,line:E,column:x,length:a,return:"",siblings:s}}function O(e,t){return m(k("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function L(e){for(;e.root;)e=O(e.root,{children:[e]});A(e,e.siblings)}function P(){return B=T<D?v(I,T++):0,x++,10===B&&(x=1,E++),B}function _(){return v(I,T)}function R(){return T}function F(e,t){return C(I,e,t)}function N(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 M(e){return E=x=1,D=y(I=e),T=0,[]}function V(e){return I="",e}function W(e){return h(F(T-1,H(91===e?e+2:40===e?e+1:e)))}function z(e){for(;(B=_())&&B<33;)P();return N(e)>2||N(B)>3?"":" "}function j(e,t){for(;--t&&P()&&!(B<48||B>102||B>57&&B<65||B>70&&B<97););return F(e,R()+(t<6&&32==_()&&32==P()))}function H(e){for(;P();)switch(B){case e:return T;case 34:case 39:34!==e&&39!==e&&H(B);break;case 40:41===e&&H(e);break;case 92:P()}return T}function U(e,t){for(;P()&&e+B!==57&&(e+B!==84||47!==_()););return"/*"+F(t,T-1)+"*"+d(47===e?e:P())}function Z(e){for(;!N(_());)P();return F(e,T)}function G(e){return V(Y("",null,null,null,[""],e=M(e),0,[0],e))}function Y(e,t,n,i,o,r,a,s,c){for(var l=0,m=0,h=a,f=0,C=0,b=0,S=1,w=1,D=1,k=0,O="",L=o,F=r,N=i,M=O;w;)switch(b=k,k=P()){case 40:if(108!=b&&58==v(M,h-1)){-1!=g(M+=p(W(k),"&","&\f"),"&\f",u(l?s[l-1]:0))&&(D=-1);break}case 34:case 39:case 91:M+=W(k);break;case 9:case 10:case 13:case 32:M+=z(b);break;case 92:M+=j(R()-1,7);continue;case 47:switch(_()){case 42:case 47:A(X(U(P(),R()),t,n,c),c);break;default:M+="/"}break;case 123*S:s[l++]=y(M)*D;case 125*S:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+m:-1==D&&(M=p(M,/\f/g,"")),C>0&&y(M)-h&&A(C>32?q(M+";",i,n,h-1,c):q(p(M," ","")+";",i,n,h-2,c),c);break;case 59:M+=";";default:if(A(N=Q(M,t,n,l,m,o,s,O,L=[],F=[],h,r),r),123===k)if(0===m)Y(M,t,N,N,L,r,h,s,F);else switch(99===f&&110===v(M,3)?100:f){case 100:case 108:case 109:case 115:Y(e,N,N,i&&A(Q(e,N,N,0,0,o,s,O,o,L=[],h,F),F),o,F,h,s,i?L:F);break;default:Y(M,N,N,N,[""],F,0,s,F)}}l=m=C=0,S=D=1,O=M="",h=a;break;case 58:h=1+y(M),C=b;default:if(S<1)if(123==k)--S;else if(125==k&&0==S++&&125==(B=T>0?v(I,--T):0,x--,10===B&&(x=1,E--),B))continue;switch(M+=d(k),k*S){case 38:D=m>0?1:(M+="\f",-1);break;case 44:s[l++]=(y(M)-1)*D,D=1;break;case 64:45===_()&&(M+=W(P())),f=_(),m=h=y(O=M+=Z(R())),k++;break;case 45:45===b&&2==y(M)&&(S=0)}}return r}function Q(e,t,n,i,o,r,a,c,l,d,m,f){for(var g=o-1,v=0===o?r:[""],y=b(v),A=0,S=0,w=0;A<i;++A)for(var E=0,x=C(e,g+1,g=u(S=a[A])),D=e;E<y;++E)(D=h(S>0?v[E]+" "+x:p(x,/&\f/g,v[E])))&&(l[w++]=D);return k(e,t,n,0===o?s:c,l,d,m,f)}function X(e,t,n,i){return k(e,t,n,a,d(B),C(e,2,-2),0,i)}function q(e,t,n,i,o){return k(e,t,n,c,C(e,0,i),C(e,i+1,-1),i,o)}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 r+"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 r+e+e;case 4789:return o+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return r+e+o+e+i+e+e;case 5936:switch(v(e,t+11)){case 114:return r+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return r+e+i+p(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return r+e+i+p(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return r+e+i+e+e;case 6165:return r+e+i+"flex-"+e+e;case 5187:return r+e+p(e,/(\w+).+(:[^]+)/,r+"box-$1$2"+i+"flex-$1$2")+e;case 5443:return r+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 r+e+i+"flex-line-pack"+p(e,/align-content|flex-|-self/g,"")+e;case 5548:return r+e+i+p(e,"shrink","negative")+e;case 5292:return r+e+i+p(e,"basis","preferred-size")+e;case 6060:return r+"box-"+p(e,"-grow","")+r+e+i+p(e,"grow","positive")+e;case 4554:return r+p(e,/([^-])(transform)/g,"$1"+r+"$2")+e;case 6187:return p(p(p(e,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),e,"")+e;case 5495:case 3959:return p(e,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return p(p(e,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+i+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+e+e;case 4200:if(!f(e,/flex-|baseline/))return i+"grid-column-align"+C(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(.+)/,r+"$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(y(e)-1-t>6)switch(v(e,t+1)){case 109:if(45!==v(e,t+4))break;case 102:return p(e,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+o+(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,o,r,a,s,c){return i+n+":"+o+c+(r?i+n+"-span:"+(a?s:+s-+o)+c:"")+e}));case 4949:if(121===v(e,t+6))return p(e,":",":"+r)+e;break;case 6444:switch(v(e,45===v(e,14)?18:11)){case 120:return p(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(e,14)?"inline-":"")+"box$3$1"+r+"$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 l:return e.return=e.value+"{"+J(e.children,i)+"}";case s:if(!y(e.value=e.props.join(",")))return""}return y(n=J(e.children,i))?e.return=e.value+"{"+n+"}":""}function ee(e){var t=b(e);return function(n,i,o,r){for(var a="",s=0;s<t;s++)a+=e[s](n,i,o,r)||"";return a}}function te(e){return function(t){t.root||(t=t.return)&&e(t)}}function ne(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case c:return void(e.return=K(e.value,e.length,n));case l:return J([O(e,{value:p(e.value,"@","@"+r)})],o);case s:if(e.length)return S(n=e.props,(function(t){switch(f(t,o=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":L(O(e,{props:[p(t,/:(read-\w+)/,":-moz-$1")]})),L(O(e,{props:[t]})),m(e,{props:w(n,o)});break;case"::placeholder":L(O(e,{props:[p(t,/:(plac\w+)/,":"+r+"input-$1")]})),L(O(e,{props:[p(t,/:(plac\w+)/,":-moz-$1")]})),L(O(e,{props:[p(t,/:(plac\w+)/,i+"input-$1")]})),L(O(e,{props:[t]})),m(e,{props:w(n,o)})}return""}))}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}));var i=n(1),o=n(6);class r extends o.a{constructor(e={}){super(),this.title=new i.o({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.f({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new i.o(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 o})),n.d(t,"b",(function(){return r}));var i=n(7);function o(e,t,n){return Math.min(Math.max(e,t),n)}function r(e,t,n){return new i.a(o(e.x,-t/2,n.width-t/2),o(e.y,-t/2,n.height-t/2))}},function(e,t,n){"use strict";n.d(t,"h",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"i",(function(){return a})),n.d(t,"j",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"f",(function(){return m})),n.d(t,"g",(function(){return h})),n.d(t,"k",(function(){return f}));var i=n(5);const o=["BINARY","ANTIALIASED"],r=["PRESET_1","PRESET_2","PRESET_3","PRESET_4","PRESET_5"];var a;!function(e){e.From=function(e){const t=e._type;switch(t){case"ScanbotBinarizationFilter":return new s(e);case"CustomBinarizationFilter":return new c(e);case"ColorDocumentFilter":return new l(e);case"BrightnessFilter":return new u(e);case"ContrastFilter":return new d(e);case"GrayscaleFilter":return new m(e);case"LegacyFilter":return new h(e);case"WhiteBlackPointFilter":return new f(e);default:throw`Unknown child class name: ${t}`}}}(a||(a={}));class s extends i.a{constructor(e={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class c extends i.a{constructor(e={}){super(),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 l extends i.a{constructor(e={}){super(),this._type="ColorDocumentFilter"}}class u extends i.a{constructor(e={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class d extends i.a{constructor(e={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class m extends i.a{constructor(e={}){super(),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 h extends i.a{constructor(e={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class f extends i.a{constructor(e={}){super(),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)}}},function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"z",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return l})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"o",(function(){return m})),n.d(t,"p",(function(){return h})),n.d(t,"q",(function(){return f})),n.d(t,"u",(function(){return p})),n.d(t,"J",(function(){return g})),n.d(t,"y",(function(){return v})),n.d(t,"H",(function(){return C})),n.d(t,"B",(function(){return y})),n.d(t,"G",(function(){return b})),n.d(t,"c",(function(){return S})),n.d(t,"D",(function(){return w})),n.d(t,"A",(function(){return E})),n.d(t,"x",(function(){return x})),n.d(t,"r",(function(){return D})),n.d(t,"w",(function(){return T})),n.d(t,"s",(function(){return A})),n.d(t,"a",(function(){return B})),n.d(t,"b",(function(){return I})),n.d(t,"v",(function(){return k})),n.d(t,"E",(function(){return O})),n.d(t,"F",(function(){return L})),n.d(t,"I",(function(){return P})),n.d(t,"C",(function(){return _})),n.d(t,"t",(function(){return R})),n.d(t,"l",(function(){return F})),n.d(t,"m",(function(){return N})),n.d(t,"k",(function(){return M})),n.d(t,"j",(function(){return V}));var i,o,r=n(5);!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatCodabarConfiguration":return new a(e);case"BarcodeFormatCode11Configuration":return new s(e);case"BarcodeFormatCode39Configuration":return new c(e);case"BarcodeFormatCode93Configuration":return new l(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new m(e);case"BarcodeFormatDataBarExpandedConfiguration":return new h(e);case"BarcodeFormatDataBarLimitedConfiguration":return new f(e);case"BarcodeFormatITFConfiguration":return new p(e);case"BarcodeFormatMSIPlesseyConfiguration":return new v(e);case"BarcodeFormatUpcEanConfiguration":return new C(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);case"BarcodeFormatAztecConfiguration":return new S(e);case"BarcodeFormatQRCodeConfiguration":return new w(e);case"BarcodeFormatPDF417Configuration":return new E(e);case"BarcodeFormatMicroPDF417Configuration":return new x(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new T(e);case"BarcodeFormatAustraliaPostConfiguration":return new I(e);case"BarcodeFormatJapanPostConfiguration":return new k(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new L(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new _(e);case"BarcodeFormatGS1CompositeConfiguration":return new R(e);case"BarcodeFormatCommonOneDConfiguration":return new F(e);case"BarcodeFormatCommonTwoDConfiguration":return new N(e);case"BarcodeFormatCommonFourStateConfiguration":return new M(e);case"BarcodeFormatCommonConfiguration":return new V(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 a(e);case"BarcodeFormatCode11Configuration":return new s(e);case"BarcodeFormatCode39Configuration":return new c(e);case"BarcodeFormatCode93Configuration":return new l(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new m(e);case"BarcodeFormatDataBarExpandedConfiguration":return new h(e);case"BarcodeFormatDataBarLimitedConfiguration":return new f(e);case"BarcodeFormatITFConfiguration":return new p(e);case"BarcodeFormatMSIPlesseyConfiguration":return new v(e);case"BarcodeFormatUpcEanConfiguration":return new C(e);case"BarcodeFormatPharmaCodeConfiguration":return new y(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={}));class a extends r.a{constructor(e={}){super(),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 s extends r.a{constructor(e={}){super(),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 c extends r.a{constructor(e={}){super(),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 l extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode93Configuration",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)}}class u extends r.a{constructor(e={}){super(),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 d extends r.a{constructor(e={}){super(),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 m extends r.a{constructor(e={}){super(),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 h extends r.a{constructor(e={}){super(),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 f extends r.a{constructor(e={}){super(),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 p extends r.a{constructor(e={}){super(),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 g=["MOD_10","MOD_11_IBM","MOD_11_NCR","MOD_10_10","MOD_11_10_IBM","MOD_11_10_NCR"];class v extends r.a{constructor(e={}){super(),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 C extends r.a{constructor(e={}){super(),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 extends r.a{constructor(e={}){super(),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 b,A;!function(e){e.From=function(e){const t=e._type;switch(t){case"BarcodeFormatAztecConfiguration":return new S(e);case"BarcodeFormatQRCodeConfiguration":return new w(e);case"BarcodeFormatPDF417Configuration":return new E(e);case"BarcodeFormatMicroPDF417Configuration":return new x(e);case"BarcodeFormatDataMatrixConfiguration":return new D(e);case"BarcodeFormatMaxiCodeConfiguration":return new T(e);default:throw`Unknown child class name: ${t}`}}}(b||(b={}));class S extends r.a{constructor(e={}){super(),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 w extends r.a{constructor(e={}){super(),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 E extends r.a{constructor(e={}){super(),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 x extends r.a{constructor(e={}){super(),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 extends r.a{constructor(e={}){super(),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 T extends r.a{constructor(e={}){super(),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 k(e);case"BarcodeFormatRoyalMailConfiguration":return new O(e);case"BarcodeFormatRoyalTNTPostConfiguration":return new L(e);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new P(e);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new _(e);default:throw`Unknown child class name: ${t}`}}}(A||(A={}));const B=["NUMERIC","ALPHA_NUMERIC"];class I extends r.a{constructor(e={}){super(),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 k extends r.a{constructor(e={}){super(),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 extends r.a{constructor(e={}){super(),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 L extends r.a{constructor(e={}){super(),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 extends r.a{constructor(e={}){super(),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 _ extends r.a{constructor(e={}){super(),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 R extends r.a{constructor(e={}){super(),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 F extends r.a{constructor(e={}){super(),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.strictMode=!0,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.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}class N extends r.a{constructor(e={}){super(),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 M extends r.a{constructor(e={}){super(),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 V extends r.a{constructor(e={}){super(),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){var i;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var r=typeof i;if("string"===r||"number"===r)e.push(i);else if(Array.isArray(i)){if(i.length){var a=o.apply(null,i);a&&e.push(a)}}else if("object"===r)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?(o.default=o,e.exports=o):void 0===(i=function(){return o}.apply(t,[]))||(e.exports=i)}()},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(t.constructor===Object)for(const n in t)t.hasOwnProperty(n)&&e(t[n])}(e),n}function o(e){return e.startsWith("http:")||e.startsWith("https:")}function r(){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{return 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]))}catch(e){return!1}}()){i+="-simd";n&&r()&&(i+="-threads")}return i}n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return a}))}).call(this,n(43))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return l}));var i=n(33),o=n(5),r=n(20);class a extends o.a{constructor(e={}){if(super(),this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,this.sizeScore=0,void 0===e.text)throw new Error("text must be present in constructor argument");if(this.text=e.text,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.isUpsideDown&&(this.isUpsideDown=e.isUpsideDown),void 0!==e.sourceImage&&(this.sourceImage=null!=e.sourceImage?e.sourceImage:null),void 0===e.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=e.rawBytes,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}}const s=["LEGACY","NEXT_GEN_LOW_POWER","NEXT_GEN","NEXT_GEN_LOW_POWER_AR","NEXT_GEN_AR"];class c extends o.a{constructor(e={}){super(),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=!0,this.engineMode="NEXT_GEN_LOW_POWER",this.live=!0,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.live&&(this.live=e.live)}}class l extends o.a{constructor(e={}){if(super(),void 0===e.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=e.barcodes.map((e=>new a(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,"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 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 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((o=>{o in t&&n(e[o])&&n(t[o])?i.mapValuesDeep(e[o],t[o]):t[o]=e[o]}))}static _fromJson(e,t){return this.mapValuesDeep(t,e),e}}},function(e,t,n){"use strict";var i=n(32);n.d(t,"a",(function(){return i.i}))},function(e,t,n){"use strict";var i={};n.r(i),n.d(i,"BarcodeFormatConfigurationBase",(function(){return m.n})),n.d(i,"BarcodeFormatOneDConfigurationBase",(function(){return m.z})),n.d(i,"BarcodeFormatCodabarConfiguration",(function(){return m.d})),n.d(i,"BarcodeFormatCode11Configuration",(function(){return m.e})),n.d(i,"BarcodeFormatCode39Configuration",(function(){return m.h})),n.d(i,"BarcodeFormatCode93Configuration",(function(){return m.i})),n.d(i,"BarcodeFormatCode128Configuration",(function(){return m.f})),n.d(i,"BarcodeFormatCode2Of5Configuration",(function(){return m.g})),n.d(i,"BarcodeFormatDataBarConfiguration",(function(){return m.o})),n.d(i,"BarcodeFormatDataBarExpandedConfiguration",(function(){return m.p})),n.d(i,"BarcodeFormatDataBarLimitedConfiguration",(function(){return m.q})),n.d(i,"BarcodeFormatItfConfiguration",(function(){return m.u})),n.d(i,"MsiPlesseyChecksumAlgorithmValues",(function(){return m.J})),n.d(i,"BarcodeFormatMsiPlesseyConfiguration",(function(){return m.y})),n.d(i,"BarcodeFormatUpcEanConfiguration",(function(){return m.H})),n.d(i,"BarcodeFormatPharmaCodeConfiguration",(function(){return m.B})),n.d(i,"BarcodeFormatTwoDConfigurationBase",(function(){return m.G})),n.d(i,"BarcodeFormatAztecConfiguration",(function(){return m.c})),n.d(i,"BarcodeFormatQrCodeConfiguration",(function(){return m.D})),n.d(i,"BarcodeFormatPdf417Configuration",(function(){return m.A})),n.d(i,"BarcodeFormatMicroPdf417Configuration",(function(){return m.x})),n.d(i,"BarcodeFormatDataMatrixConfiguration",(function(){return m.r})),n.d(i,"BarcodeFormatMaxiCodeConfiguration",(function(){return m.w})),n.d(i,"BarcodeFormatFourStateConfigurationBase",(function(){return m.s})),n.d(i,"AustraliaPostCustomerFormatValues",(function(){return m.a})),n.d(i,"BarcodeFormatAustraliaPostConfiguration",(function(){return m.b})),n.d(i,"BarcodeFormatJapanPostConfiguration",(function(){return m.v})),n.d(i,"BarcodeFormatRoyalMailConfiguration",(function(){return m.E})),n.d(i,"BarcodeFormatRoyalTntPostConfiguration",(function(){return m.F})),n.d(i,"BarcodeFormatUspsIntelligentMailConfiguration",(function(){return m.I})),n.d(i,"BarcodeFormatPharmaCodeTwoTrackConfiguration",(function(){return m.C})),n.d(i,"BarcodeFormatGs1CompositeConfiguration",(function(){return m.t})),n.d(i,"BarcodeFormatCommonOneDConfiguration",(function(){return m.l})),n.d(i,"BarcodeFormatCommonTwoDConfiguration",(function(){return m.m})),n.d(i,"BarcodeFormatCommonFourStateConfiguration",(function(){return m.k})),n.d(i,"BarcodeFormatCommonConfiguration",(function(){return m.j})),n.d(i,"BarcodeItem",(function(){return h.a})),n.d(i,"BarcodeScannerEngineModeValues",(function(){return h.c})),n.d(i,"BarcodeScannerConfiguration",(function(){return h.b})),n.d(i,"BarcodeScannerResult",(function(){return h.d})),n.d(i,"BarcodeFormatValues",(function(){return p})),n.d(i,"BarcodeFormats",(function(){return g})),n.d(i,"Gs1HandlingValues",(function(){return C})),n.d(i,"UpcEanExtensionBehaviorValues",(function(){return y})),n.d(i,"BarcodeDocumentFormatValues",(function(){return b})),n.d(i,"BarcodeDocumentFormats",(function(){return A})),n.d(i,"CheckDocumentDetectionModeValues",(function(){return O})),n.d(i,"CheckRecognitionStatusValues",(function(){return L})),n.d(i,"CheckScanningResult",(function(){return P})),n.d(i,"CheckScannerConfiguration",(function(){return _})),n.d(i,"CommonFieldTypeValues",(function(){return R.a})),n.d(i,"DocumentScannerEngineModeValues",(function(){return E})),n.d(i,"DocumentScannerParameters",(function(){return x})),n.d(i,"DocumentScannerConfiguration",(function(){return D})),n.d(i,"DocumentDetectionStatusValues",(function(){return T})),n.d(i,"DocumentDetectionScores",(function(){return B})),n.d(i,"DocumentDetectionResult",(function(){return I})),n.d(i,"DocumentQualityValues",(function(){return F})),n.d(i,"DocumentQualityThreshold",(function(){return N})),n.d(i,"DocumentQualityAnalyzerConfiguration",(function(){return M})),n.d(i,"DocumentQualityAnalyzerResult",(function(){return V})),n.d(i,"EuropeanHealthInsuranceCardRecognitionResult",(function(){return W})),n.d(i,"EuropeanHealthInsuranceCardRecognizerConfiguration",(function(){return z})),n.d(i,"OcrResult",(function(){return k.h})),n.d(i,"FieldValidationStatusValues",(function(){return k.e})),n.d(i,"FieldDataFormatValues",(function(){return k.b})),n.d(i,"FieldParsedData",(function(){return k.c})),n.d(i,"FieldType",(function(){return k.d})),n.d(i,"Field",(function(){return k.a})),n.d(i,"GenericDocumentType",(function(){return k.g})),n.d(i,"GenericDocument",(function(){return k.f})),n.d(i,"DocumentDataExtractorConfigurationElement",(function(){return j})),n.d(i,"DateValidationConfiguration",(function(){return H})),n.d(i,"EuropeanHealthInsuranceCardIssuingCountryValues",(function(){return U})),n.d(i,"EuropeanHealthInsuranceCardConfiguration",(function(){return Z})),n.d(i,"MrzFallbackConfiguration",(function(){return G})),n.d(i,"DocumentDataExtractorCommonConfiguration",(function(){return Y})),n.d(i,"DocumentDataExtractionStatusValues",(function(){return K})),n.d(i,"DocumentDataExtractionResult",(function(){return J})),n.d(i,"DocumentDataExtractionModeValues",(function(){return $})),n.d(i,"DocumentDataFrameExtractionParameters",(function(){return ee})),n.d(i,"DocumentDataExtractorConfiguration",(function(){return te})),n.d(i,"WordBox",(function(){return ne})),n.d(i,"SymbolBox",(function(){return ie})),n.d(i,"TextPatternScannerResult",(function(){return oe})),n.d(i,"ContentValidator",(function(){return re})),n.d(i,"DefaultContentValidator",(function(){return ae})),n.d(i,"PatternContentValidator",(function(){return se})),n.d(i,"TextPatternScannerConfiguration",(function(){return ce})),n.d(i,"LineSegmentInt",(function(){return w.c})),n.d(i,"LineSegmentFloat",(function(){return w.b})),n.d(i,"AspectRatio",(function(){return w.a})),n.d(i,"LicensePlateScannerStrategyValues",(function(){return le})),n.d(i,"LicensePlateScannerConfiguration",(function(){return ue})),n.d(i,"LicensePlateScannerResult",(function(){return de})),n.d(i,"MedicalCertificateScanningParameters",(function(){return me})),n.d(i,"MedicalCertificateCheckBoxTypeValues",(function(){return he})),n.d(i,"MedicalCertificateCheckBox",(function(){return fe})),n.d(i,"MedicalCertificateDateRecordTypeValues",(function(){return pe})),n.d(i,"MedicalCertificateDateRecord",(function(){return ge})),n.d(i,"MedicalCertificatePatientInfoFieldTypeValues",(function(){return ve})),n.d(i,"MedicalCertificatePatientInfoField",(function(){return Ce})),n.d(i,"MedicalCertificatePatientInfoBox",(function(){return ye})),n.d(i,"MedicalCertificateFormTypeValues",(function(){return be})),n.d(i,"MedicalCertificateScanningResult",(function(){return Ae})),n.d(i,"MrzDocumentTypeValues",(function(){return Se})),n.d(i,"MrzScannerResult",(function(){return we})),n.d(i,"MrzIncompleteResultHandlingValues",(function(){return Ee})),n.d(i,"MrzScannerConfiguration",(function(){return xe})),n.d(i,"OcrElement",(function(){return De})),n.d(i,"Glyph",(function(){return Te})),n.d(i,"Word",(function(){return Be})),n.d(i,"Line",(function(){return Ie})),n.d(i,"Block",(function(){return ke})),n.d(i,"Page",(function(){return Oe})),n.d(i,"OutputModeValues",(function(){return Le.h})),n.d(i,"BinarizationFilterPresetValues",(function(){return Le.a})),n.d(i,"ParametricFilter",(function(){return Le.i})),n.d(i,"ScanbotBinarizationFilter",(function(){return Le.j})),n.d(i,"CustomBinarizationFilter",(function(){return Le.e})),n.d(i,"ColorDocumentFilter",(function(){return Le.c})),n.d(i,"BrightnessFilter",(function(){return Le.b})),n.d(i,"ContrastFilter",(function(){return Le.d})),n.d(i,"GrayscaleFilter",(function(){return Le.f})),n.d(i,"LegacyFilter",(function(){return Le.g})),n.d(i,"WhiteBlackPointFilter",(function(){return Le.k})),n.d(i,"PdfAttributes",(function(){return Pe})),n.d(i,"PageSizeValues",(function(){return _e})),n.d(i,"PageDirectionValues",(function(){return Re})),n.d(i,"PageFitValues",(function(){return Fe})),n.d(i,"ResamplingMethodValues",(function(){return Ne})),n.d(i,"PdfConfiguration",(function(){return Me})),n.d(i,"CompressionModeValues",(function(){return Ve})),n.d(i,"BinarizationValues",(function(){return We})),n.d(i,"UserFieldValue",(function(){return ze})),n.d(i,"UserFieldDoubleValue",(function(){return He})),n.d(i,"UserFieldStringValue",(function(){return Ue})),n.d(i,"UserFieldIntValue",(function(){return Ze})),n.d(i,"UserField",(function(){return Ge})),n.d(i,"TiffGeneratorParameters",(function(){return Ye})),n.d(i,"ConfirmationMethodValues",(function(){return Q})),n.d(i,"ResultAccumulationConfiguration",(function(){return X})),n.d(i,"AccumulatedResultsVerifierConfiguration",(function(){return q})),n.d(i,"ImageRotationValues",(function(){return Qe})),n.d(i,"VinBarcodeExtractionStatusValues",(function(){return Xe})),n.d(i,"VinBarcodeResult",(function(){return qe})),n.d(i,"VinScannerResult",(function(){return Ke})),n.d(i,"VinScannerConfiguration",(function(){return Je})),n.d(i,"MRZDocumentType",(function(){return $e})),n.d(i,"DeIdCardFrontDocumentType",(function(){return et})),n.d(i,"DeIdCardBackDocumentType",(function(){return tt})),n.d(i,"DePassportDocumentType",(function(){return nt})),n.d(i,"DeDriverLicenseFrontDocumentType",(function(){return it})),n.d(i,"DeDriverLicenseBackDocumentType",(function(){return ot})),n.d(i,"DeDriverLicenseBackCategoryDocumentType",(function(){return rt})),n.d(i,"DeDriverLicenseBackCategoriesDocumentType",(function(){return at})),n.d(i,"DeDriverLicenseBackCategoriesADocumentType",(function(){return st})),n.d(i,"DeDriverLicenseBackCategoriesA1DocumentType",(function(){return ct})),n.d(i,"DeDriverLicenseBackCategoriesA2DocumentType",(function(){return lt})),n.d(i,"DeDriverLicenseBackCategoriesAMDocumentType",(function(){return ut})),n.d(i,"DeDriverLicenseBackCategoriesBDocumentType",(function(){return dt})),n.d(i,"DeDriverLicenseBackCategoriesB1DocumentType",(function(){return mt})),n.d(i,"DeDriverLicenseBackCategoriesBEDocumentType",(function(){return ht})),n.d(i,"DeDriverLicenseBackCategoriesCDocumentType",(function(){return ft})),n.d(i,"DeDriverLicenseBackCategoriesC1DocumentType",(function(){return pt})),n.d(i,"DeDriverLicenseBackCategoriesC1EDocumentType",(function(){return gt})),n.d(i,"DeDriverLicenseBackCategoriesCEDocumentType",(function(){return vt})),n.d(i,"DeDriverLicenseBackCategoriesDDocumentType",(function(){return Ct})),n.d(i,"DeDriverLicenseBackCategoriesD1DocumentType",(function(){return yt})),n.d(i,"DeDriverLicenseBackCategoriesD1EDocumentType",(function(){return bt})),n.d(i,"DeDriverLicenseBackCategoriesDEDocumentType",(function(){return At})),n.d(i,"DeDriverLicenseBackCategoriesLDocumentType",(function(){return St})),n.d(i,"DeDriverLicenseBackCategoriesTDocumentType",(function(){return wt})),n.d(i,"DeResidencePermitFrontDocumentType",(function(){return Et})),n.d(i,"DeResidencePermitBackDocumentType",(function(){return xt})),n.d(i,"EuropeanHealthInsuranceCardDocumentType",(function(){return Dt})),n.d(i,"DeHealthInsuranceCardFrontDocumentType",(function(){return Tt})),n.d(i,"MRZ",(function(){return Bt})),n.d(i,"DeIdCardFront",(function(){return It})),n.d(i,"DeIdCardBack",(function(){return kt})),n.d(i,"DePassport",(function(){return Ot})),n.d(i,"DeDriverLicenseFront",(function(){return Lt})),n.d(i,"DeDriverLicenseBack",(function(){return Pt})),n.d(i,"DeResidencePermitFront",(function(){return _t})),n.d(i,"DeResidencePermitBack",(function(){return Rt})),n.d(i,"EuropeanHealthInsuranceCard",(function(){return Ft})),n.d(i,"DeHealthInsuranceCardFront",(function(){return Nt})),n.d(i,"BoardingPassDocumentType",(function(){return Mt})),n.d(i,"BoardingPassLegDocumentType",(function(){return Vt})),n.d(i,"SwissQRDocumentType",(function(){return Wt})),n.d(i,"DEMedicalPlanDocumentType",(function(){return zt})),n.d(i,"DEMedicalPlanPatientDocumentType",(function(){return jt})),n.d(i,"DEMedicalPlanDoctorDocumentType",(function(){return Ht})),n.d(i,"DEMedicalPlanSubheadingDocumentType",(function(){return Ut})),n.d(i,"DEMedicalPlanSubheadingMedicineDocumentType",(function(){return Zt})),n.d(i,"DEMedicalPlanSubheadingMedicineSubstanceDocumentType",(function(){return Gt})),n.d(i,"DEMedicalPlanSubheadingPrescriptionDocumentType",(function(){return Yt})),n.d(i,"IDCardPDF417DocumentType",(function(){return Qt})),n.d(i,"GS1DocumentType",(function(){return Xt})),n.d(i,"GS1ElementDocumentType",(function(){return qt})),n.d(i,"GS1ElementValidationErrorDocumentType",(function(){return Kt})),n.d(i,"SEPADocumentType",(function(){return Jt})),n.d(i,"MedicalCertificateDocumentType",(function(){return $t})),n.d(i,"VCardDocumentType",(function(){return en})),n.d(i,"VCardEntryDocumentType",(function(){return tn})),n.d(i,"VCardVersionDocumentType",(function(){return nn})),n.d(i,"VCardSourceDocumentType",(function(){return on})),n.d(i,"VCardKindDocumentType",(function(){return rn})),n.d(i,"VCardXMLDocumentType",(function(){return an})),n.d(i,"VCardNameDocumentType",(function(){return sn})),n.d(i,"VCardFirstNameDocumentType",(function(){return cn})),n.d(i,"VCardNicknameDocumentType",(function(){return ln})),n.d(i,"VCardBirthdayDocumentType",(function(){return un})),n.d(i,"VCardAnniversaryDocumentType",(function(){return dn})),n.d(i,"VCardGenderDocumentType",(function(){return mn})),n.d(i,"VCardDeliveryAddressDocumentType",(function(){return hn})),n.d(i,"VCardPhotoDocumentType",(function(){return fn})),n.d(i,"VCardTelephoneNumberDocumentType",(function(){return pn})),n.d(i,"VCardEmailDocumentType",(function(){return gn})),n.d(i,"VCardIMPPDocumentType",(function(){return vn})),n.d(i,"VCardLanguagesDocumentType",(function(){return Cn})),n.d(i,"VCardTimeZoneDocumentType",(function(){return yn})),n.d(i,"VCardGeoLocationDocumentType",(function(){return bn})),n.d(i,"VCardTitleDocumentType",(function(){return An})),n.d(i,"VCardRoleDocumentType",(function(){return Sn})),n.d(i,"VCardLogoDocumentType",(function(){return wn})),n.d(i,"VCardOrganisationDocumentType",(function(){return En})),n.d(i,"VCardMemberDocumentType",(function(){return xn})),n.d(i,"VCardRelatedDocumentType",(function(){return Dn})),n.d(i,"VCardCategoriesDocumentType",(function(){return Tn})),n.d(i,"VCardNoteDocumentType",(function(){return Bn})),n.d(i,"VCardProductIdDocumentType",(function(){return In})),n.d(i,"VCardRevisionDocumentType",(function(){return kn})),n.d(i,"VCardSoundDocumentType",(function(){return On})),n.d(i,"VCardUIDDocumentType",(function(){return Ln})),n.d(i,"VCardClientPIDMapDocumentType",(function(){return Pn})),n.d(i,"VCardURLDocumentType",(function(){return _n})),n.d(i,"VCardPublicKeyDocumentType",(function(){return Rn})),n.d(i,"VCardBusyTimeURLDocumentType",(function(){return Fn})),n.d(i,"VCardCalendarURIForRequestsDocumentType",(function(){return Nn})),n.d(i,"VCardCalendarURIDocumentType",(function(){return Mn})),n.d(i,"VCardCustomDocumentType",(function(){return Vn})),n.d(i,"AAMVADocumentType",(function(){return Wn})),n.d(i,"AAMVATitleDataDocumentType",(function(){return zn})),n.d(i,"AAMVARegistrationDataDocumentType",(function(){return jn})),n.d(i,"AAMVAMotorCarrierDataDocumentType",(function(){return Hn})),n.d(i,"AAMVARegistrantAndVehicleDataDocumentType",(function(){return Un})),n.d(i,"AAMVAVehicleOwnerDataDocumentType",(function(){return Zn})),n.d(i,"AAMVAVehicleDataDocumentType",(function(){return Gn})),n.d(i,"AAMVAVehicleSafetyInspectionDataDocumentType",(function(){return Yn})),n.d(i,"AAMVADLIDDocumentType",(function(){return Qn})),n.d(i,"AAMVADriverLicenseDocumentType",(function(){return Xn})),n.d(i,"AAMVAIDCardDocumentType",(function(){return qn})),n.d(i,"AAMVAEnhancedDriverLicenseDocumentType",(function(){return Kn})),n.d(i,"AAMVARawDocumentDocumentType",(function(){return Jn})),n.d(i,"HIBCDocumentType",(function(){return $n})),n.d(i,"BoardingPass",(function(){return ei})),n.d(i,"SwissQR",(function(){return ti})),n.d(i,"DEMedicalPlan",(function(){return ni})),n.d(i,"IDCardPDF417",(function(){return ii})),n.d(i,"GS1",(function(){return oi})),n.d(i,"SEPA",(function(){return ri})),n.d(i,"MedicalCertificate",(function(){return ai})),n.d(i,"VCard",(function(){return si})),n.d(i,"AAMVA",(function(){return ci})),n.d(i,"HIBC",(function(){return li})),n.d(i,"CheckDocumentType",(function(){return ui})),n.d(i,"USACheckDocumentType",(function(){return di})),n.d(i,"UAECheckDocumentType",(function(){return mi})),n.d(i,"FRACheckDocumentType",(function(){return hi})),n.d(i,"ISRCheckDocumentType",(function(){return fi})),n.d(i,"KWTCheckDocumentType",(function(){return pi})),n.d(i,"AUSCheckDocumentType",(function(){return gi})),n.d(i,"INDCheckDocumentType",(function(){return vi})),n.d(i,"CANCheckDocumentType",(function(){return Ci})),n.d(i,"UnknownCheckDocumentType",(function(){return yi})),n.d(i,"Check",(function(){return bi})),n.d(i,"USACheck",(function(){return Ai})),n.d(i,"UAECheck",(function(){return Si})),n.d(i,"FRACheck",(function(){return wi})),n.d(i,"ISRCheck",(function(){return Ei})),n.d(i,"KWTCheck",(function(){return xi})),n.d(i,"AUSCheck",(function(){return Di})),n.d(i,"INDCheck",(function(){return Ti})),n.d(i,"CANCheck",(function(){return Bi})),n.d(i,"UnknownCheck",(function(){return Ii})),n.d(i,"CreditCardDocumentType",(function(){return ki})),n.d(i,"CreditCard",(function(){return Oi})),n.d(i,"LicenseStatusValues",(function(){return Li})),n.d(i,"SdkLicenseInfo",(function(){return Pi})),n.d(i,"PartiallyConstructible",(function(){return f.a}));class o{}o.VERSION="7.0.1",o.BUILD_WITH_UI=!1;var r=n(35);class a{constructor(e,t){this.errorInWorker=null,this.createProxy=e=>new Proxy({},{get:(t,n,i)=>(...t)=>this.post(n,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");const{requestSuffix:n=""}=t||{},i=Object(r.c)(t),o=`${e}${e.endsWith("/")?"":"/"}ScanbotSDK.Core${i}.js${n}`;if(Object(r.d)(o)){const e=new Blob([`importScripts("${o}")`]);this.instance=new Worker(URL.createObjectURL(e))}else this.instance=new Worker(o);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:o,recoverableError:r,unrecoverableError:a}=e.data,s=this.continuations[i];if(!s)return;const{resolve:c,reject:l}=s;delete this.continuations[i],a?(l(a),this.handleUnrecoverableError(a)):r?l(r):c(o)},this.instance.onerror=e=>{this.handleUnrecoverableError(e.error)}}post(e,t,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((i,o)=>{const a=Object(r.b)(t,"copy"==n),s=this.nextTicketId++;this.continuations[s]={resolve:i,reject:o},this.instance.postMessage({command:e,args:t,ticket:s},a)}))}destroy(){this.instance.terminate()}}var s=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Error{}class l extends Error{}class u extends Error{}class d{constructor(e,t,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),this.core=new a(e,t),this.coreInitializationSuccessful=(()=>s(this,void 0,void 0,(function*(){let t=!1;try{t=yield this.core.copyArgs.initialize(...n)}catch(e){return new l('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.')}if(t){let t;try{t=yield this.core.copyArgs.version()}catch(e){t="Error"}const n=o.VERSION;return t!==n?new u(`Version mismatch! \nVersion of ScanbotSDK.(ui2.)min.js is "${n}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${t}". \nThe ScanbotSDK.Core*.js file was loaded from ${e}.`):"OK"}return new c("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")})))()}awaitInitialized(){return s(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(e){return new Proxy({},{get:(t,n,i)=>(...t)=>s(this,void 0,void 0,(function*(){const i=yield this.getCoreForCommand(n),o="copy"===e?i.copyArgs:i.transferArgs;return yield o[n](...t)}))})}getCoreForCommand(e=""){return s(this,void 0,void 0,(function*(){const t=yield this.coreInitializationSuccessful;if("OK"===t||"getLicenseInfo"===e&&t instanceof c)return this.core;throw t}))}destroy(){this.core.destroy(),this.core=void 0}}var m=n(33),h=n(36),f=n(5);const p=["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 g extends f.a{constructor(e={}){super()}}var v;(v=g||(g={})).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"],v.twod=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],v.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],v.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN_7","PZN_8"],v.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"],v.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"];const C=["PARSE","VALIDATE_STRUCTURE","DECODE_STRUCTURE","VALIDATE_FULL","DECODE_FULL"],y=["REQUIRE_2","REQUIRE_5","REQUIRE_ANY","IGNORE","ALLOW_2","ALLOW_5","ALLOW_ANY"],b=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"];class A extends f.a{constructor(e={}){super()}}var S;(S=A||(A={})).all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],S.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"],VCARD:["QR_CODE"],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"]};var w=n(21);const E=["ML","LEGACY"];class x extends f.a{constructor(e={}){super(),this.isLive=!1,this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.acceptedAspectRatioScore=85,this.aspectRatios=[],this.ignoreOrientationMismatch=!1,void 0!==e.isLive&&(this.isLive=e.isLive),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 w.a(e)))),void 0!==e.ignoreOrientationMismatch&&(this.ignoreOrientationMismatch=e.ignoreOrientationMismatch)}}class D extends f.a{constructor(e={}){super(),this.engineMode="ML",this.parameters=new x({}),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.parameters&&(this.parameters=new x(e.parameters))}}const T=["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 B extends f.a{constructor(e={}){if(super(),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 I extends f.a{constructor(e={}){if(super(),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 B(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 w.c(e))),void 0===e.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=e.verticalLines.map((e=>new w.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 w.b(e))),void 0===e.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=e.verticalLinesNormalized.map((e=>new w.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)}}var k=n(20);const O=["DISABLED","DETECT_DOCUMENT","DETECT_AND_CROP_DOCUMENT"],L=["SUCCESS","VALIDATION_FAILED","FAIL"];class P extends f.a{constructor(e={}){if(super(),this.status="FAIL",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 k.f(e.check):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=null!=e.documentDetectionResult?new I(e.documentDetectionResult):null,void 0===e.croppedImage)throw new Error("croppedImage must be present in constructor argument");this.croppedImage=null!=e.croppedImage?e.croppedImage:null}}class _ extends f.a{constructor(e={}){super(),this.documentDetectionMode="DISABLED",void 0!==e.documentDetectionMode&&(this.documentDetectionMode=e.documentDetectionMode)}}var R=n(38);const F=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"];class N extends f.a{constructor(e={}){if(super(),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 M extends f.a{constructor(e={}){super(),this.qualityThresholds=[new N({symbolQuality:.5,symbolRatio:.5}),new N({symbolQuality:.7,symbolRatio:.3}),new N({symbolQuality:.85,symbolRatio:.3}),new N({symbolQuality:.9,symbolRatio:.1})],this.qualityIndices=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"],this.detectOrientation=!1,this.maxImageSize=2e3,this.minEstimatedNumberOfSymbolsForDocument=20,this.minProcessedFraction=0,this.maxProcessedFraction=.5,this.earlyStopIfNSymbolsFound=100,this.tileSize=300,void 0!==e.qualityThresholds&&(this.qualityThresholds=e.qualityThresholds.map((e=>new N(e)))),void 0!==e.qualityIndices&&(this.qualityIndices=e.qualityIndices.map((e=>e))),void 0!==e.detectOrientation&&(this.detectOrientation=e.detectOrientation),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)}}class V extends f.a{constructor(e={}){if(super(),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&&F.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");this.cumulativeQualityHistogram=e.cumulativeQualityHistogram.map((e=>e))}}class W extends f.a{constructor(e={}){if(super(),this.status="FAILED_DETECTION",void 0===e.fields)throw new Error("fields must be present in constructor argument");this.fields=e.fields.map((e=>new W.Field(e))),void 0!==e.status&&(this.status=e.status)}}!function(e){e.RecognitionStatusValues=["SUCCESS","FAILED_DETECTION","INCOMPLETE_VALIDATION"];class t extends f.a{constructor(e={}){if(super(),this.validationStatus="NOT_VALIDATED",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.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=e.confidence,void 0!==e.validationStatus&&(this.validationStatus=e.validationStatus)}}e.Field=t,function(e){e.ValidationStatusValues=["NOT_VALIDATED","FAILURE","SUCCESS","CONFIRMED"],e.FieldTypeValues=["SURNAME","GIVEN_NAME","DATE_OF_BIRTH","PERSONAL_IDENTIFICATION_NUMBER","INSTITUTION_NUMBER","INSTITUTION_NAME","CARD_NUMBER","CARD_EXPIRATION_DATE","COUNTRY"]}(t=e.Field||(e.Field={}))}(W||(W={}));class z extends f.a{constructor(e={}){super(),this.allowedCountries=[],this.minBirthYear=0,this.maxBirthYear=2999,this.minExpirationYear=0,this.maxExpirationYear=2999,this.maxCountryDetectionAttempts=5,this.minEqualFrameCount=4,this.maxAccumulatedFrameCount=10,void 0!==e.allowedCountries&&(this.allowedCountries=e.allowedCountries.map((e=>e))),void 0!==e.minBirthYear&&(this.minBirthYear=e.minBirthYear),void 0!==e.maxBirthYear&&(this.maxBirthYear=e.maxBirthYear),void 0!==e.minExpirationYear&&(this.minExpirationYear=e.minExpirationYear),void 0!==e.maxExpirationYear&&(this.maxExpirationYear=e.maxExpirationYear),void 0!==e.maxCountryDetectionAttempts&&(this.maxCountryDetectionAttempts=e.maxCountryDetectionAttempts),void 0!==e.minEqualFrameCount&&(this.minEqualFrameCount=e.minEqualFrameCount),void 0!==e.maxAccumulatedFrameCount&&(this.maxAccumulatedFrameCount=e.maxAccumulatedFrameCount)}}var j;!function(e){e.From=function(e){const t=e._type;switch(t){case"DateValidationConfiguration":return new H(e);case"EuropeanHealthInsuranceCardConfiguration":return new Z(e);case"MRZFallbackConfiguration":return new G(e);case"DocumentDataExtractorCommonConfiguration":return new Y(e);default:throw`Unknown child class name: ${t}`}}}(j||(j={}));class H extends f.a{constructor(e={}){if(super(),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}}const U=["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 Z extends f.a{constructor(e={}){super(),this._type="EuropeanHealthInsuranceCardConfiguration",this.expectedCountry=null,void 0!==e.expectedCountry&&(this.expectedCountry=null!=e.expectedCountry&&U.includes(e.expectedCountry)?e.expectedCountry:null)}}class G extends f.a{constructor(e={}){super(),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 Y extends f.a{constructor(e={}){if(super(),this._type="DocumentDataExtractorCommonConfiguration",void 0===e.acceptedDocumentTypes)throw new Error("acceptedDocumentTypes must be present in constructor argument");this.acceptedDocumentTypes=e.acceptedDocumentTypes.map((e=>e))}}const Q=["EXACT","INTERPOLATE"];class X extends f.a{constructor(e={}){super(),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 q extends f.a{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult)}}const K=["SUCCESS","ERROR_NOTHING_FOUND","ERROR_BAD_CROP","ERROR_UNKNOWN_DOCUMENT","ERROR_UNACCEPTABLE_DOCUMENT","INCOMPLETE_VALIDATION"];class J extends f.a{constructor(e={}){if(super(),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 k.f(e.document):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=new I(e.documentDetectionResult),void 0===e.croppedImage)throw new Error("croppedImage must be present in constructor argument");this.croppedImage=null!=e.croppedImage?e.croppedImage:null}}const $=["LIVE","SINGLE_SHOT"];class ee extends f.a{constructor(e={}){super(),this.mode="LIVE",void 0!==e.mode&&(this.mode=e.mode)}}class te extends f.a{constructor(e={}){if(super(),this.resultAccumulationConfig=new X({}),this.fieldExcludeList=[],void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new X(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=>j.From(e)))}}class ne extends f.a{constructor(e={}){if(super(),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 ie extends f.a{constructor(e={}){if(super(),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 oe extends f.a{constructor(e={}){if(super(),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 ne(e))),void 0===e.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=e.symbolBoxes.map((e=>new ie(e))),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful)}}var re;!function(e){e.From=function(e){const t=e._type;switch(t){case"DefaultContentValidator":return new ae(e);case"PatternContentValidator":return new se(e);default:throw`Unknown child class name: ${t}`}}}(re||(re={}));class ae extends f.a{constructor(e={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters)}}class se extends f.a{constructor(e={}){if(super(),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 ce extends f.a{constructor(e={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.validator=new ae({}),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=re.From(e.validator))}}const le=["CLASSIC","ML"];class ue extends f.a{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.scannerStrategy="ML",void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=e.minimumNumberOfRequiredFramesWithEqualScanningResult),void 0!==e.scannerStrategy&&(this.scannerStrategy=e.scannerStrategy)}}class de extends f.a{constructor(e={}){if(super(),this.confidence=0,this.validationSuccessful=!1,this.croppedImage=null,void 0===e.countryCode)throw new Error("countryCode must be present in constructor argument");if(this.countryCode=e.countryCode,void 0===e.licensePlate)throw new Error("licensePlate must be present in constructor argument");if(this.licensePlate=e.licensePlate,void 0===e.rawText)throw new Error("rawText must be present in constructor argument");this.rawText=e.rawText,void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful),void 0!==e.croppedImage&&(this.croppedImage=null!=e.croppedImage?e.croppedImage:null)}}class me extends f.a{constructor(e={}){super(),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 he=["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 fe extends f.a{constructor(e={}){if(super(),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 pe=["INCAPABLE_OF_WORK_SINCE","INCAPABLE_OF_WORK_UNTIL","DIAGNOSED_ON","DOCUMENT_DATE","BIRTH_DATE","CHILD_NEEDS_CARE_FROM","CHILD_NEEDS_CARE_UNTIL","UNDEFINED"];class ge extends f.a{constructor(e={}){if(super(),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 ve=["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 Ce extends f.a{constructor(e={}){if(super(),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 ye extends f.a{constructor(e={}){if(super(),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 Ce(e))),void 0!==e.hasContents&&(this.hasContents=e.hasContents)}}const be=["UNKNOWN","FORM_1A","FORM_1B","FORM_1C","FORM_1D","FORM_21A","FORM_21A_BACK","FORM_1B_CUSTOM"];class Ae extends f.a{constructor(e={}){if(super(),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 ye(e.patientInfoBox),void 0===e.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=e.checkBoxes.map((e=>new fe(e))),void 0===e.dates)throw new Error("dates must be present in constructor argument");if(this.dates=e.dates.map((e=>new ge(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?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(e.documentDetectionResult):null}}const Se=["UNKNOWN","CREW_MEMBER_CERTIFICATE","ID_CARD","PASSPORT","VISA","CH_DRIVING_LICENSE"];class we extends f.a{constructor(e={}){if(super(),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 k.f(e.document):null}}const Ee=["ACCEPT","REJECT"];class xe extends f.a{constructor(e={}){super(),this.frameAccumulationConfiguration=new q({}),this.enableDetection=!0,this.incompleteResultHandling="ACCEPT",void 0!==e.frameAccumulationConfiguration&&(this.frameAccumulationConfiguration=new q(e.frameAccumulationConfiguration)),void 0!==e.enableDetection&&(this.enableDetection=e.enableDetection),void 0!==e.incompleteResultHandling&&(this.incompleteResultHandling=e.incompleteResultHandling)}}var De;!function(e){e.From=function(e){const t=e._type;switch(t){case"Glyph":return new Te(e);case"Word":return new Be(e);case"Line":return new Ie(e);case"Block":return new ke(e);case"Page":return new Oe(e);default:throw`Unknown child class name: ${t}`}}}(De||(De={}));class Te extends f.a{constructor(e={}){if(super(),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 Be extends f.a{constructor(e={}){if(super(),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 Te(e)))}}class Ie extends f.a{constructor(e={}){if(super(),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 Be(e)))}}class ke extends f.a{constructor(e={}){if(super(),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 Ie(e)))}}class Oe extends f.a{constructor(e={}){if(super(),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 ke(e)))}}var Le=n(32);class Pe extends f.a{constructor(e={}){super(),this.author="Created with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==e.author&&(this.author=e.author),void 0!==e.creator&&(this.creator=e.creator),void 0!==e.title&&(this.title=e.title),void 0!==e.subject&&(this.subject=e.subject),void 0!==e.keywords&&(this.keywords=e.keywords)}}const _e=["LETTER","LEGAL","A3","A4","A5","B4","B5","EXECUTIVE","US4x6","US4x8","US5x7","COMM10","CUSTOM"],Re=["PORTRAIT","LANDSCAPE","AUTO"],Fe=["FIT_IN","FILL_IN","STRETCH","NONE"],Ne=["NONE","NEAREST","LINEAR","CUBIC","LANCZOS4","AREA"];class Me extends f.a{constructor(e={}){super(),this.attributes=new Pe({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",void 0!==e.attributes&&(this.attributes=new Pe(e.attributes)),void 0!==e.pageSize&&(this.pageSize=e.pageSize),void 0!==e.pageDirection&&(this.pageDirection=e.pageDirection),void 0!==e.pageFit&&(this.pageFit=e.pageFit),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.resamplingMethod&&(this.resamplingMethod=e.resamplingMethod)}}const Ve=["NONE","CCITTRLE","CCITT_T4","CCITT_T6","LZW","JPEG","CCITTRLEW","PACKBITS","DEFLATE","ADOBE_DEFLATE"],We=["DISABLED","ENABLED","ENABLED_IF_BINARIZATION_FILTER_SET"];var ze,je;!function(e){e.From=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new He(e);case"UserFieldStringValue":return new Ue(e);case"UserFieldIntValue":return new Ze(e);default:throw`Unknown child class name: ${t}`}}}(ze||(ze={}));class He extends f.a{constructor(e={}){if(super(),this._type="UserFieldDoubleValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Ue extends f.a{constructor(e={}){if(super(),this._type="UserFieldStringValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Ze extends f.a{constructor(e={}){if(super(),this._type="UserFieldIntValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class Ge extends f.a{constructor(e={}){if(super(),void 0===e.tag)throw new Error("tag must be present in constructor argument");if(this.tag=e.tag,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=ze.From(e.value)}}class Ye extends f.a{constructor(e={}){super(),this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==e.compression&&(this.compression=e.compression),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.zipCompressionLevel&&(this.zipCompressionLevel=e.zipCompressionLevel),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.userFields&&(this.userFields=e.userFields.map((e=>new Ge(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?Le.i.From(e.binarizationFilter):null)}}(je=Ye||(Ye={})).defaultCompression="LZW",je.binaryDocumentOptimizedCompression="CCITT_T6";const Qe=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],Xe=["SUCCESS","BARCODE_WITHOUT_VIN","NO_BARCODE_FOUND","BARCODE_EXTRACTION_DISABLED"];class qe extends f.a{constructor(e={}){if(super(),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 Ke extends f.a{constructor(e={}){if(super(),void 0===e.textResult)throw new Error("textResult must be present in constructor argument");if(this.textResult=new oe(e.textResult),void 0===e.barcodeResult)throw new Error("barcodeResult must be present in constructor argument");this.barcodeResult=new qe(e.barcodeResult)}}class Je extends f.a{constructor(e={}){super(),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)}}const $e="MRZ",et="DeIdCardFront",tt="DeIdCardBack",nt="DePassport",it="DeDriverLicenseFront",ot="DeDriverLicenseBack",rt="Category",at="Categories",st="A",ct="A1",lt="A2",ut="AM",dt="B",mt="B1",ht="BE",ft="C",pt="C1",gt="C1E",vt="CE",Ct="D",yt="D1",bt="D1E",At="DE",St="L",wt="T",Et="DeResidencePermitFront",xt="DeResidencePermitBack",Dt="EuropeanHealthInsuranceCard",Tt="DeHealthInsuranceCardFront";class Bt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return $e}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get checkDigitBirthDate(){return this.document.fields.find((e=>"CheckDigitBirthDate"===e.type.name))}get checkDigitDocumentNumber(){return this.document.fields.find((e=>"CheckDigitDocumentNumber"===e.type.name))}get checkDigitExpiryDate(){return this.document.fields.find((e=>"CheckDigitExpiryDate"===e.type.name))}get checkDigitGeneral(){return this.document.fields.find((e=>"CheckDigitGeneral"===e.type.name))}get checkDigitPersonalNumber(){return this.document.fields.find((e=>"CheckDigitPersonalNumber"===e.type.name))}get dateOfIssuance(){return this.document.fields.find((e=>"DateOfIssuance"===e.type.name))}get documentNumber(){return this.document.fields.find((e=>"DocumentNumber"===e.type.name))}get documentType(){return this.document.fields.find((e=>"DocumentType"===e.type.name))}get documentTypeCode(){return this.document.fields.find((e=>"DocumentTypeCode"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get languageCode(){return this.document.fields.find((e=>"LanguageCode"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get officeOfIssuance(){return this.document.fields.find((e=>"OfficeOfIssuance"===e.type.name))}get optional1(){return this.document.fields.find((e=>"Optional1"===e.type.name))}get optional2(){return this.document.fields.find((e=>"Optional2"===e.type.name))}get pinCode(){return this.document.fields.find((e=>"PINCode"===e.type.name))}get personalNumber(){return this.document.fields.find((e=>"PersonalNumber"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}get travelDocType(){return this.document.fields.find((e=>"TravelDocType"===e.type.name))}get travelDocTypeVariant(){return this.document.fields.find((e=>"TravelDocTypeVariant"===e.type.name))}get unknown(){return this.document.fields.find((e=>"Unknown"===e.type.name))}get versionNumber(){return this.document.fields.find((e=>"VersionNumber"===e.type.name))}get visaOptional(){return this.document.fields.find((e=>"VisaOptional"===e.type.name))}}class It{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return et}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get cardAccessNumber(){return this.document.fields.find((e=>"CardAccessNumber"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get maidenName(){return this.document.fields.find((e=>"MaidenName"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}}class kt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return tt}get address(){return this.document.fields.find((e=>"Address"===e.type.name))}get eyeColor(){return this.document.fields.find((e=>"EyeColor"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get issueDate(){return this.document.fields.find((e=>"IssueDate"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get pseudonym(){return this.document.fields.find((e=>"Pseudonym"===e.type.name))}get rawMRZ(){return this.document.fields.find((e=>"RawMRZ"===e.type.name))}get mrz(){const e=this.document.children.find((e=>"MRZ"===e.type.name));return new Bt(e)}}class Ot{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return nt}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get countryCode(){return this.document.fields.find((e=>"CountryCode"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get issueDate(){return this.document.fields.find((e=>"IssueDate"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get maidenName(){return this.document.fields.find((e=>"MaidenName"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get passportType(){return this.document.fields.find((e=>"PassportType"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get rawMRZ(){return this.document.fields.find((e=>"RawMRZ"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}get mrz(){const e=this.document.children.find((e=>"MRZ"===e.type.name));return new Bt(e)}}class Lt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return it}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get issueDate(){return this.document.fields.find((e=>"IssueDate"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get licenseCategories(){return this.document.fields.find((e=>"LicenseCategories"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get serialNumber(){return this.document.fields.find((e=>"SerialNumber"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}}class Pt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return ot}get restrictions(){return this.document.fields.find((e=>"Restrictions"===e.type.name))}get categories(){const e=this.document.children.find((e=>"Categories"===e.type.name));return new Pt.Categories(e)}}!function(e){class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get restrictions(){return this.document.fields.find((e=>"Restrictions"===e.type.name))}get validFrom(){return this.document.fields.find((e=>"ValidFrom"===e.type.name))}get validUntil(){return this.document.fields.find((e=>"ValidUntil"===e.type.name))}}e.Category=t;class n{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return at}get a(){const t=this.document.children.find((e=>"A"===e.type.name));return new e.Categories.A(t)}get a1(){const t=this.document.children.find((e=>"A1"===e.type.name));return new e.Categories.A1(t)}get a2(){const t=this.document.children.find((e=>"A2"===e.type.name));return new e.Categories.A2(t)}get am(){const t=this.document.children.find((e=>"AM"===e.type.name));return new e.Categories.AM(t)}get b(){const t=this.document.children.find((e=>"B"===e.type.name));return new e.Categories.B(t)}get b1(){const t=this.document.children.find((e=>"B1"===e.type.name));return t?new e.Categories.B1(t):void 0}get be(){const t=this.document.children.find((e=>"BE"===e.type.name));return new e.Categories.BE(t)}get c(){const t=this.document.children.find((e=>"C"===e.type.name));return new e.Categories.C(t)}get c1(){const t=this.document.children.find((e=>"C1"===e.type.name));return new e.Categories.C1(t)}get c1E(){const t=this.document.children.find((e=>"C1E"===e.type.name));return new e.Categories.C1E(t)}get ce(){const t=this.document.children.find((e=>"CE"===e.type.name));return new e.Categories.CE(t)}get d(){const t=this.document.children.find((e=>"D"===e.type.name));return new e.Categories.D(t)}get d1(){const t=this.document.children.find((e=>"D1"===e.type.name));return new e.Categories.D1(t)}get d1E(){const t=this.document.children.find((e=>"D1E"===e.type.name));return new e.Categories.D1E(t)}get de(){const t=this.document.children.find((e=>"DE"===e.type.name));return new e.Categories.DE(t)}get l(){const t=this.document.children.find((e=>"L"===e.type.name));return new e.Categories.L(t)}get t(){const t=this.document.children.find((e=>"T"===e.type.name));return new e.Categories.T(t)}}e.Categories=n,function(e){e.A=class extends t{constructor(e){super(e)}requiredDocumentType(){return st}};e.A1=class extends t{constructor(e){super(e)}requiredDocumentType(){return ct}};e.A2=class extends t{constructor(e){super(e)}requiredDocumentType(){return lt}};e.AM=class extends t{constructor(e){super(e)}requiredDocumentType(){return ut}};e.B=class extends t{constructor(e){super(e)}requiredDocumentType(){return dt}};e.B1=class extends t{constructor(e){super(e)}requiredDocumentType(){return mt}};e.BE=class extends t{constructor(e){super(e)}requiredDocumentType(){return ht}};e.C=class extends t{constructor(e){super(e)}requiredDocumentType(){return ft}};e.C1=class extends t{constructor(e){super(e)}requiredDocumentType(){return pt}};e.C1E=class extends t{constructor(e){super(e)}requiredDocumentType(){return gt}};e.CE=class extends t{constructor(e){super(e)}requiredDocumentType(){return vt}};e.D=class extends t{constructor(e){super(e)}requiredDocumentType(){return Ct}};e.D1=class extends t{constructor(e){super(e)}requiredDocumentType(){return yt}};e.D1E=class extends t{constructor(e){super(e)}requiredDocumentType(){return bt}};e.DE=class extends t{constructor(e){super(e)}requiredDocumentType(){return At}};e.L=class extends t{constructor(e){super(e)}requiredDocumentType(){return St}};e.T=class extends t{constructor(e){super(e)}requiredDocumentType(){return wt}}}(n=e.Categories||(e.Categories={}))}(Pt||(Pt={}));class _t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Et}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get cardAccessNumber(){return this.document.fields.find((e=>"CardAccessNumber"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get id(){return this.document.fields.find((e=>"ID"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get photo(){return this.document.fields.find((e=>"Photo"===e.type.name))}get placeOfIssue(){return this.document.fields.find((e=>"PlaceOfIssue"===e.type.name))}get remarks(){return this.document.fields.find((e=>"Remarks"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}get titleType(){return this.document.fields.find((e=>"TitleType"===e.type.name))}get validFrom(){return this.document.fields.find((e=>"ValidFrom"===e.type.name))}}class Rt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return xt}get address(){return this.document.fields.find((e=>"Address"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get birthplace(){return this.document.fields.find((e=>"Birthplace"===e.type.name))}get eyeColor(){return this.document.fields.find((e=>"EyeColor"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get issuingAuthority(){return this.document.fields.find((e=>"IssuingAuthority"===e.type.name))}get nationality(){return this.document.fields.find((e=>"Nationality"===e.type.name))}get rawMRZ(){return this.document.fields.find((e=>"RawMRZ"===e.type.name))}get remarks(){return this.document.fields.find((e=>"Remarks"===e.type.name))}get mrz(){const e=this.document.children.find((e=>"MRZ"===e.type.name));return new Bt(e)}}class Ft{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Dt}get barcode(){return this.document.fields.find((e=>"Barcode"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get cardNumber(){return this.document.fields.find((e=>"CardNumber"===e.type.name))}get countryCode(){return this.document.fields.find((e=>"CountryCode"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}get givenNames(){return this.document.fields.find((e=>"GivenNames"===e.type.name))}get issuerName(){return this.document.fields.find((e=>"IssuerName"===e.type.name))}get issuerNumber(){return this.document.fields.find((e=>"IssuerNumber"===e.type.name))}get personalNumber(){return this.document.fields.find((e=>"PersonalNumber"===e.type.name))}get signature(){return this.document.fields.find((e=>"Signature"===e.type.name))}get surname(){return this.document.fields.find((e=>"Surname"===e.type.name))}}class Nt{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Tt}get cardAccessNumber(){return this.document.fields.find((e=>"CardAccessNumber"===e.type.name))}get issuerName(){return this.document.fields.find((e=>"IssuerName"===e.type.name))}get issuerNumber(){return this.document.fields.find((e=>"IssuerNumber"===e.type.name))}get name(){return this.document.fields.find((e=>"Name"===e.type.name))}get personalNumber(){return this.document.fields.find((e=>"PersonalNumber"===e.type.name))}}const Mt="BoardingPass",Vt="Leg",Wt="SwissQR",zt="DEMedicalPlan",jt="Patient",Ht="Doctor",Ut="Subheading",Zt="Medicine",Gt="Substance",Yt="Prescription",Qt="IDCardPDF417",Xt="GS1",qt="Element",Kt="ValidationError",Jt="SEPA",$t="MedicalCertificate",en="VCard",tn="Entry",nn="Version",on="Source",rn="Kind",an="XML",sn="Name",cn="FirstName",ln="Nickname",un="Birthday",dn="Anniversary",mn="Gender",hn="DeliveryAddress",fn="Photo",pn="TelephoneNumber",gn="Email",vn="IMPP",Cn="Languages",yn="TimeZone",bn="GeoLocation",An="Title",Sn="Role",wn="Logo",En="Organisation",xn="Member",Dn="Related",Tn="Categories",Bn="Note",In="ProductId",kn="Revision",On="Sound",Ln="UID",Pn="ClientPIDMap",_n="URL",Rn="PublicKey",Fn="BusyTimeURL",Nn="CalendarURIForRequests",Mn="CalendarURI",Vn="Custom",Wn="AAMVA",zn="TitleData",jn="RegistrationData",Hn="MotorCarrierData",Un="RegistrantAndVehicleData",Zn="VehicleOwnerData",Gn="VehicleData",Yn="VehicleSafetyInspectionData",Qn="DLID",Xn="DriverLicense",qn="IDCard",Kn="EnhancedDriverLicense",Jn="RawDocument",$n="HIBC";class ei{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Mt}get electronicTicket(){return this.document.fields.find((e=>"ElectronicTicket"===e.type.name))}get name(){return this.document.fields.find((e=>"Name"===e.type.name))}get numberOfLegs(){return this.document.fields.find((e=>"NumberOfLegs"===e.type.name))}get securityData(){return this.document.fields.find((e=>"SecurityData"===e.type.name))}get legs(){return this.document.children.filter((e=>"Leg"===e.type.name)).map((e=>new ei.Leg(e)))}}!function(e){e.Leg=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Vt}get airlineDesignatorOfBoardingPassIssuer(){return this.document.fields.find((e=>"AirlineDesignatorOfBoardingPassIssuer"===e.type.name))}get airlineNumericCode(){return this.document.fields.find((e=>"AirlineNumericCode"===e.type.name))}get baggageTagLicensePlateNumbers(){return this.document.fields.find((e=>"BaggageTagLicensePlateNumbers"===e.type.name))}get checkInSequenceNumber(){return this.document.fields.find((e=>"CheckInSequenceNumber"===e.type.name))}get compartmentCode(){return this.document.fields.find((e=>"CompartmentCode"===e.type.name))}get dateOfBoardingPassIssuanceJulian(){return this.document.fields.find((e=>"DateOfBoardingPassIssuanceJulian"===e.type.name))}get dateOfFlightJulian(){return this.document.fields.find((e=>"DateOfFlightJulian"===e.type.name))}get departureAirportCode(){return this.document.fields.find((e=>"DepartureAirportCode"===e.type.name))}get destinationAirportCode(){return this.document.fields.find((e=>"DestinationAirportCode"===e.type.name))}get documentFormSerialNumber(){return this.document.fields.find((e=>"DocumentFormSerialNumber"===e.type.name))}get documentType(){return this.document.fields.find((e=>"DocumentType"===e.type.name))}get fastTrack(){return this.document.fields.find((e=>"FastTrack"===e.type.name))}get firstNonConsecutiveBaggageTagLicensePlateNumber(){return this.document.fields.find((e=>"FirstNonConsecutiveBaggageTagLicensePlateNumber"===e.type.name))}get flightNumber(){return this.document.fields.find((e=>"FlightNumber"===e.type.name))}get forIndividualAirlineUse(){return this.document.fields.find((e=>"ForIndividualAirlineUse"===e.type.name))}get freeBaggageAllowance(){return this.document.fields.find((e=>"FreeBaggageAllowance"===e.type.name))}get frequentFlyerAirlineDesignator(){return this.document.fields.find((e=>"FrequentFlyerAirlineDesignator"===e.type.name))}get frequentFlyerNumber(){return this.document.fields.find((e=>"FrequentFlyerNumber"===e.type.name))}get idadIndicator(){return this.document.fields.find((e=>"IDADIndicator"===e.type.name))}get internationalDocumentationVerification(){return this.document.fields.find((e=>"InternationalDocumentationVerification"===e.type.name))}get marketingCarrierDesignator(){return this.document.fields.find((e=>"MarketingCarrierDesignator"===e.type.name))}get operatingCarrierDesignator(){return this.document.fields.find((e=>"OperatingCarrierDesignator"===e.type.name))}get operatingCarrierPNRCode(){return this.document.fields.find((e=>"OperatingCarrierPNRCode"===e.type.name))}get passengerDescription(){return this.document.fields.find((e=>"PassengerDescription"===e.type.name))}get passengerStatus(){return this.document.fields.find((e=>"PassengerStatus"===e.type.name))}get seatNumber(){return this.document.fields.find((e=>"SeatNumber"===e.type.name))}get secondNonConsecutiveBaggageTagLicensePlateNumber(){return this.document.fields.find((e=>"SecondNonConsecutiveBaggageTagLicensePlateNumber"===e.type.name))}get selecteeIndicator(){return this.document.fields.find((e=>"SelecteeIndicator"===e.type.name))}get sourceOfBoardingPassIssuance(){return this.document.fields.find((e=>"SourceOfBoardingPassIssuance"===e.type.name))}get sourceOfCheckIn(){return this.document.fields.find((e=>"SourceOfCheckIn"===e.type.name))}get versionNumber(){return this.document.fields.find((e=>"VersionNumber"===e.type.name))}}}(ei||(ei={}));class ti{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Wt}get additionalBillingInformation(){return this.document.fields.find((e=>"AdditionalBillingInformation"===e.type.name))}get additionalInfoTrailer(){return this.document.fields.find((e=>"AdditionalInfoTrailer"===e.type.name))}get additionalInfoUnstructured(){return this.document.fields.find((e=>"AdditionalInfoUnstructured"===e.type.name))}get alternativeProcedureParameter(){return this.document.fields.find((e=>"AlternativeProcedureParameter"===e.type.name))}get amount(){return this.document.fields.find((e=>"Amount"===e.type.name))}get currency(){return this.document.fields.find((e=>"Currency"===e.type.name))}get debtorAddressType(){return this.document.fields.find((e=>"DebtorAddressType"===e.type.name))}get debtorBuildingOrAddressLine2(){return this.document.fields.find((e=>"DebtorBuildingOrAddressLine2"===e.type.name))}get debtorCountry(){return this.document.fields.find((e=>"DebtorCountry"===e.type.name))}get debtorName(){return this.document.fields.find((e=>"DebtorName"===e.type.name))}get debtorPlace(){return this.document.fields.find((e=>"DebtorPlace"===e.type.name))}get debtorPostalCode(){return this.document.fields.find((e=>"DebtorPostalCode"===e.type.name))}get debtorStreetOrAddressLine1(){return this.document.fields.find((e=>"DebtorStreetOrAddressLine1"===e.type.name))}get dueDate(){return this.document.fields.find((e=>"DueDate"===e.type.name))}get encoding(){return this.document.fields.find((e=>"Encoding"===e.type.name))}get finalPayeeAddressType(){return this.document.fields.find((e=>"FinalPayeeAddressType"===e.type.name))}get finalPayeeBuildingOrAddressLine2(){return this.document.fields.find((e=>"FinalPayeeBuildingOrAddressLine2"===e.type.name))}get finalPayeeCountry(){return this.document.fields.find((e=>"FinalPayeeCountry"===e.type.name))}get finalPayeeName(){return this.document.fields.find((e=>"FinalPayeeName"===e.type.name))}get finalPayeePlace(){return this.document.fields.find((e=>"FinalPayeePlace"===e.type.name))}get finalPayeePostalCode(){return this.document.fields.find((e=>"FinalPayeePostalCode"===e.type.name))}get finalPayeeStreetOrAddressLine1(){return this.document.fields.find((e=>"FinalPayeeStreetOrAddressLine1"===e.type.name))}get iban(){return this.document.fields.find((e=>"IBAN"===e.type.name))}get majorVersion(){return this.document.fields.find((e=>"MajorVersion"===e.type.name))}get payeeAddressType(){return this.document.fields.find((e=>"PayeeAddressType"===e.type.name))}get payeeBuildingOrAddressLine2(){return this.document.fields.find((e=>"PayeeBuildingOrAddressLine2"===e.type.name))}get payeeCountry(){return this.document.fields.find((e=>"PayeeCountry"===e.type.name))}get payeeName(){return this.document.fields.find((e=>"PayeeName"===e.type.name))}get payeePlace(){return this.document.fields.find((e=>"PayeePlace"===e.type.name))}get payeePostalCode(){return this.document.fields.find((e=>"PayeePostalCode"===e.type.name))}get payeeStreetOrAddressLine1(){return this.document.fields.find((e=>"PayeeStreetOrAddressLine1"===e.type.name))}get paymentReference(){return this.document.fields.find((e=>"PaymentReference"===e.type.name))}get paymentReferenceType(){return this.document.fields.find((e=>"PaymentReferenceType"===e.type.name))}}class ni{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return zt}get currentPage(){return this.document.fields.find((e=>"CurrentPage"===e.type.name))}get documentVersionNumber(){return this.document.fields.find((e=>"DocumentVersionNumber"===e.type.name))}get guid(){return this.document.fields.find((e=>"GUID"===e.type.name))}get languageCountryCode(){return this.document.fields.find((e=>"LanguageCountryCode"===e.type.name))}get patchVersionNumber(){return this.document.fields.find((e=>"PatchVersionNumber"===e.type.name))}get totalNumberOfPages(){return this.document.fields.find((e=>"TotalNumberOfPages"===e.type.name))}get patient(){const e=this.document.children.find((e=>"Patient"===e.type.name));return new ni.Patient(e)}get doctor(){const e=this.document.children.find((e=>"Doctor"===e.type.name));return new ni.Doctor(e)}get subheadings(){return this.document.children.filter((e=>"Subheading"===e.type.name)).map((e=>new ni.Subheading(e)))}}!function(e){e.Patient=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return jt}get allergiesAndIntolerances(){return this.document.fields.find((e=>"AllergiesAndIntolerances"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get breastFeeding(){return this.document.fields.find((e=>"BreastFeeding"===e.type.name))}get creatinineValue(){return this.document.fields.find((e=>"CreatinineValue"===e.type.name))}get firstName(){return this.document.fields.find((e=>"FirstName"===e.type.name))}get gender(){return this.document.fields.find((e=>"Gender"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get lastName(){return this.document.fields.find((e=>"LastName"===e.type.name))}get patientFreeText(){return this.document.fields.find((e=>"PatientFreeText"===e.type.name))}get patientID(){return this.document.fields.find((e=>"PatientID"===e.type.name))}get preName(){return this.document.fields.find((e=>"PreName"===e.type.name))}get pregnant(){return this.document.fields.find((e=>"Pregnant"===e.type.name))}get suffix(){return this.document.fields.find((e=>"Suffix"===e.type.name))}get title(){return this.document.fields.find((e=>"Title"===e.type.name))}get weight(){return this.document.fields.find((e=>"Weight"===e.type.name))}};e.Doctor=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Ht}get doctorNumber(){return this.document.fields.find((e=>"DoctorNumber"===e.type.name))}get email(){return this.document.fields.find((e=>"Email"===e.type.name))}get hospitalID(){return this.document.fields.find((e=>"HospitalID"===e.type.name))}get issuerName(){return this.document.fields.find((e=>"IssuerName"===e.type.name))}get issuingDateAndTime(){return this.document.fields.find((e=>"IssuingDateAndTime"===e.type.name))}get pharmacyID(){return this.document.fields.find((e=>"PharmacyID"===e.type.name))}get place(){return this.document.fields.find((e=>"Place"===e.type.name))}get postalCode(){return this.document.fields.find((e=>"PostalCode"===e.type.name))}get street(){return this.document.fields.find((e=>"Street"===e.type.name))}get telephoneNumber(){return this.document.fields.find((e=>"TelephoneNumber"===e.type.name))}};class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Ut}get generalNotes(){return this.document.fields.filter((e=>"GeneralNote"===e.type.name))}get keyWords(){return this.document.fields.find((e=>"KeyWords"===e.type.name))}get subheadingFreeText(){return this.document.fields.find((e=>"SubheadingFreeText"===e.type.name))}get medicines(){return this.document.children.filter((e=>"Medicine"===e.type.name)).map((t=>new e.Subheading.Medicine(t)))}get prescriptions(){return this.document.children.filter((e=>"Prescription"===e.type.name)).map((t=>new e.Subheading.Prescription(t)))}}e.Subheading=t,function(t){class n{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Zt}get dosageForm(){return this.document.fields.find((e=>"DosageForm"===e.type.name))}get dosageFormFreeText(){return this.document.fields.find((e=>"DosageFormFreeText"===e.type.name))}get dosageFreeText(){return this.document.fields.find((e=>"DosageFreeText"===e.type.name))}get dosingUnit(){return this.document.fields.find((e=>"DosingUnit"===e.type.name))}get dosingUnitFreeText(){return this.document.fields.find((e=>"DosingUnitFreeText"===e.type.name))}get drugName(){return this.document.fields.find((e=>"DrugName"===e.type.name))}get evening(){return this.document.fields.find((e=>"Evening"===e.type.name))}get generalNotes(){return this.document.fields.find((e=>"GeneralNotes"===e.type.name))}get midday(){return this.document.fields.find((e=>"Midday"===e.type.name))}get morning(){return this.document.fields.find((e=>"Morning"===e.type.name))}get night(){return this.document.fields.find((e=>"Night"===e.type.name))}get pharmaceuticalNumber(){return this.document.fields.find((e=>"PharmaceuticalNumber"===e.type.name))}get reasonForTreatment(){return this.document.fields.find((e=>"ReasonForTreatment"===e.type.name))}get relevantInfo(){return this.document.fields.find((e=>"RelevantInfo"===e.type.name))}get substances(){return this.document.children.filter((e=>"Substance"===e.type.name)).map((t=>new e.Subheading.Medicine.Substance(t)))}}t.Medicine=n,function(e){e.Substance=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Gt}get activeSubstance(){return this.document.fields.find((e=>"ActiveSubstance"===e.type.name))}get potency(){return this.document.fields.find((e=>"Potency"===e.type.name))}}}(n=t.Medicine||(t.Medicine={}));t.Prescription=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Yt}get generalInformation(){return this.document.fields.find((e=>"GeneralInformation"===e.type.name))}get prescriptionFreeText(){return this.document.fields.find((e=>"PrescriptionFreeText"===e.type.name))}}}(t=e.Subheading||(e.Subheading={}))}(ni||(ni={}));class ii{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Qt}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get dateExpired(){return this.document.fields.find((e=>"DateExpired"===e.type.name))}get dateIssued(){return this.document.fields.find((e=>"DateIssued"===e.type.name))}get documentCode(){return this.document.fields.find((e=>"DocumentCode"===e.type.name))}get firstName(){return this.document.fields.find((e=>"FirstName"===e.type.name))}get lastName(){return this.document.fields.find((e=>"LastName"===e.type.name))}get optional(){return this.document.fields.find((e=>"Optional"===e.type.name))}}class oi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Xt}get elements(){return this.document.children.filter((e=>"Element"===e.type.name)).map((e=>new oi.Element(e)))}}!function(e){class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return qt}get applicationIdentifier(){return this.document.fields.find((e=>"ApplicationIdentifier"===e.type.name))}get dataTitle(){return this.document.fields.find((e=>"DataTitle"===e.type.name))}get elementDescription(){return this.document.fields.find((e=>"ElementDescription"===e.type.name))}get rawValue(){return this.document.fields.find((e=>"RawValue"===e.type.name))}get validationErrors(){return this.document.children.filter((e=>"ValidationError"===e.type.name)).map((t=>new e.Element.ValidationError(t)))}}e.Element=t,function(e){e.ValidationError=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Kt}get code(){return this.document.fields.find((e=>"Code"===e.type.name))}get reason(){return this.document.fields.find((e=>"Reason"===e.type.name))}}}(t=e.Element||(e.Element={}))}(oi||(oi={}));class ri{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Jt}get amount(){return this.document.fields.find((e=>"Amount"===e.type.name))}get characterSet(){return this.document.fields.find((e=>"CharacterSet"===e.type.name))}get identification(){return this.document.fields.find((e=>"Identification"===e.type.name))}get information(){return this.document.fields.find((e=>"Information"===e.type.name))}get purpose(){return this.document.fields.find((e=>"Purpose"===e.type.name))}get receiverBIC(){return this.document.fields.find((e=>"ReceiverBIC"===e.type.name))}get receiverIBAN(){return this.document.fields.find((e=>"ReceiverIBAN"===e.type.name))}get receiverName(){return this.document.fields.find((e=>"ReceiverName"===e.type.name))}get remittance(){return this.document.fields.find((e=>"Remittance"===e.type.name))}get serviceTag(){return this.document.fields.find((e=>"ServiceTag"===e.type.name))}get version(){return this.document.fields.find((e=>"Version"===e.type.name))}}class ai{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return $t}get accident(){return this.document.fields.find((e=>"Accident"===e.type.name))}get assignedToAccidentInsuranceDoctor(){return this.document.fields.find((e=>"AssignedToAccidentInsuranceDoctor"===e.type.name))}get birthDate(){return this.document.fields.find((e=>"BirthDate"===e.type.name))}get childNeedsCareFrom(){return this.document.fields.find((e=>"ChildNeedsCareFrom"===e.type.name))}get childNeedsCareUntil(){return this.document.fields.find((e=>"ChildNeedsCareUntil"===e.type.name))}get diagnose(){return this.document.fields.find((e=>"Diagnose"===e.type.name))}get diagnosedOn(){return this.document.fields.find((e=>"DiagnosedOn"===e.type.name))}get doctorNumber(){return this.document.fields.find((e=>"DoctorNumber"===e.type.name))}get documentDate(){return this.document.fields.find((e=>"DocumentDate"===e.type.name))}get firstName(){return this.document.fields.find((e=>"FirstName"===e.type.name))}get healthInsuranceNumber(){return this.document.fields.find((e=>"HealthInsuranceNumber"===e.type.name))}get incapableOfWorkSince(){return this.document.fields.find((e=>"IncapableOfWorkSince"===e.type.name))}get incapableOfWorkUntil(){return this.document.fields.find((e=>"IncapableOfWorkUntil"===e.type.name))}get initialCertificate(){return this.document.fields.find((e=>"InitialCertificate"===e.type.name))}get insuredPersonNumber(){return this.document.fields.find((e=>"InsuredPersonNumber"===e.type.name))}get lastName(){return this.document.fields.find((e=>"LastName"===e.type.name))}get placeOfOperationNumber(){return this.document.fields.find((e=>"PlaceOfOperationNumber"===e.type.name))}get renewedCertificate(){return this.document.fields.find((e=>"RenewedCertificate"===e.type.name))}get requiresCare(){return this.document.fields.find((e=>"RequiresCare"===e.type.name))}get status(){return this.document.fields.find((e=>"Status"===e.type.name))}get workAccident(){return this.document.fields.find((e=>"WorkAccident"===e.type.name))}}class si{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return en}get version(){const e=this.document.children.find((e=>"Version"===e.type.name));return new si.Version(e)}get source(){const e=this.document.children.find((e=>"Source"===e.type.name));return e?new si.Source(e):void 0}get kind(){const e=this.document.children.find((e=>"Kind"===e.type.name));return e?new si.Kind(e):void 0}get xml(){const e=this.document.children.find((e=>"XML"===e.type.name));return e?new si.XML(e):void 0}get name(){const e=this.document.children.find((e=>"Name"===e.type.name));return e?new si.Name(e):void 0}get firstName(){const e=this.document.children.find((e=>"FirstName"===e.type.name));return e?new si.FirstName(e):void 0}get nickname(){const e=this.document.children.find((e=>"Nickname"===e.type.name));return e?new si.Nickname(e):void 0}get birthday(){const e=this.document.children.find((e=>"Birthday"===e.type.name));return e?new si.Birthday(e):void 0}get anniversary(){const e=this.document.children.find((e=>"Anniversary"===e.type.name));return e?new si.Anniversary(e):void 0}get gender(){const e=this.document.children.find((e=>"Gender"===e.type.name));return e?new si.Gender(e):void 0}get deliveryAddress(){const e=this.document.children.find((e=>"DeliveryAddress"===e.type.name));return e?new si.DeliveryAddress(e):void 0}get photo(){const e=this.document.children.find((e=>"Photo"===e.type.name));return e?new si.Photo(e):void 0}get telephoneNumber(){const e=this.document.children.find((e=>"TelephoneNumber"===e.type.name));return e?new si.TelephoneNumber(e):void 0}get email(){const e=this.document.children.find((e=>"Email"===e.type.name));return e?new si.Email(e):void 0}get impp(){const e=this.document.children.find((e=>"IMPP"===e.type.name));return e?new si.IMPP(e):void 0}get languages(){const e=this.document.children.find((e=>"Languages"===e.type.name));return e?new si.Languages(e):void 0}get timeZone(){const e=this.document.children.find((e=>"TimeZone"===e.type.name));return e?new si.TimeZone(e):void 0}get geoLocation(){const e=this.document.children.find((e=>"GeoLocation"===e.type.name));return e?new si.GeoLocation(e):void 0}get title(){const e=this.document.children.find((e=>"Title"===e.type.name));return e?new si.Title(e):void 0}get role(){const e=this.document.children.find((e=>"Role"===e.type.name));return e?new si.Role(e):void 0}get logo(){const e=this.document.children.find((e=>"Logo"===e.type.name));return e?new si.Logo(e):void 0}get organisation(){const e=this.document.children.find((e=>"Organisation"===e.type.name));return e?new si.Organisation(e):void 0}get member(){const e=this.document.children.find((e=>"Member"===e.type.name));return e?new si.Member(e):void 0}get related(){const e=this.document.children.find((e=>"Related"===e.type.name));return e?new si.Related(e):void 0}get categories(){const e=this.document.children.find((e=>"Categories"===e.type.name));return e?new si.Categories(e):void 0}get note(){const e=this.document.children.find((e=>"Note"===e.type.name));return e?new si.Note(e):void 0}get productId(){const e=this.document.children.find((e=>"ProductId"===e.type.name));return e?new si.ProductId(e):void 0}get revision(){const e=this.document.children.find((e=>"Revision"===e.type.name));return e?new si.Revision(e):void 0}get sound(){const e=this.document.children.find((e=>"Sound"===e.type.name));return e?new si.Sound(e):void 0}get uid(){const e=this.document.children.find((e=>"UID"===e.type.name));return e?new si.UID(e):void 0}get clientPIDMap(){const e=this.document.children.find((e=>"ClientPIDMap"===e.type.name));return e?new si.ClientPIDMap(e):void 0}get url(){const e=this.document.children.find((e=>"URL"===e.type.name));return e?new si.URL(e):void 0}get publicKey(){const e=this.document.children.find((e=>"PublicKey"===e.type.name));return e?new si.PublicKey(e):void 0}get busyTimeURL(){const e=this.document.children.find((e=>"BusyTimeURL"===e.type.name));return e?new si.BusyTimeURL(e):void 0}get calendarURIForRequests(){const e=this.document.children.find((e=>"CalendarURIForRequests"===e.type.name));return e?new si.CalendarURIForRequests(e):void 0}get calendarURI(){const e=this.document.children.find((e=>"CalendarURI"===e.type.name));return e?new si.CalendarURI(e):void 0}get customs(){return this.document.children.filter((e=>"Custom"===e.type.name)).map((e=>new si.Custom(e)))}}!function(e){class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get rawValue(){return this.document.fields.find((e=>"RawValue"===e.type.name))}get typeModifiers(){return this.document.fields.filter((e=>"TypeModifier"===e.type.name))}get values(){return this.document.fields.filter((e=>"Value"===e.type.name))}}e.Entry=t;e.Version=class extends t{constructor(e){super(e)}requiredDocumentType(){return nn}};e.Source=class extends t{constructor(e){super(e)}requiredDocumentType(){return on}};e.Kind=class extends t{constructor(e){super(e)}requiredDocumentType(){return rn}};e.XML=class extends t{constructor(e){super(e)}requiredDocumentType(){return an}};e.Name=class extends t{constructor(e){super(e)}requiredDocumentType(){return sn}};e.FirstName=class extends t{constructor(e){super(e)}requiredDocumentType(){return cn}};e.Nickname=class extends t{constructor(e){super(e)}requiredDocumentType(){return ln}};e.Birthday=class extends t{constructor(e){super(e)}requiredDocumentType(){return un}};e.Anniversary=class extends t{constructor(e){super(e)}requiredDocumentType(){return dn}};e.Gender=class extends t{constructor(e){super(e)}requiredDocumentType(){return mn}};e.DeliveryAddress=class extends t{constructor(e){super(e)}requiredDocumentType(){return hn}};e.Photo=class extends t{constructor(e){super(e)}requiredDocumentType(){return fn}};e.TelephoneNumber=class extends t{constructor(e){super(e)}requiredDocumentType(){return pn}};e.Email=class extends t{constructor(e){super(e)}requiredDocumentType(){return gn}};e.IMPP=class extends t{constructor(e){super(e)}requiredDocumentType(){return vn}};e.Languages=class extends t{constructor(e){super(e)}requiredDocumentType(){return Cn}};e.TimeZone=class extends t{constructor(e){super(e)}requiredDocumentType(){return yn}};e.GeoLocation=class extends t{constructor(e){super(e)}requiredDocumentType(){return bn}};e.Title=class extends t{constructor(e){super(e)}requiredDocumentType(){return An}};e.Role=class extends t{constructor(e){super(e)}requiredDocumentType(){return Sn}};e.Logo=class extends t{constructor(e){super(e)}requiredDocumentType(){return wn}};e.Organisation=class extends t{constructor(e){super(e)}requiredDocumentType(){return En}};e.Member=class extends t{constructor(e){super(e)}requiredDocumentType(){return xn}};e.Related=class extends t{constructor(e){super(e)}requiredDocumentType(){return Dn}};e.Categories=class extends t{constructor(e){super(e)}requiredDocumentType(){return Tn}};e.Note=class extends t{constructor(e){super(e)}requiredDocumentType(){return Bn}};e.ProductId=class extends t{constructor(e){super(e)}requiredDocumentType(){return In}};e.Revision=class extends t{constructor(e){super(e)}requiredDocumentType(){return kn}};e.Sound=class extends t{constructor(e){super(e)}requiredDocumentType(){return On}};e.UID=class extends t{constructor(e){super(e)}requiredDocumentType(){return Ln}};e.ClientPIDMap=class extends t{constructor(e){super(e)}requiredDocumentType(){return Pn}};e.URL=class extends t{constructor(e){super(e)}requiredDocumentType(){return _n}};e.PublicKey=class extends t{constructor(e){super(e)}requiredDocumentType(){return Rn}};e.BusyTimeURL=class extends t{constructor(e){super(e)}requiredDocumentType(){return Fn}};e.CalendarURIForRequests=class extends t{constructor(e){super(e)}requiredDocumentType(){return Nn}};e.CalendarURI=class extends t{constructor(e){super(e)}requiredDocumentType(){return Mn}};e.Custom=class extends t{constructor(e){super(e)}requiredDocumentType(){return Vn}}}(si||(si={}));class ci{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Wn}get issuerIdentificationNumber(){return this.document.fields.find((e=>"IssuerIdentificationNumber"===e.type.name))}get jurisdictionVersionNumber(){return this.document.fields.find((e=>"JurisdictionVersionNumber"===e.type.name))}get version(){return this.document.fields.find((e=>"Version"===e.type.name))}get titleData(){const e=this.document.children.find((e=>"TitleData"===e.type.name));return e?new ci.TitleData(e):void 0}get registrationData(){const e=this.document.children.find((e=>"RegistrationData"===e.type.name));return e?new ci.RegistrationData(e):void 0}get motorCarrierData(){const e=this.document.children.find((e=>"MotorCarrierData"===e.type.name));return e?new ci.MotorCarrierData(e):void 0}get registrantAndVehicleData(){const e=this.document.children.find((e=>"RegistrantAndVehicleData"===e.type.name));return e?new ci.RegistrantAndVehicleData(e):void 0}get vehicleOwnerData(){const e=this.document.children.find((e=>"VehicleOwnerData"===e.type.name));return e?new ci.VehicleOwnerData(e):void 0}get vehicleData(){const e=this.document.children.find((e=>"VehicleData"===e.type.name));return e?new ci.VehicleData(e):void 0}get vehicleSafetyInspectionData(){const e=this.document.children.find((e=>"VehicleSafetyInspectionData"===e.type.name));return e?new ci.VehicleSafetyInspectionData(e):void 0}get driverLicense(){const e=this.document.children.find((e=>"DriverLicense"===e.type.name));return e?new ci.DriverLicense(e):void 0}get idCard(){const e=this.document.children.find((e=>"IDCard"===e.type.name));return e?new ci.IDCard(e):void 0}get enhancedDriverLicense(){const e=this.document.children.find((e=>"EnhancedDriverLicense"===e.type.name));return e?new ci.EnhancedDriverLicense(e):void 0}get rawDocument(){const e=this.document.children.find((e=>"RawDocument"===e.type.name));return new ci.RawDocument(e)}}!function(e){e.TitleData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return zn}get addressCity(){return this.document.fields.find((e=>"AddressCity"===e.type.name))}get addressJurisdictionCode(){return this.document.fields.find((e=>"AddressJurisdictionCode"===e.type.name))}get addressStreet(){return this.document.fields.find((e=>"AddressStreet"===e.type.name))}get addressZipCode(){return this.document.fields.find((e=>"AddressZipCode"===e.type.name))}get businessName(){return this.document.fields.find((e=>"BusinessName"===e.type.name))}get familyName(){return this.document.fields.find((e=>"FamilyName"===e.type.name))}get firstLienHolderId(){return this.document.fields.find((e=>"FirstLienHolderId"===e.type.name))}get firstLienHolderName(){return this.document.fields.find((e=>"FirstLienHolderName"===e.type.name))}get givenName(){return this.document.fields.find((e=>"GivenName"===e.type.name))}get newUsedIndicator(){return this.document.fields.find((e=>"NewUsedIndicator"===e.type.name))}get odometerDate(){return this.document.fields.find((e=>"OdometerDate"===e.type.name))}get odometerDisclosure(){return this.document.fields.find((e=>"OdometerDisclosure"===e.type.name))}get odometerReadingKilometers(){return this.document.fields.find((e=>"OdometerReadingKilometers"===e.type.name))}get odometerReadingMileage(){return this.document.fields.find((e=>"OdometerReadingMileage"===e.type.name))}get previousTitleNumber(){return this.document.fields.find((e=>"PreviousTitleNumber"===e.type.name))}get previousTitlingJurisdiction(){return this.document.fields.find((e=>"PreviousTitlingJurisdiction"===e.type.name))}get titleBrand(){return this.document.fields.find((e=>"TitleBrand"===e.type.name))}get titleIssueDate(){return this.document.fields.find((e=>"TitleIssueDate"===e.type.name))}get titleNumber(){return this.document.fields.find((e=>"TitleNumber"===e.type.name))}get titlingJurisdiction(){return this.document.fields.find((e=>"TitlingJurisdiction"===e.type.name))}get vehicleBodyStyle(){return this.document.fields.find((e=>"VehicleBodyStyle"===e.type.name))}get vehicleColor(){return this.document.fields.find((e=>"VehicleColor"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModel(){return this.document.fields.find((e=>"VehicleModel"===e.type.name))}get vehicleModelYear(){return this.document.fields.find((e=>"VehicleModelYear"===e.type.name))}get vehiclePurchaseDate(){return this.document.fields.find((e=>"VehiclePurchaseDate"===e.type.name))}};e.RegistrationData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return jn}get addressCity(){return this.document.fields.find((e=>"AddressCity"===e.type.name))}get addressJurisdictionCode(){return this.document.fields.find((e=>"AddressJurisdictionCode"===e.type.name))}get addressStreet(){return this.document.fields.find((e=>"AddressStreet"===e.type.name))}get addressZipCode(){return this.document.fields.find((e=>"AddressZipCode"===e.type.name))}get axles(){return this.document.fields.find((e=>"Axles"===e.type.name))}get businessName(){return this.document.fields.find((e=>"BusinessName"===e.type.name))}get fuel(){return this.document.fields.find((e=>"Fuel"===e.type.name))}get grossVehicleWeight(){return this.document.fields.find((e=>"GrossVehicleWeight"===e.type.name))}get registrantFamilyName(){return this.document.fields.find((e=>"RegistrantFamilyName"===e.type.name))}get registrantGivenName(){return this.document.fields.find((e=>"RegistrantGivenName"===e.type.name))}get registrationExpiryDate(){return this.document.fields.find((e=>"RegistrationExpiryDate"===e.type.name))}get registrationIssueDate(){return this.document.fields.find((e=>"RegistrationIssueDate"===e.type.name))}get registrationPlateNumber(){return this.document.fields.find((e=>"RegistrationPlateNumber"===e.type.name))}get registrationWindowStickerDecal(){return this.document.fields.find((e=>"RegistrationWindowStickerDecal"===e.type.name))}get registrationYear(){return this.document.fields.find((e=>"RegistrationYear"===e.type.name))}get vehicleBodyStyle(){return this.document.fields.find((e=>"VehicleBodyStyle"===e.type.name))}get vehicleColor(){return this.document.fields.find((e=>"VehicleColor"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModel(){return this.document.fields.find((e=>"VehicleModel"===e.type.name))}get vehicleModelYear(){return this.document.fields.find((e=>"VehicleModelYear"===e.type.name))}get vehicleUse(){return this.document.fields.find((e=>"VehicleUse"===e.type.name))}};e.MotorCarrierData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Hn}get carrierName(){return this.document.fields.find((e=>"CarrierName"===e.type.name))}get city(){return this.document.fields.find((e=>"City"===e.type.name))}get jurisdiction(){return this.document.fields.find((e=>"Jurisdiction"===e.type.name))}get streetAddress(){return this.document.fields.find((e=>"StreetAddress"===e.type.name))}get usdotNumber(){return this.document.fields.find((e=>"USDOTNumber"===e.type.name))}get zip(){return this.document.fields.find((e=>"Zip"===e.type.name))}};e.RegistrantAndVehicleData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Un}get address(){return this.document.fields.find((e=>"Address"===e.type.name))}get baseJurisdictionRegisteredWeight(){return this.document.fields.find((e=>"BaseJurisdictionRegisteredWeight"===e.type.name))}get carrierNameRegistrant(){return this.document.fields.find((e=>"CarrierNameRegistrant"===e.type.name))}get city(){return this.document.fields.find((e=>"City"===e.type.name))}get grossVehicleWeight(){return this.document.fields.find((e=>"GrossVehicleWeight"===e.type.name))}get jurisdiction(){return this.document.fields.find((e=>"Jurisdiction"===e.type.name))}get modelYear(){return this.document.fields.find((e=>"ModelYear"===e.type.name))}get numberOfSeats(){return this.document.fields.find((e=>"NumberOfSeats"===e.type.name))}get registrationDecalNumber(){return this.document.fields.find((e=>"RegistrationDecalNumber"===e.type.name))}get registrationEnforcementDate(){return this.document.fields.find((e=>"RegistrationEnforcementDate"===e.type.name))}get registrationExpirationDate(){return this.document.fields.find((e=>"RegistrationExpirationDate"===e.type.name))}get registrationIssueDate(){return this.document.fields.find((e=>"RegistrationIssueDate"===e.type.name))}get registrationPlateNumber(){return this.document.fields.find((e=>"RegistrationPlateNumber"===e.type.name))}get registrationYear(){return this.document.fields.find((e=>"RegistrationYear"===e.type.name))}get typeOfVehicle(){return this.document.fields.find((e=>"TypeOfVehicle"===e.type.name))}get unitNumber(){return this.document.fields.find((e=>"UnitNumber"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get zipCode(){return this.document.fields.find((e=>"ZipCode"===e.type.name))}};e.VehicleOwnerData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Zn}get firstOwnerIdNumber(){return this.document.fields.find((e=>"FirstOwnerIdNumber"===e.type.name))}get firstOwnerLastName(){return this.document.fields.find((e=>"FirstOwnerLastName"===e.type.name))}get firstOwnerLegalStatus(){return this.document.fields.find((e=>"FirstOwnerLegalStatus"===e.type.name))}get firstOwnerMiddleName(){return this.document.fields.find((e=>"FirstOwnerMiddleName"===e.type.name))}get firstOwnerName(){return this.document.fields.find((e=>"FirstOwnerName"===e.type.name))}get firstOwnerTotalName(){return this.document.fields.find((e=>"FirstOwnerTotalName"===e.type.name))}get mailingAddress1(){return this.document.fields.find((e=>"MailingAddress1"===e.type.name))}get mailingAddress2(){return this.document.fields.find((e=>"MailingAddress2"===e.type.name))}get mailingCity(){return this.document.fields.find((e=>"MailingCity"===e.type.name))}get mailingJurisdictionCode(){return this.document.fields.find((e=>"MailingJurisdictionCode"===e.type.name))}get mailingZipCode(){return this.document.fields.find((e=>"MailingZipCode"===e.type.name))}get residenceAddress1(){return this.document.fields.find((e=>"ResidenceAddress1"===e.type.name))}get residenceAddress2(){return this.document.fields.find((e=>"ResidenceAddress2"===e.type.name))}get residenceCity(){return this.document.fields.find((e=>"ResidenceCity"===e.type.name))}get residenceJurisdictionCode(){return this.document.fields.find((e=>"ResidenceJurisdictionCode"===e.type.name))}get residenceZipCode(){return this.document.fields.find((e=>"ResidenceZipCode"===e.type.name))}get secondOwnerIdNumber(){return this.document.fields.find((e=>"SecondOwnerIdNumber"===e.type.name))}get secondOwnerLastName(){return this.document.fields.find((e=>"SecondOwnerLastName"===e.type.name))}get secondOwnerLegalStatus(){return this.document.fields.find((e=>"SecondOwnerLegalStatus"===e.type.name))}get secondOwnerMiddleName(){return this.document.fields.find((e=>"SecondOwnerMiddleName"===e.type.name))}get secondOwnerName(){return this.document.fields.find((e=>"SecondOwnerName"===e.type.name))}get secondOwnerTotalName(){return this.document.fields.find((e=>"SecondOwnerTotalName"===e.type.name))}};e.VehicleData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Gn}get bodyStyle(){return this.document.fields.find((e=>"BodyStyle"===e.type.name))}get dateJunked(){return this.document.fields.find((e=>"DateJunked"===e.type.name))}get dateRecovered(){return this.document.fields.find((e=>"DateRecovered"===e.type.name))}get dateStolen(){return this.document.fields.find((e=>"DateStolen"===e.type.name))}get engineDisplacement(){return this.document.fields.find((e=>"EngineDisplacement"===e.type.name))}get engineSize(){return this.document.fields.find((e=>"EngineSize"===e.type.name))}get fuelType(){return this.document.fields.find((e=>"FuelType"===e.type.name))}get horsepower(){return this.document.fields.find((e=>"Horsepower"===e.type.name))}get iftaIndicator(){return this.document.fields.find((e=>"IFTAIndicator"===e.type.name))}get irpIndicator(){return this.document.fields.find((e=>"IRPIndicator"===e.type.name))}get junkedIndicator(){return this.document.fields.find((e=>"JunkedIndicator"===e.type.name))}get msrp(){return this.document.fields.find((e=>"MSRP"===e.type.name))}get majorCode(){return this.document.fields.find((e=>"MajorCode"===e.type.name))}get makeYear(){return this.document.fields.find((e=>"MakeYear"===e.type.name))}get manufactureGrossWeight(){return this.document.fields.find((e=>"ManufactureGrossWeight"===e.type.name))}get minorCode(){return this.document.fields.find((e=>"MinorCode"===e.type.name))}get numberOfAxles(){return this.document.fields.find((e=>"NumberOfAxles"===e.type.name))}get numberOfCylinders(){return this.document.fields.find((e=>"NumberOfCylinders"===e.type.name))}get numberOfDoors(){return this.document.fields.find((e=>"NumberOfDoors"===e.type.name))}get stolenIndicator(){return this.document.fields.find((e=>"StolenIndicator"===e.type.name))}get transmissionCode(){return this.document.fields.find((e=>"TransmissionCode"===e.type.name))}get unladenWeight(){return this.document.fields.find((e=>"UnladenWeight"===e.type.name))}get vltClacFromDate(){return this.document.fields.find((e=>"VLTClacFromDate"===e.type.name))}get vehicleIdNumber(){return this.document.fields.find((e=>"VehicleIdNumber"===e.type.name))}get vehicleIdentificationNumber(){return this.document.fields.find((e=>"VehicleIdentificationNumber"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModel(){return this.document.fields.find((e=>"VehicleModel"===e.type.name))}get vehicleStatusCode(){return this.document.fields.find((e=>"VehicleStatusCode"===e.type.name))}get vehicleTypeCode(){return this.document.fields.find((e=>"VehicleTypeCode"===e.type.name))}};e.VehicleSafetyInspectionData=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Yn}get inspectionAddress(){return this.document.fields.find((e=>"InspectionAddress"===e.type.name))}get inspectionAirPollutionDeviceConditions(){return this.document.fields.find((e=>"InspectionAirPollutionDeviceConditions"===e.type.name))}get inspectionFacilityIdentifier(){return this.document.fields.find((e=>"InspectionFacilityIdentifier"===e.type.name))}get inspectionFormOrStickerNumberCurrent(){return this.document.fields.find((e=>"InspectionFormOrStickerNumberCurrent"===e.type.name))}get inspectionFormOrStickerNumberPrevious(){return this.document.fields.find((e=>"InspectionFormOrStickerNumberPrevious"===e.type.name))}get inspectionSmogCertificateIndicator(){return this.document.fields.find((e=>"InspectionSmogCertificateIndicator"===e.type.name))}get inspectionStationNumber(){return this.document.fields.find((e=>"InspectionStationNumber"===e.type.name))}get inspectorIdentificationNumber(){return this.document.fields.find((e=>"InspectorIdentificationNumber"===e.type.name))}get odometerReadingAtInspection(){return this.document.fields.find((e=>"OdometerReadingAtInspection"===e.type.name))}get vehicleBodyType(){return this.document.fields.find((e=>"VehicleBodyType"===e.type.name))}get vehicleMake(){return this.document.fields.find((e=>"VehicleMake"===e.type.name))}get vehicleModelYear(){return this.document.fields.find((e=>"VehicleModelYear"===e.type.name))}};class t{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get addressCity(){return this.document.fields.find((e=>"AddressCity"===e.type.name))}get addressJurisdictionCode(){return this.document.fields.find((e=>"AddressJurisdictionCode"===e.type.name))}get addressPostalCode(){return this.document.fields.find((e=>"AddressPostalCode"===e.type.name))}get addressStreet1(){return this.document.fields.find((e=>"AddressStreet1"===e.type.name))}get addressStreet2(){return this.document.fields.find((e=>"AddressStreet2"===e.type.name))}get adultInformation(){return this.document.fields.find((e=>"AdultInformation"===e.type.name))}get aliasFamilyName(){return this.document.fields.find((e=>"AliasFamilyName"===e.type.name))}get aliasGivenName(){return this.document.fields.find((e=>"AliasGivenName"===e.type.name))}get aliasMiddleName(){return this.document.fields.find((e=>"AliasMiddleName"===e.type.name))}get aliasPrefixName(){return this.document.fields.find((e=>"AliasPrefixName"===e.type.name))}get aliasSuffixName(){return this.document.fields.find((e=>"AliasSuffixName"===e.type.name))}get cardRevisionDate(){return this.document.fields.find((e=>"CardRevisionDate"===e.type.name))}get complianceType(){return this.document.fields.find((e=>"ComplianceType"===e.type.name))}get countryIdentification(){return this.document.fields.find((e=>"CountryIdentification"===e.type.name))}get customerFamilyName(){return this.document.fields.find((e=>"CustomerFamilyName"===e.type.name))}get customerFirstName(){return this.document.fields.find((e=>"CustomerFirstName"===e.type.name))}get customerGivenNames(){return this.document.fields.find((e=>"CustomerGivenNames"===e.type.name))}get customerIdNumber(){return this.document.fields.find((e=>"CustomerIdNumber"===e.type.name))}get customerMiddleName(){return this.document.fields.find((e=>"CustomerMiddleName"===e.type.name))}get dateOfBirth(){return this.document.fields.find((e=>"DateOfBirth"===e.type.name))}get documentDiscriminator(){return this.document.fields.find((e=>"DocumentDiscriminator"===e.type.name))}get documentExpirationDate(){return this.document.fields.find((e=>"DocumentExpirationDate"===e.type.name))}get documentIssueDate(){return this.document.fields.find((e=>"DocumentIssueDate"===e.type.name))}get driverAliasDateOfBirthField(){return this.document.fields.find((e=>"DriverAliasDateOfBirthField"===e.type.name))}get driverAliasFirstName(){return this.document.fields.find((e=>"DriverAliasFirstName"===e.type.name))}get driverAliasLastName(){return this.document.fields.find((e=>"DriverAliasLastName"===e.type.name))}get driverAliasSocialSecurityNumber(){return this.document.fields.find((e=>"DriverAliasSocialSecurityNumber"===e.type.name))}get driverLastName(){return this.document.fields.find((e=>"DriverLastName"===e.type.name))}get driverLicenseClassificationCode(){return this.document.fields.find((e=>"DriverLicenseClassificationCode"===e.type.name))}get driverLicenseEndorsementsCode(){return this.document.fields.find((e=>"DriverLicenseEndorsementsCode"===e.type.name))}get driverLicenseName(){return this.document.fields.find((e=>"DriverLicenseName"===e.type.name))}get driverLicenseRestrictionCode(){return this.document.fields.find((e=>"DriverLicenseRestrictionCode"===e.type.name))}get driverNamePrefix(){return this.document.fields.find((e=>"DriverNamePrefix"===e.type.name))}get driverNameSuffix(){return this.document.fields.find((e=>"DriverNameSuffix"===e.type.name))}get driverPermitClassificationCode(){return this.document.fields.find((e=>"DriverPermitClassificationCode"===e.type.name))}get driverPermitEndorsementCode(){return this.document.fields.find((e=>"DriverPermitEndorsementCode"===e.type.name))}get driverPermitIssueDate(){return this.document.fields.find((e=>"DriverPermitIssueDate"===e.type.name))}get driverPermitRestrictionCode(){return this.document.fields.find((e=>"DriverPermitRestrictionCode"===e.type.name))}get driverResidenceCity(){return this.document.fields.find((e=>"DriverResidenceCity"===e.type.name))}get driverResidenceJurisdictionCode(){return this.document.fields.find((e=>"DriverResidenceJurisdictionCode"===e.type.name))}get driverResidencePostalCode(){return this.document.fields.find((e=>"DriverResidencePostalCode"===e.type.name))}get driverResidenceStreetAddress1(){return this.document.fields.find((e=>"DriverResidenceStreetAddress1"===e.type.name))}get driverResidenceStreetAddress2(){return this.document.fields.find((e=>"DriverResidenceStreetAddress2"===e.type.name))}get familyNameTruncation(){return this.document.fields.find((e=>"FamilyNameTruncation"===e.type.name))}get federalCommercialVehicleCodes(){return this.document.fields.find((e=>"FederalCommercialVehicleCodes"===e.type.name))}get firstNameTruncation(){return this.document.fields.find((e=>"FirstNameTruncation"===e.type.name))}get hazmatEndorsementExpirationDate(){return this.document.fields.find((e=>"HAZMATEndorsementExpirationDate"===e.type.name))}get hairColor(){return this.document.fields.find((e=>"HairColor"===e.type.name))}get height(){return this.document.fields.find((e=>"Height"===e.type.name))}get inventoryControlNumber(){return this.document.fields.find((e=>"InventoryControlNumber"===e.type.name))}get issueTimeStamp(){return this.document.fields.find((e=>"IssueTimeStamp"===e.type.name))}get jurisdictionSpecificEndorsementCodeDescription(){return this.document.fields.find((e=>"JurisdictionSpecificEndorsementCodeDescription"===e.type.name))}get jurisdictionSpecificEndorsementCodes(){return this.document.fields.find((e=>"JurisdictionSpecificEndorsementCodes"===e.type.name))}get jurisdictionSpecificRestrictionCodeDescription(){return this.document.fields.find((e=>"JurisdictionSpecificRestrictionCodeDescription"===e.type.name))}get jurisdictionSpecificRestrictionCodes(){return this.document.fields.find((e=>"JurisdictionSpecificRestrictionCodes"===e.type.name))}get jurisdictionSpecificVehicleClass(){return this.document.fields.find((e=>"JurisdictionSpecificVehicleClass"===e.type.name))}get jurisdictionSpecificVehicleClassificationDescription(){return this.document.fields.find((e=>"JurisdictionSpecificVehicleClassificationDescription"===e.type.name))}get limitedDurationDocumentIndicator(){return this.document.fields.find((e=>"LimitedDurationDocumentIndicator"===e.type.name))}get middleNameTruncation(){return this.document.fields.find((e=>"MiddleNameTruncation"===e.type.name))}get nameSuffix(){return this.document.fields.find((e=>"NameSuffix"===e.type.name))}get nonResidentIndicator(){return this.document.fields.find((e=>"NonResidentIndicator"===e.type.name))}get numberOfDuplicates(){return this.document.fields.find((e=>"NumberOfDuplicates"===e.type.name))}get organDonor(){return this.document.fields.find((e=>"OrganDonor"===e.type.name))}get organDonorIndicator(){return this.document.fields.find((e=>"OrganDonorIndicator"===e.type.name))}get permitExpirationDate(){return this.document.fields.find((e=>"PermitExpirationDate"===e.type.name))}get permitIdentifier(){return this.document.fields.find((e=>"PermitIdentifier"===e.type.name))}get physicalDescriptionEyeColor(){return this.document.fields.find((e=>"PhysicalDescriptionEyeColor"===e.type.name))}get physicalDescriptionHeight(){return this.document.fields.find((e=>"PhysicalDescriptionHeight"===e.type.name))}get physicalDescriptionSex(){return this.document.fields.find((e=>"PhysicalDescriptionSex"===e.type.name))}get physicalDescriptionWeightRange(){return this.document.fields.find((e=>"PhysicalDescriptionWeightRange"===e.type.name))}get placeOfBirth(){return this.document.fields.find((e=>"PlaceOfBirth"===e.type.name))}get raceEthnicity(){return this.document.fields.find((e=>"RaceEthnicity"===e.type.name))}get socialSecurityNumber(){return this.document.fields.find((e=>"SocialSecurityNumber"===e.type.name))}get standardEndorsementCode(){return this.document.fields.find((e=>"StandardEndorsementCode"===e.type.name))}get standardRestrictionCode(){return this.document.fields.find((e=>"StandardRestrictionCode"===e.type.name))}get standardVehicleClassification(){return this.document.fields.find((e=>"StandardVehicleClassification"===e.type.name))}get under18Until(){return this.document.fields.find((e=>"Under18Until"===e.type.name))}get under19Until(){return this.document.fields.find((e=>"Under19Until"===e.type.name))}get under21Until(){return this.document.fields.find((e=>"Under21Until"===e.type.name))}get uniqueCustomerIdentifier(){return this.document.fields.find((e=>"UniqueCustomerIdentifier"===e.type.name))}get veteranIndicator(){return this.document.fields.find((e=>"VeteranIndicator"===e.type.name))}get weightKilograms(){return this.document.fields.find((e=>"WeightKilograms"===e.type.name))}get weightPounds(){return this.document.fields.find((e=>"WeightPounds"===e.type.name))}}e.DLID=t;e.DriverLicense=class extends t{constructor(e){super(e)}requiredDocumentType(){return Xn}};e.IDCard=class extends t{constructor(e){super(e)}requiredDocumentType(){return qn}};e.EnhancedDriverLicense=class extends t{constructor(e){super(e)}requiredDocumentType(){return Kn}};e.RawDocument=class{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return Jn}}}(ci||(ci={}));class li{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return $n}get dateOfManufacture(){return this.document.fields.find((e=>"DateOfManufacture"===e.type.name))}get expiryDateDay(){return this.document.fields.find((e=>"ExpiryDateDay"===e.type.name))}get expiryDateHour(){return this.document.fields.find((e=>"ExpiryDateHour"===e.type.name))}get expiryDateJulianDay(){return this.document.fields.find((e=>"ExpiryDateJulianDay"===e.type.name))}get expiryDateMonth(){return this.document.fields.find((e=>"ExpiryDateMonth"===e.type.name))}get expiryDateYear(){return this.document.fields.find((e=>"ExpiryDateYear"===e.type.name))}get hasPrimaryData(){return this.document.fields.find((e=>"HasPrimaryData"===e.type.name))}get hasSecondaryData(){return this.document.fields.find((e=>"HasSecondaryData"===e.type.name))}get labelerIdentificationCode(){return this.document.fields.find((e=>"LabelerIdentificationCode"===e.type.name))}get labelersProductOrCatalogNumber(){return this.document.fields.find((e=>"LabelersProductOrCatalogNumber"===e.type.name))}get linkCharacter(){return this.document.fields.find((e=>"LinkCharacter"===e.type.name))}get lotNumber(){return this.document.fields.find((e=>"LotNumber"===e.type.name))}get quantity(){return this.document.fields.find((e=>"Quantity"===e.type.name))}get serialNumber(){return this.document.fields.find((e=>"SerialNumber"===e.type.name))}get unitOfMeasureID(){return this.document.fields.find((e=>"UnitOfMeasureID"===e.type.name))}}const ui="Check",di="USACheck",mi="UAECheck",hi="FRACheck",fi="ISRCheck",pi="KWTCheck",gi="AUSCheck",vi="INDCheck",Ci="CANCheck",yi="UnknownCheck";class bi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}get fontType(){return this.document.fields.find((e=>"FontType"===e.type.name))}get rawString(){return this.document.fields.find((e=>"RawString"===e.type.name))}}class Ai extends bi{constructor(e){super(e)}requiredDocumentType(){return di}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get auxiliaryOnUs(){return this.document.fields.find((e=>"AuxiliaryOnUs"===e.type.name))}get transitNumber(){return this.document.fields.find((e=>"TransitNumber"===e.type.name))}}class Si extends bi{constructor(e){super(e)}requiredDocumentType(){return mi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get routingNumber(){return this.document.fields.find((e=>"RoutingNumber"===e.type.name))}}class wi extends bi{constructor(e){super(e)}requiredDocumentType(){return hi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get routingNumber(){return this.document.fields.find((e=>"RoutingNumber"===e.type.name))}}class Ei extends bi{constructor(e){super(e)}requiredDocumentType(){return fi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get bankNumber(){return this.document.fields.find((e=>"BankNumber"===e.type.name))}get branchNumber(){return this.document.fields.find((e=>"BranchNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}}class xi extends bi{constructor(e){super(e)}requiredDocumentType(){return pi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get sortCode(){return this.document.fields.find((e=>"SortCode"===e.type.name))}}class Di extends bi{constructor(e){super(e)}requiredDocumentType(){return gi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get auxDomestic(){return this.document.fields.find((e=>"AuxDomestic"===e.type.name))}get bsb(){return this.document.fields.find((e=>"BSB"===e.type.name))}get extraAuxDomestic(){return this.document.fields.find((e=>"ExtraAuxDomestic"===e.type.name))}get transactionCode(){return this.document.fields.find((e=>"TransactionCode"===e.type.name))}}class Ti extends bi{constructor(e){super(e)}requiredDocumentType(){return vi}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get serialNumber(){return this.document.fields.find((e=>"SerialNumber"===e.type.name))}get sortNumber(){return this.document.fields.find((e=>"SortNumber"===e.type.name))}get transactionCode(){return this.document.fields.find((e=>"TransactionCode"===e.type.name))}}class Bi extends bi{constructor(e){super(e)}requiredDocumentType(){return Ci}get accountNumber(){return this.document.fields.find((e=>"AccountNumber"===e.type.name))}get bankNumber(){return this.document.fields.find((e=>"BankNumber"===e.type.name))}get chequeNumber(){return this.document.fields.find((e=>"ChequeNumber"===e.type.name))}get designationNumber(){return this.document.fields.find((e=>"DesignationNumber"===e.type.name))}get transactionCode(){return this.document.fields.find((e=>"TransactionCode"===e.type.name))}get transitNumber(){return this.document.fields.find((e=>"TransitNumber"===e.type.name))}}class Ii extends bi{constructor(e){super(e)}requiredDocumentType(){return yi}}const ki="CreditCard";class Oi{get document(){return this._document}constructor(e){if(e.type.name!==this.requiredDocumentType())throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${e.type.name}`);this._document=e}requiredDocumentType(){return ki}get cardNumber(){return this.document.fields.find((e=>"CardNumber"===e.type.name))}get cardholderName(){return this.document.fields.find((e=>"CardholderName"===e.type.name))}get expiryDate(){return this.document.fields.find((e=>"ExpiryDate"===e.type.name))}}const Li=["OKAY","TRIAL","FAILURE_NOT_SET","FAILURE_CORRUPTED","FAILURE_WRONG_OS","FAILURE_APP_ID_MISMATCH","FAILURE_EXPIRED"];class Pi extends f.a{constructor(e={}){if(super(),void 0===e.status)throw new Error("status must be present in constructor argument");if(this.status=e.status,void 0===e.licenseStatusMessage)throw new Error("licenseStatusMessage must be present in constructor argument");if(this.licenseStatusMessage=e.licenseStatusMessage,void 0===e.expirationDateString)throw new Error("expirationDateString must be present in constructor argument");this.expirationDateString=e.expirationDateString}}class _i extends Pi{isValid(){return"OKAY"===this.status||"TRIAL"===this.status}constructor(e){super(e)}}var Ri=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Fi{constructor(e,t){this._sdk=e,this._pdfOperation=t}addPage(e,t={}){return Ri(this,void 0,void 0,(function*(){const{consumeImage:n="COPY_IMAGE"}=t,i=this._sdk.getBridge(n);yield i.addPageToPdf(this._pdfOperation,e)}))}addPages(e){return Ri(this,void 0,void 0,(function*(){for(const t of e.pages){const e=yield t.finalRawImage();yield this.addPage(e)}}))}complete(){return Ri(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var Ni=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Mi{constructor(e,t){this._sdk=e,this._tiffOperation=t}addPage(e,t={}){return Ni(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:i="COPY_IMAGE"}=t,o=this._sdk.getBridge(i);yield o.addPageToTiff(this._tiffOperation,e,n)}))}addPages(e,t={}){return Ni(this,void 0,void 0,(function*(){for(const n of e.pages){const e=yield n.finalRawImage();yield this.addPage(e,t)}}))}complete(){return Ni(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var Vi=n(23);class Wi{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 zi=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 ji{static toDataUrl(e){return new Promise(((t,n)=>{const i=new Blob([e],{type:"image/jpeg"}),o=new FileReader;o.onload=()=>t(o.result),o.onerror=()=>n(o.error),o.readAsDataURL(i)}))}static getObjectFitSize(e,t,n=!0){const i=t.width/t.height,o=e.width/e.height;let r=0,a=0;(n?i>o:i<o)?(r=e.width,a=r/i):(a=e.height,r=a*i);const s=(e.width-r)/2,c=(e.height-a)/2;return new Vi.a(s,c,r,a)}static loadFromUrl(e){return new Promise(((t,n)=>{const i=document.createElement("img");i.src=e,i.onload=()=>zi(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 o=n.getImageData(0,0,i.width,i.height);t(o)})),i.onerror=n}))}static saveImageData(e){const t=this.createImageDataCanvas(e),n=" ("+e.width+"x"+e.height+")";t.toBlob((e=>this.saveBlob(e,Wi.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 ji.createImageDataCanvas(ji.convertImageDataWrapperToImageData(e)).toDataURL("image/png")}static toBase64(e,t=!0){return zi(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 zi(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{const i=document.createElement("canvas"),o=document.createElement("img");o.src=e,o.onload=()=>zi(this,void 0,void 0,(function*(){i.width=o.width,i.height=o.height;const e=i.getContext("2d");e.drawImage(o,0,0);const n=e.getImageData(0,0,o.width,o.height);t(n)})),o.onerror=n}))}))}}class Hi{saveImageAsJpeg(e,t){if(!e||0===e.length)return void console.log("Data cannot be null or empty");t||(t=Wi.uuid()+".jpeg");let n=new Blob([e],{type:"image/jpeg"});ji.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 Ui=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Zi{constructor(e,t){this._sdk=e,this._mrzRecognizerToken=t}recognize(e,t="COPY_IMAGE"){return Ui(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanMRZ(yield this._mrzRecognizerToken,e)}))}recognizeURL(e){return Ui(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),i=document.createElement("img");i.src=e,i.onload=()=>Ui(this,void 0,void 0,(function*(){n.width=i.width,n.height=i.height;const e=n.getContext("2d");e.drawImage(i,0,0);const o=e.getImageData(0,0,i.width,i.height),r=yield this.recognize(o);t(r||void 0)}))}))}))}release(){return Ui(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var Gi=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Yi{constructor(e,t){this._sdk=e,this._OcrEngineToken=t}performOcr(e,t="COPY_IMAGE"){return Gi(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.performOcr(this._OcrEngineToken,e)}))}recognizeURL(e){return Gi(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),i=document.createElement("img");i.src=e,i.onload=()=>Gi(this,void 0,void 0,(function*(){n.width=i.width,n.height=i.height;const e=n.getContext("2d");e.drawImage(i,0,0);const o=e.getImageData(0,0,i.width,i.height),r=yield this.performOcr(o);t(r)}))}))}))}release(){return Gi(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var Qi=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Xi{constructor(e,t){this._sdk=e,this._textPatternScannerToken=t}recognize(e,t="COPY_IMAGE"){return Qi(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanTextLine(yield this._textPatternScannerToken,e)}))}cleanRecognitionQueue(){return Qi(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanTextLineScanningQueue(yield this._textPatternScannerToken)}))}recognizeURL(e){return Qi(this,void 0,void 0,(function*(){return this.recognize(yield ji.imageUrlToImageData(e))}))}release(){return Qi(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textPatternScannerToken)}))}}var qi=n(13),Ki=n(22);class Ji extends Ki.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new ce,this.onTextDetected=function(e){},this.finder.aspectRatio=new w.a({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(e){const t=new Ji;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class $i extends Ki.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_HD),this.detectionConfiguration=new Je,this.onVinDetected=function(e){},this.finder.aspectRatio=new w.a({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 $i;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class eo extends Error{constructor(e){super(e.licenseStatusMessage),this.name="LicenseError"}}class to{static throwIfMissingBuffer(e){to.throwIfMissing(e,"ImageBuffer may not be null")}static throwIfMissing(e,t){if(!e)throw new Error(t)}}var no=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 io{constructor(e,t){this._sdk=e,this._token=t}analyze(e,t="COPY_IMAGE"){return no(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const n=this._sdk.getBridge(t);return yield n.documentQualityAnalyzerAnalyze(this._token,e)}))}release(){return no(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var oo=n(17),ro=n(0),ao=n(44),so=n(14),co=n(2),lo=n.n(co),uo=n(4);const mo="var(--1-sb-dvh, 1vh)";function ho(){const e=Object(ro.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(ro.useEffect)((()=>{if(t(),!e)return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}})),null}var fo=n(30),po=n(8),go=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function vo(e){const{polygonConfig:t}=e,n=go(e,["polygonConfig"]),i=Object.assign(Object.assign({},e.style),{backgroundColor:uo.b.getColorValue(t.fillColor),borderColor:uo.b.getColorValue(t.strokeColor),borderWidth:t.strokeWidth,borderRadius:t.cornerRadius,borderStyle:"solid"});return ro.default.createElement(co.Box,Object.assign({},n,{style:i}))}function Co(e){return e=uo.b.getColorValue(e),Object.assign(Object.assign({},function(e){return{color:e=uo.b.getColorValue(e),"&:hover":{textDecoration:"underline !important",backgroundColor:"transparent !important"}}}(e)),yo(e))}function yo(e){return{"&:focus-visible":{outlineColor:`${e=uo.b.getColorValue(e)} !important`,outlineWidth:"2px !important",outlineStyle:"solid !important"}}}function bo(e){var t;const n=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{};return ro.default.createElement(ro.default.Fragment,null,e.config.visible&&ro.default.createElement(co.IconButton,Object.assign({disabled:!e.enabled,component:null!==(t=e.iconButtonComponent)&&void 0!==t?t:"button","aria-label":uo.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign({opacity:e.enabled?1:.5,backgroundColor:uo.b.getColorValue(e.config.background.fillColor),borderWidth:e.config.background.strokeWidth,borderColor:uo.b.getColorValue(e.config.background.strokeColor),borderStyle:"solid",borderRadius:"4px",visibility:e.config.visible?"visible":"hidden",flexDirection:"column"},Co(e.config.title.color)),onClick:e.onClick},n),e.config.icon.visible&&ro.default.createElement(e.icon,{color:uo.b.getColorValue(e.config.icon.color)}),e.children,ro.default.createElement(po.a,{config:e.config.title,style:{fontSize:12,marginTop:8}})))}const Ao=new Map;function So(e){const t=function(e){if(!Ao.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 Ao.set(e,null),null;n.fillRect(0,0,1,1);const o=[...n.getImageData(0,0,1,1).data];Ao.set(e,{r:o[0],g:o[1],b:o[2],a:o[3]})}return Ao.get(e)}(e);return 0===(null==t?void 0:t.a)}function wo(e){var t,n;if(!e.visible)return ro.default.createElement("div",{style:{display:"flex",flex:1}});const i=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{},o="right"===(null!==(t=e.iconPosition)&&void 0!==t?t:"left");let r={};return So(uo.b.getColorValue(e.background.fillColor))&&(r={textDecoration:"underline"}),ro.default.createElement(co.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(po.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":r,"&:focus-visible > div":{outlineColor:uo.b.getColorValue(e.foreground.color),outlineWidth:2,outlineStyle:"solid"},px:0},e.buttonWidth?{width:`${e.buttonWidth}px`,minWidth:0}:{}),disableRipple:!0},i),ro.default.createElement(vo,{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&&!o&&e.icon,uo.b.getLocalizedText(e.text),e.foreground.iconVisible&&o&&e.icon))}fo.a;const Eo=ro.default.createContext(null);function xo(e){const t=e.mode,n="HIDDEN"===t?0:48;Object(ro.useEffect)((()=>{if("HIDDEN"===t)return;const n=document.createElement("meta");return n.name="theme-color",n.content=uo.b.getColorValue(e.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[t]);const i="SOLID"===t?0:n,o={height:n,remainingVisibleBodyHeight:"SOLID"===t?`calc(100 * ${mo} - ${n}px)`:`calc(100 * ${mo})`,minTopPaddingForContent:i,minTopPaddingForViewFinder:10+i},r="SOLID"===t?{backgroundColor:uo.b.getColorValue(e.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${uo.b.getColorValue(e.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return ro.default.createElement(ro.default.Fragment,null,"HIDDEN"!==t&&ro.default.createElement(co.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},ro.default.createElement(co.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},ro.default.createElement(co.Box,{sx:{flex:1}},e.cancelButton.visible&&ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(wo,Object.assign({onClick:e.onBackPress,icon:e.cancelButton.foreground.iconVisible&&ro.default.createElement(lo.a,{sx:{fontSize:12,mr:"5px"}})},e.cancelButton)))),ro.default.createElement(co.Box,null,ro.default.createElement(co.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},ro.default.createElement(po.a,{config:e.title}))),ro.default.createElement(co.Box,{sx:{flex:1}}))),ro.default.createElement(Eo.Provider,{value:o},e.children))}function Do(e){return{textOverflow:"ellipsis",WebkitBoxOrient:"vertical",WebkitLineClamp:`${e}`,overflow:"hidden",whiteSpace:e>1?"normal":"nowrap",display:e>1?"-webkit-box":"block"}}function To(e){if(e.loading)return ro.default.createElement(co.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 ro.default.createElement(co.Box,{sx:t})}const t={width:e.imageSize,height:e.imageSize,borderRadius:8};return ro.default.createElement("img",{src:e.data.barcodeImage,alt:e.data.title,style:t})}function Bo(e){var t,n;const i=(null===(t=e.barcodeMappedData)||void 0===t?void 0:t.state)||"LOADING",o=(null===(n=e.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!e||"LOADED"!==i,a=e.imageSize,s=e.barcodeTitle.visible||e.barcodeSubtitle.visible||e.counterForm,c=e.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:uo.b.getColorValue(e.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}},l=Object(ro.useRef)(),[u,d]=Object(ro.useState)("100%");return Object(ro.useEffect)((()=>{var t;const n=e.readonlyCount?.87:.97,i=null===(t=l.current)||void 0===t?void 0:t.parentNode,o=i&&i.clientWidth>0?i.clientWidth*n:"100%";d(o)})),ro.default.createElement(co.Box,{ref:l,sx:{display:"flex",maxWidth:u},"data-sb-barcode-info":"1"},e.barcodeImageVisible&&ro.default.createElement(co.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},ro.default.createElement(To,{data:o,imageSize:a,loading:r})),s&&ro.default.createElement(co.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},e.barcodeTitle.visible&&ro.default.createElement(co.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},ro.default.createElement(co.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign(Object.assign({},Do(e.maxNumberOfTitleLines)),Object(po.b)(e.barcodeTitle)),{textOverflow:"ellipsis",overflow:"hidden",display:"inline-block"})},r?ro.default.createElement(co.Skeleton,{variant:"text"}):o.title),e.displayRightArrow&&!r&&ro.default.createElement(lo.a,{sx:{fontSize:16,fontWeight:"bold",color:uo.b.getColorValue(e.barcodeTitle.color)}})),e.barcodeSubtitle.visible&&ro.default.createElement(co.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},Do(e.maxNumberOfSubtitleLines)),Object(po.b)(e.barcodeSubtitle))},r?ro.default.createElement(co.Skeleton,{variant:"text"}):o.subtitle),e.counterForm&&ro.default.createElement(co.ButtonGroup,{variant:"outlined"},ro.default.createElement(co.Button,{disabled:!e.counterForm.removeButtonEnabled,sx:c,style:{opacity:e.counterForm.removeButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter-1),disableRipple:!0},ro.default.createElement(lo.a,{sx:{color:uo.b.getColorValue(e.counterForm.manualCountChangeColor)}})),ro.default.createElement(co.Button,{sx:Object.assign(Object.assign({},c),{color:uo.b.getColorValue(e.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:e.counterForm.onNumberClick,disableRipple:!0},e.counterForm.counter),ro.default.createElement(co.Button,{disabled:!e.counterForm.addButtonEnabled,sx:c,style:{opacity:e.counterForm.addButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter+1),disableRipple:!0},ro.default.createElement(lo.a,{sx:{color:uo.b.getColorValue(e.counterForm.manualCountChangeColor)}})))))}so.ButtonConfiguration;function Io(e){var t;if(!e.visible)return null;const n={["data-sb-button-"+e.debugName]:!0};return ro.default.createElement(co.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:uo.b.getColorValue(e.background.strokeColor),borderWidth:e.background.strokeWidth,backgroundColor:uo.b.getColorValue(e.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},n),e.foreground.iconVisible&&e.icon&&ro.default.createElement(e.icon,{sx:{color:uo.b.getColorValue(e.foreground.color),pr:2}}),ro.default.createElement(po.a,{config:{visible:!0,text:e.text,color:e.foreground.color,useShadow:e.foreground.useShadow}}))}var ko=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function Oo(e){var t,{modalOverlayColor:n}=e,i=ko(e,["modalOverlayColor"]);const o={backdrop:{style:{backgroundColor:uo.b.getColorValue(n)}}},r=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 ro.default.createElement(co.Dialog,Object.assign({},i,{componentsProps:o,PaperProps:r}))}function Lo(e){const t=Object(ro.useContext)(uo.a).getColorValue,n=!e.barcodeMappedData||"LOADED"!==e.barcodeMappedData.state,i={backgroundColor:t(n?e.sheetColorLoading:e.sheetColorLoaded)},[o,r]=ro.default.useState(),a=Object(ro.useRef)((()=>{}));Object(ro.useEffect)((()=>{e.open&&r(!1)}),[e.open]);const s=()=>{a.current=e.handleCancel,r(!0)};return ro.default.createElement(Oo,{modalOverlayColor:e.modalOverlayColor,open:e.open&&!o,fullWidth:!0,TransitionProps:{onExited:()=>{o&&a.current()}},onClose:()=>{n||s()}},ro.default.createElement(co.DialogContent,{style:i},ro.default.createElement(Bo,Object.assign({},e,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),ro.default.createElement(co.DialogActions,{style:i},ro.default.createElement(lo.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},ro.default.createElement(lo.a,{item:!0,xs:12},ro.default.createElement(lo.a,{color:t(e.dividerColor)})),n?ro.default.createElement(lo.a,{item:!0,xs:12,sx:{textAlign:"center"}},ro.default.createElement(co.Box,null,ro.default.createElement(co.CircularProgress,{sx:{color:t(e.loadingMessage.color),verticalAlign:"middle",mr:2}}),ro.default.createElement(po.a,{config:e.loadingMessage}))):ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},onClick:s},e.cancelButton))),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},onClick:()=>{a.current=e.handleSubmit,r(!0)}},e.submitButton)))))))}var Po=n(1);Po.l;function _o(e){if(!1===e.visible)return null;const t={backgroundColor:e.active?uo.b.getColorValue(e.activeBackgroundColor):uo.b.getColorValue(e.backgroundColor),color:e.active?uo.b.getColorValue(e.activeForegroundColor):uo.b.getColorValue(e.foregroundColor)};return ro.default.createElement(co.IconButton,{sx:Object.assign(Object.assign({},t),{"&:hover, &:focus":Object.assign({outline:"none"},t),width:48,height:48}),onClick:e.onClick},e.text&&ro.default.createElement("span",{style:{fontSize:15}},uo.b.getLocalizedText(e.text)),e.icon&&ro.default.createElement(e.icon,{style:{padding:7}}))}var Ro=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Fo{constructor(){this.audioFile=new Audio}initialize(e){return Ro(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 Ro(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(e){}}))}}Fo.INSTANCE=new Fo;var No=Fo;class Mo{constructor(){this.DURATION=200}vibrate(e){e.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}Mo.INSTANCE=new Mo;var Vo=Mo,Wo=n(11),zo=n(25),jo=n(24),Ho=n(26);class Uo extends ro.default.Component{constructor(e){super(e),this.state={base64Image:void 0}}render(){const e="x"+this.props.barcode.count;return ro.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},ro.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},ro.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},ro.default.createElement("div",{style:{flex:1}},this.props.barcode.text),ro.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},e)),ro.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}function Zo(e,t){return e.format===t.format&&e.text===t.text}function Go(e){return e.text+e.format}class Yo extends ro.default.Component{constructor(e){super(e),this.state={barcodes:this.toUniqueListWithDuplicateCounter(e.barcodes)}}toUniqueListWithDuplicateCounter(e){const t=[];return e.forEach((e=>{const n=t.findIndex((t=>Zo(t,e)));-1===n?(e.count=1,t.push(e)):t[n].count++})),t}update(e){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(e)})}render(){return ro.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((e,t)=>ro.default.createElement(Uo,{key:t,barcode:e,onClick:this.props.onClick}))))}}class Qo{}Qo.ScanbotPrimary="#c8193c",Qo.LightGray="#F5F5F5",Qo.Gray="#808080",Qo.DarkGray="#333333",Qo.Orange="#FF5533",Qo.White="#FFFFFF",Qo.TransparentGreen="rgba(0, 255, 0, 0.5)",Qo.TransparentGray="rgba(50, 50, 50, 0.5)",Qo.TransparentBlack="rgba(0, 0, 0, 0.3)",Qo.SBNegative="#FF3737";var Xo,qo=Qo;!function(e){e[e.None=0]="None",e[e.PushRight=1]="PushRight",e[e.PushBottom=2]="PushBottom",e[e.Pop=3]="Pop"}(Xo||(Xo={}));class Ko extends ro.default.Component{constructor(e){super(e),this._isVisible=!1,this.state={animation:{type:Xo.None},elements:[]}}containerStyle(e){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:e,overflow:"scroll"}}render(){var e,t,n;if(this.state.animation.type===Xo.None)return null;const i=this.animation(this.state.animation.type),o=this.to(this.state.animation.type);this.previousDestination=o;const r=this.props.style;return ro.default.createElement(i,{style:this.containerStyle(`${o}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:e=>{this.reset()}},ro.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:e=>{e.stopPropagation()}},ro.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:qo.ScanbotPrimary}},ro.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},ro.default.createElement("div",{style:{backgroundColor:qo.White,height:3,width:33,borderRadius:5}})),ro.default.createElement("div",{style:{display:"flex",height:50}},ro.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:qo.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),ro.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:qo.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(t=null===(e=this.barcodes)||void 0===e?void 0:e.length)&&void 0!==t?t:0)+" Codes"),ro.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:qo.White,justifyContent:"right",alignItems:"center",paddingRight:10}},ro.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:e=>{e.stopPropagation(),this.reset()}},"×")))),ro.default.createElement(Yo,{ref:e=>{null!==e&&(this.list=e)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(e,t){this._isVisible=!0,this.barcodes=t,this.updateAnimationType(e)}update(e){this.barcodes=e,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(Xo.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===Xo.Pop&&this.updateAnimationType(Xo.None)}updateAnimationType(e,t){this.setState({animation:{type:e}},t)}animation(e){let t=this.from(e),n=this.to(e);this.previousDestination===n&&(t=this.previousDestination,n=this.previousDestination);const i=Ho.b`from {transform: ${t};} to {transform: ${n};}`;return Ho.a.div`animation: ${i} 0.5s;`}from(e){if(e===Xo.PushRight)return this.translate("X",100);if(e===Xo.PushBottom)return this.translate("Y",100);if(e===Xo.Pop){const e=this.pushType===Xo.PushRight?"X":"Y";return this.translate(e,0)}}to(e){if(e===Xo.PushRight)return this.translate("X",0);if(e===Xo.PushBottom)return this.translate("Y",0);if(e===Xo.Pop){const e=this.pushType===Xo.PushRight?"X":"Y";return this.translate(e,100)}}translate(e,t){return"translate"+e+"("+t+"%)"}componentWillUnmount(){this._isVisible=!1}}var Jo=n(3),$o=function(e){return{isEnabled:function(t){return e.some((function(e){return!!t[e]}))}}},er={measureLayout:$o(["layout","layoutId","drag","_layoutResetTransform"]),animation:$o(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:$o(["exit"]),drag:$o(["drag","dragControls"]),focus:$o(["whileFocus"]),hover:$o(["whileHover","onHoverStart","onHoverEnd"]),tap:$o(["whileTap","onTap","onTapStart","onTapCancel"]),pan:$o(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:$o(["layout","layoutId"])};var tr=Object(ro.createContext)({strict:!1}),nr=Object.keys(er),ir=nr.length;var or=Object(ro.createContext)({transformPagePoint:function(e){return e},isStatic:!1}),rr=Object(ro.createContext)({});var ar=Object(ro.createContext)(null);function sr(e){var t=Object(ro.useRef)(null);return null===t.current&&(t.current=e()),t.current}function cr(){var e=Object(ro.useContext)(ar);if(null===e)return[!0,null];var t=e.isPresent,n=e.onExitComplete,i=e.register,o=mr();Object(ro.useEffect)((function(){return i(o)}),[]);return!t&&n?[!1,function(){return null==n?void 0:n(o)}]:[!0]}function lr(e){return null===e||e.isPresent}var ur=0,dr=function(){return ur++},mr=function(){return sr(dr)},hr=Object(ro.createContext)(null),fr="undefined"!=typeof window,pr=fr?ro.useLayoutEffect:ro.useEffect;function gr(e,t,n,i){var o=Object(ro.useContext)(or),r=Object(ro.useContext)(tr),a=Object(ro.useContext)(rr).visualElement,s=Object(ro.useContext)(ar),c=function(e){var t=e.layoutId,n=Object(ro.useContext)(hr);return n&&void 0!==t?n+"-"+t:t}(n),l=Object(ro.useRef)(void 0);i||(i=r.renderer),!l.current&&i&&(l.current=i(e,{visualState:t,parent:a,props:Object(Jo.a)(Object(Jo.a)({},n),{layoutId:c}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=l.current;return pr((function(){u&&(u.setProps(Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},o),n),{layoutId:c})),u.isPresent=lr(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(ro.useEffect)((function(){var e;u&&(null===(e=u.animationState)||void 0===e||e.animateChanges())})),pr((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function vr(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Cr(e){return Array.isArray(e)}function yr(e){return"string"==typeof e||Cr(e)}function br(e,t,n,i,o){var r;return void 0===i&&(i={}),void 0===o&&(o={}),"string"==typeof t&&(t=null===(r=e.variants)||void 0===r?void 0:r[t]),"function"==typeof t?t(null!=n?n:e.custom,i,o):t}function Ar(e,t,n){var i=e.getProps();return br(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 Sr(e){var t;return"function"==typeof(null===(t=e.animate)||void 0===t?void 0:t.start)||yr(e.initial)||yr(e.animate)||yr(e.whileHover)||yr(e.whileDrag)||yr(e.whileTap)||yr(e.whileFocus)||yr(e.exit)}function wr(e){return Boolean(Sr(e)||e.variants)}function Er(e,t){var n=function(e,t){if(Sr(e)){var n=e.initial,i=e.animate;return{initial:!1===n||yr(n)?n:void 0,animate:yr(i)?i:void 0}}return!1!==e.inherit?t:{}}(e,Object(ro.useContext)(rr)),i=n.initial,o=n.animate;return Object(ro.useMemo)((function(){return{initial:i,animate:o}}),t?[xr(i),xr(o)]:[])}function xr(e){return Array.isArray(e)?e.join(" "):e}function Dr(e){var t=e.preloadedFeatures,n=e.createVisualElement,i=e.useRender,o=e.useVisualState,r=e.Component;return t&&function(e){for(var t in e){var n=e[t];null!==n&&(er[t].Component=n)}}(t),Object(ro.forwardRef)((function(e,t){var a=Object(ro.useContext)(or).isStatic,s=null,c=Er(e,a),l=o(e,a);return!a&&fr&&(c.visualElement=gr(r,l,e,n),s=function(e,t,n){var i=[];if(Object(ro.useContext)(tr),!t)return null;for(var o=0;o<ir;o++){var r=nr[o],a=er[r],s=a.isEnabled,c=a.Component;s(e)&&c&&i.push(ro.createElement(c,Object(Jo.a)({key:r},e,{visualElement:t})))}return i}(e,c.visualElement)),ro.createElement(ro.Fragment,null,ro.createElement(rr.Provider,{value:c},i(r,e,function(e,t,n){return Object(ro.useCallback)((function(i){var o;i&&(null===(o=e.mount)||void 0===o||o.call(e,i)),t&&(i?t.mount(i):t.unmount()),n&&("function"==typeof n?n(i):vr(n)&&(n.current=i))}),[t])}(l,c.visualElement,t),l,a)),s)}))}function Tr(e){function t(t,n){return void 0===n&&(n={}),Dr(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 Br=["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 Ir(e){return"string"==typeof e&&!e.includes("-")&&!!(Br.indexOf(e)>-1||/[A-Z]/.test(e))}var kr={};var Or=["","X","Y","Z"],Lr=["transformPerspective","x","y","z"];function Pr(e,t){return Lr.indexOf(e)-Lr.indexOf(t)}["translate","scale","rotate","skew"].forEach((function(e){return Or.forEach((function(t){return Lr.push(e+t)}))}));var _r=new Set(Lr);function Rr(e){return _r.has(e)}var Fr=new Set(["originX","originY","originZ"]);function Nr(e){return Fr.has(e)}function Mr(e,t){var n=t.layout,i=t.layoutId;return Rr(e)||Nr(e)||(n||void 0!==i)&&(!!kr[e]||"opacity"===e)}var Vr=function(e){return null!==e&&"object"==typeof e&&e.getVelocity},Wr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function zr(e){return e.startsWith("--")}var jr=function(e,t){return t&&"number"==typeof e?t.transform(e):e},Hr=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},Ur=function(e){return e%1?Number(e.toFixed(5)):e},Zr=/(-)?([\d]*\.?[\d])+/g,Gr=/(#[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,Yr=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function Qr(e){return"string"==typeof e}var Xr=function(e){return{test:function(t){return Qr(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},qr=Xr("deg"),Kr=Xr("%"),Jr=Xr("px"),$r=Xr("vh"),ea=Xr("vw"),ta=Object(Jo.a)(Object(Jo.a)({},Kr),{parse:function(e){return Kr.parse(e)/100},transform:function(e){return Kr.transform(100*e)}}),na={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},ia=Object(Jo.a)(Object(Jo.a)({},na),{transform:Hr(0,1)}),oa=Object(Jo.a)(Object(Jo.a)({},na),{default:1}),ra=Object(Jo.a)(Object(Jo.a)({},na),{transform:Math.round}),aa={borderWidth:Jr,borderTopWidth:Jr,borderRightWidth:Jr,borderBottomWidth:Jr,borderLeftWidth:Jr,borderRadius:Jr,radius:Jr,borderTopLeftRadius:Jr,borderTopRightRadius:Jr,borderBottomRightRadius:Jr,borderBottomLeftRadius:Jr,width:Jr,maxWidth:Jr,height:Jr,maxHeight:Jr,size:Jr,top:Jr,right:Jr,bottom:Jr,left:Jr,padding:Jr,paddingTop:Jr,paddingRight:Jr,paddingBottom:Jr,paddingLeft:Jr,margin:Jr,marginTop:Jr,marginRight:Jr,marginBottom:Jr,marginLeft:Jr,rotate:qr,rotateX:qr,rotateY:qr,rotateZ:qr,scale:oa,scaleX:oa,scaleY:oa,scaleZ:oa,skew:qr,skewX:qr,skewY:qr,distance:Jr,translateX:Jr,translateY:Jr,translateZ:Jr,x:Jr,y:Jr,z:Jr,perspective:Jr,transformPerspective:Jr,opacity:ia,originX:ta,originY:ta,originZ:Jr,zIndex:ra,fillOpacity:ia,strokeOpacity:ia,numOctaves:ra};function sa(e,t,n,i,o,r,a,s){var c,l=e.style,u=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 C=t[v];if(zr(v))u[v]=C;else{var y=aa[v],b=jr(C,y);if(Rr(v)){if(f=!0,d[v]=b,m.push(v),!g)continue;C!==(null!==(c=y.default)&&void 0!==c?c:0)&&(g=!1)}else if(Nr(v))h[v]=b,p=!0;else if((null==n?void 0:n.isHydrated)&&(null==i?void 0:i.isHydrated)&&kr[v]){var A=kr[v].process(C,i,n),S=kr[v].applyTo;if(S)for(var w=S.length,E=0;E<w;E++)l[S[E]]=A;else l[v]=A}else l[v]=b}}i&&n&&a&&s?(l.transform=a(i.deltaFinal,i.treeScale,f?d:void 0),r&&(l.transform=r(d,l.transform)),l.transformOrigin=s(i)):(f&&(l.transform=function(e,t,n,i){var o=e.transform,r=e.transformKeys,a=t.enableHardwareAcceleration,s=void 0===a||a,c=t.allowTransformNone,l=void 0===c||c,u="";r.sort(Pr);for(var d=!1,m=r.length,h=0;h<m;h++){var f=r[h];u+=(Wr[f]||f)+"("+o[f]+") ","z"===f&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),i?u=i(o,n?"":u):l&&n&&(u="none"),u}(e,o,g,r)),p&&(l.transformOrigin=function(e){var t=e.originX,n=void 0===t?"50%":t,i=e.originY,o=void 0===i?"50%":i,r=e.originZ;return n+" "+o+" "+(void 0===r?0:r)}(h)))}var ca=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function la(e,t,n){for(var i in t)Vr(t[i])||Mr(i,n)||(e[i]=t[i])}function ua(e,t,n){var i={};return la(i,e.style||{},e),Object.assign(i,function(e,t,n){var i=e.transformTemplate;return Object(ro.useMemo)((function(){var e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};sa(e,t,void 0,void 0,{enableHardwareAcceleration:!n},i);var o=e.vars,r=e.style;return Object(Jo.a)(Object(Jo.a)({},o),r)}),[t])}(e,t,n)),e.transformValues&&(i=e.transformValues(i)),i}function da(e,t,n){var i={},o=ua(e,t,n);return Boolean(e.drag)&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),i.style=o,i}var ma=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 ha(e){return ma.has(e)}var fa=function(e){return!ha(e)};try{var pa=n(53).default;fa=function(e){return e.startsWith("on")?!ha(e):pa(e)}}catch(e){}function ga(e,t,n){return"string"==typeof e?e:Jr.transform(t+n*e)}var va=function(e,t){return Jr.transform(e*t)},Ca={offset:"stroke-dashoffset",array:"stroke-dasharray"},ya={offset:"strokeDashoffset",array:"strokeDasharray"};function ba(e,t,n,i,o,r,a,s){var c=t.attrX,l=t.attrY,u=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;sa(e,Object(Jo.d)(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,i,o,r,a,s),e.attrs=e.style,e.style={};var v=e.attrs,C=e.style,y=e.dimensions,b=e.totalPathLength;v.transform&&(y&&(C.transform=v.transform),delete v.transform),y&&(void 0!==u||void 0!==d||C.transform)&&(C.transformOrigin=function(e,t,n){return ga(t,e.x,e.width)+" "+ga(n,e.y,e.height)}(y,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==c&&(v.x=c),void 0!==l&&(v.y=l),void 0!==b&&void 0!==m&&function(e,t,n,i,o,r){void 0===i&&(i=1),void 0===o&&(o=0),void 0===r&&(r=!0);var a=r?Ca:ya;e[a.offset]=va(-o,t);var s=va(n,t),c=va(i,t);e[a.array]=s+" "+c}(v,b,m,f,g,!1)}var Aa=function(){return Object(Jo.a)(Object(Jo.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Sa(e,t){var n=Object(ro.useMemo)((function(){var n=Aa();return ba(n,t,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Object(Jo.a)(Object(Jo.a)({},n.attrs),{style:Object(Jo.a)({},n.style)})}),[t]);if(e.style){var i={};la(i,e.style,e),n.style=Object(Jo.a)(Object(Jo.a)({},i),n.style)}return n}function wa(e){void 0===e&&(e=!1);return function(t,n,i,o,r){var a=o.latestValues,s=(Ir(t)?Sa:da)(n,a,r),c=function(e,t,n){var i={};for(var o in e)(fa(o)||!0===n&&ha(o)||!t&&!ha(o))&&(i[o]=e[o]);return i}(n,"string"==typeof t,e),l=Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},c),s),{ref:i});return Object(ro.createElement)(t,l)}}var Ea=/([a-z])([A-Z])/g,xa=function(e){return e.replace(Ea,"$1-$2").toLowerCase()};function Da(e,t){var n=t.style,i=t.vars;for(var o in Object.assign(e.style,n),i)e.style.setProperty(o,i[o])}var Ta=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function Ba(e,t){for(var n in Da(e,t),t.attrs)e.setAttribute(Ta.has(n)?n:xa(n),t.attrs[n])}function Ia(e){var t=e.style,n={};for(var i in t)(Vr(t[i])||Mr(i,e))&&(n[i]=t[i]);return n}function ka(e){var t=Ia(e);for(var n in e){if(Vr(e[n]))t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function Oa(e){return"object"==typeof e&&"function"==typeof e.start}var La=function(e){return Array.isArray(e)};function Pa(e){var t,n=Vr(e)?e.get():e;return t=n,Boolean(t&&"object"==typeof t&&t.mix&&t.toValue)?n.toValue():n}function _a(e,t,n,i){var o=e.scrapeMotionValuesFromProps,r=e.createRenderState,a=e.onMount,s={latestValues:Fa(t,n,i,o),renderState:r()};return a&&(s.mount=function(e){return a(t,e,s)}),s}var Ra=function(e){return function(t,n){var i=Object(ro.useContext)(rr),o=Object(ro.useContext)(ar);return n?_a(e,t,i,o):sr((function(){return _a(e,t,i,o)}))}};function Fa(e,t,n,i){var o={},r=!1===(null==n?void 0:n.initial),a=i(e);for(var s in a)o[s]=Pa(a[s]);var c=e.initial,l=e.animate,u=Sr(e),d=wr(e);t&&d&&!u&&!1!==e.inherit&&(null!=c||(c=t.initial),null!=l||(l=t.animate));var m=r||!1===c?l:c;m&&"boolean"!=typeof m&&!Oa(m)&&(Array.isArray(m)?m:[m]).forEach((function(t){var n=br(e,t);if(n){var i=n.transitionEnd;n.transition;var r=Object(Jo.d)(n,["transitionEnd","transition"]);for(var a in r)o[a]=r[a];for(var a in i)o[a]=i[a]}}));return o}var Na={useVisualState:Ra({scrapeMotionValuesFromProps:ka,createRenderState:Aa,onMount:function(e,t,n){var i=n.renderState,o=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()),ba(i,o,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Ba(t,i)}})};var Ma,Va={useVisualState:Ra({scrapeMotionValuesFromProps:Ia,createRenderState:ca})};function Wa(e,t,n,i){var o=t.forwardMotionProps,r=void 0!==o&&o,a=Ir(e)?Na:Va;return Object(Jo.a)(Object(Jo.a)({},a),{preloadedFeatures:n,useRender:wa(r),createVisualElement:i,Component:e})}function za(e,t,n,i){return e.addEventListener(t,n,i),function(){return e.removeEventListener(t,n,i)}}function ja(e,t,n,i){Object(ro.useEffect)((function(){var o=e.current;if(n&&o)return za(o,t,n,i)}),[e,t,n,i])}function Ha(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function Ua(e){return!!e.touches}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.Exit="exit"}(Ma||(Ma={}));var Za={pageX:0,pageY:0};function Ga(e,t){void 0===t&&(t="page");var n=e.touches[0]||e.changedTouches[0]||Za;return{x:n[t+"X"],y:n[t+"Y"]}}function Ya(e,t){return void 0===t&&(t="page"),{x:e[t+"X"],y:e[t+"Y"]}}function Qa(e,t){return void 0===t&&(t="page"),{point:Ua(e)?Ga(e,t):Ya(e,t)}}var Xa=function(e,t){void 0===t&&(t=!1);var n,i=function(t){return e(t,Qa(t))};return t?(n=i,function(e){var t=e instanceof MouseEvent;(!t||t&&0===e.button)&&n(e)}):i},qa={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Ka={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Ja(e){return fr&&null===window.onpointerdown?e:fr&&null===window.ontouchstart?Ka[e]:fr&&null===window.onmousedown?qa[e]:e}function $a(e,t,n,i){return za(e,Ja(t),Xa(n,"pointerdown"===t),i)}function es(e,t,n,i){return ja(e,Ja(t),n&&Xa(n,"pointerdown"===t),i)}function ts(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var ns=ts("dragHorizontal"),is=ts("dragVertical");function os(e){var t=!1;if("y"===e)t=is();else if("x"===e)t=ns();else{var n=ns(),i=is();n&&i?t=function(){n(),i()}:(n&&n(),i&&i())}return t}function rs(){var e=os(!0);return!e||(e(),!1)}function as(e,t,n){return function(i,o){var r;Ha(i)&&!rs()&&(null==n||n(i,o),null===(r=e.animationState)||void 0===r||r.setActive(Ma.Hover,t))}}var ss=function(e,t){return!!t&&(e===t||ss(e,t.parentElement))};function cs(e){return Object(ro.useEffect)((function(){return function(){return e()}}),[])}var ls=function(e,t){return function(n){return t(e(n))}},us=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(ls)};var ds=function(e){return function(t){return e(t),null}},ms={tap:ds((function(e){var t=e.onTap,n=e.onTapStart,i=e.onTapCancel,o=e.whileTap,r=e.visualElement,a=t||n||i||o,s=Object(ro.useRef)(!1),c=Object(ro.useRef)(null);function l(){var e;null===(e=c.current)||void 0===e||e.call(c),c.current=null}function u(){var e;return l(),s.current=!1,null===(e=r.animationState)||void 0===e||e.setActive(Ma.Tap,!1),!rs()}function d(e,n){u()&&(ss(r.getInstance(),e.target)?null==t||t(e,n):null==i||i(e,n))}function m(e,t){u()&&(null==i||i(e,t))}es(r,"pointerdown",a?function(e,t){var i;l(),s.current||(s.current=!0,c.current=us($a(window,"pointerup",d),$a(window,"pointercancel",m)),null==n||n(e,t),null===(i=r.animationState)||void 0===i||i.setActive(Ma.Tap,!0))}:void 0),cs(l)})),focus:ds((function(e){var t=e.whileFocus,n=e.visualElement;ja(n,"focus",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Ma.Focus,!0)}:void 0),ja(n,"blur",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Ma.Focus,!1)}:void 0)})),hover:ds((function(e){var t=e.onHoverStart,n=e.onHoverEnd,i=e.whileHover,o=e.visualElement;es(o,"pointerenter",t||i?as(o,!0,t):void 0),es(o,"pointerleave",n||i?as(o,!1,n):void 0)}))};function hs(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 fs=function(e,t,n){return Math.min(Math.max(n,e),t)},ps=.001;function gs(e){var t,n,i=e.duration,o=void 0===i?800:i,r=e.bounce,a=void 0===r?.25:r,s=e.velocity,c=void 0===s?0:s,l=e.mass,u=void 0===l?1:l,d=1-a;d=fs(.05,1,d),o=fs(.01,10,o/1e3),d<1?(t=function(e){var t=e*d,n=t*o,i=t-c,r=vs(e,d),a=Math.exp(-n);return ps-i/r*a},n=function(e){var n=e*d*o,i=n*c+c,r=Math.pow(d,2)*Math.pow(e,2)*o,a=Math.exp(-n),s=vs(Math.pow(e,2),d);return(-t(e)+ps>0?-1:1)*((i-r)*a)/s}):(t=function(e){return Math.exp(-e*o)*((e-c)*o+1)-.001},n=function(e){return Math.exp(-e*o)*(o*o*(c-e))});var m=function(e,t,n){for(var i=n,o=1;o<12;o++)i-=e(i)/t(i);return i}(t,n,5/o);if(o*=1e3,isNaN(m))return{stiffness:100,damping:10,duration:o};var h=Math.pow(m,2)*u;return{stiffness:h,damping:2*d*Math.sqrt(u*h),duration:o}}function vs(e,t){return e*Math.sqrt(1-t*t)}var Cs=["duration","bounce"],ys=["stiffness","damping","mass"];function bs(e,t){return t.some((function(t){return void 0!==e[t]}))}function As(e){var t=e.from,n=void 0===t?0:t,i=e.to,o=void 0===i?1:i,r=e.restSpeed,a=void 0===r?2:r,s=e.restDelta,c=Object(Jo.d)(e,["from","to","restSpeed","restDelta"]),l={done:!1,value:n},u=function(e){var t=Object(Jo.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!bs(e,ys)&&bs(e,Cs)){var n=gs(e);(t=Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(c),d=u.stiffness,m=u.damping,h=u.mass,f=u.velocity,p=u.duration,g=u.isResolvedFromDuration,v=Ss,C=Ss;function y(){var e=f?-f/1e3:0,t=o-n,i=m/(2*Math.sqrt(d*h)),r=Math.sqrt(d/h)/1e3;if(null!=s||(s=Math.abs(o-n)<=1?.01:.4),i<1){var a=vs(r,i);v=function(n){var s=Math.exp(-i*r*n);return o-s*((e+i*r*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},C=function(n){var o=Math.exp(-i*r*n);return i*r*o*(Math.sin(a*n)*(e+i*r*t)/a+t*Math.cos(a*n))-o*(Math.cos(a*n)*(e+i*r*t)-a*t*Math.sin(a*n))}}else if(1===i)v=function(n){return o-Math.exp(-r*n)*(t+(e+r*t)*n)};else{var c=r*Math.sqrt(i*i-1);v=function(n){var a=Math.exp(-i*r*n),s=Math.min(c*n,300);return o-a*((e+i*r*t)*Math.sinh(s)+c*t*Math.cosh(s))/c}}}return y(),{next:function(e){var t=v(e);if(g)l.done=e>=p;else{var n=1e3*C(e),i=Math.abs(n)<=a,r=Math.abs(o-t)<=s;l.done=i&&r}return l.value=l.done?o:t,l},flipTarget:function(){var e;f=-f,n=(e=[o,n])[0],o=e[1],y()}}}As.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var Ss=function(e){return 0},ws=function(e,t,n){var i=t-e;return 0===i?1:(n-e)/i},Es=function(e,t,n){return-n*e+n*t+e},xs=function(e,t){return function(n){return Boolean(Qr(n)&&Yr.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},Ds=function(e,t,n){return function(i){var o;if(!Qr(i))return i;var r=i.match(Zr),a=r[0],s=r[1],c=r[2],l=r[3];return(o={})[e]=parseFloat(a),o[t]=parseFloat(s),o[n]=parseFloat(c),o.alpha=void 0!==l?parseFloat(l):1,o}},Ts=Hr(0,255),Bs=Object(Jo.a)(Object(Jo.a)({},na),{transform:function(e){return Math.round(Ts(e))}}),Is={test:xs("rgb","red"),parse:Ds("red","green","blue"),transform:function(e){var t=e.red,n=e.green,i=e.blue,o=e.alpha,r=void 0===o?1:o;return"rgba("+Bs.transform(t)+", "+Bs.transform(n)+", "+Bs.transform(i)+", "+Ur(ia.transform(r))+")"}};var ks={test:xs("#"),parse:function(e){var t="",n="",i="",o="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),i=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),i=e.substr(3,1),o=e.substr(4,1),t+=t,n+=n,i+=i,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:Is.transform},Os={test:xs("hsl","hue"),parse:Ds("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,i=e.lightness,o=e.alpha,r=void 0===o?1:o;return"hsla("+Math.round(t)+", "+Kr.transform(Ur(n))+", "+Kr.transform(Ur(i))+", "+Ur(ia.transform(r))+")"}},Ls=function(e,t,n){var i=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-i)+i))},Ps=[ks,Is,Os],_s=function(e){return Ps.find((function(t){return t.test(e)}))},Rs=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},Fs=function(e,t){var n=_s(e),i=_s(t);Rs(e),Rs(t),n.transform,i.transform;var o=n.parse(e),r=i.parse(t),a=Object(Jo.a)({},o),s=n===Os?Es:Ls;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(o[t],r[t],e));return a.alpha=Es(o.alpha,r.alpha,e),n.transform(a)}},Ns={test:function(e){return Is.test(e)||ks.test(e)||Os.test(e)},parse:function(e){return Is.test(e)?Is.parse(e):Os.test(e)?Os.parse(e):ks.parse(e)},transform:function(e){return Qr(e)?e:e.hasOwnProperty("red")?Is.transform(e):Os.transform(e)}},Ms="${c}",Vs="${n}";function Ws(e){var t=[],n=0,i=e.match(Gr);i&&(n=i.length,e=e.replace(Gr,Ms),t.push.apply(t,i.map(Ns.parse)));var o=e.match(Zr);return o&&(e=e.replace(Zr,Vs),t.push.apply(t,o.map(na.parse))),{values:t,numColors:n,tokenised:e}}function zs(e){return Ws(e).values}function js(e){var t=Ws(e),n=t.values,i=t.numColors,o=t.tokenised,r=n.length;return function(e){for(var t=o,n=0;n<r;n++)t=t.replace(n<i?Ms:Vs,n<i?Ns.transform(e[n]):Ur(e[n]));return t}}var Hs=function(e){return"number"==typeof e?0:e};var Us={test:function(e){var t,n,i,o;return isNaN(e)&&Qr(e)&&(null!==(n=null===(t=e.match(Zr))||void 0===t?void 0:t.length)&&void 0!==n?n:0)+(null!==(o=null===(i=e.match(Gr))||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0},parse:zs,createTransformer:js,getAnimatableNone:function(e){var t=zs(e);return js(e)(t.map(Hs))}},Zs=function(e){return"number"==typeof e};function Gs(e,t){return Zs(e)?function(n){return Es(e,t,n)}:Ns.test(e)?Fs(e,t):qs(e,t)}var Ys=function(e,t){var n=Object(Jo.e)([],e),i=n.length,o=e.map((function(e,n){return Gs(e,t[n])}));return function(e){for(var t=0;t<i;t++)n[t]=o[t](e);return n}},Qs=function(e,t){var n=Object(Jo.a)(Object(Jo.a)({},e),t),i={};for(var o in n)void 0!==e[o]&&void 0!==t[o]&&(i[o]=Gs(e[o],t[o]));return function(e){for(var t in i)n[t]=i[t](e);return n}};function Xs(e){for(var t=Us.parse(e),n=t.length,i=0,o=0,r=0,a=0;a<n;a++)i||"number"==typeof t[a]?i++:void 0!==t[a].hue?r++:o++;return{parsed:t,numNumbers:i,numRGB:o,numHSL:r}}var qs=function(e,t){var n=Us.createTransformer(t),i=Xs(e),o=Xs(t);return i.numHSL===o.numHSL&&i.numRGB===o.numRGB&&(i.numNumbers,o.numNumbers),us(Ys(i.parsed,o.parsed),n)},Ks=function(e,t){return function(n){return Es(e,t,n)}};function Js(e,t,n){for(var i,o=[],r=n||("number"==typeof(i=e[0])?Ks:"string"==typeof i?Ns.test(i)?Fs:qs:Array.isArray(i)?Ys:"object"==typeof i?Qs:void 0),a=e.length-1,s=0;s<a;s++){var c=r(e[s],e[s+1]);if(t){var l=Array.isArray(t)?t[s]:t;c=us(l,c)}o.push(c)}return o}function $s(e,t,n){var i=void 0===n?{}:n,o=i.clamp,r=void 0===o||o,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 l=Js(t,a,s),u=2===c?function(e,t){var n=e[0],i=e[1],o=t[0];return function(e){return o(ws(n,i,e))}}(e,l):function(e,t){var n=e.length,i=n-1;return function(o){var r=0,a=!1;if(o<=e[0]?a=!0:o>=e[i]&&(r=i-1,a=!0),!a){for(var s=1;s<n&&!(e[s]>o||s===i);s++);r=s-1}var c=ws(e[r],e[r+1],o);return t[r](c)}}(e,l);return r?function(t){return u(fs(e[0],e[c-1],t))}:u}var ec,tc=function(e){return function(t){return 1-e(1-t)}},nc=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},ic=function(e){return function(t){return t*t*((e+1)*t-e)}},oc=function(e){return e},rc=(ec=2,function(e){return Math.pow(e,ec)}),ac=tc(rc),sc=nc(rc),cc=function(e){return 1-Math.sin(Math.acos(e))},lc=tc(cc),uc=nc(lc),dc=ic(1.525),mc=tc(dc),hc=nc(dc),fc=function(e){var t=ic(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),pc=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},gc=tc(pc);function vc(e,t){return e.map((function(){return t||sc})).splice(0,e.length-1)}function Cc(e){var t=e.from,n=void 0===t?0:t,i=e.to,o=void 0===i?1:i,r=e.ease,a=e.offset,s=e.duration,c=void 0===s?300:s,l={done:!1,value:n},u=Array.isArray(o)?o:[n,o],d=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===u.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(u),c);function m(){return $s(d,u,{ease:Array.isArray(r)?r:vc(u,r)})}var h=m();return{next:function(e){return l.value=h(e),l.done=e>=c,l},flipTarget:function(){u.reverse(),h=m()}}}var yc={keyframes:Cc,spring:As,decay:function(e){var t=e.velocity,n=void 0===t?0:t,i=e.from,o=void 0===i?0:i,r=e.power,a=void 0===r?.8:r,s=e.timeConstant,c=void 0===s?350:s,l=e.restDelta,u=void 0===l?.5:l,d=e.modifyTarget,m={done:!1,value:o},h=a*n,f=o+h,p=void 0===d?f:d(f);return p!==f&&(h=p-o),{next:function(e){var t=-h*Math.exp(-e/c);return m.done=!(t>u||t<-u),m.value=m.done?p:p+t,m},flipTarget:function(){}}}};var bc=1/60*1e3,Ac="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Sc="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(Ac())}),bc)};var wc=!0,Ec=!1,xc=!1,Dc={delta:0,timestamp:0},Tc=["read","update","preRender","render","postRender"],Bc=Tc.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],i=0,o=!1,r=new WeakSet,a={schedule:function(e,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var c=s&&o,l=c?t:n;return a&&r.add(e),-1===l.indexOf(e)&&(l.push(e),c&&o&&(i=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),r.delete(e)},process:function(s){var c;if(o=!0,t=(c=[n,t])[0],(n=c[1]).length=0,i=t.length)for(var l=0;l<i;l++){var u=t[l];u(s),r.has(u)&&(a.schedule(u),e())}o=!1}};return a}((function(){return Ec=!0})),e}),{}),Ic=Tc.reduce((function(e,t){var n=Bc[t];return e[t]=function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!1),Ec||_c(),n.schedule(e,t,i)},e}),{}),kc=Tc.reduce((function(e,t){return e[t]=Bc[t].cancel,e}),{}),Oc=Tc.reduce((function(e,t){return e[t]=function(){return Bc[t].process(Dc)},e}),{}),Lc=function(e){return Bc[e].process(Dc)},Pc=function(e){Ec=!1,Dc.delta=wc?bc:Math.max(Math.min(e-Dc.timestamp,40),1),Dc.timestamp=e,xc=!0,Tc.forEach(Lc),xc=!1,Ec&&(wc=!1,Sc(Pc))},_c=function(){Ec=!0,wc=!0,xc||Sc(Pc)},Rc=function(){return Dc},Fc=Ic;function Nc(e,t,n){return void 0===n&&(n=0),e-t-n}var Mc=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return Fc.update(t,!0)},stop:function(){return kc.update(t)}}};function Vc(e){var t,n,i,o,r,a=e.from,s=e.autoplay,c=void 0===s||s,l=e.driver,u=void 0===l?Mc:l,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,C=void 0===v?0:v,y=e.onPlay,b=e.onStop,A=e.onComplete,S=e.onRepeat,w=e.onUpdate,E=Object(Jo.d)(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),x=E.to,D=0,T=E.duration,B=!1,I=!0,k=function(e){if(Array.isArray(e.to))return Cc;if(yc[e.type])return yc[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Cc:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?As:Cc}(E);(null===(n=(t=k).needsInterpolation)||void 0===n?void 0:n.call(t,a,x))&&(r=$s([0,100],[a,x],{clamp:!1}),a=0,x=100);var O=k(Object(Jo.a)(Object(Jo.a)({},E),{from:a,to:x}));function L(){D++,"reverse"===g?m=function(e,t,n,i){return void 0===n&&(n=0),void 0===i&&(i=!0),i?Nc(t+-e,t,n):t-(e-t)+n}(m,T,C,I=D%2==0):(m=Nc(m,T,C),"mirror"===g&&O.flipTarget()),B=!1,S&&S()}function P(e){if(I||(e=-e),m+=e,!B){var t=O.next(Math.max(0,m));o=t.value,r&&(o=r(o)),B=I?t.done:m<=0}null==w||w(o),B&&(0===D&&(null!=T||(T=m)),D<f?function(e,t,n,i){return i?e>=t+n:e<=-n}(m,T,C,I)&&L():(i.stop(),A&&A()))}return c&&(null==y||y(),(i=u(P)).start()),{stop:function(){null==b||b(),i.stop()}}}function Wc(e,t){return t?e*(1e3/t):0}var zc=function(e){return 1e3*e},jc=function(e,t){return 1-3*t+3*e},Hc=function(e,t){return 3*t-6*e},Uc=function(e){return 3*e},Zc=function(e,t,n){return((jc(t,n)*e+Hc(t,n))*e+Uc(t))*e},Gc=function(e,t,n){return 3*jc(t,n)*e*e+2*Hc(t,n)*e+Uc(t)};var Yc=.1;function Qc(e,t,n,i){if(e===t&&n===i)return oc;for(var o=new Float32Array(11),r=0;r<11;++r)o[r]=Zc(r*Yc,e,n);function a(t){for(var i=0,r=1;10!==r&&o[r]<=t;++r)i+=Yc;--r;var a=i+(t-o[r])/(o[r+1]-o[r])*Yc,s=Gc(a,e,n);return s>=.001?function(e,t,n,i){for(var o=0;o<8;++o){var r=Gc(t,n,i);if(0===r)return t;t-=(Zc(t,n,i)-e)/r}return t}(t,a,e,n):0===s?a:function(e,t,n,i,o){var r,a,s=0;do{(r=Zc(a=t+(n-t)/2,i,o)-e)>0?n=a:t=a}while(Math.abs(r)>1e-7&&++s<10);return a}(t,i,i+Yc,e,n)}return function(e){return 0===e||1===e?e:Zc(a(e),t,i)}}var Xc={linear:oc,easeIn:rc,easeInOut:sc,easeOut:ac,circIn:cc,circInOut:uc,circOut:lc,backIn:dc,backInOut:hc,backOut:mc,anticipate:fc,bounceIn:gc,bounceInOut:function(e){return e<.5?.5*(1-pc(1-2*e)):.5*pc(2*e-1)+.5},bounceOut:pc},qc=function(e){if(Array.isArray(e)){e.length;var t=Object(Jo.c)(e,4);return Qc(t[0],t[1],t[2],t[3])}return"string"==typeof e?Xc[e]:e},Kc=function(e,t){return"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Us.test(t)||t.startsWith("url(")))},Jc=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},$c=function(e){return{type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},el=function(){return{type:"keyframes",ease:"linear",duration:.3}},tl=function(e){return{type:"keyframes",duration:.8,values:e}},nl={x:Jc,y:Jc,z:Jc,rotate:Jc,rotateX:Jc,rotateY:Jc,rotateZ:Jc,scaleX:$c,scaleY:$c,scale:$c,opacity:el,backgroundColor:el,color:el,default:$c},il=new Set(["brightness","contrast","saturate","opacity"]);function ol(e){var t=e.slice(0,-1).split("("),n=t[0],i=t[1];if("drop-shadow"===n)return e;var o=(i.match(Zr)||[])[0];if(!o)return e;var r=i.replace(o,""),a=il.has(n)?1:0;return o!==i&&(a*=100),n+"("+a+r+")"}var rl=/([a-z-]*)\(.*?\)/g,al=Object(Jo.a)(Object(Jo.a)({},Us),{getAnimatableNone:function(e){var t=e.match(rl);return t?t.map(ol).join(" "):e}}),sl=Object(Jo.a)(Object(Jo.a)({},aa),{color:Ns,backgroundColor:Ns,outlineColor:Ns,fill:Ns,stroke:Ns,borderColor:Ns,borderTopColor:Ns,borderRightColor:Ns,borderBottomColor:Ns,borderLeftColor:Ns,filter:al,WebkitFilter:al}),cl=function(e){return sl[e]};function ll(e,t){var n,i=cl(e);return i!==al&&(i=Us),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,t)}function ul(e){var t=e.ease,n=e.times,i=e.yoyo,o=e.flip,r=e.loop,a=Object(Jo.d)(e,["ease","times","yoyo","flip","loop"]),s=Object(Jo.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=zc(a.duration)),a.repeatDelay&&(s.repeatDelay=zc(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!=typeof e[0]}(t)?t.map(qc):qc(t)),"tween"===a.type&&(s.type="keyframes"),(i||r||o)&&(!0,i?s.repeatType="reverse":r?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=r||i||o||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function dl(e,t,n){var i,o,r,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(Jo.e)([],Object(Jo.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(Jo.d)(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}(e)||(e=Object(Jo.a)(Object(Jo.a)({},e),(o=n,r=t.to,a=La(r)?tl:nl[o]||nl.default,Object(Jo.a)({to:r},a(r))))),Object(Jo.a)(Object(Jo.a)({},t),ul(e))}function ml(e,t,n,i,o){var r,a=pl(i,e),s=null!==(r=a.from)&&void 0!==r?r:t.get(),c=Kc(e,n);"none"===s&&c&&"string"==typeof n?s=ll(e,n):hl(s)&&"string"==typeof n?s=fl(n):!Array.isArray(n)&&hl(n)&&"string"==typeof s&&(n=fl(s));var l=Kc(e,s);return l&&c&&!1!==a.type?function(){var i={from:s,to:n,velocity:t.getVelocity(),onComplete:o,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,o=e.velocity,r=void 0===o?0:o,a=e.min,s=e.max,c=e.power,l=void 0===c?.8:c,u=e.timeConstant,d=void 0===u?750:u,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,C=e.modifyTarget,y=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=Vc(Object(Jo.a)(Object(Jo.a)({},e),{driver:y,onUpdate:function(t){var n;null==b||b(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:A}))}function x(e){E(Object(Jo.a)({type:"spring",stiffness:h,damping:p,restDelta:v},e))}if(S(i))x({from:i,velocity:r,to:w(i)});else{var D=l*r+i;"undefined"!=typeof C&&(D=C(D));var T,B,I=w(D),k=I===a?-1:1;E({type:"decay",from:i,velocity:r,timeConstant:d,power:l,restDelta:v,modifyTarget:C,onUpdate:S(D)?function(e){T=B,B=e,r=Wc(e-T,Rc().delta),(1===k&&e>I||-1===k&&e<I)&&x({from:e,to:I,velocity:r})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}}(Object(Jo.a)(Object(Jo.a)({},i),a)):Vc(Object(Jo.a)(Object(Jo.a)({},dl(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),o(),null===(e=null==a?void 0:a.onComplete)||void 0===e||e.call(a),{stop:function(){}}}}function hl(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function fl(e){return"number"==typeof e?0:ll("",e)}function pl(e,t){return e[t]||e.default||e}function gl(e,t,n,i){return void 0===i&&(i={}),t.start((function(o){var r,a,s=ml(e,t,n,i,o),c=function(e,t){var n;return null!==(n=(pl(e,t)||{}).delay)&&void 0!==n?n:0}(i,e),l=function(){return a=s()};return c?r=setTimeout(l,zc(c)):l(),function(){clearTimeout(r),null==a||a.stop()}}))}function vl(e,t){-1===e.indexOf(t)&&e.push(t)}function Cl(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var yl=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return vl(this.subscriptions,e),function(){return Cl(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 o=0;o<i;o++){var r=this.subscriptions[o];r&&r(e,t,n)}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),bl=function(){function e(e){var t,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new yl,this.velocityUpdateSubscribers=new yl,this.renderSubscribers=new yl,this.canTrackVelocity=!1,this.updateAndNotify=function(e,t){void 0===t&&(t=!0),n.prev=n.current,n.current=e;var i=Rc(),o=i.delta,r=i.timestamp;n.lastUpdated!==r&&(n.timeDelta=o,n.lastUpdated=r,Fc.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 Fc.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?Wc(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 Al(e){return new bl(e)}var Sl=function(e){return function(t){return t.test(e)}},wl=[na,Jr,Kr,qr,ea,$r,{test:function(e){return"auto"===e},parse:function(e){return e}}],El=function(e){return wl.find(Sl(e))},xl=Object(Jo.e)(Object(Jo.e)([],Object(Jo.c)(wl)),[Ns,Us]),Dl=function(e){return xl.find(Sl(e))};function Tl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Al(n))}function Bl(e,t){var n=Ar(e,t),i=n?e.makeTargetAnimatable(n,!1):{},o=i.transitionEnd,r=void 0===o?{}:o;i.transition;var a,s=Object(Jo.d)(i,["transitionEnd","transition"]);for(var c in s=Object(Jo.a)(Object(Jo.a)({},s),r)){Tl(e,c,(a=s[c],La(a)?a[a.length-1]||0:a))}}function Il(e,t){if(t)return(t[e]||t.default||t).from}function kl(e,t,n){var i;void 0===n&&(n={});var o=Ar(e,t,n.custom),r=(o||{}).transition,a=void 0===r?e.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=o?function(){return Ol(e,o,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 o=a.delayChildren,r=void 0===o?0:o,s=a.staggerChildren,c=a.staggerDirection;return function(e,t,n,i,o,r){void 0===n&&(n=0);void 0===i&&(i=0);void 0===o&&(o=1);var a=[],s=(e.variantChildren.size-1)*i,c=1===o?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(Ll).forEach((function(e,i){a.push(kl(e,t,Object(Jo.a)(Object(Jo.a)({},r),{delay:n+c(i)})).then((function(){return e.notifyAnimationComplete(t)})))})),Promise.all(a)}(e,t,r+i,s,c,n)}:function(){return Promise.resolve()},l=a.when;if(l){var u=Object(Jo.c)("beforeChildren"===l?[s,c]:[c,s],2),d=u[0],m=u[1];return d().then(m)}return Promise.all([s(),c(n.delay)])}function Ol(e,t,n){var i,o=void 0===n?{}:n,r=o.delay,a=void 0===r?0:r,s=o.transitionOverride,c=o.type,l=e.makeTargetAnimatable(t),u=l.transition,d=void 0===u?e.getDefaultTransition():u,m=l.transitionEnd,h=Object(Jo.d)(l,["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),C=h[g];if(!(!v||void 0===C||p&&Pl(p,g))){var y=gl(g,v,C,Object(Jo.a)({delay:a},d));f.push(y)}}return Promise.all(f).then((function(){m&&Bl(e,m)}))}function Ll(e,t){return e.sortNodePosition(t)}function Pl(e,t){var n=e.protectedKeys,i=e.needsAnimating,o=n.hasOwnProperty(t)&&!0!==i[t];return i[t]=!1,o}var _l=[Ma.Animate,Ma.Hover,Ma.Tap,Ma.Drag,Ma.Focus,Ma.Exit],Rl=Object(Jo.e)([],Object(Jo.c)(_l)).reverse(),Fl=_l.length;function Nl(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 o=t.map((function(t){return kl(e,t,n)}));i=Promise.all(o)}else if("string"==typeof t)i=kl(e,t,n);else{var r="function"==typeof t?Ar(e,t,n.custom):t;i=Ol(e,r,n)}return i.then((function(){return e.notifyAnimationComplete(t)}))}(e,n,i)})))}}function Ml(e){var t,n=Nl(e),i=((t={})[Ma.Animate]=Vl(!0),t[Ma.Hover]=Vl(),t[Ma.Tap]=Vl(),t[Ma.Drag]=Vl(),t[Ma.Focus]=Vl(),t[Ma.Exit]=Vl(),t),o={},r=!0,a=function(t,n){var i=Ar(e,n);if(i){i.transition;var o=i.transitionEnd,r=Object(Jo.d)(i,["transition","transitionEnd"]);t=Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},t),r),o)}return t};function s(t,s){for(var c,l=e.getProps(),u=e.getVariantContext(!0)||{},d=[],m=new Set,h={},f=1/0,p=function(n){var o=Rl[n],p=i[o],g=null!==(c=l[o])&&void 0!==c?c:u[o],v=yr(g),C=o===s?p.isActive:null;!1===C&&(f=n);var y=g===u[o]&&g!==l[o]&&v;if(y&&r&&e.manuallyAnimateOnMount&&(y=!1),p.protectedKeys=Object(Jo.a)({},h),!p.isActive&&null===C||!g&&!p.prevProp||Oa(g)||"boolean"==typeof g)return"continue";var b=function(e,t){if("string"==typeof t)return t!==e;if(Cr(t))return!hs(t,e);return!1}(p.prevProp,g)||o===s&&p.isActive&&!y&&v||n>f&&v,A=Array.isArray(g)?g:[g],S=A.reduce(a,{});!1===C&&(S={});var w=p.prevResolvedValues,E=void 0===w?{}:w,x=Object(Jo.a)(Object(Jo.a)({},E),S),D=function(e){b=!0,m.delete(e),p.needsAnimating[e]=!0};for(var T in x){var B=S[T],I=E[T];h.hasOwnProperty(T)||(B!==I?La(B)&&La(I)?hs(B,I)?p.protectedKeys[T]=!0:D(T):void 0!==B?D(T):m.add(T):void 0!==B&&m.has(T)?D(T):p.protectedKeys[T]=!0)}p.prevProp=g,p.prevResolvedValues=S,p.isActive&&(h=Object(Jo.a)(Object(Jo.a)({},h),S)),r&&e.blockInitialAnimation&&(b=!1),b&&!y&&d.push.apply(d,Object(Jo.e)([],Object(Jo.c)(A.map((function(e){return{animation:e,options:Object(Jo.a)({type:o},t)}})))))},g=0;g<Fl;g++)p(g);if(o=Object(Jo.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 C=Boolean(d.length);return r&&!1===l.initial&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,C?n(d):Promise.resolve()}return{isAnimated:function(e){return void 0!==o[e]},animateChanges:s,setActive:function(t,n,o){var r;return i[t].isActive===n?Promise.resolve():(null===(r=e.variantChildren)||void 0===r||r.forEach((function(e){var i;return null===(i=e.animationState)||void 0===i?void 0:i.setActive(t,n)})),i[t].isActive=n,s(o,t))},setAnimateFunction:function(t){n=t(e)},getState:function(){return i}}}function Vl(e){return void 0===e&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var Wl={animation:ds((function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=Ml(t)),Oa(n)&&Object(ro.useEffect)((function(){return n.subscribe(t)}),[n])})),exit:ds((function(e){var t=e.custom,n=e.visualElement,i=Object(Jo.c)(cr(),2),o=i[0],r=i[1],a=Object(ro.useContext)(ar);Object(ro.useEffect)((function(){var e,i,s=null===(e=n.animationState)||void 0===e?void 0:e.setActive(Ma.Exit,!o,{custom:null!==(i=null==a?void 0:a.custom)&&void 0!==i?i:t});!o&&(null==s||s.then(r))}),[o])}))},zl=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},jl=function(e){return zl(e)&&e.hasOwnProperty("z")},Hl=function(e,t){return Math.abs(e-t)};function Ul(e,t){if(Zs(e)&&Zs(t))return Hl(e,t);if(zl(e)&&zl(t)){var n=Hl(e.x,t.x),i=Hl(e.y,t.y),o=jl(e)&&jl(t)?Hl(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(i,2)+Math.pow(o,2))}}var Zl=function(){function e(e,t,n){var i=this,o=(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=Ql(i.lastMoveEventInfo,i.history),t=null!==i.startEvent,n=Ul(e.offset,{x:0,y:0})>=3;if(t||n){var o=e.point,r=Rc().timestamp;i.history.push(Object(Jo.a)(Object(Jo.a)({},o),{timestamp:r}));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=Gl(t,i.transformPagePoint),Ha(e)&&0===e.buttons?i.handlePointerUp(e,t):Fc.update(i.updatePoint,!0)},this.handlePointerUp=function(e,t){i.end();var n=i.handlers,o=n.onEnd,r=n.onSessionEnd,a=Ql(Gl(t,i.transformPagePoint),i.history);i.startEvent&&o&&o(e,a),r&&r(e,a)},!(Ua(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=o;var r=Gl(Qa(e),this.transformPagePoint),a=r.point,s=Rc().timestamp;this.history=[Object(Jo.a)(Object(Jo.a)({},a),{timestamp:s})];var c=t.onSessionStart;c&&c(e,Ql(r,this.history)),this.removeListeners=us($a(window,"pointermove",this.handlePointerMove),$a(window,"pointerup",this.handlePointerUp),$a(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),kc.update(this.updatePoint)},e}();function Gl(e,t){return t?{point:t(e.point)}:e}function Yl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ql(e,t){var n=e.point;return{point:n,delta:Yl(n,ql(t)),offset:Yl(n,Xl(t)),velocity:Kl(t,.1)}}function Xl(e){return e[0]}function ql(e){return e[e.length-1]}function Kl(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,i=null,o=ql(e);n>=0&&(i=e[n],!(o.timestamp-i.timestamp>zc(t)));)n--;if(!i)return{x:0,y:0};var r=(o.timestamp-i.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(o.x-i.x)/r,y:(o.y-i.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Jl(e){return e}function $l(e){var t=e.top;return{x:{min:e.left,max:e.right},y:{min:t,max:e.bottom}}}var eu={translate:0,scale:1,origin:0,originPoint:0};function tu(){return{x:Object(Jo.a)({},eu),y:Object(Jo.a)({},eu)}}function nu(e){return[e("x"),e("y")]}function iu(e,t,n){var i=t.min,o=t.max;return void 0!==i&&e<i?e=n?Es(i,e,n.min):Math.max(e,i):void 0!==o&&e>o&&(e=n?Es(o,e,n.max):Math.min(e,o)),e}function ou(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 ru(e,t){var n,i=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&(i=(n=Object(Jo.c)([o,i],2))[0],o=n[1]),{min:e.min+i,max:e.min+o}}function au(e,t,n){return{min:su(e,t),max:su(e,n)}}function su(e,t){var n;return"number"==typeof e?e:null!==(n=e[t])&&void 0!==n?n:0}function cu(e,t){return $l(function(e,t){var n=e.top,i=e.left,o=e.bottom,r=e.right;void 0===t&&(t=Jl);var a=t({x:i,y:n}),s=t({x:r,y:o});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(e.getBoundingClientRect(),t))}function lu(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=.01),Ul(e,t)<n}function uu(e){return e.max-e.min}function du(e,t){var n=.5,i=uu(e),o=uu(t);return o>i?n=ws(t.min,t.max-i,e.min):i>o&&(n=ws(e.min,e.max-o,t.min)),fs(0,1,n)}function mu(e,t,n,i){void 0===i&&(i=.5),e.origin=i,e.originPoint=Es(t.min,t.max,e.origin),e.scale=uu(n)/uu(t),lu(e.scale,1,1e-4)&&(e.scale=1),e.translate=Es(n.min,n.max,e.origin)-e.originPoint,lu(e.translate)&&(e.translate=0)}function hu(e,t,n,i){mu(e.x,t.x,n.x,fu(i.originX)),mu(e.y,t.y,n.y,fu(i.originY))}function fu(e){return"number"==typeof e?e:.5}function pu(e,t,n){e.min=n.min+t.min,e.max=e.min+uu(t)}var gu=function(e,t){return e.depth-t.depth};function vu(e){return e.projection.isEnabled||e.shouldResetTransform()}function Cu(e,t){void 0===t&&(t=[]);var n=e.parent;return n&&Cu(n,t),vu(e)&&t.push(e),t}function yu(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(Jo.a)({},t.x),y:Object(Jo.a)({},t.y)}),e.notifyLayoutMeasure(n.layout,e.prevViewportBox||n.layout),Fc.update((function(){return e.rebaseProjectionTarget()}))}}function bu(e,t){return{min:t.min-e.min,max:t.max-e.min}}function Au(e,t){return{x:bu(e.x,t.x),y:bu(e.y,t.y)}}function Su(e,t){var n=e.getLayoutId(),i=t.getLayoutId();return n!==i||void 0===i&&e!==t}function wu(e){var t=e.getProps(),n=t.drag,i=t._dragX;return n&&!i}function Eu(e,t){e.min=t.min,e.max=t.max}function xu(e,t,n){return n+t*(e-n)}function Du(e,t,n,i,o){return void 0!==o&&(e=xu(e,o,i)),xu(e,n,i)+t}function Tu(e,t,n,i,o){void 0===t&&(t=0),void 0===n&&(n=1),e.min=Du(e.min,t,n,i,o),e.max=Du(e.max,t,n,i,o)}function Bu(e,t){var n=t.x,i=t.y;Tu(e.x,n.translate,n.scale,n.originPoint),Tu(e.y,i.translate,i.scale,i.originPoint)}function Iu(e,t,n,i){var o=Object(Jo.c)(i,3),r=o[0],a=o[1],s=o[2];e.min=t.min,e.max=t.max;var c=void 0!==n[s]?n[s]:.5,l=Es(t.min,t.max,c);Tu(e,n[r],n[a],l,n.scale)}var ku=["x","scaleX","originX"],Ou=["y","scaleY","originY"];function Lu(e,t,n){Iu(e.x,t.x,n,ku),Iu(e.y,t.y,n,Ou)}function Pu(e,t,n,i,o){return e=xu(e-=t,1/n,i),void 0!==o&&(e=xu(e,1/o,i)),e}function _u(e,t,n){var i=Object(Jo.c)(n,3),o=i[0],r=i[1],a=i[2];!function(e,t,n,i,o){void 0===t&&(t=0),void 0===n&&(n=1),void 0===i&&(i=.5);var r=Es(e.min,e.max,i)-t;e.min=Pu(e.min,t,n,r,o),e.max=Pu(e.max,t,n,r,o)}(e,t[o],t[r],t[a],t.scale)}function Ru(e,t){_u(e.x,t,ku),_u(e.y,t,Ou)}var Fu=new Set;function Nu(e,t,n){e[n]||(e[n]=[]),e[n].push(t)}function Mu(e){return Fu.add(e),function(){return Fu.delete(e)}}function Vu(){if(Fu.size){var e=0,t=[[]],n=[],i=function(n){return Nu(t,n,e)},o=function(t){Nu(n,t,e),e++};Fu.forEach((function(t){t(i,o),e=0})),Fu.clear();for(var r=n.length,a=0;a<=r;a++)t[a]&&t[a].forEach(zu),n[a]&&n[a].forEach(zu)}}var Wu,zu=function(e){return e()},ju=new WeakMap,Hu=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(),ju.set(t,this)}return e.prototype.start=function(e,t){var n=this,i=void 0===t?{}:t,o=i.snapToCursor,r=void 0!==o&&o,a=i.cursorProgress,s=this.props.transformPagePoint;this.panSession=new Zl(e,{onSessionStart:function(e){var t;n.stopMotion();var i=function(e){return Qa(e,"client")}(e).point;null===(t=n.cancelLayout)||void 0===t||t.call(n),n.cancelLayout=Mu((function(e,t){var o=Cu(n.visualElement),s=function(e){var t=[],n=function(e){vu(e)&&t.push(e),e.children.forEach(n)};return e.children.forEach(n),t.sort(gu)}(n.visualElement),c=Object(Jo.e)(Object(Jo.e)([],Object(Jo.c)(o)),Object(Jo.c)(s)),l=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),t((function(){c.forEach((function(e){return e.resetTransform()}))})),e((function(){yu(n.visualElement),s.forEach(yu)})),t((function(){c.forEach((function(e){return e.restoreTransform()})),r&&(l=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;nu((function(t){if(!l){var o=e.target[t],r=o.min,s=o.max;n.cursorProgress[t]=a?a[t]:ws(r,s,i[t])}var c=n.getAxisMotionValue(t);c&&(n.originPoint[t]=c.get())}))})),t((function(){Oc.update(),Oc.preRender(),Oc.render(),Oc.postRender()})),e((function(){return n.resolveDragConstraints()}))}))},onStart:function(e,t){var i,o,r,a=n.props,s=a.drag,c=a.dragPropagation;(!s||c||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=os(s),n.openGlobalLock))&&(Vu(),n.isDragging=!0,n.currentDirection=null,null===(o=(i=n.props).onDragStart)||void 0===o||o.call(i,e,t),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(Ma.Drag,!0))},onMove:function(e,t){var i,o,r,a,s=n.props,c=s.dragPropagation,l=s.dragDirectionLock;if(c||n.openGlobalLock){var u=t.offset;if(l&&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}(u),void(null!==n.currentDirection&&(null===(o=(i=n.props).onDirectionLock)||void 0===o||o.call(i,n.currentDirection)));n.updateAxis("x",t.point,u),n.updateAxis("y",t.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,e,t),Wu=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,o=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(vr(n)?this.resolveRefConstraints(o,n):function(e,t){var n=t.top,i=t.left,o=t.bottom,r=t.right;return{x:ou(e.x,i,r),y:ou(e.y,n,o)}}(o,n)),this.elastic=function(e){return!1===e?e=0:!0===e&&(e=.35),{x:au(e,"left","right"),y:au(e,"top","bottom")}}(i),this.constraints&&!this.hasMutatedConstraints&&nu((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}(o[t],e.constraints[t]))}))},e.prototype.resolveRefConstraints=function(e,t){var n=this.props,i=n.onMeasureDragConstraints,o=n.transformPagePoint,r=t.current;this.constraintsBox=cu(r,o);var a=function(e,t){return{x:ru(e.x,t.x),y:ru(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=$l(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(Ma.Drag,!1)},e.prototype.stop=function(e,t){var n,i,o;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=t.velocity;this.animateDragEnd(a),null===(o=(i=this.props).onDragEnd)||void 0===o||o.call(i,e,t)}},e.prototype.snapToCursor=function(e){var t=this;return nu((function(n){if(Uu(n,t.props.drag,t.currentDirection)){var i=t.getAxisMotionValue(n);if(!i)return t.cursorProgress[n]=.5,!0;var o=t.visualElement.getLayoutState().layout,r=o[n].max-o[n].min,a=o[n].min+r/2,s=e[n]-a;t.originPoint[n]=e[n],i.set(s)}})).includes(!0)},e.prototype.updateAxis=function(e,t,n){if(Uu(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],o=this.constraints?iu(i,this.constraints[e],this.elastic[e]):i;n.set(o)}},e.prototype.updateVisualElementAxis=function(e,t){var n,i=this.visualElement.getLayoutState().layout[e],o=i.max-i.min,r=this.cursorProgress[e],a=function(e,t,n,i,o){var r=e-t*n;return i?iu(r,i,o):r}(t[e],o,r,null===(n=this.constraints)||void 0===n?void 0:n[e],this.elastic[e]);this.visualElement.setProjectionTargetAxis(e,a,a+o)},e.prototype.setProps=function(e){var t=e.drag,n=void 0!==t&&t,i=e.dragDirectionLock,o=void 0!==i&&i,r=e.dragPropagation,a=void 0!==r&&r,s=e.dragConstraints,c=void 0!==s&&s,l=e.dragElastic,u=void 0===l?.35:l,d=e.dragMomentum,m=void 0===d||d,h=Object(Jo.d)(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(Jo.a)({drag:n,dragDirectionLock:o,dragPropagation:a,dragConstraints:c,dragElastic:u,dragMomentum:m},h)},e.prototype.getAxisMotionValue=function(e){var t=this.props,n=t.layout,i=t.layoutId,o="_drag"+e.toUpperCase();return this.props[o]?this.props[o]: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,o=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(e,t){void 0===t&&(t=!0);var n,i=e.getProjectionParent();return!!i&&(t?Ru(n=Au(i.projection.target,e.projection.target),i.getLatestValues()):n=Au(i.getLayoutState().layout,e.getLayoutState().layout),nu((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 l=this.visualElement.getProjectionParent();if(l){var u=Au(l.projection.targetFinal,c);nu((function(e){var t=u[e],n=t.min,i=t.max;c[e]={min:isNaN(n)?void 0:n,max:isNaN(i)?void 0:i}}))}}var d=nu((function(n){var l;if(Uu(n,i,t.currentDirection)){var u=null!==(l=null==c?void 0:c[n])&&void 0!==l?l:{},d=r?200:1e6,m=r?40:1e7,h=Object(Jo.a)(Object(Jo.a)({type:"inertia",velocity:o?e[n]:0,bounceStiffness:d,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10},a),u);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;nu((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),gl(e,n,0,t)}},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.drag;if(vr(t.dragConstraints)&&this.constraintsBox){this.stopMotion();var i={x:0,y:0};nu((function(t){i[t]=du(e.visualElement.projection.target[t],e.constraintsBox[t])})),this.updateConstraints((function(){nu((function(t){if(Uu(t,n,null)){var o=function(e,t,n){var i=e.max-e.min,o=Es(t.min,t.max-i,n);return{min:o,max:o+i}}(e.visualElement.projection.target[t],e.constraintsBox[t],i[t]),r=o.min,a=o.max;e.visualElement.setProjectionTargetAxis(t,r,a)}}))})),setTimeout(Vu,1)}},e.prototype.updateConstraints=function(e){var t=this;this.cancelLayout=Mu((function(n,i){var o=Cu(t.visualElement);i((function(){return o.forEach((function(e){return e.resetTransform()}))})),n((function(){return yu(t.visualElement)})),i((function(){return o.forEach((function(e){return e.restoreTransform()}))})),n((function(){t.resolveDragConstraints()})),e&&i(e)}))},e.prototype.mount=function(e){var t=this,n=$a(e.getInstance(),"pointerdown",(function(e){var n=t.props,i=n.drag,o=n.dragListener;i&&(void 0===o||o)&&t.start(e)})),i=za(window,"resize",(function(){t.scalePoint()})),o=e.onLayoutUpdate((function(){t.isDragging&&t.resolveDragConstraints()})),r=e.prevDragCursor;return r&&this.start(Wu,{cursorProgress:r}),function(){null==n||n(),null==i||i(),null==o||o(),t.cancelDrag()}},e}();function Uu(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}var Zu,Gu,Yu={pan:ds((function(e){var t=e.onPan,n=e.onPanStart,i=e.onPanEnd,o=e.onPanSessionStart,r=e.visualElement,a=t||n||i||o,s=Object(ro.useRef)(null),c=Object(ro.useContext)(or).transformPagePoint,l={onSessionStart:o,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,i&&i(e,t)}};Object(ro.useEffect)((function(){null!==s.current&&s.current.updateHandlers(l)})),es(r,"pointerdown",a&&function(e){s.current=new Zl(e,l,{transformPagePoint:c})}),cs((function(){return s.current&&s.current.end()}))})),drag:ds((function(e){var t=e.dragControls,n=e.visualElement,i=Object(ro.useContext)(or).transformPagePoint,o=sr((function(){return new Hu({visualElement:n})}));o.setProps(Object(Jo.a)(Object(Jo.a)({},e),{transformPagePoint:i})),Object(ro.useEffect)((function(){return t&&t.subscribe(o)}),[o]),Object(ro.useEffect)((function(){return o.mount(n)}),[])}))};function Qu(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"}(Zu||(Zu={})),function(e){e[e.Hide=0]="Hide",e[e.Show=1]="Show"}(Gu||(Gu={}));var Xu=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function qu(e,t,n){void 0===n&&(n=1);var i=Object(Jo.c)(function(e){var t=Xu.exec(e);if(!t)return[,];var n=Object(Jo.c)(t,3);return[n[1],n[2]]}(e),2),o=i[0],r=i[1];if(o){var a=window.getComputedStyle(t).getPropertyValue(o);return a?a.trim():Qu(r)?qu(r,t,n+1):r}}function Ku(e,t){return e/(t.max-t.min)*100}var Ju="_$css";var $u={process:function(e,t,n){var i=n.target;if("string"==typeof e){if(!Jr.test(e))return e;e=parseFloat(e)}return Ku(e,i.x)+"% "+Ku(e,i.y)+"%"}},ed={borderRadius:Object(Jo.a)(Object(Jo.a)({},$u),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:$u,borderTopRightRadius:$u,borderBottomLeftRadius:$u,borderBottomRightRadius:$u,boxShadow:{process:function(e,t){var n=t.delta,i=t.treeScale,o=e,r=e.includes("var("),a=[];r&&(e=e.replace(Xu,(function(e){return a.push(e),Ju})));var s=Us.parse(e);if(s.length>5)return o;var c=Us.createTransformer(e),l="number"!=typeof s[0]?1:0,u=n.x.scale*i.x,d=n.y.scale*i.y;s[0+l]/=u,s[1+l]/=d;var m=Es(u,d,.5);"number"==typeof s[2+l]&&(s[2+l]/=m),"number"==typeof s[3+l]&&(s[3+l]/=m);var h=c(s);if(r){var f=0;h=h.replace(Ju,(function(){var e=a[f];return f++,e}))}return h}}},td=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 o=i.originBox,r=i.targetBox,a=i.visibilityAction,s=i.shouldStackAnimate,c=i.onComplete,l=i.prevParent,u=Object(Jo.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=o||n,e=r||e;var f=!1,p=m.getProjectionParent();if(p){var g=p.prevViewportBox,v=p.getLayoutState().layout;l&&(r&&(v=l.getLayoutState().layout),o&&!Su(l,p)&&l.prevViewportBox&&(g=l.prevViewportBox)),g&&sd(l,o,r)&&(f=!0,n=Au(g,n),e=Au(v,e))}var C=nd(n,e),y=nu((function(i){var o,r;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?C?t.animateAxis(i,e[i],n[i],Object(Jo.a)(Object(Jo.a)({},u),{isRelative:f})):(null===(r=(o=t.stopAxisAnimation)[i])||void 0===r||r.call(o),m.setProjectionTargetAxis(i,e[i].min,e[i].max,f)):void m.setVisibility(a===Gu.Show)}));return m.syncRender(),Promise.all(y).then((function(){t.isAnimatingTree=!1,c&&c(),m.notifyLayoutAnimationComplete()}))}},t}return Object(Jo.b)(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.visualElement;t.animateMotionValue=gl,t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate),t.layoutSafeToRemove=function(){return e.safeToRemove()},function(e){for(var t in e)kr[t]=e[t]}(ed)},t.prototype.componentWillUnmount=function(){var e=this;this.unsubLayoutReady(),nu((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 o,r,a=this,s=void 0===i?{}:i,c=s.transition,l=s.isRelative;if(!this.isAnimating[e]||!rd(t,this.currentAnimationTarget[e])){null===(r=(o=this.stopAxisAnimation)[e])||void 0===r||r.call(o),this.isAnimating[e]=!0;var u=this.props.visualElement,d=this.frameTarget[e],m=u.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=Es(t.min,n.min,i),e.max=Es(t.max,n.max,i)}(d,n,t,i),u.setProjectionTargetAxis(e,d.min,d.max,l)};h();var f=m.onChange(h);this.stopAxisAnimation[e]=function(){a.isAnimating[e]=!1,m.stop(),f()},this.currentAnimationTarget[e]=t;var p=c||u.getDefaultTransition()||ad;return gl("x"===e?"layoutX":"layoutY",m,1e3,p&&pl(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}(ro.Component);function nd(e,t){return!(od(e)||od(t)||rd(e.x,t.x)&&rd(e.y,t.y))}var id={min:0,max:0};function od(e){return rd(e.x,id)&&rd(e.y,id)}function rd(e,t){return e.min===t.min&&e.max===t.max}var ad={duration:.45,ease:[.4,0,.1,1]};function sd(e,t,n){return e||!e&&!(t||n)}var cd={layoutReady:function(e){return e.notifyLayoutReady()}};function ld(){var e=new Set;return{add:function(t){return e.add(t)},flush:function(t){var n=void 0===t?cd:t,i=n.layoutReady,o=n.parent;Mu((function(t,n){var r=Array.from(e).sort(gu),a=o?Cu(o):[];n((function(){Object(Jo.e)(Object(Jo.e)([],Object(Jo.c)(a)),Object(Jo.c)(r)).forEach((function(e){return e.resetTransform()}))})),t((function(){r.forEach(yu)})),n((function(){a.forEach((function(e){return e.restoreTransform()})),r.forEach(i)})),t((function(){r.forEach((function(e){e.isPresent&&(e.presence=Zu.Present)}))})),n((function(){Oc.preRender(),Oc.render()})),t((function(){Fc.postRender((function(){return r.forEach(ud)})),e.clear()}))})),Vu()}}}function ud(e){e.prevViewportBox=e.projection.target}var dd=Object(ro.createContext)(ld()),md=Object(ro.createContext)(ld());function hd(e){return!!e.forceUpdate}var fd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(Jo.b)(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.syncLayout,n=e.framerSyncLayout,i=e.visualElement;hd(t)&&t.register(i),hd(n)&&n.register(i),i.onUnmount((function(){hd(t)&&t.remove(i),hd(n)&&n.remove(i)}))},t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.syncLayout,n=e.visualElement;return hd(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;hd(e)||e.flush()},t.prototype.render=function(){return null},t}(ro.default.Component);var pd={measureLayout:function(e){var t=Object(ro.useContext)(dd),n=Object(ro.useContext)(md);return ro.default.createElement(fd,Object(Jo.a)({},e,{syncLayout:t,framerSyncLayout:n}))},layoutAnimation:function(e){var t=Object(Jo.c)(cr(),2)[1];return ro.createElement(td,Object(Jo.a)({},e,{safeToRemove:t}))}};function gd(){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:tu(),deltaFinal:tu(),deltaTransform:""}}var vd=gd();function Cd(e,t,n){var i=e.x,o=e.y,r="translate3d("+i.translate/t.x+"px, "+o.translate/t.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,c=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),c&&(r+="rotateY("+c+") ")}return r+="scale("+i.scale+", "+o.scale+")",n||r!==bd?r:""}function yd(e){var t=e.deltaFinal;return 100*t.x.origin+"% "+100*t.y.origin+"% 0"}var bd=Cd(vd.delta,vd.treeScale,{x:1,y:1}),Ad=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Sd(e,t,n,i){var o,r,a=e.delta,s=e.layout,c=e.layoutCorrected,l=e.treeScale,u=t.target;r=s,Eu((o=c).x,r.x),Eu(o.y,r.y),function(e,t,n){var i=n.length;if(i){var o,r;t.x=t.y=1;for(var a=0;a<i;a++)r=(o=n[a]).getLayoutState().delta,t.x*=r.x.scale,t.y*=r.y.scale,Bu(e,r),wu(o)&&Lu(e,e,o.getLatestValues())}}(c,l,n),hu(a,c,u,i)}var wd=function(){function e(){this.children=[],this.isDirty=!1}return e.prototype.add=function(e){vl(this.children,e),this.isDirty=!0},e.prototype.remove=function(e){Cl(this.children,e),this.isDirty=!0},e.prototype.forEach=function(e){this.isDirty&&this.children.sort(gu),this.isDirty=!1,this.children.forEach(e)},e}();var Ed=function(e){var t=e.treeType,n=void 0===t?"":t,i=e.build,o=e.getBaseTarget,r=e.makeTargetAnimatable,a=e.measureViewportBox,s=e.render,c=e.readValueFromInstance,l=e.resetTransform,u=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,C=e.visualState;void 0===t&&(t={});var y,b,A,S,w,E,x=C.latestValues,D=C.renderState,T=function(){var e=Ad.map((function(){return new yl})),t={},n={clearAllListeners:function(){return e.forEach((function(e){return e.clear()}))},updatePropListeners:function(e){return Ad.forEach((function(i){var o;null===(o=t[i])||void 0===o||o.call(t);var r="on"+i,a=e[r];a&&(t[i]=n[r](a))}))}};return e.forEach((function(e,t){n["on"+Ad[t]]=function(t){return e.add(t)},n["notify"+Ad[t]]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.notify.apply(e,Object(Jo.e)([],Object(Jo.c)(t)))}})),n}(),B={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}}},I=B,k=x,O=gd(),L=!1,P=new Map,_=new Map,R={},F=Object(Jo.a)({},x);function N(){y&&(G.isProjectionReady()&&(Lu(I.targetFinal,I.target,k),hu(O.deltaFinal,O.layoutCorrected,I.targetFinal,x)),M(),s(y,D))}function M(){var e=x;if(S&&S.isActive()){var n=S.getCrossfadeState(G);n&&(e=n)}i(G,D,e,I,O,t,p)}function V(){T.notifyUpdate(x)}function W(){G.layoutTree.forEach(Dd)}var z=h(p);for(var j in z){var H=z[j];void 0!==x[j]&&Vr(H)&&H.set(x[j],!1)}var U=Sr(p),Z=wr(p),G=Object(Jo.a)(Object(Jo.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(Jo.e)(Object(Jo.e)([],Object(Jo.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new wd,presenceId:g,projection:B,variantChildren:Z?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(y)},mount:function(e){y=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(){kc.update(V),kc.render(N),kc.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(),T.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 Fc.preRender(G.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return p.layoutId},getInstance:function(){return y},getStaticValue:function(e){return x[e]},setStaticValue:function(e,t){return x[e]=t},getLatestValues:function(){return x},setVisibility:function(e){G.isVisible!==e&&(G.isVisible=e,G.scheduleRender())},makeTargetAnimatable:function(e,t){return void 0===t&&(t=!0),r(G,e,p,t)},addValue:function(e,t){G.hasValue(e)&&G.removeValue(e),P.set(e,t),x[e]=t.get(),function(e,t){var n=t.onChange((function(t){x[e]=t,p.onUpdate&&Fc.update(V,!1,!0)})),i=t.onRenderRequest(G.scheduleRender);_.set(e,(function(){n(),i()}))}(e,t)},removeValue:function(e){var t;P.delete(e),null===(t=_.get(e))||void 0===t||t(),_.delete(e),delete x[e],d(e,D)},hasValue:function(e){return P.has(e)},getValue:function(e,t){var n=P.get(e);return void 0===n&&void 0!==t&&(n=Al(t),G.addValue(e,n)),n},forEachValue:function(e){return P.forEach(e)},readValue:function(e){var n;return null!==(n=x[e])&&void 0!==n?n:c(y,e,t)},setBaseTarget:function(e,t){F[e]=t},getBaseTarget:function(e){if(o){var t=o(p,e);if(void 0!==t&&!Vr(t))return t}return F[e]}},T),{build:function(){return M(),D},scheduleRender:function(){Fc.render(N,!1,!0)},syncRender:N,setProps:function(e){p=e,T.updatePropListeners(e),R=function(e,t,n){var i;for(var o in t){var r=t[o],a=n[o];if(Vr(r))e.addValue(o,r);else if(Vr(a))e.addValue(o,Al(r));else if(a!==r)if(e.hasValue(o)){var s=e.getValue(o);!s.hasAnimated&&s.set(r)}else e.addValue(o,Al(null!==(i=e.getStaticValue(o))&&void 0!==i?i:r))}for(var o in n)void 0===t[o]&&e.removeValue(o);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<Id;i++){var o=Bd[i],r=p[o];(yr(r)||!1===r)&&(n[o]=r)}return n},enableLayoutProjection:function(){B.isEnabled=!0,G.layoutTree.add(G)},lockProjectionTarget:function(){B.isTargetLocked=!0},unlockProjectionTarget:function(){G.stopLayoutAnimation(),B.isTargetLocked=!1},getLayoutState:function(){return O},setCrossfader:function(e){S=e},isProjectionReady:function(){return B.isEnabled&&B.isHydrated&&O.isHydrated},startLayoutAnimation:function(e,t,n){void 0===n&&(n=!1);var i=G.getProjectionAnimationProgress()[e],o=n?B.relativeTarget[e]:B.target[e],r=o.min,a=o.max-r;return i.clearListeners(),i.set(r),i.set(r),i.onChange((function(t){G.setProjectionTargetAxis(e,t,t+a,n)})),G.animateMotionValue(e,i,0,t)},stopLayoutAnimation:function(){nu((function(e){return G.getProjectionAnimationProgress()[e].stop()}))},measureViewportBox:function(e){void 0===e&&(e=!0);var n=a(y,t);return e||Ru(n,x),n},getProjectionAnimationProgress:function(){return w||(w={x:Al(0),y:Al(0)}),w},setProjectionTargetAxis:function(e,t,n,i){var o;void 0===i&&(i=!1),i?(B.relativeTarget||(B.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),o=B.relativeTarget[e]):(B.relativeTarget=void 0,o=B.target[e]),B.isHydrated=!0,o.min=t,o.max=n,L=!0,T.notifySetAxisTarget()},rebaseProjectionTarget:function(e,t){void 0===t&&(t=O.layout);var n=G.getProjectionAnimationProgress(),i=n.x,o=n.y,r=!(B.relativeTarget||B.isTargetLocked||i.isAnimating()||o.isAnimating());(e||r)&&nu((function(e){var n=t[e],i=n.min,o=n.max;G.setProjectionTargetAxis(e,i,o)}))},notifyLayoutReady:function(e){!function(e){var t=e.getProjectionParent();if(t){var n=Au(t.getLayoutState().layout,e.getLayoutState().layout);nu((function(t){e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)}))}else e.rebaseProjectionTarget()}(G),G.notifyLayoutUpdate(O.layout,G.prevViewportBox||O.layout,e)},resetTransform:function(){return l(G,y,p)},restoreTransform:function(){return u(y,D)},updateLayoutProjection:function(){if(G.isProjectionReady()){var e=O.delta,t=O.treeScale,n=t.x,i=t.y,o=O.deltaTransform;Sd(O,I,G.path,x),L&&G.notifyViewportBoxUpdate(I.target,e),L=!1;var r=Cd(e,t);r===o&&n===t.x&&i===t.y||G.scheduleRender(),O.deltaTransform=r}},updateTreeLayoutProjection:function(){G.layoutTree.forEach(xd),Fc.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(B.relativeTarget&&e&&(function(e,t){pu(e.target.x,e.relativeTarget.x,t.target.x),pu(e.target.y,e.relativeTarget.y,t.target.y)}(B,e.projection),wu(e))){var t=B.target;Lu(t,t,e.getLatestValues())}},shouldResetTransform:function(){return Boolean(p._layoutResetTransform)},pointTo:function(e){I=e.projection,k=e.getLatestValues(),null==A||A(),A=us(e.onSetAxisTarget(G.scheduleUpdateLayoutProjection),e.onLayoutAnimationComplete((function(){var e;G.isPresent?G.presence=Zu.Present:null===(e=G.layoutSafeToRemove)||void 0===e||e.call(G)})))},isPresent:!0,presence:Zu.Entering});return G}};function xd(e){e.resolveRelativeTargetBox()}function Dd(e){e.updateLayoutProjection()}var Td,Bd=Object(Jo.e)(["initial"],Object(Jo.c)(_l)),Id=Bd.length,kd=new Set(["width","height","top","left","right","bottom","x","y"]),Od=function(e){return kd.has(e)},Ld=function(e,t){e.set(t,!1),e.set(t)},Pd=function(e){return e===na||e===Jr};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(Td||(Td={}));var _d=function(e,t){return parseFloat(e.split(", ")[t])},Rd=function(e,t){return function(n,i){var o=i.transform;if("none"===o||!o)return 0;var r=o.match(/^matrix3d\((.+)\)$/);if(r)return _d(r[1],t);var a=o.match(/^matrix\((.+)\)$/);return a?_d(a[1],e):0}},Fd=new Set(["x","y","z"]),Nd=Lr.filter((function(e){return!Fd.has(e)}));var Md={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:Rd(4,13),y:Rd(5,14)},Vd=function(e,t,n,i){void 0===n&&(n={}),void 0===i&&(i={}),t=Object(Jo.a)({},t),i=Object(Jo.a)({},i);var o=Object.keys(t).filter(Od),r=[],a=!1,s=[];if(o.forEach((function(o){var c=e.getValue(o);if(e.hasValue(o)){var l,u=n[o],d=t[o],m=El(u);if(La(d))for(var h=d.length,f=null===d[0]?1:0;f<h;f++)l?El(d[f]):(l=El(d[f]))===m||Pd(m)&&Pd(l);else l=El(d);if(m!==l)if(Pd(m)&&Pd(l)){var p=c.get();"string"==typeof p&&c.set(parseFloat(p)),"string"==typeof d?t[o]=parseFloat(d):Array.isArray(d)&&l===Jr&&(t[o]=d.map(parseFloat))}else(null==m?void 0:m.transform)&&(null==l?void 0:l.transform)&&(0===u||0===d)?0===u?c.set(l.transform(u)):t[o]=m.transform(d):(a||(r=function(e){var t=[];return Nd.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(o),i[o]=void 0!==i[o]?i[o]:t[o],Ld(c,d))}})),s.length){var c=function(e,t,n){var i=t.measureViewportBox(),o=t.getInstance(),r=getComputedStyle(o),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&t.setStaticValue("display",e.display||"block"),t.syncRender();var c=t.measureViewportBox();return n.forEach((function(n){var o=t.getValue(n);Ld(o,Md[n](i,s)),e[n]=Md[n](c,r)})),e}(t,e,s);return r.length&&r.forEach((function(t){var n=Object(Jo.c)(t,2),i=n[0],o=n[1];e.getValue(i).set(o)})),e.syncRender(),{target:c,transitionEnd:i}}return{target:t,transitionEnd:i}};function Wd(e,t,n,i){return function(e){return Object.keys(e).some(Od)}(t)?Vd(e,t,n,i):{target:t,transitionEnd:i}}var zd=function(e,t,n,i){var o=function(e,t,n){var i,o=Object(Jo.d)(t,[]),r=e.getInstance();if(!(r instanceof HTMLElement))return{target:o,transitionEnd:n};for(var a in n&&(n=Object(Jo.a)({},n)),e.forEachValue((function(e){var t=e.get();if(Qu(t)){var n=qu(t,r);n&&e.set(n)}})),o){var s=o[a];if(Qu(s)){var c=qu(s,r);c&&(o[a]=c,n&&(null!==(i=n[a])&&void 0!==i||(n[a]=s)))}}return{target:o,transitionEnd:n}}(e,t,i);return Wd(e,t=o.target,n,i=o.transitionEnd)};var jd={treeType:"dom",readValueFromInstance:function(e,t){if(Rr(t)){var n=cl(t);return n&&n.default||0}var i,o=(i=e,window.getComputedStyle(i));return(zr(t)?o.getPropertyValue(t):o[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 cu(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 o=n.transformValues;void 0===i&&(i=!0);var r=t.transition,a=t.transitionEnd,s=Object(Jo.d)(t,["transition","transitionEnd"]),c=function(e,t,n){var i,o,r={};for(var a in e)r[a]=null!==(i=Il(a,t))&&void 0!==i?i:null===(o=n.getValue(a))||void 0===o?void 0:o.get();return r}(s,r||{},e);if(o&&(a&&(a=o(a)),s&&(s=o(s)),c&&(c=o(c))),i){!function(e,t,n){var i,o,r,a,s=Object.keys(t).filter((function(t){return!e.hasValue(t)})),c=s.length;if(c)for(var l=0;l<c;l++){var u=s[l],d=t[u],m=null;Array.isArray(d)&&(m=d[0]),null===m&&(m=null!==(o=null!==(i=n[u])&&void 0!==i?i:e.readValue(u))&&void 0!==o?o:t[u]),null!=m&&("string"==typeof m&&/^\-?\d*\.?\d+$/.test(m)?m=parseFloat(m):!Dl(m)&&Us.test(d)&&(m=ll(u,d)),e.addValue(u,Al(m)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=m),e.setBaseTarget(u,m))}}(e,s,c);var l=zd(e,s,c,a);a=l.transitionEnd,s=l.target}return Object(Jo.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:Ia,build:function(e,t,n,i,o,r,a){void 0!==e.isVisible&&(t.style.visibility=e.isVisible?"visible":"hidden");var s=i.isEnabled&&o.isHydrated;sa(t,n,i,o,r,a.transformTemplate,s?Cd:void 0,s?yd:void 0)},render:Da},Hd=Ed(jd),Ud=Ed(Object(Jo.a)(Object(Jo.a)({},jd),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var n;return Rr(t)?(null===(n=cl(t))||void 0===n?void 0:n.default)||0:(t=Ta.has(t)?t:xa(t),e.getAttribute(t))},scrapeMotionValuesFromProps:ka,build:function(e,t,n,i,o,r,a){var s=i.isEnabled&&o.isHydrated;ba(t,n,i,o,r,a.transformTemplate,s?Cd:void 0,s?yd:void 0)},render:Ba})),Zd=function(e,t){return Ir(e)?Ud(t,{enableHardwareAcceleration:!1}):Hd(t,{enableHardwareAcceleration:!0})},Gd=Object(Jo.a)(Object(Jo.a)(Object(Jo.a)(Object(Jo.a)({},Wl),ms),Yu),pd),Yd=Tr((function(e,t){return Wa(e,t,Gd,Zd)}));class Qd{constructor(e){this.highlighted=!1,this.code=e,this.points=[]}}var Xd=n(7);class qd{static now(){return Date.now()}}function Kd(e){var t=sr((function(){return Al(e)}));if(Object(ro.useContext)(or).isStatic){var n=Object(Jo.c)(Object(ro.useState)(e),2)[1];Object(ro.useEffect)((function(){return t.onChange(n)}),[])}return t}var Jd=function(e){return function(e){return"object"==typeof e&&e.mix}(e)?e.mix:void 0};function $d(e,t){var n=Kd(t()),i=function(){return n.set(t())};return i(),function(e,t){Object(ro.useEffect)((function(){var n=e.map((function(e){return e.onChange(t)}));return function(){return n.forEach((function(e){return e()}))}}))}(e,(function(){return Fc.update(i,!1,!0)})),n}function em(e,t,n,i){var o="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,o=e[0+i],r=e[1+i],a=e[2+i],s=e[3+i],c=$s(r,a,Object(Jo.a)({mixer:Jd(a[0])},s));return n?c(o):c}(t,n,i);return Array.isArray(e)?tm(e,o):tm([e],(function(e){var t=Object(Jo.c)(e,1)[0];return o(t)}))}function tm(e,t){var n=sr((function(){return[]}));return $d(e,(function(){n.length=0;for(var i=e.length,o=0;o<i;o++)n[o]=e[o].get();return t(n)}))}function nm(e,t,n){void 0===n&&(n={});var i=Vr(e)?e:Al(e);return gl("",i,t,n),{stop:function(){return i.stop()}}}var im=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};class om extends ro.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,o,r,a,s,c;const l=this.state.element,u=this.props.configuration.style;!l.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(l);const d=null!==(t=null===(e=this.customStyle)||void 0===e?void 0:e.fillColor)&&void 0!==t?t:l.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,m=null!==(i=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==i?i:l.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,h=null!==(r=null===(o=this.customStyle)||void 0===o?void 0:o.strokeWidth)&&void 0!==r?r:l.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:l.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,p=null!==(c=this.props.animateToPoints)&&void 0!==c?c:l.points;return ro.default.createElement(rm,{points:p,onClick:()=>{this.props.onClick&&this.props.onClick(l)},fill:d,stroke:m,strokeWidth:h,cornerRadius:f})}}function rm(e){var{points:t,cornerRadius:n}=e,i=im(e,["points","cornerRadius"]);const o=[t[0].x,t[0].y,t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y],r=o.map(Kd),a=em(r,(([e,t,i,o,r,a,s,c])=>{const l=[{x:e,y:t},{x:i,y:o},{x:r,y:a},{x:s,y:c}];return Xd.a.toSvgPathStringWithRoundedCorners(l,n)}));return Object(ro.useEffect)((()=>{const e=[];for(let t=0;t<o.length;t++)e.push(nm(r[t],o[t]));return()=>{e.forEach((e=>e.stop()))}}),[t]),ro.default.createElement(Yd.path,Object.assign({d:a},i))}class am{constructor(){this.detectedAt=0}update(e,t,n,i,o,r){this.polygon=e,this.polygonRef=t,this.label=n,this.labelRef=i,this.element=o,this.updatedAt=r}}class sm extends ro.default.Component{constructor(e){super(e),this.state={polygonElements:[]}}update(e,t,n,i){const o=[];(class{static keepOnlyCenterMostDuplicate(e,t){const n=new Map;e.forEach((e=>{const t=Go(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 o=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},r=t.width/2,a=n.reduce(((e,t)=>{const n=o(e.quad),i=o(t.quad);return Math.abs(r-n.x)<Math.abs(r-i.x)?e:t}));e.push(a)}))}}).keepOnlyCenterMostDuplicate(i,n),i.forEach((i=>{const r=new Qd(i);r.points=void 0===e?Xd.a.scaleListToHtmlElement(i.quad,n,t.video):i.quad.map((t=>{const i=new Xd.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})),r.points.forEach((e=>{t.state.mirrored&&this.container&&(e.x=this.container.clientWidth-e.x)})),o.push(r)}));const r=[];this.state.polygonElements.forEach((e=>{const t=o.find((t=>Zo(t.code,e.element.code)));let n=!1;const i=qd.now();void 0===t?e.updatedAt+1e3<i&&(n=!0):(e.element=t,e.polygon=ro.default.createElement(om,{key:Go(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=ro.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:Go(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||r.push(e)})),o.forEach((e=>{if(void 0===this.state.polygonElements.find((t=>Zo(t.element.code,e.code)))){let t,n;const i=new am,o=ro.default.createElement(om,{key:Go(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=ro.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:Go(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(o,t,a,n,e,qd.now()),r.push(i)}})),this.setState({polygonElements:r})}onPolygonClick(e){var t,n,i,o;let r;e.highlighted=!e.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((t=>{var n;const i=t.labelRef,o=t.label.props.element;Zo(o.code,e.code)&&(r=t),i&&Zo(o.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),r&&(r.detectedAt=qd.now())),null===(o=(i=this.props).onPolygonClick)||void 0===o||o.call(i,e.code)}render(){var e,t;return ro.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:e=>this.container=e},ro.default.createElement(Yd.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 cm=n(47),lm=n.n(cm),um=n(42),dm={insert:"head",singleton:!1},mm=(lm()(um.a,dm),um.a.locals,n(34)),hm=n.n(mm);class fm{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 pm extends ro.default.Component{constructor(){super(...arguments),this.inner1=new fm("scanbot-shutter-rotate"),this.inner2=new fm("scanbot-shutter-rotate")}render(){return ro.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,ro.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},ro.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},ro.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},ro.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},ro.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 ro.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:e})}svgBase(e,t,n){return ro.default.createElement("div",{className:hm()(e),ref:n},ro.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},t))}}class gm extends ro.default.Component{render(){return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_919_23088)"},ro.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}class vm extends ro.default.Component{render(){return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_919_23102)"},ro.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}class Cm extends ro.default.Component{constructor(e){super(e),this.state={barcodes:void 0}}update(e){this.setState({barcodes:e})}didScan(){return void 0!==this.state.barcodes}render(){var e,t;return ro.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:qo.ScanbotPrimary}},ro.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},ro.default.createElement(gm,null),ro.default.createElement("div",{style:{backgroundColor:qo.Orange,color:qo.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(t=null===(e=this.state.barcodes)||void 0===e?void 0:e.length)&&void 0!==t?t:0)),ro.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},ro.default.createElement(pm,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),ro.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},ro.default.createElement("div",{style:{fontSize:13,color:qo.White,marginRight:10}},"Scan More"),ro.default.createElement(vm,null)))}}class ym extends ro.default.Component{render(){const e=Xd.a.centerOf(this.props.points),t=Xd.a.smallerSizeOfQuad(this.props.points)/40;return ro.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:e.x-20,top:e.y-20,transform:`scale(${t})`}},ro.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},ro.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_910_20901)"},ro.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),ro.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}var bm=n(9);class Am extends ro.default.Component{constructor(e){super(e),this.state={elements:[],imageSize:bm.a.empty()}}update(e){const t=[];e.barcodes.forEach((n=>{const i=new Qd(n);i.points=Xd.a.scaleListToHtmlElement(n.quad,e.originalImageSize,this.image),t.push(i)})),this.setState({imageSize:bm.a.fromHtmlElement(this.image),elements:t})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:ro.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},ro.default.createElement("img",{style:{maxWidth:"100%"},ref:e=>this.image=e,src:`${this.props.image}`}),ro.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((e,t)=>ro.default.createElement(ym,{key:t,points:e.points})))))}}class Sm extends ro.default.Component{render(){if(!this.props.visible)return null;const e=Ho.a.svg`
|
|
32
32
|
animation: rotate 2s linear infinite;
|
|
33
33
|
@keyframes rotate { 100% { transform: rotate(360deg); } }
|
|
34
|
-
`;return ro.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},ro.default.createElement(e,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),ro.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"}),ro.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"}),ro.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 wm extends ro.default.Component{render(){return this.props.text?ro.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},ro.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:qo.TransparentGray,color:qo.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class Em extends ro.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,o;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),c=Xd.a.width(null!==(e=this.props.animateToPoints)&&void 0!==e?e:r.points);if(!s)return null;if(!r.points)return null;const l=null!==(n=null===(t=this.customStyle)||void 0===t?void 0:t.backgroundColor)&&void 0!==n?n:r.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,u=null!==(o=null===(i=this.customStyle)||void 0===i?void 0:i.textColor)&&void 0!==o?o:r.highlighted?a.highlightedTextColor:a.textColor;return ro.default.createElement(Yd.div,{ref:e=>this.label=e,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:Xd.a.lowestX(r.points),y:Xd.a.highestY(r.points)+3,backgroundColor:l,fontSize:12,width:c,overflow:"hidden",color:u,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:Xd.a.lowestX(this.props.animateToPoints),y:Xd.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class xm{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 Dm{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.countingRepeatDelay=-1,this.style=new xm}}class Tm{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class Bm{constructor(){this.enabled=!1,this.style=new Tm}}class Im extends Ki.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new Dm,this.detectionParameters=new h.b,this.scanAndCount=new Bm,this.onBarcodesDetected=function(e){}}static fromJson(e){const t=new Im;return this.mapValues(e,t,["style","videoConstraints","overlay","scanAndCount","finder","userGuidance"]),this.mapFinderConfiguration(t,e),e.overlay&&(this.mapValues(e.overlay,t.overlay,["style"]),e.overlay.style&&this.mapValues(e.overlay.style,t.overlay.style)),e.scanAndCount&&(this.mapValues(e.scanAndCount,t.scanAndCount,["style"]),e.scanAndCount.style&&this.mapValues(e.scanAndCount.style,t.scanAndCount.style)),this.mapVideoConstraints(e,t),t}}class km{constructor(e){this.barcodes=[],this.originalImageSize=null,this.barcodes=e.barcodes,e.originalImage&&(this.originalImageSize=new bm.a(e.originalImage.width,e.originalImage.height))}isEmpty(){return 0===this.barcodes.length}}class Om{static warn(e){console.warn("[ScanbotSDK]",e)}}class Lm{static convertLinesToViewportLines(e,t){if(t&&e)return t.map((t=>({start:new Xd.a(t.start.x*e.width,t.start.y*e.height),end:new Xd.a(t.end.x*e.width,t.end.y*e.height)})))}static convertToViewportPointsFromParentSize(e,t){return t?bm.a.isEmpty(e)?void 0:t.map((t=>Xd.a.scaleUpTo(t,e))):bm.a.toPolygon(e)}static calculateScale(e){let t,n=0,i=0;return 1>e.width/e.height?(t=e.height/1,n=(1-e.width/t)/2):(t=e.width/1,i=(1-e.height/t)/2),{x:n,y:i,containerScale:t}}static findScale(e,t){let n,i=0,o=0;return t.ratio(!0)>e.ratio(!0)?(n=e.width/t.width,o=(t.height-e.height/n)/2):(n=e.height/t.height,i=(t.width-e.width/n)/2),{x:i,y:o,scale:n}}static preventDefaultCallback(e){e.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",Lm.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",Lm.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(e){var t;const n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize scanner: Cannot find container element either from 'container' property or with the containerId property provided.");return n}}var Pm=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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())}))};Wo.a;Wo.b;class _m extends Wo.c{constructor(e){var t;super(e),this.shouldComputeSize=!0,this.paused=!1,this.barcodeScannerHandle=null,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.backendurl=void 0,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=Im.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e){return Pm(this,void 0,void 0,(function*(){const t=Lm.findContainerOrThrow(e);return new Promise(((n,i)=>{Object(ro.render)(ro.default.createElement(_m,{container:t,configuration:e,onSuccess:n,onFailure:i}),t)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Pm(this,void 0,void 0,(function*(){Om.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){Om.warn("Barcode detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Pm(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeScannerHandle&&this.bridge.copyArgs.releaseObject(this.barcodeScannerHandle).catch((e=>{var t,n;return null===(n=(t=this.props.configuration).onError)||void 0===n?void 0:n.call(t,e)}))}updateDimensions(){return Pm(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Pm(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,i,o;return Pm(this,void 0,void 0,(function*(){if(!this.enabled)return;if(this.paused)return;if(null===(e=this.configuration.scanAndCount)||void 0===e?void 0:e.enabled)return;if(this.detectionRunning)return;let r=!1;try{this.detectionRunning=!0;const e=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!e)return;const a=new km(e);a.isEmpty()?this.configuration._onDetectionFailed&&(null===(t=this.configuration)||void 0===t||t._onDetectionFailed(e.originalImage)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(null===(i=this.finder)||void 0===i?void 0:i.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(e){console.log(e)}finally{this.detectionRunning=!1;const e=()=>requestAnimationFrame((()=>this.detect())),t=(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)?0:this.configuration.captureDelay;r&&0!=t?setTimeout(e,t):e()}}))}setUseBackendService(e){console.log("Now using backend service for recognition: ",e),this.backendurl=e}recognizeBarcodes(e,t){var n,i,o,r,a,s,c,l;return Pm(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(e=!1);const c=e?Wo.c.DEFAULT_DETECTION_RESOLUTION:Wo.c.DETECTION_RESULTION_4K,l=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:c;this.camera.finderFrame=null===(i=this.finder)||void 0===i?void 0:i.holeRect;const u=yield null===(o=this.camera)||void 0===o?void 0:o.createImageData(l,!1);if(!u)return;t&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:ji.wrapperToBase64(u)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",Wo.c.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));new bm.a(u.width,u.height);this.barcodeScannerHandle||(this.barcodeScannerHandle=yield this.bridge.copyArgs.createBarcodeScanner(new h.b(Object.assign(Object.assign({},this.configuration.detectionParameters),{live:e}))));const d=yield this.bridge.transferArgs.scanBarcodes(this.barcodeScannerHandle,u);if(!this.enabled)return;return null===d?void(null===(s=(a=this.props).onLicenseError)||void 0===s||s.call(a)):(this.camera.reusableImageBuffer=d.originalImage.data,d)}catch(e){return void(null===(l=(c=this.props.configuration).onError)||void 0===l||l.call(c,e))}}))}setRecognitionResolution(e){this.desiredRecognitionResolution=e}getResolution(){return Pm(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?e(bm.a.fromJson(n)):this.camera.didLoadVideo=()=>{const t=this.camera.videoSize();e(bm.a.fromJson(t))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}setZoom(e){this.setState({zoom:e})}setCameraDirection(e){this.camera.setDirection(e)}updateTorch(e){this.camera.videoStream.updateTorch(e)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var e,t,n,i,o,r,a;const s=(null===(e=this.configuration.scanAndCount)||void 0===e?void 0:e.enabled)?"Tap the shutter button to scan":void 0;return ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},ro.default.createElement(zo.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(n=this.state.zoom)&&void 0!==n?n:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),ro.default.createElement(wm,{top:null===(i=this.configuration.scanAndCount)||void 0===i?void 0:i.style.topLabelTop,text:s}),ro.default.createElement(Am,{ref:e=>this.scannedImage=e,image:this.state.image}),this.state.isFinderVisible&&ro.default.createElement(jo.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),ro.default.createElement(wm,{bottom:100,text:this.state.bottomHintText}),ro.default.createElement(Sm,{visible:"processing"===this.state.action}),(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)&&ro.default.createElement(sm,{ref:e=>{e&&(this.overlay=e)},configuration:this.configuration.overlay,onPolygonSelected:e=>{const t=new km({barcodes:[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:Em,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&ro.default.createElement(Cm,{ref:e=>this.bottomActionBar=e,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(Xo.PushBottom,this.barcodes)},onShutterButtonClick:()=>Pm(this,void 0,void 0,(function*(){(new Hi).flash(),this.setState({action:"processing"});const e=(new Date).getTime();let t=yield this.recognizeBarcodes(!1,!1);const n=new km(null!=t?t:{barcodes:[]});console.log("Recognition took:",((new Date).getTime()-e)/1e3);const i=this.countLabelText(n.barcodes);this.setState({action:"manual",bottomHintText:i}),this.scannedImage.update(n),this.barcodes.push(...n.barcodes),this.bottomActionBar.update(this.barcodes),n.barcodes.length>0&&this.configuration.onBarcodesDetected(n)})),onScanMoreClick:()=>{this.resetCountImage()}}),ro.default.createElement(Ko,{ref:e=>this.popup=e,style:null===(a=this.configuration.scanAndCount)||void 0===a?void 0:a.style,onDeleteClick:()=>{if(confirm("Are you sure you want to delete all scanned barcodes?")){for(;this.barcodes.length>0;)this.barcodes.pop();console.log("Cleared barcodes",this.barcodes.length),this.popup.update(this.barcodes),this.bottomActionBar.update(void 0),this.resetCountImage(),this.popup.reset()}}}))}resetCountImage(){this.scannedImage.reset(),this.setState({image:void 0,bottomHintText:void 0})}countLabelText(e){return 0==e.length?"No codes scanned. Try again?":1==e.length?"1 Code Scanned":`${e.length} Codes Scanned`}}function Rm(e,t){return e&&(e.hasFacingOptions&&t.flipCameraButton.visible||e.isTorchAvailable&&t.flashButton.visible)||t.zoomButton.visible}function Fm(e){const t=e.zoomSteps.findIndex((t=>t==e.defaultZoomFactor)),[n,i]=Object(ro.useState)(e.torchEnabledInitially),[o,r]=Object(ro.useState)(t),a=e.zoomSteps[o],[s,c]=Object(ro.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,o=()=>i?i.getBoundingClientRect():null,[r,a]=Object(ro.useState)(o());return Object(ro.useEffect)((()=>{if(i){const e=()=>a(o());e();const t=new ResizeObserver(e);return t.observe(i),()=>{t.disconnect()}}}),[i]),r}(e.scanner),u=!!l;if(Object(ro.useEffect)((()=>{var t;(null===(t=e.capabilities)||void 0===t?void 0:t.isTorchAvailable)&&u&&e.scanner.setTorchState(n)}),[e.capabilities,u,n]),Object(ro.useEffect)((()=>{var t;u&&(null===(t=e.scanner)||void 0===t||t.setZoom(a))}),[u,a]),!e.capabilities||!l)return null;if(!Rm(e.capabilities,e.config))return null;const d=l.height-e.bottomPadding-48;return ro.default.createElement(co.Box,{style:{position:"absolute",marginTop:d,marginLeft:l.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},ro.default.createElement(_o,Object.assign({},e.config.flashButton,{visible:e.capabilities.isTorchAvailable&&e.config.flashButton.visible,icon:n?co.FlashlightOn:co.FlashlightOff,active:n,onClick:()=>i(!n)})),ro.default.createElement("div",{style:{width:20}}),ro.default.createElement(_o,Object.assign({},e.config.zoomButton,{text:`${a.toFixed(1)}x`,active:o!==t,onClick:()=>r((o+1)%e.zoomSteps.length)})),ro.default.createElement("div",{style:{width:20}}),ro.default.createElement(_o,Object.assign({},e.config.flipCameraButton,{visible:e.capabilities.hasFacingOptions&&e.config.flipCameraButton.visible,active:"user"===s,icon:co.FlipCameraIos,onClick:()=>{var t;const n="environment"===s?"user":"environment";c(n),null===(t=e.scanner)||void 0===t||t.setCameraDirection(n)}})))}const Nm=Object(ro.createContext)(null);class Mm{static compute(e,t,n){const i=(Xd.a.lowestY(e)+Xd.a.highestY(e))/2,o={badgeY:i,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},o),{labelY:Math.max(Xd.a.highestY(e)+Mm.LABEL_AND_BADGE_PADDING,t?i-Mm.AR_BADGE_SIZE/2-Mm.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},o),{labelY:Math.min(Xd.a.lowestY(e)-Mm.LABEL_AND_BADGE_PADDING,t.visible?i+Mm.AR_BADGE_SIZE/2+Mm.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:i,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${Mm.LABEL_AND_BADGE_PADDING/2}px))`},labelY:i,labelStyle:{transform:t.visible?`translateX(-50%) translateY(${Mm.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},o),{labelY:0,labelStyle:{display:"none"}}):void 0}}Mm.AR_BADGE_SIZE=48,Mm.LABEL_AND_BADGE_PADDING=10;var Vm=Mm;function Wm(e){return e.style.visible?""==e.content?null:ro.default.createElement(Yd.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},e.positionBadge),animate:e.animateToPoints?e.positionBadge:{},transition:e.transition},ro.default.createElement(vo,{polygonConfig:Object.assign(Object.assign({},e.style.background),{cornerRadius:Vm.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},e.verticalPositions.badgeStyle),{width:Vm.AR_BADGE_SIZE,height:Vm.AR_BADGE_SIZE,color:uo.b.getColorValue(e.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==e?void 0:e.onClick()},ro.default.createElement(co.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e.content))):null}var zm=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};class jm extends Em{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:o}=this.props;const r=n,a=this.state.element,s=null!==(e=this.props.animateToPoints)&&void 0!==e?e:a.points,c=a.code,l=a.highlighted,u=(Xd.a.lowestX(s)+Xd.a.highestX(s))/2;void 0===i&&(i="BELOW");const d=Vm.compute(s,o,i),m=void 0===r||!1===r.titleDeselected.visible&&!1===r.subtitleDeselected.visible,h={x:u,y:Math.round(d.labelY)},f={x:u,y:Math.round(d.badgeY)},p={duration:.25,easing:"linear"};return ro.default.createElement(ro.default.Fragment,null,r&&ro.default.createElement(Yd.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},ro.default.createElement(vo,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:m?"inline-block":"block",zIndex:1500},d.labelStyle),polygonConfig:l?r.backgroundSelected:r.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)}},ro.default.createElement(Hm,{barcode:c,barcodeImageVisible:r.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:l?r.titleSelected:r.titleDeselected,barcodeSubtitle:l?r.subtitleSelected:r.subtitleDeselected}))),ro.default.createElement(Wm,{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:o,positionBadge:f,content:this.badgeContent(),verticalPositions:d,transition:p,animateToPoints:this.props.animateToPoints}))}}function Hm(e){var{barcode:t}=e,n=zm(e,["barcode"]);const i=Object(ro.useContext)(Nm).useBarcodeMappedData(t);return ro.default.createElement(Bo,Object.assign({barcodeMappedData:i},n))}var Um=n(10);function Zm(e){const t=Object(ro.useRef)(),n=Object(ro.useRef)(null),[i,o]=(Object(ro.useContext)(Eo),Object(ro.useState)(void 0)),[r,a]=Object(ro.useState)(!1);Object(ro.useEffect)((()=>{var n,i;e.scanningPaused?null===(n=t.current)||void 0===n||n.pause():null===(i=t.current)||void 0===i||i.resume()}),[e.scanningPaused]);const s=function(e){const t=new Dm;t.visible=e.visible;const n=e.polygon instanceof Um.c,i=e.polygon,o=e,r=n?i.selected:o.polygon.partiallyScanned,a=n?i.deselected:o.polygon.partiallyScanned;return e.polygon.visible?(t.style.highlightedPolygonFillColor=uo.b.getColorValue(r.fillColor),t.style.highlightedPolygonStrokeColor=uo.b.getColorValue(r.strokeColor),t.style.highlightedPolygonStrokeWidth=r.strokeWidth,t.style.highlightedPolygonCornerRadius=r.cornerRadius,t.style.polygonFillColor=uo.b.getColorValue(a.fillColor),t.style.polygonStrokeColor=uo.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 o,r,a,s,c,l;null===(o=n.current)||void 0===o||o.update(null===(a=null===(r=t.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,i.originalImageSize,i.barcodes),null===(l=(c=e.barcodeScannerViewConfig).onBarcodesDetected)||void 0===l||l.call(c,i)},_onDetectionFailed:i=>{var o,r,a,s,c,l;null===(o=n.current)||void 0===o||o.update(null===(a=null===(r=t.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,new bm.a(i.width,i.height),[]),null===(l=(c=e.barcodeScannerViewConfig)._onDetectionFailed)||void 0===l||l.call(c,i)}});return Object(ro.useEffect)((()=>{const t=Rm(i,e.actionBarConfig);e.setActionButtonsVisible(t),a(t)}),[i,e.actionBarConfig]),ro.default.createElement(ro.default.Fragment,null,e.arOverlay.visible&&ro.default.createElement(sm,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:jm,labelComponentConfig:e.arOverlay,onBarcodeFound:e.arOnBarcodeEnter,onPolygonClick:e.arOnBarcodeClick,configuration:s}),ro.default.createElement(Fm,{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}),ro.default.createElement(_m,{ref:t,viewFinderPadding:e.viewFinderPadding,configuration:c,onSuccess:()=>class{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})}}.setFromScanner(t,o),onFailure:e.onCameraPermissionDenied,onLicenseError:e.onLicenseError}))}function Gm(e){return Object(ro.useMemo)((()=>{const t=(new Im).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=[],o={regexFilter:n.barcodesRegexFilter,minimum1DQuietZoneSize:n.minimum1DBarcodesQuietZone,minimumSizeScore:n.minimumSizeScore,minimumTextLength:n.minimumTextLength,maximumTextLength:n.maximumTextLength,stripCheckDigits:n.stripCheckDigits,gs1Handling:n.gs1Handling};var r;return i.push(new m.j(Object.assign({formats:n.barcodeFormats.length>0?n.barcodeFormats:void 0},o))),e.scannerConfiguration.barcodeFormats.includes("MSI_PLESSEY")&&i.push(new m.y(Object.assign({checksumAlgorithms:[n.msiPlesseyChecksumAlgorithm]},o))),e.scannerConfiguration.barcodeFormats.includes("IATA_2_OF_5")&&i.push(new m.g(Object.assign({useIATA2OF5Checksum:n.useIATA2OF5Checksum},o))),e.scannerConfiguration.barcodeFormats.includes("CODE_11")&&i.push(new m.e(Object.assign({checksum:n.useCode11Checksum},o))),e.scannerConfiguration.barcodeFormats.includes("AUSTRALIA_POST")&&i.push(new m.b(Object.assign({australiaPostCustomerFormat:n.australiaPostCustomerFormat},o))),e.scannerConfiguration.barcodeFormats.includes("UPC_E")&&i.push(new m.H(Object.assign({extensions:(r=n.barcodesExtensionFilter,"NO_FILTER"===r?"ALLOW_ANY":"ONLY_WITH_EXTENSIONS"===r?"REQUIRE_ANY":"ONLY_WITHOUT_EXTENSIONS"===r?"IGNORE":"ALLOW_ANY")},o))),{videoConstraints:t,backgroundColor:uo.b.getColorValue(e.backgroundColor),userGuidance:e.userGuidance,finder:e.viewFinder,desiredRecognitionResolution:n.maximumRecognizerResolution,detectionParameters:new h.b({live:!0,engineMode:n.engineMode,barcodeFormatConfigurations:i,extractedDocumentFormats:n.extractedDocumentFormats})}}),[e])}var Ym=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Qm(e){const[t,n]=Object(ro.useState)(null),[i,o]=Object(ro.useState)(!0),r=Object(ro.useMemo)((()=>"__sb_"+Math.random()),[]),a=e.barcodeMapper,s=e.configuration.useCase,c=Object.assign(Object.assign({},Gm(e.configuration)),{onBarcodesDetected:t=>{t.barcodes.length>0&&!s.arOverlay.visible&&e.scanningEnabled.current&&n(t.barcodes[0])},onError:e.onError,containerId:r,captureDelay:0}),l=n=>Ym(this,void 0,void 0,(function*(){let i;i=null===t?[]:[new so.BarcodeScannerUiItem({count:1,barcode:n})];const o={items:i};e.onSubmit(o)}));Object(ro.useEffect)((()=>{t&&(No.INSTANCE.beep(e.configuration.sound),Vo.INSTANCE.vibrate(e.configuration.vibration))}),[t]),Object(ro.useEffect)((()=>{null===t||s.confirmationSheetEnabled||l(t)}),[t,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(t);Object(ro.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(ro.useContext)(Eo);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Nm.Provider,{value:e.barcodeMapper},ro.default.createElement(Lo,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{l(t)},barcodeMappedData:u},{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})),ro.default.createElement(co.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},ro.default.createElement(Zm,{cameraConfiguration:e.configuration.cameraConfiguration,scanningPaused:null!==t,setActionButtonsVisible:o,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:i?80:0},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:r,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:e.onCameraPermissionDenied,onLicenseError:e.onError}))));var m}function Xm(e){const t=Object.assign(Object.assign({},e.title),{text:uo.b.getLocalizedText(e.title.text,e.textReplacementArgs)});return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(wo,Object.assign({},e.leftButton)),ro.default.createElement(co.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},ro.default.createElement(po.a,{config:t})),ro.default.createElement(wo,Object.assign({},e.rightButton)))}function qm(){return ro.default.createElement("div",{style:{width:30,height:6,backgroundColor:co.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function Km(e){return ro.default.createElement(co.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:e.innerRef},e.dragProps),ro.default.createElement(qm,null),ro.default.createElement(Xm,Object.assign({},e.drawerHeaderContentProps)))}function Jm(e){return ro.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},ro.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 $m(e){return e.isVisible?ro.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},e.style.placeholderIcon.visible&&ro.default.createElement(co.Avatar,{style:{backgroundColor:uo.b.getColorValue(e.style.placeholderIconBackground),width:100,height:100}},ro.default.createElement(Jm,{color:uo.b.getColorValue(e.style.placeholderIcon.color)})),ro.default.createElement(co.Typography,{style:{marginTop:20},variant:"h6"},ro.default.createElement(po.a,{config:e.style.placeholderTitle})),ro.default.createElement(co.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},ro.default.createElement(po.a,{config:e.style.placeholderSubtitle})),e.onStartClick&&e.style.startScanningButton.visible&&ro.default.createElement(Io,Object.assign({style:{width:"60%",marginTop:20}},e.style.startScanningButton,{visible:!0,onClick:e.onStartClick}))):null}function eh(e,t,n){const i=Object(ro.useRef)(),o=Object(ro.useRef)(null),[r,a]=Object(ro.useState)(),[s,c]=Object(ro.useState)(!1),l=Object(ro.useRef)([]),u=e=>{let n="none";if(l.current.length>0){const t=200,i=((e,t)=>{let n=e[0],i=Math.abs(n.time-t);for(let o=1;o<e.length;o++){const r=Math.abs(e[o].time-t);r<i&&(n=e[o],i=r)}return n})(l.current,e.timeStamp-t),o=i.y-e.clientY,r=100;o>r?n="up":o<-r&&(n="down")}l.current.splice(0,l.current.length),t(new Xd.a(e.clientX,e.clientY),n)},d={onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),c(!0),o.current=new Xd.a(e.clientX,e.clientY),a(Xd.a.empty()),e.stopPropagation()},onPointerMove:t=>{if(!s)return;const n=new Xd.a(t.clientX,t.clientY);i.current=t,a(n),e(n),l.current.push({x:t.clientX,y:t.clientY,time:t.timeStamp})},onPointerUp:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),u(e)},onPointerCancel:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),n()}};return{startPoint:o,currentPoint:r,props:d,stop:()=>{i.current.stopPropagation()},dragOngoing:s}}var th=n(31);function nh(e){const[t,n]=Object(ro.useState)(0),[i,o]=Object(ro.useState)(!1),r=Object(ro.useRef)(null),a=Object(ro.useContext)(Eo).height,s=e=>{n(e),o(!0),setTimeout((()=>{o(!1)}),500)},c=t=>{const n=t-l.startPoint.current.y;return Object(th.a)((e.isOpen?100:0)-100*n/(window.innerHeight-a-e.closedSheetVisibleHeight),0,100)},l=eh((e=>{n(c(e.y))}),((t,n)=>{if(t.y===l.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(ro.useEffect)((()=>{i||l.dragOngoing||!r||(e.isOpen||0===t?e.isOpen&&100!==t&&s(100):s(0))}),[e.isOpen,t,l.dragOngoing]),ro.createElement("div",null,ro.createElement(lo.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${mo} - ${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:uo.b.getColorValue(e.contentStyle.sheetColor)},elevation:24}},ro.createElement(Km,{innerRef:e=>{r.current=e},drawerHeaderContentProps:e.drawerHeaderContentProps,dragProps:l.props}),e.children,ro.createElement($m,{isVisible:e.isPlaceholderVisible,style:e.contentStyle,onStartClick:()=>e.onSwipe("swipe-to-close")})))}var ih=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function oh(e){var{inputRef:t}=e,n=ih(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 ro.default.createElement("input",Object.assign({},i,{ref:t}))}function rh(e){const t=!!e.barcode,[n,i]=ro.default.useState(""),o=ro.default.useRef(null),r={backgroundColor:uo.b.getColorValue(e.dialogStyling.sheetColor)};return Object(ro.useEffect)((()=>{t&&i(String(e.barcode.count))}),[t]),ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Oo,{open:t,modalOverlayColor:e.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var e;return null===(e=o.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)}}},ro.default.createElement(co.DialogContent,{style:r},ro.default.createElement(co.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},ro.default.createElement(po.a,{config:e.dialogStyling.title})),ro.default.createElement(co.Typography,{fontSize:14,textAlign:"center"},ro.default.createElement(po.a,{config:e.dialogStyling.info})),ro.default.createElement(co.Box,{sx:{display:"flex",border:"2px solid",borderColor:uo.b.getColorValue(e.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},ro.default.createElement(oh,{inputRef:o,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&&ro.default.createElement(lo.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>i(""),htmlColor:uo.b.getColorValue(e.dialogStyling.clearTextButton.color)}))),ro.default.createElement(co.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},ro.default.createElement(lo.a,{container:!0,spacing:2},ro.default.createElement(lo.a,{item:!0,xs:12},ro.default.createElement(lo.a,{color:uo.b.getColorValue(e.dialogStyling.dividerColor)})),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},onClick:e.onCancel},e.dialogStyling.cancelButton))),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({icon:co.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},e.dialogStyling.updateButton)))))))}function ah(e){return ro.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:uo.b.getColorValue(e.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},ro.default.createElement(lo.a,{style:{height:"100%",color:uo.b.getColorValue(e.config.iconColor),paddingRight:e.visibleOffset/2,cursor:"pointer"}}))}const sh=0,ch=800,lh=1200;function uh(e){switch(e){case"mobile":return Object(co.useMediaQuery)("(min-width:"+sh+"px) and (max-width:"+(ch-1)+"px)");case"tablet":return Object(co.useMediaQuery)("(min-width:"+ch+"px) and (max-width:"+(lh-1)+"px)");case"desktop":return Object(co.useMediaQuery)("(min-width:"+lh+"px)")}}function dh(e){switch(e){case"mobile":return Object(co.useMediaQuery)("(min-width:"+sh+"px)");case"tablet":return Object(co.useMediaQuery)("(min-width:"+ch+"px)");case"desktop":return Object(co.useMediaQuery)("(min-width:"+lh+"px)")}}const mh=150;function hh(e){const[t,n]=Object(ro.useState)(0),[i,o]=Object(ro.useState)(!1);let r;const a=eh((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?()=>{l(0)}:void 0;l(mh,t)}else l(0)}),(()=>{l(0)})),s=Object(ro.useContext)(Nm),c=s.useBarcodeMappedData(e.barcode);Object(ro.useEffect)((()=>{const t={barcode:e.barcode,callback:()=>e.onDelete(e.barcode)};return s.addOnEvictionListener(t),()=>{s.removeOnEvictionListener(t)}}),[]);const l=(t,i)=>{const a=t>=mh,s=-r.getBoundingClientRect().width;n(a?s:0),o(!0),setTimeout((()=>{o(!1),a&&e.onDelete(e.barcode),i&&i()}),200)},u=uh("desktop")&&e.swipeToDeleteConfig.enabled,d=!u&&e.swipeToDeleteConfig.enabled;return Object(ro.useEffect)((()=>{d||l(0)}),[d]),ro.default.createElement(co.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:e=>{e&&(r=e)}},ro.default.createElement(ah,{config:e.swipeToDeleteConfig,visibleOffset:mh}),ro.default.createElement(co.Box,Object.assign({sx:{width:"100%",backgroundColor:uo.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:{}),ro.default.createElement(Bo,Object.assign({barcodeMappedData:c},e,{readonlyCount:e.readonlyCount})),null!==e.readonlyCount&&ro.default.createElement(co.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",paddingRight:"16px",color:uo.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",e.readonlyCount),u&&ro.default.createElement(lo.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",paddingRight:"16px",color:uo.b.getColorValue("?sbColorOnSurface")},onClick:()=>e.onDelete(e.barcode)}),ro.default.createElement(co.Box,{sx:{width:"0px"}})))}function fh(e){const t=uo.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),uo.b.getColorValue(i)};return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Divider,{style:{borderColor:t}}),e.barcodes.length>0&&ro.default.createElement(lo.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},ro.default.createElement(lo.a,{sx:{p:0}},e.barcodes.map((({barcode:o,count:r},a)=>{const s=e.expectedBarcodes.find((e=>e.barcodeValue===o.text));return ro.default.createElement(lo.a,{key:a,sx:{padding:0,borderBottom:`1px solid ${t}`}},e.indicatorColor&&ro.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:i(s,r),position:"absolute"}}),ro.default.createElement(hh,{barcode:o,animateBackAfterDelete:e.animateBackAfterDelete,onDelete:()=>e.onBarcodeChange({type:"remove",barcode:o}),counterForm:n&&{counter:r,manualCountChangeColor:e.sheetContent.manualCountChangeColor,manualCountOutlineColor:e.sheetContent.manualCountOutlineColor,addButtonEnabled:void 0===s||s.count>r,removeButtonEnabled:void 0===s||r>0,setCounter:t=>{e.onBarcodeChange({type:"setCount",barcodes:[o],computeNewCount:()=>t})},onNumberClick:()=>e.onNumberClick({barcode:o,count:r})},readonlyCount:"COUNTING"!==e.mode||e.sheetContent.manualCountChangeEnabled?null:r,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 ph(e){const t=e.badgeStyle||{},n=e.overlap||"circular";return ro.default.createElement(co.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 gh(e){if(!e.buttonStyling.visible)return null;return ro.default.createElement(co.Box,{style:e.style},ro.default.createElement(ph,{text:e.text,backgroundColor:uo.b.getColorValue(e.buttonStyling.badgeBackgroundColor),foregroundColor:uo.b.getColorValue(e.buttonStyling.badgeForegroundColor)},ro.default.createElement(co.IconButton,{sx:{backgroundColor:uo.b.getColorValue(e.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:uo.b.getColorValue(e.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:e.onClick,disableRipple:!0,disableFocusRipple:!0},ro.default.createElement(lo.a,{sx:{color:uo.b.getColorValue(e.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:uo.b.getColorValue(e.buttonStyling.activeForegroundColor)}}}))))}const vh=(e,t)=>(null===e.format||null===t.format||e.format===t.format)&&e.text===t.text,Ch=(e,t)=>e.find((e=>((e,t)=>e.barcodeValue===t.text)(e,t)));class yh{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 bh(e){const t=Object(ro.useContext)(uo.a).getColorValue,n={backgroundColor:t(e.sheetColor)};return ro.default.createElement(Oo,{modalOverlayColor:e.modalOverlayColor,open:e.open},ro.default.createElement(co.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},ro.default.createElement(co.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},ro.default.createElement(po.a,{config:e.title})),ro.default.createElement(co.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},ro.default.createElement(po.a,{config:e.subtitle}))),ro.default.createElement(co.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},ro.default.createElement(lo.a,{container:!0,spacing:2},ro.default.createElement(lo.a,{item:!0,xs:12},ro.default.createElement(lo.a,{color:t(e.dividerColor)})),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},icon:e.cancelButton.icon,onClick:e.cancelButton.onClick},e.cancelButton.style))),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},icon:e.okButton.icon,onClick:e.okButton.onClick},e.okButton.style))))))}function Ah(e){return e.open?ro.default.createElement(bh,{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 Sh{constructor(e,t,n){this.barcodeItemSubtitleText=e,this.foundBarcodes=t,this.expectedBarcodes=n}useBarcodeMappedData(e){var t,n,i;const o=null!==(n=null===(t=this.foundBarcodes.find((t=>vh(t.barcode,e))))||void 0===t?void 0:t.count.toString())&&void 0!==n?n:"0",r=Ch(this.expectedBarcodes,e);return{state:"LOADED",value:{title:`${null!==(i=r.title)&&void 0!==i?i:e.text}`,subtitle:uo.b.getLocalizedText(this.barcodeItemSubtitleText,[o,null==r?void 0:r.count.toString()]),barcodeImage:r.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function wh(e){const t=Object(ro.useContext)(Eo);return ro.default.createElement(lo.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:t.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:uo.b.getColorValue(e.sheetContent.sheetColor)}},ro.default.createElement(lo.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},ro.default.createElement(Xm,Object.assign({},e.headerProps))),e.barcodeList,ro.default.createElement($m,{isVisible:e.isEmptyStateVisible,style:e.sheetContent}))}var Eh=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 xh(e){const t=Object(ro.useRef)(),n=Object(ro.useRef)(new Date("2001-01-01")),[i,o]=Object(ro.useReducer)(function(e,t,n,i){return(o,r)=>{const a=e.useCase,s="FindAndPickScanningMode"===a._type,c=s?"COUNTING":a.mode,l=s?a.expectedBarcodes:[],u=e=>{let t=[...o];const n=r.barcodes||[r.barcode];for(const i of n){const n=t.findIndex((e=>vh(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 o;if(t.current=new Date,!n)return e;const r=null===(o=Ch(l,n.barcode))||void 0===o?void 0:o.count;return void 0===r||r===e?e:(i(),e+1)};switch(r.type){case"onBarcodesDetected":{if((new Date).getTime()-t.current.getTime()<a.countingRepeatDelay||!n.current)return[...o];if(s)return a.arOverlay.automaticSelectionEnabled?u(d):[...o];const e=a.arOverlay;if(!e.visible||e.automaticSelectionEnabled){let e=!1;return u((n=>{let o="COUNTING"===c?n+1:1;return o===n||e||(t.current=new Date,i()),o}))}return u((e=>e))}case"onARCodeClick":return u(((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=()=>r.count||0;if(s){const t=Ch(l,r.barcode);r.count>t.count&&(e=()=>t.count)}return u(e)}case"setCount":return u(r.computeNewCount);case"remove":return o.map((e=>Object.assign(Object.assign({},e),{count:vh(e.barcode,r.barcode)?0:e.count})));case"clear":return o.map((e=>Object.assign(Object.assign({},e),{count:0})));case"setHtmlElements":let e=!1;const m=o.map((t=>vh(t.barcode,r.barcode)?(e=!0,Object.assign(Object.assign({},t),{polygonElement:r.polygonElement,labelElement:r.labelElement})):t));return e||m.push({barcode:r.barcode,count:0,labelElement:r.labelElement,polygonElement:r.polygonElement}),m}}}(e.configuration,n,e.scanningEnabled,(()=>{No.INSTANCE.beep(e.configuration.sound),Vo.INSTANCE.vibrate(e.configuration.vibration)})),[]),[r,a]=ro.default.useState(null),[s,c]=Object(ro.useState)(!1),l=Object(ro.useMemo)((()=>"__sb_"+Math.random()),[]),[u,d]=Object(ro.useState)(!0),m=e.barcodeMapper,[f,p]=Object(ro.useState)(null),g="FindAndPickScanningMode"===e.configuration.useCase._type,v=e.configuration.useCase,C=g?"COUNTING":v.mode,y=Object(ro.useRef)(Object.assign(Object.assign({},Gm(e.configuration)),{onBarcodesDetected:e=>{o({type:"onBarcodesDetected",barcodes:e.barcodes})},_onDetectionFailed(e){},onError:e.onError,captureDelay:1e3/60}));Object(ro.useEffect)((()=>{if(g){const t=S();for(const n of t){const t=[(e=n.barcodeValue,new h.a({text:e,format:null,quad:[],quadNormalized:[],sourceImage:null,rawBytes:null,upcEanExtension:null,extractedDocument:null}))];o({type:"setCount",barcodes:t,computeNewCount:()=>0})}}var e}),[]),Object(ro.useEffect)((()=>{y.current.container=t.current}),[t]),Object(ro.useEffect)((()=>{if(g)for(const e of i){const t=v.arOverlay,n=e.polygonElement,i=e.labelElement;if(E(e.barcode)){const o=R(e.barcode);let r=e.count+"/"+o.expectedCount;v.arOverlay.automaticSelectionEnabled||0!==e.count||(r=ro.default.createElement(co.TouchApp,null)),o.isFulFilled()?(null==n||n.style(uo.b.getPolygonColorValues(t.polygon.completed,t.polygon.visible)),null==i||i.styleBadge(t.badge.completed,ro.default.createElement(co.Check,null))):(null==n||n.style(uo.b.getPolygonColorValues(t.polygon.partiallyScanned,t.polygon.visible)),null==i||i.styleBadge(t.badge.partiallyScanned,r))}else null==n||n.style(uo.b.getPolygonColorValues(t.polygon.rejected,t.polygon.visible)),null==i||i.styleBadge(t.badge.rejected,ro.default.createElement(co.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(uo.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=>Ch(S(),e),E=e=>!!w(e),x=()=>g?i.filter((e=>E(e.barcode))):i.filter((e=>e.count>0)),D=()=>Eh(this,void 0,void 0,(function*(){const t=x().map((e=>new so.BarcodeScannerUiItem({count:"COUNTING"===C?e.count:1,barcode:e.barcode})));e.onSubmit({items:t})})),T=ro.default.createElement(fh,{expectedBarcodes:S(),barcodes:x(),animateBackAfterDelete:g,onBarcodeChange:o,sheetContent:v.sheetContent,onNumberClick:e=>a(e),mode:C,indicatorColor:g&&{partial:v.scanningPartiallyColor,complete:v.scanningCompletedColor,notScanned:v.scanningNotScannedColor}}),B={textReplacementArgs:[b.toString()],leftButton:Object.assign(Object.assign({},v.sheetContent.clearAllButton),{onClick:()=>o({type:"clear"})}),rightButton:Object.assign(Object.assign({},v.sheetContent.submitButton),{onClick:()=>Eh(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 D()}else yield D()})),disabled:!g&&!v.allowEmptySubmission&&0===b}),title:v.sheetContent.title},I=uh("mobile"),k="BUTTON"!==v.sheet.mode&&I?"SMALL"===v.sheet.collapsedVisibleHeight?69:128:0,O=I&&"BUTTON"===v.sheet.mode,L=O?76:0,P=(u?80:0)+L,_=Object(ro.useContext)(Eo),R=e=>{const t=i.find((t=>t.barcode.text===e.text)),n=w(e);return new yh(null==n?void 0:n.count,null==t?void 0:t.count)},F=S().reduce(((e,t)=>e+t.count),0);g&&B.textReplacementArgs.push(F.toString());const N=g?new Sh(v.sheetContent.barcodeItemSubtitle.text,i,S()):m,M=!g&&0===b;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Nm.Provider,{value:N},ro.default.createElement(lo.a,{container:!0,sx:{display:"flex",flexDirection:I?"column":"row",height:`calc(${_.remainingVisibleBodyHeight} - ${k}px)`},alignItems:"stretch"},ro.default.createElement(lo.a,{id:l,item:!0,ref:t,component:"div",xs:I?12:7,zIndex:100},O&&ro.default.createElement(gh,{style:{position:"absolute",marginTop:`calc(${_.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:g?`${b}/${F}`:b.toString(),onClick:()=>c(!s),buttonStyling:v.sheet.listButton}),ro.default.createElement(Zm,{viewFinderPadding:{minTopPadding:_.minTopPaddingForContent,minBottomPadding:P},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"===C})})})(),containerId:l,barcodeScannerViewConfig:y.current,onCameraPermissionDenied:e.onCameraPermissionDenied,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16+L,setActionButtonsVisible:d,arOnBarcodeClick:e=>{o({type:"onARCodeClick",barcode:e})},arOnBarcodeEnter:(e,t,n)=>{if(!n||!t)return;o({type:"setHtmlElements",barcode:e,labelElement:n,polygonElement:t})},scanningPaused:s&&I,cameraConfiguration:e.configuration.cameraConfiguration,onLicenseError:e.onError}),I&&ro.default.createElement(nh,{closedSheetVisibleHeight:k,sheetStyle:v.sheet,contentStyle:v.sheetContent,manualCountEditDialog:v.manualCountEditDialog,isPlaceholderVisible:M,onBarcodeChange:e=>o(e),drawerHeaderContentProps:B,isOpen:s,onSwipe:e=>{c("swipe-to-open"===e)}},T)),dh("tablet")&&ro.default.createElement(wh,{headerProps:B,sheetContent:v.sheetContent,isEmptyStateVisible:M,barcodeList:T})),ro.default.createElement(rh,{barcode:r,dialogStyling:v.manualCountEditDialog,onCancel:()=>a(null),setCounter:(e,t)=>{o({type:"onCountEditDialogChange",barcode:e,count:t}),a(null)}}),ro.default.createElement(Ah,{open:null!==f,style:f,onDismiss:()=>p(null),onSubmit:D})))}const Dh=Object(ro.createContext)(null),Th={didCatch:!1,error:null};class Bh extends ro.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Th}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:o,reason:"imperative-api"}),this.setState(Th)}}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 o,r;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===(o=(r=this.props).onReset)||void 0===o||o.call(r,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Th))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:o,error:r}=this.state;let a=e;if(o){const e={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)a=t(e);else if(n)a=Object(ro.createElement)(n,e);else{if(null!==i&&!Object(ro.isValidElement)(i))throw r;a=i}}return Object(ro.createElement)(Dh.Provider,{value:{didCatch:o,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Ih(){const e=Object(ro.useRef)(!0);return Object(ro.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function kh(e){const t=Ih(),[,n]=Object(ro.useReducer)((e=>e+1),0),i=Object(ro.useRef)();return Object(ro.useMemo)((()=>{i.current={loading:!0,value:void 0,error:null}}),[e]),function(e,t){Object(ro.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 Oh=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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{constructor(e,t){this.barcodeItemMapper=e,this.onError=t,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=e=>Go(e),this.onEvictionListeners=new Set}getBarcodeMappedData(e){const t=this.hash(e);if(!this.cache.has(t)){const n=(()=>Oh(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const t=new so.BarcodeScannerUiItem({count:1,barcode:e});return this.barcodeItemMapper(t)}{const t=yield ji.toDataUrl(yield wC.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(ro.useRef)(!1),n=kh(e&&this.getBarcodeMappedData(e));if(Object(ro.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)}}so.BarcodeItemErrorState;function Ph(e){return ro.default.createElement(bh,{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:co.Replay,onClick:e.handleRetry}})}function _h(e){const t=Object(ro.useContext)(Eo);return ro.default.createElement(co.Box,{sx:{paddingTop:t.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:uo.b.getColorValue(e.config.background)}},ro.default.createElement(co.Box,{sx:{height:t.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},e.config.icon.visible&&ro.default.createElement(co.Box,null,ro.default.createElement(co.Avatar,{sx:{width:100,height:100,backgroundColor:uo.b.getColorValue(e.config.iconBackground),margin:"24px"}},ro.default.createElement(lo.a,{sx:{fontSize:50,color:uo.b.getColorValue(e.config.icon.color)}}))),ro.default.createElement(co.Typography,{sx:{fontSize:20,textAlign:"center"}},ro.default.createElement(po.a,{config:e.config.enableCameraTitle})),ro.default.createElement(co.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},ro.default.createElement(po.a,{config:e.config.enableCameraExplanation})),ro.default.createElement(co.Box,{sx:{paddingTop:"16px"}},ro.default.createElement(wo,Object.assign({},e.config.closeButton,{onClick:e.onAppClose})))))}function Rh(e){const t=Object(ro.useRef)(Object(co.createTheme)({palette:{primary:{main:qo.ScanbotPrimary},secondary:{main:qo.DarkGray}}})),[n,i]=Object(ro.useState)(!1),[o,r]=Object(ro.useState)(!1),[a,s]=Object(ro.useState)(e.configuration.timeouts.initialScanDelay<=0),c=Object(ro.useRef)(!1),l=Object(ro.useRef)(),u=Object(ro.useRef)(),d=e.configuration.useCase,m="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,h=Object(ro.useMemo)((()=>new Lh(null==m?void 0:m.barcodeItemMapper,((e,t)=>{i(!0),l.current=()=>{i(!1),e()},u.current=()=>{i(!1),t()}}))),[]);let f;if(Object(ro.useMemo)((()=>{uo.b.setPalette(e.configuration.palette),uo.b.setLocalization(e.configuration.localization)}),[e.configuration]),Object(ro.useEffect)((()=>{if(e.configuration.timeouts.autoCancelTimeout>0){const t=setTimeout((()=>{e.onClose()}),e.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(t)}}}),[]),Object(ro.useEffect)((()=>{if(e.configuration.timeouts.initialScanDelay>0){const t=setTimeout((()=>{s(!0)}),e.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(t)}}}),[]),Object(ro.useEffect)((()=>{c.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)f=ro.default.createElement(Qm,{configuration:e.configuration,barcodeMapper:h,onClose:e.onClose,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:c});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");f=ro.default.createElement(xh,{configuration:e.configuration,barcodeMapper:h,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:c})}return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(ho,null),ro.default.createElement(Bh,{onError:e.onError,fallback:ro.default.createElement("div",null,"Error")},ro.default.createElement(uo.a.Provider,{value:Object(uo.c)(e.configuration.palette)},ro.default.createElement(co.ThemeProvider,{theme:t.current},m&&ro.default.createElement(Ph,Object.assign({open:n,handleCancel:u.current,handleRetry:l.current,modalOverlayColor:m.modalOverlayColor,dividerColor:m.dividerColor,sheetColor:m.sheetColor},m.errorState)),ro.default.createElement(lo.a,{sx:{height:`100 * ${mo}`,width:"100vw",backgroundColor:uo.b.getColorValue(e.configuration.backgroundColor)}},ro.default.createElement(xo,Object.assign({onBackPress:e.onClose},e.configuration.topBar),!o&&f,o&&ro.default.createElement(_h,{onAppClose:e.onClose,config:e.configuration.cameraPermission})))))))}class Fh{constructor(e){this.document=e}}var Nh=n(16);function Mh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.489746)",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M172.051 142.95V124.876L96.3274 152.397V170.471L172.051 142.95Z",fill:t})))}function Vh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.237671)",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M172.844 188.832H86.629V113.394L172.844 148.212V188.832Z",fill:"url(#paint0_linear_557_1465)"})),ro.default.createElement("defs",null,ro.default.createElement("linearGradient",{id:"paint0_linear_557_1465",x1:"130.151",y1:"118.368",x2:"129.736",y2:"188.832",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),ro.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function Wh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M172.844 188.594H86.629V113.156L172.844 147.974V188.594Z",fill:"url(#paint0_linear_557_1462)"})),ro.default.createElement("defs",null,ro.default.createElement("linearGradient",{id:"paint0_linear_557_1462",x1:"130.151",y1:"118.13",x2:"129.736",y2:"188.594",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),ro.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function zh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.252197)",fill:"transparent"}),ro.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}),ro.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.232 131.072H70.4609V134.579H192.232V131.072Z",fill:t}),ro.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.023 124.445H70.4609V127.951H137.023V124.445Z",fill:t}),ro.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}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M124.937 70.8245H143.011L115.49 146.438H97.4164L124.937 70.8245Z",fill:t})),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M157.336 70.8245H162.725L134.954 146.438H129.565L157.336 70.8245Z",fill:t})))}function jh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.371094)",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.default.createElement("path",{d:"M166.838 91.7213H128.493V88.658H166.838V91.7213Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M167.041 103.232H128.696V100.169H167.041V103.232Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M177.817 140.631H74.0316V137.568H177.817V140.631Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M208.701 108.301H191.401V105.238H208.701V108.301Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M208.904 119.812H191.603V116.748H208.904V119.812Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M191.401 128.035V131.098H208.904V128.035H191.401Z",fill:"#A5A5A5"}),ro.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"}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M126.999 68.3479H145.072L117.552 150.417H99.4783L126.999 68.3479Z",fill:t})),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M164.554 68.3479H169.942L142.171 150.417H136.783L164.554 68.3479Z",fill:t})))}function Hh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.118896)",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M111.248 68.0957H129.322L101.801 150.165H83.7275L111.248 68.0957Z",fill:t})),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M154.606 68.0957H159.994L132.223 150.165H126.835L154.606 68.0957Z",fill:t})))}function Uh(e){if(e.source instanceof Nh.j)return null;const t="#FFFFFF";return ro.default.createElement(co.Box,{sx:{backgroundColor:"rgb(191, 191, 191)",borderRadius:1,width:"100%",height:250}},ro.default.createElement(co.Box,{sx:{padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - 20px)"}},(()=>{if(e.source instanceof Nh.k)return ro.default.createElement(Mh,{color:t});if(e.source instanceof Nh.i)return ro.default.createElement(Vh,{color:t});if(e.source instanceof Nh.d)return ro.default.createElement(Wh,{color:t});if(e.source instanceof Nh.a)return ro.default.createElement(zh,{color:t});if(e.source instanceof Nh.e)return ro.default.createElement(jh,{color:t});if(e.source instanceof Nh.b)return ro.default.createElement(Hh,{color:t});if(e.source instanceof Nh.c){const n=e.source;return ro.default.createElement("img",{src:n.uri,style:{color:t,backgroundColor:"rgb(191, 191, 191)",maxHeight:"100%",maxWidth:"100%"},alt:""})}throw new Error("Unknown intro image type")})()))}function Zh(e){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Oo,{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 * ${mo} - 2 * 24px)`,backgroundColor:uo.b.getColorValue(e.config.backgroundColor)}}},ro.default.createElement(co.Typography,{component:"div"},ro.default.createElement(co.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},ro.default.createElement(po.a,{style:Object.assign({fontWeight:600,fontSize:16},Do(1)),config:e.config.title}),ro.default.createElement(co.Box,null,ro.default.createElement(wo,{onClick:e.onClose,visible:e.config.topBarDoneButton.visible,text:e.config.topBarDoneButton.text,background:e.config.topBarDoneButton.background,foreground:e.config.topBarDoneButton.foreground,icon:ro.default.createElement(lo.a,{sx:{fontSize:24}}),debugName:"close-introduction"}))),ro.default.createElement(co.Box,{sx:{width:"100%",border:`1px solid ${uo.b.getColorValue(e.config.dividerColor)}`,marginBottom:"12px"}}),ro.default.createElement(po.a,{config:e.config.subtitle,style:{fontSize:16,paddingBottom:"10px"}}),e.config.items.map(((e,t)=>{const n=e.image instanceof Nh.j;return ro.default.createElement(co.Box,{key:t,sx:{display:"flex",flexDirection:"column"}},ro.default.createElement(co.Box,{sx:{pt:n?0:"10px",pb:n?0:"10px"}},ro.default.createElement(Uh,{source:e.image})),ro.default.createElement(po.a,{style:{fontWeight:500,fontSize:14,padding:1,paddingLeft:15,textIndent:-15},config:e.text}))})))))}function Gh(e){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{sx:{backgroundColor:uo.b.getColorValue(e.backgroundColor),display:"flex",justifyContent:"space-between",alignItems:"center",height:50,width:"100vw"}},ro.default.createElement(co.Box,{style:{flexBasis:0,flexGrow:1}},e.leftContent),ro.default.createElement(co.Box,null,ro.default.createElement("h1",{style:{fontSize:18,fontWeight:500,textAlign:"center"}},ro.default.createElement(po.a,{config:e.centerTitle,replacementArgs:e.centerTitleReplacementArgs}))),ro.default.createElement(co.Box,{style:{flexBasis:0,flexGrow:1,textAlign:"right",whiteSpace:"nowrap"}},e.rightContent)))}function Yh(e){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Menu,{anchorEl:e.anchor,open:null!==e.anchor,onClose:e.onClose,MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:uo.b.getColorValue(e.backgroundColor),minWidth:e.minWidth}}}},e.children))}function Qh(e){const t=uo.b.getColorValue(e.textColor);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.MenuItem,{tabIndex:0,disabled:e.disabled,autoFocus:e.autoFocus,"aria-label":uo.b.getLocalizedText(e.ariaLabel),onClick:e.onClick,sx:Object.assign(Object.assign({"&, &:hover, &:focus":{backgroundColor:"transparent"}},Co(t)),{paddingX:"8px",marginX:"8px"})},e.children))}function Xh(e){const[t,n]=ro.default.useState(!1),[i,o]=ro.default.useState(null),r=Boolean(i),a=e.config.screens.camera.topBarCameraSelect;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(wo,{id:"sb-button-camera-select",ariaLabel:uo.b.getLocalizedText(a.button.accessibilityDescription),onClick:e=>o(e.currentTarget),visible:a.button.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:a.button.color,iconVisible:!0,useShadow:!1},icon:ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(lo.a,null),!r&&ro.default.createElement(lo.a,{sx:{marginX:"-4px"}}),r&&ro.default.createElement(lo.a,{sx:{marginX:"-4px"}})),buttonWidth:48}),ro.default.createElement(Yh,{anchor:i,ariaLabelledBy:"sb-button-camera-select",backgroundColor:a.backgroundColor,onClose:()=>o(null),minWidth:"calc(min(100% - 40px, 323px))"},ro.default.createElement(co.MenuItem,{disabled:!0,sx:{borderBottomColor:uo.b.getColorValue(a.dividerColor),borderBottomStyle:"solid",borderBottomWidth:"1px",fontSize:14,marginTop:"-4px",marginBottom:"4px",marginX:"4px",width:"calc(100% - 8px)",opacity:"1 !important"}},ro.default.createElement(po.a,{config:a.title})),e.cameraSelectConfig.availableCameras.map((i=>{const r=i.deviceId===e.cameraSelectConfig.activeCamera.deviceId,s=r?a.menuEntryActive:a.menuEntry;return ro.default.createElement(Qh,{disabled:t,key:i.deviceId,autoFocus:r,ariaLabel:s.accessibilityDescription,textColor:s.title.color,onClick:()=>{o(null),n(!0),e.cameraSelectConfig.onSelect(i).finally((()=>n(!1)))}},s.icon.visible&&ro.default.createElement(lo.a,{style:{color:uo.b.getColorValue(s.icon.color),marginRight:"8px"}}),ro.default.createElement(co.Typography,{variant:"inherit",noWrap:!0},ro.default.createElement(po.a,{config:Object.assign(Object.assign({},s.title),{text:i.label})})),r&&ro.default.createElement(lo.a,{style:{color:uo.b.getColorValue(s.icon.color),marginLeft:"auto",paddingLeft:15,fontSize:16}}))}))))}function qh(e){const t=e.config.screens.camera;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Gh,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:ro.default.createElement(wo,{ariaLabel:uo.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:ro.default.createElement(lo.a,{sx:{fontSize:24}}),debugName:"close-camera-screen"}),centerTitle:t.topBarTitle,rightContent:ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{style:{display:"flex",justifyContent:"space-around",alignItems:"center",whiteSpace:"nowrap",maxWidth:120,marginLeft:"auto"}},ro.default.createElement(Xh,{config:e.config,cameraSelectConfig:e.cameraSelectConfig}),ro.default.createElement(wo,{ariaLabel:uo.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:ro.default.createElement(lo.a,{sx:{fontSize:24}}),onClick:e.onShowIntroButtonClick,buttonWidth:20})))}))}function Kh(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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}),ro.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 Jh(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement(ro.default.Fragment,null,ro.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}},ro.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}),ro.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 $h(e){return"NoButtonMode"===e.config._type?ro.default.createElement(ro.default.Fragment,null):"PagePreviewMode"===e.config._type?ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Button,{"data-sb-button-preview":!0,"arial-label":uo.b.getLocalizedText(e.config.accessibilityDescription),disabled:!e.enabled,sx:Object.assign({paddingY:"11px"},Co(e.config.pageCounter.background.fillColor)),onClick:e.onClick},ro.default.createElement(ph,{text:`${e.count}`,backgroundColor:uo.b.getColorValue(e.config.pageCounter.background.fillColor),badgeStyle:{borderColor:uo.b.getColorValue(e.config.pageCounter.background.strokeColor),borderWidth:e.config.pageCounter.background.strokeWidth,borderStyle:"solid"},overlap:"rectangular",foregroundColor:uo.b.getColorValue(e.config.pageCounter.foregroundColor)},e.previewImageUrl&&ro.default.createElement("img",{style:{maxWidth:40,maxHeight:56},src:e.previewImageUrl,alt:"Preview image of the last page"}),!e.previewImageUrl&&ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(e.config.imagePlaceholderColor),width:40,height:56}})))):"TextButtonMode"===e.config._type?ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Button,{"data-sb-button-preview":!0,disabled:!e.enabled,onClick:e.onClick,"aria-label":uo.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign(Object.assign({},Co(e.config.style.color)),{textTransform:"none"})},ro.default.createElement(po.a,{config:e.config.style,replacementArgs:[`${e.count}`]}))):void 0}function ef(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"65",height:"65",viewBox:"0 0 65 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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)"},ro.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"})),ro.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)"},ro.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"})),ro.default.createElement("defs",null,ro.default.createElement("linearGradient",{id:"paint0_linear_779_506",x1:"60.3614",y1:"33.7149",x2:"37.0173",y2:"64.479",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{stopColor:t}),ro.default.createElement("stop",{offset:"0.847585",stopColor:t,stopOpacity:"0"})),ro.default.createElement("linearGradient",{id:"paint1_linear_779_506",x1:"8.69831",y1:"51.1273",x2:"20.179",y2:"68.157",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{stopColor:t}),ro.default.createElement("stop",{offset:"0.370714",stopColor:t,stopOpacity:"0"})))))}function tf(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("g",{clipPath:"url(#clip0_780_4723)"},ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.4s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.2s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.0s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.8s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.6s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.4s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.2s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"0s",repeatCount:"indefinite"}))),ro.default.createElement("defs",null,ro.default.createElement("clipPath",{id:"clip0_780_4723"},ro.default.createElement("rect",{width:"44",height:"44",fill:t,transform:"translate(0.5)"})))))}function nf(e){const t=uo.b.getColorValue(e.innerColor),n=uo.b.getColorValue(e.outerColor);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"65",height:"64",viewBox:"0 0 65 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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}),ro.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 of(e){const t="manual"===e.state||"auto"===e.state&&e.config.enabledInAutoSnappingMode;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Button,{disabled:!t,onClick:e.onClick,"aria-label":uo.b.getLocalizedText(e.config.accessibilityDescription),"data-sb-button-shutter":!0,sx:Object.assign({width:56,margin:0,padding:0},Co(e.config.innerColor))},"auto"===e.state&&ro.default.createElement(ef,{key:"auto",color:e.config.outerColor}),"loading"===e.state&&ro.default.createElement(tf,{key:"loading",color:e.config.outerColor}),"manual"===e.state&&ro.default.createElement(nf,{key:"manual",innerColor:e.config.innerColor,outerColor:e.config.outerColor})))}function rf(e){const t={backgroundColor:uo.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,[o,r]=ro.default.useState(!0);Object(ro.useEffect)((()=>{r(e.open)}),[e.open]);const a=o?1:.5;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Oo,{modalOverlayColor:e.config.modalOverlayColor,open:e.open,PaperProps:{style:{borderRadius:"8px"}},onClose:e.onCancelClick},ro.default.createElement(co.DialogContent,{sx:Object.assign(Object.assign({},t),{p:2,pb:1,textAlign:"center"})},ro.default.createElement(co.Typography,{sx:{fontSize:"16px",fontWeight:"bold"}},ro.default.createElement(po.a,{config:e.config.title})),ro.default.createElement(co.Typography,{sx:{fontSize:"14px",lineHeight:"16pt",pt:1}},ro.default.createElement(po.a,{config:e.config.subtitle}))),ro.default.createElement(co.DialogActions,{sx:Object.assign(Object.assign({},t),{pt:1})},ro.default.createElement(lo.a,{container:!0,spacing:2},ro.default.createElement(lo.a,{item:!0,xs:12},ro.default.createElement(lo.a,{color:uo.b.getColorValue(e.config.dividerColor)})),n.map(((e,t)=>{return ro.default.createElement(lo.a,{item:!0,xs:i,key:t},ro.default.createElement(Io,{disabled:!o,style:Object.assign({width:"100%",opacity:a},(n=e.config,So(uo.b.getColorValue(n.background.fillColor))?Co(n.foreground.color):Object.assign(Object.assign({},yo(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:()=>{r(!1),e.onClick()},visible:e.config.visible,text:e.config.text,foreground:e.config.foreground,background:e.config.background,debugName:e.debugName,accessibilityDescription:uo.b.getLocalizedText(e.config.accessibilityDescription)}));var n}))))))}const af=["image/jpeg","image/jpg","image/png","image/bmp","image/dib","image/tiff"];var sf=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 cf(e){const t=e.config.screens.camera.bottomBar,n="auto"===e.buttonStates.snappingModeState?t.autoSnappingModeButton:t.manualSnappingModeButton,i="auto"===e.buttonStates.snappingModeState?Kh:Jh,o="on"===e.buttonStates.torchState?t.torchOnButton:t.torchOffButton,r=ro.default.createRef();Object(ro.useEffect)((()=>{r.current&&(r.current.oncancel=e.onFileSelectDialogClosed)}),[r.current]);const[a,s]=ro.default.useState(!1),c=()=>s(!0);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{"data-sb-bottom-bar":!0,sx:{backgroundColor:uo.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:112,display:"flex",alignItems:"center",justifyContent:"center"}},ro.default.createElement(co.Box,{sx:{maxWidth:400,display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)"}},ro.default.createElement("div",null,ro.default.createElement(bo,{onClick:e.scanLimitReached?c:e.onFileSelectDialogOpened,enabled:e.buttonStates.importButtonEnabled,config:t.importButton,iconButtonComponent:e.scanLimitReached?"button":"label",icon:({color:e})=>ro.default.createElement(lo.a,{sx:{color:e}}),debugName:"import"},!e.scanLimitReached&&ro.default.createElement("input",{hidden:!0,type:"file",accept:af.join(", "),ref:r,onChange:t=>{var n,i;e.onFileSelectDialogClosed();const o=null===(i=null===(n=null==t?void 0:t.target)||void 0===n?void 0:n.files)||void 0===i?void 0:i[0];o&&(()=>{sf(this,void 0,void 0,(function*(){const t=e.sdk.detectAndCropDocument(yield o.arrayBuffer(),"CONSUME_IMAGE");e.onFileUploaded(t)}))})()},value:""}))),ro.default.createElement("div",null,ro.default.createElement(bo,{enabled:e.buttonStates.snappingModeButtonEnabled,config:n,icon:i,onClick:e.snappingModeButtonClick,debugName:"snapping-mode"})),ro.default.createElement(of,{state:e.buttonStates.shutterButtonState,onClick:e.scanLimitReached?c:e.onShutterButtonClick,config:e.config.screens.camera.bottomBar.shutterButton}),ro.default.createElement("div",null,ro.default.createElement(bo,{enabled:e.buttonStates.torchButtonEnabled,config:o,icon:t=>(e.buttonStates.torchState,ro.default.createElement(lo.a,{sx:t})),onClick:e.onTorchButtonClick,debugName:"torch"})),ro.default.createElement("div",null,ro.default.createElement($h,{enabled:e.buttonStates.reviewButtonEnabled,config:t.previewButton,count:e.buttonStates.reviewButtonCount,previewImageUrl:e.buttonStates.reviewButtonPreviewImageUrl,onClick:e.onReviewButtonClick})))),ro.default.createElement(rf,{open:a,config:e.config.screens.camera.limitReachedAlertDialog,onCancelClick:()=>{},onActionClick:()=>{},onOkClick:()=>{s(!1)}}))}function lf(e){const t=uo.b.getColorValue(e.color),n=221/376,i=`calc(${e.maxHeight} - ${e.paddingTop}px - ${e.paddingBottom}px)`,o=e.maxWidth,r=`min(${`calc(${i} * ${n})`}, ${o})`,a=`min(${i}, ${`calc(${o} / ${n})`})`;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{style:{width:r,height:a,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom},viewBox:"0 0 221 376",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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"}),ro.default.createElement("defs",null,ro.default.createElement("linearGradient",{id:"paint0_linear_441_9693",x1:"110.664",y1:"375.7",x2:"110.664",y2:"1",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{offset:"0.029183",stopColor:t,stopOpacity:"0"}),ro.default.createElement("stop",{offset:"0.204626",stopColor:t})))))}function uf(e){return ro.default.createElement(ro.default.Fragment,null,e.config.visible&&ro.default.createElement(vo,{polygonConfig:{strokeColor:e.config.background.strokeColor,fillColor:e.config.background.fillColor,cornerRadius:0,strokeWidth:0},sx:{height:40,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",width:"100%"}},ro.default.createElement(po.a,{config:e.config.title})))}function df(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.badAspectRatio,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 ro.default.createElement(po.a,{config:Object.assign(Object.assign({},e.config.screens.camera.userGuidance.title),{text:uo.b.getLocalizedText(i[e.text])})})}const mf=`calc(100 * ${mo} - 50px - 112px)`,hf="0.5s";function ff(e){const t=e.config.screens.camera,n=e.bottomUserGuidanceVisible?56:0;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:mf}},e.documentScannerView),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:mf,backgroundColor:"white",opacity:e.showCameraBlink?1:0,transition:e.showCameraBlink?"":"opacity 0.5s ease-in"}}),ro.default.createElement(co.Box,{sx:{height:mf,position:"relative"}},ro.default.createElement(uf,{config:t.topUserGuidance}),e.bottomUserGuidanceVisible&&ro.default.createElement(co.Box,{key:"bottomUserGuidance",sx:{position:"absolute",marginTop:`calc(${mf} - ${n}px)`,width:"100%",display:"flex",justifyContent:"center"}},ro.default.createElement(vo,{polygonConfig:{fillColor:t.userGuidance.background.fillColor,strokeColor:t.userGuidance.background.strokeColor,strokeWidth:t.userGuidance.background.strokeWidth,cornerRadius:4},sx:{padding:"6px 10px"}},ro.default.createElement(df,{config:e.config,text:e.userGuidanceText,snappingMode:e.snappingMode}))),t.scanAssistanceOverlay.visible&&!t.viewFinder.visible&&ro.default.createElement(co.Box,{key:"scanAssistanceOverlay",sx:{backgroundColor:uo.b.getColorValue(t.scanAssistanceOverlay.backgroundColor),height:"100%",display:"flex",justifyContent:"center",alignItems:"center",opacity:e.showHand?1:0,transition:"opacity 0.5s"}},ro.default.createElement(lf,{color:t.scanAssistanceOverlay.foregroundColor,maxWidth:"80%",maxHeight:`min(calc(${mf} * 0.85), 600px)`,paddingTop:40,paddingBottom:n}))))}const pf={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 gf{constructor(e){this.initializing={enabled:!0,value:"Initializing..."},this.hint=e}}class vf{constructor(){this.outline=new Cf,this.captureButton=new Sf}}class Cf{constructor(){this.polygon=new yf,this.path=new bf,this.label=new Af}}class yf{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent",this.strokeWidthCapturing=2,this.strokeWidthSearching=2}}class bf{constructor(){this.stroke="green",this.strokeWidth=4}}class Af{}class Sf{constructor(){this.color="#FFF"}}class wf extends qi.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new x,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new gf(pf),this.style=new vf,this.onDocumentDetected=function(e){},this.finder=Object(Ki.b)(),this.finder.visible=!1}static fromJson(e){var t,n;const i=new wf;if(qi.a.mapValuesDeep(null!==(t=e.finder)&&void 0!==t?t:{},i.finder),this.mapValues(e,i,["text","style","videoConstraints","detectionParameters","finder"]),i.detectionParameters=new x(null!==(n=e.detectionParameters)&&void 0!==n?n:{}),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 o=t.label;o&&this.mapValues(o,i.style.outline.label)}const n=e.style.captureButton;n&&this.mapValues(n,i.style.captureButton)}return this.mapVideoConstraints(e,i),i}}class Ef extends ro.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return ro.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(ro.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()))}}Ef.CLASSNAME="scanbot-document-outline";class xf extends ro.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 o={points:e,animatedPoints:t,isOk:n,isVisible:i};this.setState(o)}pointStringOrLatestValidPoints(e){return e&&e.length>0?Xd.a.toSvgString(e):Xd.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=hm()(Ef.CLASSNAME,{[`${Ef.CLASSNAME}-ok`]:this.state.isOk},{[`${Ef.CLASSNAME}-visible`]:this.state.isVisible},{[`${Ef.CLASSNAME}-hidden`]:!this.state.isVisible});return ro.default.createElement(Yd.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 Df=xf;class Tf extends ro.default.Component{constructor(e){super(e),this.state={path:void 0}}render(){var e,t;return this.state.path?ro.default.createElement(Yd.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:`${Ef.CLASSNAME}-path`}):null}animate(e){const t="M"+Xd.a.toSvgString(e)+"z";this.setState({path:t})}clear(){this.setState({path:void 0})}}class Bf extends ro.default.Component{render(){return ro.default.createElement(Yd.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},ro.default.createElement(Df,{ref:e=>this.polygon=e,style:this.props.polygonStyle}),ro.default.createElement(Tf,{ref:e=>this.path=e,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(e,t,n){var i;const o="processing"!==n&&!!e,r=null!==(i=this.previous)&&void 0!==i?i:e,a=this.previous?e:void 0;this.polygon.update(r,a,t,o),this.previous=e,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class If extends ro.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 ro.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},ro.default.createElement(Bf,{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}),ro.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 kf{static isConvex(e){if(e.length<4)return!0;let t=!1,n=e.length;for(let i=0;i<n;i++){const o=e[(i+2)%n].x-e[(i+1)%n].x,r=e[(i+2)%n].y-e[(i+1)%n].y,a=e[i].x-e[(i+1)%n].x,s=o*(e[i].y-e[(i+1)%n].y)-r*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=Xd.a.subtract(e[1],n),o=t[0],r=Xd.a.subtract(t[1],o);if(0===Xd.a.cross(i,r))return;const a=Xd.a.cross(Xd.a.subtract(o,n),i)/Xd.a.cross(i,r);return Xd.a.add(o,Xd.a.multiply(r,a))}}class Of{constructor(e,t=Of.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 kf.distanceBetweenPoints(e,t)/this.maxDistance>this.sensitivity}calculateMaxDistance(e){let t=new Xd.a(0,0),n=new Xd.a(e.width,e.height);return kf.distanceBetweenPoints(t,n)}}Of.DEFAULT_SENSITIVITY=.5;var Lf=n(15),Pf=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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())}))};Wo.b;Wo.a;class _f extends Wo.c{constructor(e){if(super(e),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>Pf(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=wf.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 Pf(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,o)=>{Object(ro.render)(ro.default.createElement(_f,{container:n,configuration:e,onSuccess:i,onFailure:o,sdk:t}),n)}))}))}detectAndCrop(){var e,t,n,i;return Pf(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 n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(_f.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);return n?(oo.a.debug("Detect & Crop document of size: "+n.height*n.width),yield this.bridge.transferArgs.detectAndCropDocument(n)):null}}catch(e){return null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,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}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Pf(this,void 0,void 0,(function*(){e.componentDidMount.call(this),this.detect(),this.scannerToken=this.bridge.copyArgs.createDocumentScanner(new x(this.configuration.detectionParameters)),this.scannerToken.catch((e=>{var t,n;return null===(n=(t=this.configuration).onError)||void 0===n?void 0:n.call(t,e)}))}))}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return Pf(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield this.props.sdk.release(yield this.scannerToken,"Document Scanner")}))}detect(){var e,t,n,i;return Pf(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.data;const i=this.getStatusString(n),o="OK"===i,r=i.startsWith("OK")?this.scalePolygonPointsToPixels(n.pointsNormalized):void 0;this.outline.update(o,r,Wi.getProperty(this.configuration.text.hint,i)),null===(t=(e=this.props).onStatusStringUpdate)||void 0===t||t.call(e,i),yield this.handleAutoCapture(o,r)}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;return Pf(this,void 0,void 0,(function*(){try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Wo.c.DEFAULT_DETECTION_RESOLUTION,!1);return n&&this.enabled?yield this.bridge.transferArgs.documentScannerDetect(yield this.scannerToken,n):null}catch(e){return null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e),null}}))}handleAutoCapture(e,t){return Pf(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 Of(e)}if(this.runMovementPredicate(t))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>Pf(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const e=yield this.detectAndCrop();if(null==e?void 0:e.pointsNormalized){const t=this.scalePolygonPointsToPixels(e.pointsNormalized);if(this.runMovementPredicate(t))return}(null==e?void 0:e.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:o}=this.state,{configuration:r}=this,a=null===(e=r.style)||void 0===e?void 0:e.captureButton,s=!(null!==(t=this.props.hideShutterButton)&&void 0!==t&&t);return ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(n=this.configuration)||void 0===n?void 0:n.spinnerColor),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},ro.default.createElement(zo.a,{configuration:this.configuration,videoConstraints:r.videoConstraints,mirrored:r.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}}),s&&ro.default.createElement(pm,{color:(null==a?void 0:a.color)?a.color:"FFF",action:o,onClick:this.enabled?r.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}})),this.configuration.finder.visible&&ro.default.createElement(jo.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:new Lf.b({visible:!1}),configuration:r.finder}),ro.default.createElement(If,{ref:e=>{this.outline=e},style:null===(i=r.style)||void 0===i?void 0:i.outline,initializationText:r.text.initializing,action:o,autoCaptureSensitivity:this.autoCaptureSensitivity}))}scalePolygonPointsToPixels(e){var t;if(e){const n=this.getCameraFrameSize(),i=bm.a.fromHtmlElement(this.camera.video),o=Lm.findScale(i,n);(null===(t=this.finder)||void 0===t?void 0:t.holeRect)&&(e=e.map((e=>new Xd.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=Lm.convertToViewportPointsFromParentSize(n,e))?void 0:e.map((e=>Xd.a.scaleToPoint(e,o.x,o.y,o.scale)))}return e}runMovementPredicate(e){const t=this.polygonMovementPredicate.check(e);return this.polygonMovementPredicate.update(e),t}getCameraFrameSize(){return this.camera.calculateFrameSize(Wo.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}_f.DETECT_AND_CROP_RESOLUTION=0;var Rf=_f;function Ff(e){const[t,n]=Object(ro.useState)(!1);return Object(ro.useEffect)((()=>{const t=setTimeout((()=>{n(!0)}),e);return()=>clearTimeout(t)}),[]),t}var Nf=n(12);function Mf(e){if(!e.visible)return null;const t=e.config.screens.camera.cameraPermission;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Dialog,{fullScreen:!0,open:e.visible,transitionDuration:0},ro.default.createElement(Gh,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:null,rightContent:null,centerTitle:e.config.screens.camera.topBarTitle}),ro.default.createElement(co.Box,{style:{height:`calc(100 * ${mo} - 50px)`,backgroundColor:uo.b.getColorValue(t.background),display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(t.iconBackground),borderRadius:40,width:80,height:80,display:"flex",justifyContent:"center",alignItems:"center"}},ro.default.createElement(lo.a,{style:{color:uo.b.getColorValue(t.icon.color)},sx:{fontSize:40}})),ro.default.createElement("h4",{style:{margin:12}},ro.default.createElement(po.a,{style:{fontSize:18,fontWeight:500},config:t.enableCameraTitle})),ro.default.createElement(co.Box,{style:{marginBottom:"12px",maxWidth:350,textAlign:"center"}},ro.default.createElement(po.a,{config:t.enableCameraExplanation})),ro.default.createElement(co.Box,null,ro.default.createElement(wo,{icon:ro.default.createElement(co.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"}})))))}class Vf{constructor(){}static get(e,t){const n=localStorage.getItem(this.getKey(e));return null===n?t:JSON.parse(n)}static set(e,t){localStorage.setItem(this.getKey(e),JSON.stringify(t))}static clear(){localStorage.clear()}static getKey(e){return`sb_document_rtu_ui_${e}`}}var Wf=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 zf(e,t){return Wf(this,void 0,void 0,(function*(){return{value:yield e,source:t}}))}var jf=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Hf(e){var t;const n=e.configuration.screens.camera,[i,o]=Object(ro.useState)(n.cameraConfiguration.autoSnappingEnabled?"auto":"manual"),[r,a]=Object(ro.useState)(n.cameraConfiguration.flashEnabled),[s,c]=ro.default.useState(!1),l=Object(ro.useRef)(null);const[u,d]=Object(ro.useState)((()=>!Vf.get("hasSeenIntroduction",!1)||n.introduction.showAutomatically));Object(ro.useEffect)((()=>{e.scanLimitReached&&o("manual")}),[e.scanLimitReached]);const m=null===(t=e.pages)||void 0===t?void 0:t[e.pages.length-1],[h,f]=Object(ro.useState)(null),p=kh(null==m?void 0:m.finalImageUrl());Object(ro.useEffect)((()=>{0===e.pages.length?f(null):p.value&&f(p.value)}),[p,e.pages.length]);const g="ENABLED"===n.userGuidance.visibility||"AUTO_CAPTURE_ONLY"===n.userGuidance.visibility&&"auto"===i,v={minTopPadding:20+(n.topUserGuidance.visible?40:0),minBottomPadding:20+(g?56:0)},[C,y]=Object(ro.useState)(!1),b=0===n.timeouts.initialScanDelay||Ff(n.timeouts.initialScanDelay),[A,S]=Object(ro.useState)("START"),[w,E]=Object(ro.useState)(!0),{documentScannerView:x,documentScannerViewRef:D,torchSupported:T,scannerInitialized:B,activeCamera:I,availableCameras:k,setActiveCamera:O}=function(e){const t=e.configuration.screens.camera,n=t.cameraConfiguration,i=!e.pauseAR&&("ENABLED"===t.polygon.visibility||"AUTO_CAPTURE_ONLY"===t.polygon.visibility&&"auto"===e.snappingMode),o=e=>i?uo.b.getColorValue(e):"#00000000",r=(new wf).videoConstraints;r.width.ideal=n.idealPreviewResolution.width,r.height.ideal=n.idealPreviewResolution.height,r.facingMode="FRONT"===n.cameraModule?"user":"environment";const a=!e.scanningPaused&&"auto"===e.snappingMode,s={videoConstraints:r,onError:e.onError,backgroundColor:uo.b.getColorValue(t.backgroundColor),onDocumentDetected:e.onImageCaptured,autoCaptureEnabled:a,autoCaptureDelay:n.autoSnappingDelay,autoCaptureSensitivity:n.autoSnappingSensitivity,ignoreBadAspectRatio:n.ignoreBadAspectRatio,detectionParameters:{aspectRatios:n.requiredAspectRatios,acceptedAngleScore:n.acceptedAngleScore,acceptedBrightnessThreshold:n.acceptedBrightnessThreshold,acceptedSizeScore:n.acceptedSizeScore},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},c=Object(ro.useRef)(null);Object(ro.useEffect)((()=>()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.dispose()}),[]),Object(ro.useEffect)((()=>{c.current&&(a?c.current.enableAutoCapture():c.current.disableAutoCapture())}),[e.scanningPaused,e.snappingMode,c.current]);const[l,u]=Object(ro.useState)(!1);Object(ro.useEffect)((()=>{c.current&&l&&c.current.setTorchState(e.torchEnabled).catch((e=>{}))}),[e.torchEnabled,c.current,l]);const[d,m]=Object(ro.useState)(!1),[h,f]=Object(ro.useState)(null),[p,g]=Object(ro.useState)([]);Object(ro.useEffect)((()=>{c.current||m(!1)}),[c.current]);const v=ro.default.createElement(Rf,{sdk:e.sdk,ref:c,configuration:s,onSuccess:function(){var e,t,n;u(null===(e=c.current)||void 0===e?void 0:e.getActiveCameraInfo().supportsTorchControl),m(!0);const i=null===(t=c.current)||void 0===t?void 0:t.getActiveCameraInfo();f(null!=i?i:null),g(i?[i]:[]),null===(n=c.current)||void 0===n||n.fetchAvailableCameras().then(g)},onFailure:e.onError,hideShutterButton:!0,onStatusStringUpdate:e.onUserGuidanceTextUpdate,viewFinderPadding:e.viewFinderPadding,pauseAR:e.pauseAR});return{documentScannerView:v,documentScannerViewRef:c,torchSupported:l,scannerInitialized:d,activeCamera:h,availableCameras:p,setActiveCamera:function(e){var t;return f(e),null===(t=c.current)||void 0===t?void 0:t.switchCamera(e.deviceId)}}}({sdk:e.sdk,configuration:e.configuration,onImageCaptured:e=>{R(zf(Promise.resolve(e),"AUTO_SNAP"))},onUserGuidanceTextUpdate:function(e){(!w||"ERROR_NOTHING_DETECTED"!==e&&L)&&(S(e),E(!1))},snappingMode:i,scanningPaused:e.scanningPaused||!b,torchEnabled:r,onError:t=>{t instanceof Nf.a?y(!0):e.onError(t)},viewFinderPadding:v,pauseAR:!e.visible||e.scanningPaused||!b}),L=Ff(1e3),[P,_]=Object(ro.useState)(!1);Object(ro.useEffect)((()=>{requestAnimationFrame((()=>_(!1)))}),[P]);function R(t){_(n.captureFeedback.cameraBlinkEnabled),Vo.INSTANCE.vibrate(e.configuration.screens.camera.vibration),e.onImageCaptured(t)}return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{display:e.visible?"block":"none","data-sb-screen-camera":!0,style:{position:"absolute",width:"100vw"}},ro.default.createElement(Zh,{config:n.introduction,isOpen:u,onClose:()=>{d(!1),Vf.set("hasSeenIntroduction",!0)}}),ro.default.createElement(qh,{cameraSelectConfig:{availableCameras:k,activeCamera:I,onSelect:e=>jf(this,void 0,void 0,(function*(){yield O(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)}),ro.default.createElement(ff,{config:e.configuration,sdk:e.sdk,documentScannerView:x,showHand:w,userGuidanceText:A,bottomUserGuidanceVisible:g,snappingMode:i,showCameraBlink:P}),ro.default.createElement(cf,{buttonStates:{importButtonEnabled:!e.scanningPaused,snappingModeState:i,snappingModeButtonEnabled:!e.scanLimitReached,torchState:r&&T?"on":"off",torchButtonEnabled:T,reviewButtonCount:e.pages.length,reviewButtonPreviewImageUrl:h,reviewButtonEnabled:e.pages.length>0,shutterButtonState:e.scanningPaused||!B?"loading":i},sdk:e.sdk,onFileSelectDialogOpened:function(){l.current=i,o("manual")},onFileSelectDialogClosed:function(){l.current&&(o(l.current),l.current=null)},onFileUploaded:t=>e.onImageCaptured(zf(t,"IMPORTED")),snappingModeButtonClick:()=>o((e=>function(e){return"auto"===e?"manual":"auto"}(e))),onTorchButtonClick:()=>a((e=>!e)),onReviewButtonClick:e.onReviewButtonClick,onShutterButtonClick:function(){var e;return jf(this,void 0,void 0,(function*(){E(!1),R(zf(null===(e=D.current)||void 0===e?void 0:e.detectAndCrop(),"MANUAL_SNAP"))}))},scanLimitReached:e.scanLimitReached,config:e.configuration}),ro.default.createElement(rf,{open:s,config:e.configuration.screens.camera.cancelAlertDialog,onCancelClick:()=>c(!1),onActionClick:()=>{},onOkClick:e.onClose}),ro.default.createElement(Mf,{visible:C,onCloseClick:e.onClose,config:e.configuration})))}function Uf(e){const t=Object(ro.useMemo)((()=>Object(co.createTheme)({components:{MuiButtonBase:{styleOverrides:{root:{"&:hover, &:focus":{outline:"none"}}},defaultProps:{disableRipple:!0}}}})),[]);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.ThemeProvider,{theme:t},ro.default.createElement(co.Typography,{component:"div"},e.children)))}function Zf(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_856_1211",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_856_1211)"},ro.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 Gf(e){const t=e.config,n=e.isQualityAcceptable?t.acceptWhenOkButton:t.acceptWhenNotOkButton;return ro.default.createElement(co.Box,{sx:{backgroundColor:uo.b.getColorValue(e.backgroundColor),height:78,display:"flex",width:"100%",zIndex:1e3,justifyContent:"center"}},ro.default.createElement(co.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)",maxWidth:400}},ro.default.createElement(bo,{config:e.config.retakeButton,icon:Zf,enabled:!0,debugName:"ack-retake",onClick:e.onRetake}),ro.default.createElement(bo,{config:n,icon:e=>ro.default.createElement(co.Check,{style:e}),enabled:!0,debugName:"ack-use-scan",onClick:e.onAccept})))}function Yf(e){if(!e.config.visible)return null;const t=uo.b.getColorValue(e.config.color);return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_447_6066",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_447_6066)"},ro.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}),ro.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 Qf(e){if(!e.visible||!e.config.visible)return null;const t=e.config.background;return ro.default.createElement(co.Box,{style:Object.assign({backgroundColor:uo.b.getColorValue(t.fillColor),borderWidth:t.strokeWidth,borderColor:uo.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)},ro.default.createElement(Yf,{config:e.config.icon}),ro.default.createElement(po.a,{style:{marginLeft:"10px",fontSize:"14px",lineHeight:"16px",fontWeight:400},config:e.config.title}))}function Xf(e){return ro.default.createElement("img",{"data-sb-acknowledgment-image":!0,style:{display:"block",maxWidth:"90%",objectFit:"contain",flex:1,height:`calc(100 * ${mo} - 78px - 52px - 20px)`,paddingTop:10},src:e.image,alt:""})}function qf(e){if(!e.visible)return null;const t=e.isQualityAcceptable;return ro.default.createElement("div",{style:{display:"inherit",flexDirection:"inherit",justifyContent:"inherit",alignItems:"inherit",height:"100%",width:"100%"}},ro.default.createElement(Xf,{image:e.base64Image}),ro.default.createElement(Qf,{visible:!t,config:e.banner.config}),ro.default.createElement(Gf,{isQualityAcceptable:t,backgroundColor:e.bottomBar.backgroundColor,config:e.bottomBar.config,onRetake:e.bottomBar.onRetake,onAccept:e.bottomBar.onAccept}))}function Kf(e){const t=uo.b.getColorValue(e.config.checkMarkColor),n=uo.b.getColorValue(e.config.checkMarkBackgroundColor);return ro.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"},ro.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}),ro.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 Jf(e){if(!e.visible)return null;if("PageSnapFeedbackNone"===e.mode._type)return null;if("PageSnapFunnelAnimation"===e.mode._type)return ro.default.createElement(Xf,{image:e.base64Image});if("PageSnapCheckMarkAnimation"===e.mode._type)return ro.default.createElement(Kf,{config:e.mode});throw new Error(`Unknown PageSnapFeedbackMode: ${e.mode}`)}var $f=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 ep(e){const t=kh(e.croppedDetectionResult);Object(ro.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,o=e.configuration.outputSettings,r=n.acknowledgementMode,[a,s]=ro.default.useState(null),[c,l]=ro.default.useState(null),u=ro.default.useRef(null),d=null!==c,m=()=>"ALWAYS"===r||"NONE"!==r&&(!!d&&("BAD_QUALITY"===r&&!c)),h=t=>{setTimeout((()=>{f(),e.onAccept(t,u.current)}),1500)},f=()=>{s(null),l(null)},p={null:-1,VERY_POOR:0,POOR:1,REASONABLE:2,GOOD:3,EXCELLENT:4};let g;Object(ro.useEffect)((()=>{var a;if(null==t?void 0:t.value){const c=t.value.value;let d=null!==(a=c.croppedImage)&&void 0!==a?a:c.originalImage;function m(){return $f(this,void 0,void 0,(function*(){null!==o.defaultFilter&&"FILTERED_DOCUMENT"===o.documentAnalysisMode&&(d=yield e.sdk.imageFilter(d,o.defaultFilter,"COPY_IMAGE"));if("PageSnapFunnelAnimation"===i.snapFeedbackMode._type||"ALWAYS"===r||"BAD_QUALITY"===r){const t=yield e.sdk.imageToJpeg(d),n=yield ji.toBase64(t,!1);s(n)}if("NONE"===r)return l(!0),void h(t.value);if(null===c.croppedImage)return void l(!1);const a=yield e.sdk.createDocumentQualityAnalyzer(),m=yield a.analyze(d);u.current=m.quality,yield a.release();const f=p[m.quality]>=p[n.minimumQuality];l(f),f&&"BAD_QUALITY"===r&&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=uo.b.getColorValue(g);const v=i.cameraBlinkEnabled?hf:"0s";return ro.default.createElement(lo.a,{open:e.visible},ro.default.createElement(co.Fade,{tabIndex:-1,"data-sb-screen-acknowledgment":!0,in:e.visible,timeout:250,style:{position:"absolute",width:"100vw",height:`calc(100 * ${mo})`,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",transitionDelay:e.visible?v:"0s"}},ro.default.createElement(co.Box,{style:{display:e.visible?"flex":"none",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:g,zIndex:1e3}},ro.default.createElement(Jf,{visible:!m()&&d,base64Image:a,mode:i.snapFeedbackMode}),ro.default.createElement(qf,{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,u.current)}}}))))}function tp(e){const t=e.config.screens.review,[n,i]=ro.default.useState(null);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Gh,{backgroundColor:uo.b.getColorValue(e.config.appearance.topBarBackgroundColor),leftContent:ro.default.createElement(wo,{disabled:!e.buttonsEnabled,onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:ro.default.createElement(lo.a,{sx:{fontSize:24}}),debugName:"close-review-screen"}),centerTitle:t.topBarTitle,centerTitleReplacementArgs:[`${e.numPages}`],rightContent:ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(wo,{disabled:!e.buttonsEnabled,onClick:e=>i(e.currentTarget),visible:t.topBarMoreButton.visible,text:"",background:new Po.a({strokeColor:"transparent",fillColor:"transparent",strokeWidth:0}),foreground:new Po.f({color:t.topBarMoreButton.color,iconVisible:!0}),icon:ro.default.createElement(lo.a,{sx:{fontSize:24}}),debugName:"more",id:"sb-button-review-more",ariaLabel:uo.b.getLocalizedText(t.topBarMoreButton.accessibilityDescription)}),ro.default.createElement(co.Menu,{anchorEl:n,open:null!==n,onClose:()=>i(null),MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:uo.b.getColorValue(t.morePopup.backgroundColor)}}}},ro.default.createElement(Qh,{disabled:!1,autoFocus:!0,ariaLabel:t.morePopup.deleteAll.accessibilityDescription,onClick:()=>{i(null),e.onDeleteButtonClick()},textColor:t.morePopup.deleteAll.title.color},ro.default.createElement(lo.a,{sx:{color:uo.b.getColorValue(t.morePopup.deleteAll.icon.color),visibility:t.morePopup.deleteAll.icon.visible?"visible":"hidden"}}),ro.default.createElement(po.a,{config:t.morePopup.deleteAll.title,style:{marginLeft:8}}))))}))}function np(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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}),ro.default.createElement("path",{d:"M16.8624 19V22H18.8624V19H21.8624V17H18.8624V14H16.8624V17H13.8624V19H16.8624Z",fill:t}))}function ip(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_856_1229",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_856_1229)"},ro.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 op(){return dh("tablet")?80:160}function rp(e){const t=dh("tablet"),n=e.config.screens.review,i=ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(vo,{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})},ro.default.createElement(po.a,{config:{text:uo.b.getLocalizedText(n.bottomBar.submitButton.text),visible:!0,color:n.bottomBar.submitButton.foreground.color,useShadow:n.bottomBar.submitButton.foreground.useShadow}}))),o=Object.assign(Object.assign({padding:"4px"},yo(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 ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:op(),width:"100%"}},ro.default.createElement(co.Box,{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:t?"space-between":"center",height:80}},t&&ro.default.createElement(co.Box,{visibility:"hidden"}),ro.default.createElement(co.Box,{style:{display:"flex",flexDirection:"row",maxWidth:"600px",justifyContent:"space-around",flexGrow:1}},ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.addButton,icon:np,onClick:e.onAddPageClick,debugName:"add-page"}),ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.retakeButton,icon:Zf,onClick:e.onRetakeClick,debugName:"retake"}),ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.cropButton,icon:e=>ro.default.createElement(lo.a,{sx:{color:e}}),onClick:e.onCropClick,debugName:"crop-button"}),ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.rotateButton,icon:e=>ro.default.createElement(lo.a,{sx:{color:e}}),onClick:e.onRotateClick,debugName:"rotate-button"}),ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.deleteButton,icon:ip,onClick:e.onDeleteClick,debugName:"delete-button"})),t&&ro.default.createElement(co.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":uo.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:172,marginX:"4px"},o),onClick:e.onSubmitClick},i)),!t&&ro.default.createElement(co.Box,{style:{padding:"12px",display:"flex"}},ro.default.createElement(co.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":uo.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:600,margin:"0 auto"},o),onClick:e.onSubmitClick},i))))}function ap(e){const t=e.config.pageCounter;return ro.default.createElement(co.Box,{style:{display:"flex",width:"100%",backgroundColor:uo.b.getColorValue(e.config.backgroundColor),justifyContent:"space-between",alignItems:"end",padding:"16px 0"}},ro.default.createElement(co.Box,{style:{width:72,height:20}}),ro.default.createElement(co.Box,null,ro.default.createElement(vo,{polygonConfig:{strokeColor:t.background.strokeColor,fillColor:t.background.fillColor,strokeWidth:t.background.strokeWidth,cornerRadius:4},style:{visibility:t.visible?"visible":"hidden"}},ro.default.createElement(po.a,{config:t.title,replacementArgs:[`${e.currentPage}`,`${e.totalNumPages}`],style:{fontSize:14,padding:"8px 12px"}}))),ro.default.createElement(co.Box,null,ro.default.createElement(co.IconButton,{onClick:e.onZoomButtonClick,"aria-label":uo.b.getLocalizedText(e.config.zoomButton.accessibilityDescription),sx:Object.assign({backgroundColor:uo.b.getColorValue(e.config.zoomButton.backgroundColor),color:uo.b.getColorValue(e.config.zoomButton.foregroundColor),margin:"0 16px",visibility:e.config.zoomButton.visible?"visible":"hidden","&:hover":{backgroundColor:uo.b.getColorValue(e.config.zoomButton.activeBackgroundColor),color:uo.b.getColorValue(e.config.zoomButton.activeForegroundColor)}},yo(e.config.zoomButton.foregroundColor))},ro.default.createElement(lo.a,null))))}function sp(){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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"},ro.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"})),ro.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"},ro.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 cp(e){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Dialog,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},slotProps:{backdrop:{style:{backgroundColor:"transparent"}}},open:e.open,transitionDuration:100},ro.default.createElement(co.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"}},ro.default.createElement(sp,null))))}function lp(e){const t=e.config.visible&&e.active;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("div",{style:{width:"40px"}},ro.default.createElement(co.Button,{[`data-sb-button-${e.debugName}`]:!0,sx:Object.assign({color:uo.b.getColorValue(e.config.color),minWidth:"auto",visibility:t?"visible":"hidden",paddingX:"4px",marginX:"4px"},Co(e.config.color)),onClick:e.onClick,"aria-label":uo.b.getLocalizedText(e.config.accessibilityDescription)},ro.default.createElement(e.icon,null))))}var up=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 dp(e){var t,n;const i=kh(e.page.finalImageUrl()),[o,r]=ro.default.useState(null),[a,s]=ro.default.useState(!1);Object(ro.useEffect)((()=>{(()=>{up(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})),r(i.value),s(!1)),e.animateRotation&&s(!0)}))})()}),[i.value,e.animateRotation]);const c=ro.default.useRef(null),l=(()=>{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),o=t.clientWidth/t.clientHeight;n=t.clientHeight>e.naturalWidth&&t.clientWidth>e.naturalHeight?Math.max(e.naturalHeight/t.clientHeight,1):i<o?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===o&&null!==e.onAnimateRotationDone.current?(null===(n=(t=e.onAnimateRotationDone).current)||void 0===n||n.call(t),null):ro.default.createElement(ro.default.Fragment,null,o&&ro.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),l),src:o,alt:`Page ${e.index}`}))}function mp(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function hp(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],o=t[n];return"function"==typeof i?`${i}`==`${o}`:mp(i)&&mp(o)?hp(i,o):i===o}))}function fp(e){return e.concat().sort(((e,t)=>e.name>t.name?1:-1)).map((e=>e.options))}function pp(e){return"number"==typeof e}function gp(e){return"string"==typeof e}function vp(e){return"boolean"==typeof e}function Cp(e){return"[object Object]"===Object.prototype.toString.call(e)}function yp(e){return Math.abs(e)}function bp(e){return Math.sign(e)}function Ap(e,t){return yp(e-t)}function Sp(e){return Tp(e).map(Number)}function wp(e){return e[Ep(e)]}function Ep(e){return Math.max(0,e.length-1)}function xp(e,t){return t===Ep(e)}function Dp(e,t=0){return Array.from(Array(e),((e,n)=>t+n))}function Tp(e){return Object.keys(e)}function Bp(e,t){return[e,t].reduce(((e,t)=>(Tp(t).forEach((n=>{const i=e[n],o=t[n],r=Cp(i)&&Cp(o);e[n]=r?Bp(i,o):o})),e)),{})}function Ip(e,t){return"undefined"!=typeof t.MouseEvent&&e instanceof t.MouseEvent}function kp(){let e=[];const t={add:function(n,i,o,r={passive:!0}){let a;if("addEventListener"in n)n.addEventListener(i,o,r),a=()=>n.removeEventListener(i,o,r);else{const e=n;e.addListener(o),a=()=>e.removeListener(o)}return e.push(a),t},clear:function(){e=e.filter((e=>e()))}};return t}function Op(e,t,n,i){const o=kp(),r=1e3/60;let a=null,s=0,c=0;function l(e){if(!c)return;a||(a=e);const o=e-a;for(a=e,s+=o;s>=r;)n(r),s-=r;i(s/r),c&&t.requestAnimationFrame(l)}function u(){t.cancelAnimationFrame(c),a=null,s=0,c=0}return{init:function(){o.add(e,"visibilitychange",(()=>{e.hidden&&(a=null,s=0)}))},destroy:function(){u(),o.clear()},start:function(){c||(c=t.requestAnimationFrame(l))},stop:u,update:()=>n(r),render:i}}function Lp(e=0,t=0){const n=yp(e-t);function i(t){return t<e}function o(e){return e>t}function r(e){return i(e)||o(e)}return{length:n,max:t,min:e,constrain:function(n){return r(n)?i(n)?e:t:n},reachedAny:r,reachedMax:o,reachedMin:i,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}}}function Pp(e,t,n){const{constrain:i}=Lp(0,e),o=e+1;let r=a(t);function a(e){return n?yp((o+e)%o):i(e)}function s(){return r}function c(){return Pp(e,s(),n)}const l={get:s,set:function(e){return r=a(e),l},add:function(e){return c().set(s()+e)},clone:c};return l}function _p(e,t,n,i,o,r,a,s,c,l,u,d,m,h,f,p,g,v,C){const{cross:y,direction:b}=e,A=["INPUT","SELECT","TEXTAREA"],S={passive:!1},w=kp(),E=kp(),x=Lp(50,225).constrain(h.measure(20)),D={mouse:300,touch:400},T={mouse:500,touch:600},B=f?43:25;let I=!1,k=0,O=0,L=!1,P=!1,_=!1,R=!1;function F(e){if(!Ip(e,i)&&e.touches.length>=2)return N(e);const t=r.readPoint(e),n=r.readPoint(e,y),a=Ap(t,k),c=Ap(n,O);if(!P&&!R){if(!e.cancelable)return N(e);if(P=a>c,!P)return N(e)}const u=r.pointerMove(e);a>p&&(_=!0),l.useFriction(.3).useDuration(.75),s.start(),o.add(b(u)),e.preventDefault()}function N(e){const t=u.byDistance(0,!1).index!==d.get(),n=r.pointerUp(e)*(f?T:D)[R?"mouse":"touch"],i=function(e,t){const n=d.add(-1*bp(e)),i=u.byDistance(e,!f).distance;return f||yp(e)<x?i:g&&t?.5*i:u.byIndex(n.get(),0).distance}(b(n),t),o=function(e,t){if(0===e||0===t)return 0;if(yp(e)<=yp(t))return 0;const n=Ap(yp(e),yp(t));return yp(n/e)}(n,i),a=B-10*o,s=v+o/50;P=!1,L=!1,E.clear(),l.useDuration(a).useFriction(s),c.distance(i,!f),R=!1,m.emit("pointerUp")}function M(e){_&&(e.stopPropagation(),e.preventDefault(),_=!1)}return{init:function(e){if(!C)return;function s(s){(vp(C)||C(e,s))&&function(e){const s=Ip(e,i);if(R=s,_=f&&s&&!e.buttons&&I,I=Ap(o.get(),a.get())>=2,s&&0!==e.button)return;if(function(e){const t=e.nodeName||"";return A.includes(t)}(e.target))return;L=!0,r.pointerDown(e),l.useFriction(0).useDuration(0),o.set(a),function(){const e=R?n:t;E.add(e,"touchmove",F,S).add(e,"touchend",N).add(e,"mousemove",F,S).add(e,"mouseup",N)}(),k=r.readPoint(e),O=r.readPoint(e,y),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",N).add(c,"contextmenu",N).add(c,"click",M,!0)},destroy:function(){w.clear(),E.clear()},pointerDown:function(){return L}}}function Rp(e,t){let n,i;function o(e){return e.timeStamp}function r(n,i){const o="client"+("x"===(i||e.scroll)?"X":"Y");return(Ip(n,t)?n:n.touches[0])[o]}return{pointerDown:function(e){return n=e,i=e,r(e)},pointerMove:function(e){const t=r(e)-r(i),a=o(e)-o(n)>170;return i=e,a&&(n=e),t},pointerUp:function(e){if(!n||!i)return 0;const t=r(i)-r(n),a=o(e)-o(n),s=o(e)-o(i)>170,c=t/a;return a&&!s&&yp(c)>.1?c:0},readPoint:r}}function Fp(e,t,n,i,o,r,a){const s=[e].concat(i);let c,l,u=[],d=!1;function m(e){return o.measureSize(a.measure(e))}return{init:function(o){r&&(l=m(e),u=i.map(m),c=new ResizeObserver((n=>{(vp(r)||r(o,n))&&function(n){for(const r of n){if(d)return;const n=r.target===e,a=i.indexOf(r.target),s=n?l:u[a];if(yp(m(n?e:i[a])-s)>=.5){o.reInit(),t.emit("resize");break}}}(n)})),n.requestAnimationFrame((()=>{s.forEach((e=>c.observe(e)))})))},destroy:function(){d=!0,c&&c.disconnect()}}}function Np(e,t,n,i,o){const r=o.measure(10),a=o.measure(50),s=Lp(.1,.99);let c=!1;function l(){return!c&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:l,constrain:function(o){if(!l())return;const c=e.reachedMin(t.get())?"min":"max",u=yp(e[c]-t.get()),d=n.get()-t.get(),m=s.constrain(u/a);n.subtract(d*m),!o&&yp(d)<r&&(n.set(e.constrain(n.get())),i.useDuration(25).useBaseFriction())},toggleActive:function(e){c=!e}}}function Mp(e,t,n,i){const o=t.min+.1,r=t.max+.1,{reachedMin:a,reachedMax:s}=Lp(o,r);return{loop:function(t){if(!function(e){return 1===e?s(n.get()):-1===e&&a(n.get())}(t))return;const o=e*(-1*t);i.forEach((e=>e.add(o)))}}}function Vp(e,t,n,i,o){const{reachedAny:r,removeOffset:a,constrain:s}=i;function c(e){return e.concat().sort(((e,t)=>yp(e)-yp(t)))[0]}function l(t,i){const o=[t,t+n,t-n];if(!e)return t;if(!i)return c(o);const r=o.filter((e=>bp(e)===i));return r.length?c(r):wp(o)-n}const u={byDistance:function(n,i){const c=o.get()+n,{index:u,distance:d}=function(n){const i=e?a(n):s(n),o=t.map(((e,t)=>({diff:l(e-i,0),index:t}))).sort(((e,t)=>yp(e.diff)-yp(t.diff))),{index:r}=o[0];return{index:r,distance:i}}(c),m=!e&&r(c);return!i||m?{index:u,distance:n}:{index:u,distance:n+l(t[u]-d,0)}},byIndex:function(e,n){return{index:e,distance:l(t[e]-o.get(),n)}},shortcut:l};return u}function Wp(e,t,n,i,o,r,a,s){const c={passive:!0,capture:!0};let l=0;function u(e){"Tab"===e.code&&(l=(new Date).getTime())}return{init:function(d){s&&(r.add(document,"keydown",u,!1),t.forEach(((t,u)=>{r.add(t,"focus",(t=>{(vp(s)||s(d,t))&&function(t){if((new Date).getTime()-l>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const r=n.findIndex((e=>e.includes(t)));pp(r)&&(o.useDuration(0),i.index(r,0),a.emit("slideFocus"))}(u)}),c)})))}}}function zp(e){let t=e;function n(e){return pp(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 jp(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 o=!1;return{clear:function(){o||(i.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){o||(i.transform=n(e.direction(t)))},toggleActive:function(e){o=!e}}}function Hp(e,t,n,i,o,r,a,s,c){const l=Sp(o),u=Sp(o).reverse(),d=function(){const e=a[0];return f(h(u,e),n,!1)}().concat(function(){const e=t-a[0]-1;return f(h(l,e),-n,!0)}());function m(e,t){return e.reduce(((e,t)=>e-o[t]),t)}function h(e,t){return e.reduce(((e,n)=>m(e,t)>0?e.concat([n]):e),[])}function f(o,a,l){const u=function(e){return r.map(((n,o)=>({start:n-i[o]+.5+e,end:n+t-.5+e})))}(a);return o.map((t=>{const i=l?0:-n,o=l?n:0,r=l?"end":"start",a=u[t][r];return{index:t,loopPoint:a,slideLocation:zp(-1),translate:jp(e,c[t]),target:()=>s.get()>a?i:o}}))}return{canLoop:function(){return d.every((({index:e})=>m(l.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,o=t();o!==i.get()&&(n.to(o),i.set(o))}))},loopPoints:d}}function Up(e,t,n){let i,o=!1;return{init:function(r){n&&(i=new MutationObserver((e=>{o||(vp(n)||n(r,e))&&function(e){for(const n of e)if("childList"===n.type){r.reInit(),t.emit("slidesChanged");break}}(e)})),i.observe(e,{childList:!0}))},destroy:function(){i&&i.disconnect(),o=!0}}}function Zp(e,t,n,i){const o={};let r,a=null,s=null,c=!1;return{init:function(){r=new IntersectionObserver((e=>{c||(e.forEach((e=>{const n=t.indexOf(e.target);o[n]=e})),a=null,s=null,n.emit("slidesInView"))}),{root:e.parentElement,threshold:i}),t.forEach((e=>r.observe(e)))},destroy:function(){r&&r.disconnect(),c=!0},get:function(e=!0){if(e&&a)return a;if(!e&&s)return s;const t=function(e){return Tp(o).reduce(((t,n)=>{const i=parseInt(n),{isIntersecting:r}=o[i];return(e&&r||!e&&!r)&&t.push(i),t}),[])}(e);return e&&(a=t),e||(s=t),t}}}function Gp(e,t,n,i,o,r,a,s,c){const{startEdge:l,endEdge:u,direction:d}=e,m=pp(n);return{groupSlides:function(e){return m?function(e,t){return Sp(e).filter((e=>e%t==0)).map((n=>e.slice(n,n+t)))}(e,n):function(e){return e.length?Sp(e).reduce(((n,m,h)=>{const f=wp(n)||0,p=0===f,g=m===Ep(e),v=o[l]-r[f][l],C=o[l]-r[m][u],y=!i&&p?d(a):0,b=yp(C-(!i&&g?d(s):0)-(v+y));return h&&b>t+c&&n.push(m),g&&n.push(e.length),n}),[]).map(((t,n,i)=>{const o=Math.max(i[n-1]||0);return e.slice(o,t)})):[]}(e)}}}function Yp(e,t,n,i,o,r,a){const{align:s,axis:c,direction:l,startIndex:u,loop:d,duration:m,dragFree:h,dragThreshold:f,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:C,watchResize:y,watchSlides:b,watchDrag:A,watchFocus:S}=r,w={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:i,offsetHeight:o}=e;return{top:t,right:n+i,bottom:t+o,left:n,width:i,height:o}}},E=w.measure(t),x=n.map(w.measure),D=function(e,t){const n="rtl"===t,i="y"===e,o=!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*o}}}(c,l),T=D.measureSize(E),B=function(e){return{measure:function(t){return e*(t/100)}}}(T),I=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,o){return gp(e)?n[e](i):e(t,i,o)}}}(s,T),k=!d&&!!C,O=d||!!C,{slideSizes:L,slideSizesWithGaps:P,startGap:_,endGap:R}=function(e,t,n,i,o,r){const{measureSize:a,startEdge:s,endEdge:c}=e,l=n[0]&&o,u=function(){if(!l)return 0;const e=n[0];return yp(t[s]-e[s])}(),d=function(){if(!l)return 0;const e=r.getComputedStyle(wp(i));return parseFloat(e.getPropertyValue(`margin-${c}`))}(),m=n.map(a),h=n.map(((e,t,n)=>{const i=!t,o=xp(n,t);return i?m[t]+u:o?m[t]+d:n[t+1][s]-e[s]})).map(yp);return{slideSizes:m,slideSizesWithGaps:h,startGap:u,endGap:d}}(D,E,x,n,O,o),F=Gp(D,T,g,d,E,x,_,R,2),{snaps:N,snapsAligned:M}=function(e,t,n,i,o){const{startEdge:r,endEdge:a}=e,{groupSlides:s}=o,c=s(i).map((e=>wp(e)[a]-e[0][r])).map(yp).map(t.measure),l=i.map((e=>n[r]-e[r])).map((e=>-yp(e))),u=s(l).map((e=>e[0])).map(((e,t)=>e+c[t]));return{snaps:l,snapsAligned:u}}(D,I,E,x,F),V=-wp(N)+wp(P),{snapsContained:W,scrollContainLimit:z}=function(e,t,n,i,o){const r=Lp(-t+e,0),a=n.map(((e,t)=>{const{min:i,max:o}=r,a=r.constrain(e),s=!t,l=xp(n,t);return s?o:l||c(i,a)?i:c(o,a)?o:a})).map((e=>parseFloat(e.toFixed(3)))),s=function(){const e=a[0],t=wp(a);return Lp(a.lastIndexOf(e),a.indexOf(t)+1)}();function c(e,t){return Ap(e,t)<1}return{snapsContained:function(){if(t<=e+o)return[r.max];if("keepSnaps"===i)return a;const{min:n,max:c}=s;return a.slice(n,c)}(),scrollContainLimit:s}}(T,V,M,C,2),j=k?W:M,{limit:H}=function(e,t,n){const i=t[0];return{limit:Lp(n?i-e:wp(t),i)}}(V,j,d),U=Pp(Ep(j),u,d),Z=U.clone(),G=Sp(n),Y=Op(i,o,(e=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:i}},o)=>{i||n.constrain(e.pointerDown()),t.seek(o)})(se,e)),(e=>(({scrollBody:e,translate:t,location:n,offsetLocation:i,scrollLooper:o,slideLooper:r,dragHandler:a,animation:s,eventHandler:c,scrollBounds:l,options:{loop:u}},d)=>{const m=e.settled(),h=!l.shouldConstrain(),f=u?m:m&&h;f&&!a.pointerDown()&&(s.stop(),c.emit("settle")),f||c.emit("scroll");const p=n.get()*d+q.get()*(1-d);i.set(p),u&&(o.loop(e.direction()),r.loop()),t.to(i.get())})(se,e))),Q=j[U.get()],X=zp(Q),q=zp(Q),K=zp(Q),J=zp(Q),$=function(e,t,n,i,o,r){let a=0,s=0,c=o,l=r,u=e.get(),d=0;function m(e){return c=e,f}function h(e){return l=e,f}const f={direction:function(){return s},duration:function(){return c},velocity:function(){return a},seek:function(t){const o=t/1e3,r=c*o,m=i.get()-e.get();let h=0;return c?(n.set(e),a+=m/r,a*=l,u+=a,e.add(a*o),h=u-d):(a=0,n.set(i),e.set(i),h=m),s=bp(h),d=u,f},settled:function(){return yp(i.get()-t.get())<.001},useBaseFriction:function(){return h(r)},useBaseDuration:function(){return m(o)},useFriction:h,useDuration:m};return f}(X,K,q,J,m,.68),ee=Vp(d,j,V,H,J),te=function(e,t,n,i,o,r,a){function s(o){const s=o.distance,c=o.index!==t.get();r.add(s),s&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),c&&(n.set(t.get()),t.set(o.index),a.emit("select"))}return{distance:function(e,t){s(o.byDistance(e,t))},index:function(e,n){const i=t.clone().set(e);s(o.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=kp(),oe=Zp(t,n,a,p),{slideRegistry:re}=function(e,t,n,i,o,r){const{groupSlides:a}=o,{min:s,max:c}=i;return{slideRegistry:function(){const i=a(r),o=!e||"keepSnaps"===t;return 1===n.length?[r]:o?i:i.slice(s,c).map(((e,t,n)=>{const i=!t,o=xp(n,t);return i?Dp(wp(n[0])+1):o?Dp(Ep(r)-wp(n)[0]+1,wp(n)[0]):e}))}()}}(k,C,j,z,F,G),ae=Wp(e,n,re,te,$,ie,a,S),se={ownerDocument:i,ownerWindow:o,eventHandler:a,containerRect:E,slideRects:x,animation:Y,axis:D,dragHandler:_p(D,e,i,o,J,Rp(D,o),X,Y,te,$,ee,U,a,B,h,f,v,.68,A),eventStore:ie,percentOfView:B,index:U,indexPrevious:Z,limit:H,location:X,offsetLocation:K,previousLocation:q,options:r,resizeHandler:Fp(t,a,o,n,D,y,w),scrollBody:$,scrollBounds:Np(H,K,J,$,B),scrollLooper:Mp(V,H,K,[X,K,q,J]),scrollProgress:ne,scrollSnapList:j.map(ne.get),scrollSnaps:j,scrollTarget:ee,scrollTo:te,slideLooper:Hp(D,T,V,L,P,N,j,K,n),slideFocus:ae,slidesHandler:Up(t,a,b),slidesInView:oe,slideIndexes:G,slideRegistry:re,slidesToScroll:F,target:J,translate:jp(D,t)};return se}const Qp={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 Xp(e){function t(e,t){return Bp(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const i=n.breakpoints||{},o=Tp(i).filter((t=>e.matchMedia(t).matches)).map((e=>i[e])).reduce(((e,n)=>t(e,n)),{});return t(n,o)},optionsMediaQueries:function(t){return t.map((e=>Tp(e.breakpoints||{}))).reduce(((e,t)=>e.concat(t)),[]).map(e.matchMedia)}};return n}function qp(e,t,n){const i=e.ownerDocument,o=i.defaultView,r=Xp(o),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()))}}}(r),s=kp(),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,o){return t[e]=n(e).filter((e=>e!==o)),i},on:function(e,o){return t[e]=n(e).concat([o]),i},clear:function(){t={}}};return i}(),{mergeOptions:l,optionsAtMedia:u,optionsMediaQueries:d}=r,{on:m,off:h,emit:f}=c,p=D;let g,v,C,y,b=!1,A=l(Qp,qp.globalOptions),S=l(A),w=[];function E(t){const n=Yp(e,C,y,i,o,t,c);if(t.loop&&!n.slideLooper.canLoop()){return E(Object.assign({},t,{loop:!1}))}return n}function x(t,n){b||(A=l(A,t),S=u(A),w=n||w,function(){const{container:t,slides:n}=S,i=gp(t)?e.querySelector(t):t;C=i||e.children[0];const o=gp(n)?C.querySelectorAll(n):n;y=[].slice.call(o||C.children)}(),g=E(S),d([A,...w.map((({options:e})=>e))]).forEach((e=>s.add(e,"change",D))),S.active&&(g.translate.to(g.location.get()),g.animation.init(),g.slidesInView.init(),g.slideFocus.init(k),g.eventHandler.init(k),g.resizeHandler.init(k),g.slidesHandler.init(k),g.options.loop&&g.slideLooper.loop(),C.offsetParent&&y.length&&g.dragHandler.init(k),v=a.init(k,w)))}function D(e,t){const n=I();T(),x(l({startIndex:n},e),t),c.emit("reInit")}function T(){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 B(e,t,n){S.active&&!b&&(g.scrollBody.useBaseFriction().useDuration(!0===t?0:S.duration),g.scrollTo.index(e,n||0))}function I(){return g.index.get()}const k={canScrollNext:function(){return g.index.add(1).get()!==I()},canScrollPrev:function(){return g.index.add(-1).get()!==I()},containerNode:function(){return C},internalEngine:function(){return g},destroy:function(){b||(b=!0,s.clear(),T(),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){B(g.index.add(1).get(),e,-1)},scrollPrev:function(e){B(g.index.add(-1).get(),e,1)},scrollProgress:function(){return g.scrollProgress.get(g.location.get())},scrollSnapList:function(){return g.scrollSnapList},scrollTo:B,selectedScrollSnap:I,slideNodes:function(){return y},slidesInView:function(){return g.slidesInView.get()},slidesNotInView:function(){return g.slidesInView.get(!1)}};return x(t,n),setTimeout((()=>c.emit("init")),0),k}function Kp(e={},t=[]){const n=Object(ro.useRef)(e),i=Object(ro.useRef)(t),[o,r]=Object(ro.useState)(),[a,s]=Object(ro.useState)(),c=Object(ro.useCallback)((()=>{o&&o.reInit(n.current,i.current)}),[o]);return Object(ro.useEffect)((()=>{hp(n.current,e)||(n.current=e,c())}),[e,c]),Object(ro.useEffect)((()=>{(function(e,t){if(e.length!==t.length)return!1;const n=fp(e),i=fp(t);return n.every(((e,t)=>hp(e,i[t])))})(i.current,t)||(i.current=t,c())}),[t,c]),Object(ro.useEffect)((()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){qp.globalOptions=Kp.globalOptions;const e=qp(a,n.current,i.current);return r(e),()=>e.destroy()}r(void 0)}),[a,r]),[s,o]}qp.globalOptions=void 0,Kp.globalOptions=void 0;function Jp(e){var t,n,i;const o=Object(ro.useMemo)((()=>{var t;return null!==(t=e.currentPosition)&&void 0!==t?t:0}),[]),r={duration:20,startIndex:o},[a,s]=Kp(r);Object(ro.useEffect)((()=>{s&&s.on("select",(()=>{e.onGoToPage(null==s?void 0:s.selectedScrollSnap())}))}),[s]),Object(ro.useEffect)((()=>{s&&(e.buttonsEnabled?s.reInit({watchDrag:!0}):s.reInit({watchDrag:!1}))}),[e.buttonsEnabled]);const c=op();return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{sx:{flexGrow:1,backgroundColor:uo.b.getColorValue(e.configuration.screens.review.backgroundColor),width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"32px"}},ro.default.createElement(lp,{config:e.configuration.screens.review.switchPreviousPageButton,icon:lo.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition-1),active:e.currentPosition>0,debugName:"carousel-back"}),ro.default.createElement("div",{className:"embla",ref:a,style:{overflow:"hidden",width:"100%",height:"100%"}},ro.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)=>ro.default.createElement("div",{className:"embla__slide",key:t.id,style:{position:"relative",minWidth:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0"}},ro.default.createElement(dp,{page:t,animateRotation:t.id===e.currentlyRotatingPageId,onAnimateRotationDone:e.onRotationAnimationDone,index:n+1,style:{maxHeight:`calc(100 * ${mo} - ${50+c+72+32}px)`,maxWidth:"100%"}})))))),ro.default.createElement(lp,{config:e.configuration.screens.review.switchNextPageButton,icon:lo.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 $p=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 eg(e){var t,n,i,o,r,a;const s=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),[c,l]=ro.default.useState(!1);Object(ro.useEffect)((()=>{e.visible&&!e.configuration.screens.review.enabled&&e.onSubmit()}),[e.visible]),Object(ro.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[u,d]=Object(ro.useState)(!0),[m,h]=Object(ro.useState)(null),f=Object(ro.useRef)(null),[p,g]=Object(ro.useState)(!1),[v,C]=Object(ro.useState)(!1);return Object(ro.useEffect)((()=>{d(!p&&!v)}),[p,v]),e.visible?ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(cp,{open:c}),ro.default.createElement(rf,{open:p,config:e.configuration.screens.review.deletePageAlertDialog,onCancelClick:()=>g(!1),onActionClick:()=>{g(!1),e.onRetakeImage(e.currentPosition)},onOkClick:()=>$p(this,void 0,void 0,(function*(){var t,n,i;l(!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),l(!1),g(!1)}))}),ro.default.createElement(rf,{open:v,config:e.configuration.screens.review.deleteAllPagesAlertDialog,onCancelClick:()=>C(!1),onOkClick:()=>$p(this,void 0,void 0,(function*(){var t;l(!0),yield null===(t=e.document)||void 0===t?void 0:t.deleteAllPages(),l(!1),C(!1)}))}),ro.default.createElement(co.Box,{"data-sb-screen-review":!0,display:e.visible?"flex":"none",style:{position:"absolute",width:"100vw",height:`calc(100 * ${mo})`,flexDirection:"column",alignItems:"center",justifyContent:"center"}},ro.default.createElement(tp,{config:e.configuration,numPages:null===(o=null===(i=e.document)||void 0===i?void 0:i.pages)||void 0===o?void 0:o.length,onCloseButtonClick:e.onClose,onDeleteButtonClick:()=>C(!0),buttonsEnabled:u}),ro.default.createElement(Jp,{buttonsEnabled:u,document:e.document,currentPosition:e.currentPosition,onGoToPage:e.onGoToPage,configuration:e.configuration,onRotationAnimationDone:f,currentlyRotatingPageId:m}),ro.default.createElement(ap,{config:e.configuration.screens.review,currentPage:e.currentPosition+1,totalNumPages:null===(a=null===(r=e.document)||void 0===r?void 0:r.pages)||void 0===a?void 0:a.length,onZoomButtonClick:()=>e.onZoomButtonClick(e.currentPosition)}),ro.default.createElement(rp,{config:e.configuration,onSubmitClick:e.onSubmit,onAddPageClick:()=>{e.onInsertImage(e.currentPosition+1)},onRetakeClick:()=>e.onRetakeImage(e.currentPosition),onCropClick:()=>e.onCropButtonClick(e.currentPosition),onRotateClick:()=>$p(this,void 0,void 0,(function*(){var t,n;if(null!==f.current)return;d(!1),l(!0);const i=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),o=new Promise((e=>{f.current=e,h(i.id)})),r=null===(n=e.document)||void 0===n?void 0:n.cropAndRotatePage(i,null,1);yield Promise.all([o,r]),yield i.finalImageUrl(),f.current=null,h(null),d(!0),l(!1)})),onDeleteClick:()=>g(!0),buttonsEnabled:u}))):null}var tg=function(e,t){return Number(e.toFixed(t))},ng=function(e,t,n){n&&"function"==typeof n&&n(e,t)},ig={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}},og=function(e){"number"==typeof e&&cancelAnimationFrame(e)},rg=function(e){e.mounted&&(og(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function ag(e,t,n,i){if(e.mounted){var o=(new Date).getTime();rg(e),e.animation=function(){if(!e.mounted)return og(e.animation);var r=(new Date).getTime()-o,a=(0,ig[t])(r/n);r>=n?(i(1),e.animation=null):e.animation&&(i(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function sg(e,t,n,i){var o=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&&o){var r=e.setTransformState,a=e.transformState,s=a.scale,c=a.positionX,l=a.positionY,u=t.scale-s,d=t.positionX-c,m=t.positionY-l;0===n?r(t.scale,t.positionX,t.positionY):ag(e,i,n,(function(e){r(s+u*e,c+d*e,l+m*e)}))}}var cg=function(e,t){var n=e.wrapperComponent,i=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!i)throw new Error("Components are not mounted");var r=function(e,t,n){var i=e.offsetWidth,o=e.offsetHeight,r=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:i,wrapperHeight:o,newContentWidth:r,newDiffWidth:i-r,newContentHeight:a,newDiffHeight:o-a}}(n,i,t),a=r.wrapperWidth,s=r.wrapperHeight,c=function(e,t,n,i,o,r,a){var s=e>t?n*(a?1:.5):0,c=i>o?r*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:i-o-c,maxPositionY:c}}(a,r.newContentWidth,r.newDiffWidth,s,r.newContentHeight,r.newDiffHeight,Boolean(o));return c},lg=function(e,t,n,i){return tg(i?e<t?t:e>n?n:e:e,2)},ug=function(e,t){var n=cg(e,t);return e.bounds=n,n};function dg(e,t,n,i,o,r,a){var s=n.minPositionX,c=n.minPositionY,l=n.maxPositionX,u=n.maxPositionY,d=0,m=0;return a&&(d=o,m=r),{x:lg(e,s-d,l+d,i),y:lg(t,c-m,u+m,i)}}function mg(e,t,n,i,o,r){var a=e.transformState,s=a.scale,c=a.positionX,l=a.positionY,u=i-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:c,y:l}):dg(c-t*u,l-n*u,o,r,0,0,null)}function hg(e,t,n,i,o){var r=t-(o?i:0);return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=r?r:e}var fg=function(e,t){var n=e.setup.panning.excluded,i=e.isInitialized,o=e.wrapperComponent,r=t.target,a="shadowRoot"in r&&"composedPath"in t?t.composedPath().some((function(e){return e instanceof Element&&(null==o?void 0:o.contains(e))})):null==o?void 0:o.contains(r);return!!(i&&r&&a)&&!Yg(r,n)},pg=function(e){var t=e.isInitialized,n=e.isPanning,i=e.setup.panning.disabled;return!(!t||!n||i)};function gg(e,t,n,i,o){var r=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,c=e.transformState,l=c.scale,u=c.positionX,d=c.positionY;if(null!==a&&null!==s&&(t!==u||n!==d)){var m=dg(t,n,s,r,i,o,a),h=m.x,f=m.y;e.setTransformState(l,h,f)}}var vg=function(e,t){var n=e.setup,i=e.transformState.scale,o=n.minScale,r=n.disablePadding;return t>0&&i>=o&&!r?t:0};function Cg(e,t,n,i,o,r,a,s,c,l){if(o){var u;if(t>a&&n>a)return(u=a+(e-a)*l)>c?c:u<a?a:u;if(t<r&&n<r)return(u=r+(e-r)*l)<s?s:u>r?r:u}return i?t:lg(e,r,a,o)}function yg(e,t){var n=function(e){var t=e.mounted,n=e.setup,i=n.disabled,o=n.velocityAnimation,r=e.transformState.scale;return!(o.disabled&&!(r>1)&&i&&!t)}(e);if(n){var i=e.lastMousePosition,o=e.velocityTime,r=e.setup,a=e.wrapperComponent,s=r.velocityAnimation.equalToMove,c=Date.now();if(i&&o&&a){var l=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-i.x,d=t.y-i.y,m=u/l,h=d/l,f=c-o,p=u*u+d*d,g=Math.sqrt(p)/f;e.velocity={velocityX:m,velocityY:h,total:g}}e.lastMousePosition=t,e.velocityTime=c}}function bg(e,t){var n=e.transformState.scale;rg(e),ug(e,n),void 0!==window.TouchEvent&&t instanceof TouchEvent?function(e,t){var n=t.touches,i=e.transformState,o=i.positionX,r=i.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-r}}}(e,t):function(e,t){var n=e.transformState,i=n.positionX,o=n.positionY;e.isPanning=!0;var r=t.clientX,a=t.clientY;e.startCoords={x:r-i,y:a-o}}(e,t)}function Ag(e){var t=e.transformState.scale,n=e.setup,i=n.minScale,o=n.alignmentAnimation,r=o.disabled,a=o.sizeX,s=o.sizeY,c=o.animationTime,l=o.animationType;if(!(r||t<i||!a&&!s)){var u=function(e){var t=e.transformState,n=t.positionX,i=t.positionY,o=t.scale,r=e.setup,a=r.disabled,s=r.limitToBounds,c=r.centerZoomedOut,l=e.wrapperComponent;if(!a&&l&&e.bounds){var u=e.bounds,d=u.maxPositionX,m=u.minPositionX,h=u.maxPositionY,f=u.minPositionY,p=n>d||n<m,g=i>h||i<f,v=mg(e,n>d?l.offsetWidth:e.setup.minPositionX||0,i>h?l.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||c),C=v.x,y=v.y;return{scale:o,positionX:p?C:n,positionY:g?y:i}}}(e);u&&sg(e,u,c,l)}}function Sg(e,t,n){var i=e.startCoords,o=e.setup.alignmentAnimation,r=o.sizeX,a=o.sizeY;if(i){var s=function(e,t,n){var i=e.startCoords,o=e.transformState,r=e.setup.panning,a=r.lockAxisX,s=r.lockAxisY,c=o.positionX,l=o.positionY;if(!i)return{x:c,y:l};var u=t-i.x,d=n-i.y;return{x:a?c:u,y:s?l:d}}(e,t,n),c=s.x,l=s.y,u=vg(e,r),d=vg(e,a);yg(e,{x:c,y:l}),gg(e,c,l,u,d)}}function wg(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,i=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var r=null==i?void 0:i.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==r?void 0:r.width)||0,c=(null==r?void 0:r.height)||0,l=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s<l||c<u;!t&&n&&(null==n?void 0:n.total)>.1&&d?function(e){var t=e.velocity,n=e.bounds,i=e.setup,o=e.wrapperComponent,r=function(e){var t=e.mounted,n=e.velocity,i=e.bounds,o=e.setup,r=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&r&&!t||!n||!i)}(e);if(r&&t&&n&&o){var a=t.velocityX,s=t.velocityY,c=t.total,l=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,m=n.minPositionY,h=i.limitToBounds,f=i.alignmentAnimation,p=i.zoomAnimation,g=i.panning,v=g.lockAxisY,C=g.lockAxisX,y=p.animationType,b=f.sizeX,A=f.sizeY,S=f.velocityAlignmentTime,w=function(e,t){var n=e.setup.velocityAnimation,i=n.equalToMove,o=n.animationTime,r=n.sensitivity;return i?o*t*r:o}(e,c),E=Math.max(w,S),x=vg(e,b),D=vg(e,A),T=x*o.offsetWidth/100,B=D*o.offsetHeight/100,I=l+T,k=u-T,O=d+B,L=m-B,P=e.transformState,_=(new Date).getTime();ag(e,y,E,(function(t){var n=e.transformState,i=n.scale,o=n.positionX,r=n.positionY,c=((new Date).getTime()-_)/S,p=1-(0,ig[f.animationType])(Math.min(1,c)),g=1-t,y=o+a*g,b=r+s*g,A=Cg(y,P.positionX,o,C,h,u,l,k,I,p),w=Cg(b,P.positionY,r,v,h,m,d,L,O,p);o===y&&r===b||e.setTransformState(i,A,w)}))}}(e):Ag(e)}}function Eg(e,t,n,i){var o=e.setup,r=o.minScale,a=o.maxScale,s=o.limitToBounds,c=hg(tg(t,2),r,a,0,!1),l=mg(e,n,i,c,ug(e,c),s);return{scale:c,positionX:l.x,positionY:l.y}}function xg(e,t,n){var i=e.transformState.scale,o=e.wrapperComponent,r=e.setup,a=r.minScale,s=r.limitToBounds,c=r.zoomAnimation,l=c.disabled,u=c.animationTime,d=c.animationType,m=l||i>=a;if((i>=1||s)&&Ag(e),!m&&o&&e.mounted){var h=Eg(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);h&&sg(e,h,u,d)}}var Dg=function(){return Dg=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Dg.apply(this,arguments)};function Tg(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}var Bg=1,Ig=0,kg=0,Og={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}},Lg=function(e){var t,n,i,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:Bg,scale:null!==(n=e.initialScale)&&void 0!==n?n:Bg,positionX:null!==(i=e.initialPositionX)&&void 0!==i?i:Ig,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:kg}},Pg=function(e){var t=Dg({},Og);return Object.keys(e).forEach((function(n){var i="undefined"!=typeof e[n];if("undefined"!=typeof Og[n]&&i){var o=Object.prototype.toString.call(Og[n]),r="[object Object]"===o,a="[object Array]"===o;t[n]=r?Dg(Dg({},Og[n]),e[n]):a?Tg(Tg([],Og[n],!0),e[n],!0):e[n]}})),t},_g=function(e,t,n){var i=e.transformState.scale,o=e.wrapperComponent,r=e.setup,a=r.maxScale,s=r.minScale,c=r.zoomAnimation,l=r.smooth,u=c.size;if(!o)throw new Error("Wrapper is not mounted");var d=l?i*Math.exp(t*n):i+t*n;return hg(tg(d,3),s,a,u,!1)};function Rg(e,t,n,i,o){var r=e.wrapperComponent,a=e.transformState,s=a.scale,c=a.positionX,l=a.positionY;if(!r)return console.error("No WrapperComponent found");var u=(r.offsetWidth/2-c)/s,d=(r.offsetHeight/2-l)/s,m=Eg(e,_g(e,t,n),u,d);if(!m)return console.error("Error during zoom event. New transformation state was not calculated.");sg(e,m,i,o)}function Fg(e,t,n,i){var o=e.setup,r=e.wrapperComponent,a=o.limitToBounds,s=Lg(e.props),c=e.transformState,l=c.scale,u=c.positionX,d=c.positionY;if(r){var m=cg(e,s.scale),h=dg(s.positionX,s.positionY,m,a,0,0,r),f={scale:s.scale,positionX:h.x,positionY:h.y};l===s.scale&&u===s.positionX&&d===s.positionY||(null==i||i(),sg(e,f,t,n))}}var Ng=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Rg(e,1,t,n,i)}},Mg=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Rg(e,-1,t,n,i)}},Vg=function(e){return function(t,n,i,o,r){void 0===o&&(o=300),void 0===r&&(r="easeOut");var a=e.transformState,s=a.positionX,c=a.positionY,l=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var m={positionX:Number.isNaN(t)?s:t,positionY:Number.isNaN(n)?c:n,scale:Number.isNaN(i)?l:i};sg(e,m,o,r)}}},Wg=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),Fg(e,t,n)}},zg=function(e){return function(t,n,i){void 0===n&&(n=200),void 0===i&&(i="easeOut");var o=e.transformState,r=e.wrapperComponent,a=e.contentComponent;if(r&&a){var s=Xg(t||o.scale,r,a);sg(e,s,n,i)}}},jg=function(e){return function(t,n,i,o){void 0===i&&(i=600),void 0===o&&(o="easeOut"),rg(e);var r=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(r&&a&&r.contains(a)){var s=function(e,t,n){var i=e.wrapperComponent,o=e.contentComponent,r=e.transformState,a=e.setup,s=a.limitToBounds,c=a.minScale,l=a.maxScale;if(!i||!o)return r;var u,d,m,h,f,p,g,v,C=i.getBoundingClientRect(),y=t.getBoundingClientRect(),b=(u=i,d=o,m=r,h=t.getBoundingClientRect(),f=u.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=y.width/r.scale,E=y.height/r.scale,x=i.offsetWidth/w,D=i.offsetHeight/E,T=hg(n||Math.min(x,D),c,l,0,!1),B=(C.width-w*T)/2,I=(C.height-E*T)/2,k=dg((C.left-A)*T+B,(C.top-S)*T+I,cg(e,T),s,0,0,i);return{positionX:k.x,positionY:k.y,scale:T}}(e,a,n);sg(e,s,i,o)}}},Hg=function(e){return{instance:e,zoomIn:Ng(e),zoomOut:Mg(e),setTransform:Vg(e),resetTransform:Wg(e),centerView:zg(e),zoomToElement:jg(e)}},Ug=function(e){return{instance:e,state:e.transformState}},Zg=function(e){var t={};return Object.assign(t,Ug(e)),Object.assign(t,Hg(e)),t};function Gg(){try{return{get passive(){return!0,!1}}}catch(e){return!1}}var Yg=function(e,t){return t.some((function(t){return e.matches("".concat(t,", .").concat(t,", ").concat(t," *, .").concat(t," *"))}))},Qg=function(e){e&&clearTimeout(e)},Xg=function(e,t,n){var i=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-i)/2,positionY:(t.offsetHeight-o)/2}};function qg(e,t,n){var i=t.getBoundingClientRect(),o=0,r=0;if("clientX"in e)o=(e.clientX-i.left)/n,r=(e.clientY-i.top)/n;else{var a=e.touches[0];o=(a.clientX-i.left)/n,r=(a.clientY-i.top)/n}return(Number.isNaN(o)||Number.isNaN(r))&&console.error("No mouse or touch offset found"),{x:o,y:r}}var Kg=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))},Jg=function(e,t){var n=e.props,i=n.onWheel,o=n.onZoom,r=e.contentComponent,a=e.setup,s=e.transformState.scale,c=a.limitToBounds,l=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,m=a.disablePadding,h=a.smooth,f=u.size,p=u.disabled,g=d.step,v=d.smoothStep;if(!r)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var C=function(e,t){var n,i,o=function(e){return e?e.deltaY<0?1:-1:0}(e);return i=o,"number"==typeof(n=t)?n:i}(t,null),y=function(e,t,n,i,o){var r=e.transformState.scale,a=e.wrapperComponent,s=e.setup,c=s.maxScale,l=s.minScale,u=s.zoomAnimation,d=s.disablePadding,m=u.size,h=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=r+t*n;if(o)return f;var p=!i&&!h;return hg(tg(f,3),l,c,m,p&&!d)}(e,C,h?v*Math.abs(t.deltaY):g,!t.ctrlKey);if(s!==y){var b=ug(e,y),A=qg(t,r,s),S=c&&(p||0===f||l||m),w=mg(e,A.x,A.y,y,b,S),E=w.x,x=w.y;e.previousWheelEvent=t,e.setTransformState(y,E,x),ng(Zg(e),t,i),ng(Zg(e),t,o)}},$g=function(e,t){var n=e.props,i=n.onWheelStop,o=n.onZoomStop;Qg(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(xg(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var r=function(e,t){var n=e.previousWheelEvent,i=e.transformState.scale,o=e.setup,r=o.maxScale,a=o.minScale;return!!n&&(i<r||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);r&&(Qg(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,ng(Zg(e),t,i),ng(Zg(e),t,o))}),160))},ev=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}},tv=function(e,t){var n=e.contentComponent,i=e.pinchStartDistance,o=e.wrapperComponent,r=e.transformState.scale,a=e.setup,s=a.limitToBounds,c=a.centerZoomedOut,l=a.zoomAnimation,u=a.alignmentAnimation,d=l.disabled,m=l.size;if(null!==i&&n){var h=function(e,t,n){var i=n.getBoundingClientRect(),o=e.touches,r=tg(o[0].clientX-i.left,5),a=tg(o[0].clientY-i.top,5);return{x:(r+tg(o[1].clientX-i.left,5))/2/t,y:(a+tg(o[1].clientY-i.top,5))/2/t}}(t,r,n);if(Number.isFinite(h.x)&&Number.isFinite(h.y)){var f=Kg(t),p=function(e,t){var n=e.pinchStartScale,i=e.pinchStartDistance,o=e.setup,r=o.maxScale,a=o.minScale,s=o.zoomAnimation,c=o.disablePadding,l=s.size,u=s.disabled;if(!n||null===i||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:hg(tg(t/i*n,2),a,r,l,!u&&!c)}(e,f),g=ev(t),v=g.x-(e.pinchLastCenterX||0),C=g.y-(e.pinchLastCenterY||0);if(p!==r||0!==v||0!==C){e.pinchLastCenterX=g.x,e.pinchLastCenterY=g.y;var y=ug(e,p),b=s&&(d||0===m||c),A=mg(e,h.x,h.y,p,y,b),S=A.x,w=A.y;e.pinchMidpoint=h,e.lastDistance=f;var E=u.sizeX,x=u.sizeY,D=dg(S+v,w+C,y,s,vg(e,E),vg(e,x),o),T=D.x,B=D.y;e.setTransformState(p,T,B)}}}},nv=function(e,t){var n=e.props.onZoomStop,i=e.setup.doubleClick.animationTime;Qg(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout((function(){e.doubleClickStopEventTimer=null,ng(Zg(e),t,n)}),i)};function iv(e,t){var n=e.setup,i=e.doubleClickStopEventTimer,o=e.transformState,r=e.contentComponent,a=o.scale,s=e.props,c=s.onZoomStart,l=s.onZoom,u=n.doubleClick,d=u.disabled,m=u.mode,h=u.step,f=u.animationTime,p=u.animationType;if(!d&&!i){if("reset"===m)return function(e,t){var n=e.props,i=n.onZoomStart,o=n.onZoom,r=e.setup.doubleClick,a=r.animationTime,s=r.animationType;ng(Zg(e),t,i),Fg(e,a,s,(function(){return ng(Zg(e),t,o)})),nv(e,t)}(e,t);if(!r)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=_g(e,g,h);if(a!==v){ng(Zg(e),t,c);var C=qg(t,r,a),y=Eg(e,v,C.x,C.y);if(!y)return console.error("Error during zoom event. New transformation state was not calculated.");ng(Zg(e),t,l),sg(e,y,f,p),nv(e,t)}}}var ov=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,ug(t,t.transformState.scale),t.setup=Pg(e)},this.initializeWindowEvents=function(){var e,n,i=Gg(),o=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==o?void 0:o.defaultView;null===(n=t.wrapperComponent)||void 0===n||n.addEventListener("wheel",t.onWheelPanning,i),null==r||r.addEventListener("mousedown",t.onPanningStart,i),null==r||r.addEventListener("mousemove",t.onPanning,i),null==r||r.addEventListener("mouseup",t.onPanningStop,i),null==o||o.addEventListener("mouseleave",t.clearPanning,i),null==r||r.addEventListener("keyup",t.setKeyUnPressed,i),null==r||r.addEventListener("keydown",t.setKeyPressed,i)},this.cleanupWindowEvents=function(){var e,n,i=Gg(),o=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==o?void 0:o.defaultView;null==r||r.removeEventListener("mousedown",t.onPanningStart,i),null==r||r.removeEventListener("mousemove",t.onPanning,i),null==r||r.removeEventListener("mouseup",t.onPanningStop,i),null==o||o.removeEventListener("mouseleave",t.clearPanning,i),null==r||r.removeEventListener("keyup",t.setKeyUnPressed,i),null==r||r.removeEventListener("keydown",t.setKeyPressed,i),document.removeEventListener("mouseleave",t.clearPanning,i),rg(t),null===(n=t.observer)||void 0===n||n.disconnect()},this.handleInitializeWrapperEvents=function(e){var n=Gg();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(Zg(t))})),n&&(t.setCenter(),t.observer=new ResizeObserver((function(){var n,i=e.offsetWidth,o=e.offsetHeight;(i>0||o>0)&&(t.onInitCallbacks.forEach((function(e){return e(Zg(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,o=n.wheelDisabled,r=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,c=e.isPanning,l=t.target;return!(!s||c||i||!l||o&&!t.ctrlKey||r&&t.ctrlKey||Yg(l,a))}(t,e);n&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(function(e,t){var n=e.props,i=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(rg(e),ng(Zg(e),t,i),ng(Zg(e),t,o))}(t,e),Jg(t,e),$g(t,e))}},this.onWheelPanning=function(e){var n=t.setup,i=n.disabled,o=n.wheel,r=n.panning;if(t.wrapperComponent&&t.contentComponent&&!i&&o.wheelDisabled&&!r.disabled&&r.wheelPanning&&!e.ctrlKey){e.preventDefault(),e.stopPropagation();var a=t.transformState,s=a.positionX,c=a.positionY,l=s-e.deltaX,u=c-e.deltaY,d=r.lockAxisX?s:l,m=r.lockAxisY?c:u,h=t.setup.alignmentAnimation,f=h.sizeX,p=h.sizeY,g=vg(t,f),v=vg(t,p);d===s&&m===c||gg(t,d,m,g,v)}},this.onPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;n||fg(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(),rg(t),bg(t,e),ng(Zg(t),e,i))},this.onPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;n||pg(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Sg(t,e.clientX,e.clientY),ng(Zg(t),e,i))},this.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(wg(t),ng(Zg(t),e,n))},this.onPinchStart=function(e){var n=t.setup.disabled,i=t.props,o=i.onPinchingStart,r=i.onZoomStart;if(!n){var a=function(e,t){var n=e.setup.pinch,i=n.disabled,o=n.excluded,r=e.isInitialized,a=t.target;return!(!r||i||!a||Yg(a,o))}(t,e);a&&(function(e,t){var n=Kg(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1;var i=ev(t);e.pinchLastCenterX=i.x,e.pinchLastCenterY=i.y,rg(e)}(t,e),rg(t),ng(Zg(t),e,o),ng(Zg(t),e,r))}},this.onPinch=function(e){var n=t.setup.disabled,i=t.props,o=i.onPinching,r=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(),tv(t,e),ng(Zg(t),e,o),ng(Zg(t),e,r))}},this.onPinchStop=function(e){var n,i,o=t.props,r=o.onPinchingStop,a=o.onZoomStop;t.pinchStartScale&&(i=(n=t).pinchMidpoint,n.velocity=null,n.lastDistance=null,n.pinchMidpoint=null,n.pinchStartScale=null,n.pinchStartDistance=null,xg(n,null==i?void 0:i.x,null==i?void 0:i.y),ng(Zg(t),e,r),ng(Zg(t),e,a))},this.onTouchPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;if(!n&&fg(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,rg(t);var o=e.touches,r=1===o.length,a=2===o.length;r&&(rg(t),bg(t,e),ng(Zg(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(!pg(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];Sg(t,o.clientX,o.clientY),ng(Zg(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,o=e.wrapperComponent,r=i.doubleClick,a=r.disabled,s=r.excluded,c=t.target,l=null==o?void 0:o.contains(c);return!(!(n&&c&&l)||a||Yg(c,s))}(t,e);n&&iv(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 o=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 r=Zg(t);t.onChangeCallbacks.forEach((function(e){return e(r)})),ng(r,{scale:e,positionX:n,positionY:i},o)}},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Xg(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,o=e.positionY,r=t.handleTransformStyles(i,o,n);t.contentComponent.style.transform=r}},this.getContext=function(){return Zg(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,ug(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(n),t.initializeWindowEvents(),t.isInitialized=!0;var i=Zg(t);ng(i,void 0,t.props.onInit)},this.props=e,this.setup=Pg(this.props),this.transformState=Lg(this.props)},rv=ro.default.createContext(null),av=ro.default.forwardRef((function(e,t){var n,i,o=Object(ro.useRef)(new ov(e)).current,r=(n=e.children,i=Hg(o),"function"==typeof n?n(i):n);return Object(ro.useImperativeHandle)(t,(function(){return Hg(o)}),[o]),Object(ro.useEffect)((function(){o.update(e)}),[o,e]),ro.default.createElement(rv.Provider,{value:o},r)}));ro.default.forwardRef((function(e,t){var n,i=Object(ro.useRef)(null),o=Object(ro.useContext)(rv);return Object(ro.useEffect)((function(){return o.onChange((function(e){if(i.current){i.current.style.transform=o.handleTransformStyles(0,0,1/e.instance.transformState.scale)}}))}),[o]),ro.default.createElement("div",Dg({},e,{ref:(n=[i,t],function(e){n.forEach((function(t){"function"==typeof t?t(e):null!=t&&(t.current=e)}))})}))}));var sv="transform-component-module_wrapper__SPB86",cv="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],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.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 lv=function(e){var t=e.children,n=e.wrapperClass,i=void 0===n?"":n,o=e.contentClass,r=void 0===o?"":o,a=e.wrapperStyle,s=e.contentStyle,c=e.wrapperProps,l=void 0===c?{}:c,u=e.contentProps,d=void 0===u?{}:u,m=Object(ro.useContext)(rv),h=m.init,f=m.cleanupWindowEvents,p=Object(ro.useRef)(null),g=Object(ro.useRef)(null);return Object(ro.useEffect)((function(){var e=p.current,t=g.current;return null!==e&&null!==t&&h&&(null==h||h(e,t)),function(){null==f||f()}}),[]),ro.default.createElement("div",Dg({},l,{ref:p,className:"react-transform-wrapper ".concat(sv," ").concat(i),style:a}),ro.default.createElement("div",Dg({},d,{ref:g,className:"react-transform-component ".concat(cv," ").concat(r),style:s}),t))};function uv(e){var t;const n=kh(null===(t=e.page)||void 0===t?void 0:t.finalImageUrl());if(!(e.visible&&n.value))return null;const i=e.config.closeButton;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{style:{touchAction:"none",backgroundColor:uo.b.getColorValue(e.config.overlayColor)}},ro.default.createElement(co.Box,{style:{textAlign:"right",height:"45px",paddingRight:8}},ro.default.createElement(wo,{onClick:e.onCloseButtonClick,visible:i.visible,text:i.text,background:i.background,foreground:i.foreground,ariaLabel:uo.b.getLocalizedText(i.accessibilityDescription),iconPosition:"right",icon:ro.default.createElement(lo.a,{style:{paddingLeft:4}})})),ro.default.createElement(av,{centerOnInit:!0},ro.default.createElement(lv,{wrapperStyle:{width:"100%"},contentStyle:{width:"100%"}},ro.default.createElement(co.Box,{style:{width:"100%",height:`calc(100 *${mo} - 45px)`,display:"flex",justifyContent:"center",alignItems:"center",touchAction:"none"}},ro.default.createElement("img",{src:n.value,alt:"Zoomed image",style:{maxWidth:"100%",maxHeight:"100%"}}))))))}var dv=n(39);class mv{constructor(){this.disabled=!1,this.color="transparent"}}class hv{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20,this.filter=""}}class fv{constructor(){this.color="#1ec31e",this.width=4}}class pv{constructor(){this.padding=10}}class gv{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class vv{constructor(){this.width=2,this.color="white"}}class Cv{constructor(){this.size=20,this.color="white"}}class yv extends dv.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new pv,this.style.magneticLines=new mv,this.style.polygon=new fv,this.style.polygon.handles=new hv,this.style.magnifier=new gv,this.style.magnifier.border=new vv,this.style.magnifier.crosshair=new Cv}static fromJson(e){const t=new yv;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 bv extends ro.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(e){return ro.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},ro.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,o,r;return ro.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===(r=null===(o=null===(i=this.props.lines)||void 0===i?void 0:i.vertical)||void 0===o?void 0:o.scaled)||void 0===r?void 0:r.map((e=>this.fromPoint(e))))}snapToClosestIfAnyAreClose(){var e,t,n,i;const o=this.props.movingLine;let r=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.vertical)||void 0===t?void 0:t.scaled;if(o.isHorizontal&&(r=null===(i=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===i?void 0:i.scaled),!r||0===r.length)return;const a=this.midPoint(o.points[0].coordinates,o.points[1].coordinates),s=r.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:o})}distanceToLine(e,t){const n=t.x-e.start.x,i=t.y-e.start.y,o=e.end.x-e.start.x,r=e.end.y-e.start.y,a=o*o+r*r;if(0===a)return 1/0;const s=(n*o+i*r)/a;let c;return c=s<=0?e.start:s>=1?e.end:new Xd.a(e.start.x+s*o,e.start.y+s*r),Xd.a.distance(t,c)}midPoint(e,t){return new Xd.a((e.x+t.x)/2,(e.y+t.y)/2)}}class Av extends ro.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 Sv extends Av{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=ro.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},ro.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));e.push(i)}return e}cornerTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=Xd.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],o=Xd.a.fromHtmlElement(i);this.parentOffset=new Xd.a(n.x-o.x,n.y-o.y),this.props.cornerMoveStart({index:t,point:this.props.points[t]})}cornerTouchMove(e,t){if(!this.parentOffset)return;const n=Xd.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),{x:i,y:o}=Object(th.b)({x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},this.pointSize,this.props.containerSize),r=this.pointSize/2,a=this.props.points[t];this.props.points[t]=new Xd.a(i+r,o+r),kf.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 ro.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 wv extends Av{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 o=ro.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},ro.default.createElement("div",{style:this.invisibleHandleStyle}));e.push(o)}return e}lineTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=Xd.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],o=Xd.a.fromHtmlElement(i),r=this.props.points[t],a=this.props.points[this.nextIndex(t)];this.point0Start=Wi.copy(this.props.points[this.previousIndex(t)]),this.point1Start=Wi.copy(r),this.point2Start=Wi.copy(a),this.point3Start=Wi.copy(this.props.points[this.nextIndex(this.nextIndex(t))]),this.point1Offset=new Xd.a(r.x-o.x,r.y-o.y),this.point2Offset=new Xd.a(a.x-o.x,a.y-o.y),this.parentOffset=new Xd.a(n.x-o.x,n.y-o.y)}lineTouchMove(e,t){if(!this.parentOffset)return;const n=Xd.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.props.points[this.previousIndex(t)];let o=new Xd.a(null,null),r=new Xd.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;o.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),r.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),o.y=e,r.y=t}else{const e=s+this.point1Offset.x,t=s+this.point2Offset.x,n=e-this.point1Start.x;o.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),r.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),o.x=e,r.x=t}o=Xd.a.clamp(o,this.props.containerSize),r=Xd.a.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,o,i,this.isHorizontal(t)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(t)?"y":"x")||this.areEdgesCrossing(i,o,r,a)||kf.isConvex([i,o,r,a])&&(this.props.points[t].x=o.x,this.props.points[t].y=o.y,this.props.points[this.nextIndex(t)].x=r.x,this.props.points[this.nextIndex(t)].y=r.y,this.props.lineMoved({points:[{index:t,coordinates:o},{index:this.nextIndex(t),coordinates:r}],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 o=e.x,r=e.y,a=t.x,s=t.y,c=n.x,l=n.y,u=i.x,d=i.y;return((o-c)*(s-l)-(r-l)*(a-c))*((o-u)*(s-d)-(r-d)*(a-u))<0&&((c-o)*(d-r)-(l-r)*(u-o))*((c-a)*(d-s)-(l-s)*(u-a))<0}render(){return ro.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class Ev extends ro.default.Component{render(){return ro.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},ro.default.createElement(Sv,{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}),ro.default.createElement(wv,{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]=kf.intersection(t,i),this.props.coordinatePoints[e.polygonLine.points[1].index]=kf.intersection(n,i),this.props.cornerMoveEnd(),this.setFrame()}}class xv extends ro.default.Component{constructor(e){super(e),this.state={movingLine:void 0}}render(){return ro.default.createElement("div",null,ro.default.createElement(Ev,{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})}}),ro.default.createElement(bv,{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()}}),ro.default.createElement(Ef,{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 Dv extends ro.default.Component{render(){return ro.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 Tv extends ro.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:o}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=Ho.b`
|
|
34
|
+
`;return ro.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},ro.default.createElement(e,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),ro.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"}),ro.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"}),ro.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 wm extends ro.default.Component{render(){return this.props.text?ro.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},ro.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:qo.TransparentGray,color:qo.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class Em extends ro.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,o;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),c=Xd.a.width(null!==(e=this.props.animateToPoints)&&void 0!==e?e:r.points);if(!s)return null;if(!r.points)return null;const l=null!==(n=null===(t=this.customStyle)||void 0===t?void 0:t.backgroundColor)&&void 0!==n?n:r.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,u=null!==(o=null===(i=this.customStyle)||void 0===i?void 0:i.textColor)&&void 0!==o?o:r.highlighted?a.highlightedTextColor:a.textColor;return ro.default.createElement(Yd.div,{ref:e=>this.label=e,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:Xd.a.lowestX(r.points),y:Xd.a.highestY(r.points)+3,backgroundColor:l,fontSize:12,width:c,overflow:"hidden",color:u,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:Xd.a.lowestX(this.props.animateToPoints),y:Xd.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class xm{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 Dm{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.countingRepeatDelay=-1,this.style=new xm}}class Tm{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class Bm{constructor(){this.enabled=!1,this.style=new Tm}}class Im extends Ki.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new Dm,this.detectionParameters=new h.b,this.scanAndCount=new Bm,this.onBarcodesDetected=function(e){}}static fromJson(e){const t=new Im;return this.mapValues(e,t,["style","videoConstraints","overlay","scanAndCount","finder","userGuidance"]),this.mapFinderConfiguration(t,e),e.overlay&&(this.mapValues(e.overlay,t.overlay,["style"]),e.overlay.style&&this.mapValues(e.overlay.style,t.overlay.style)),e.scanAndCount&&(this.mapValues(e.scanAndCount,t.scanAndCount,["style"]),e.scanAndCount.style&&this.mapValues(e.scanAndCount.style,t.scanAndCount.style)),this.mapVideoConstraints(e,t),t}}class km{constructor(e){this.barcodes=[],this.originalImageSize=null,this.barcodes=e.barcodes,e.originalImage&&(this.originalImageSize=new bm.a(e.originalImage.width,e.originalImage.height))}isEmpty(){return 0===this.barcodes.length}}class Om{static warn(e){console.warn("[ScanbotSDK]",e)}}class Lm{static convertLinesToViewportLines(e,t){if(t&&e)return t.map((t=>({start:new Xd.a(t.start.x*e.width,t.start.y*e.height),end:new Xd.a(t.end.x*e.width,t.end.y*e.height)})))}static convertToViewportPointsFromParentSize(e,t){return t?bm.a.isEmpty(e)?void 0:t.map((t=>Xd.a.scaleUpTo(t,e))):bm.a.toPolygon(e)}static calculateScale(e){let t,n=0,i=0;return 1>e.width/e.height?(t=e.height/1,n=(1-e.width/t)/2):(t=e.width/1,i=(1-e.height/t)/2),{x:n,y:i,containerScale:t}}static findScale(e,t){let n,i=0,o=0;return t.ratio(!0)>e.ratio(!0)?(n=e.width/t.width,o=(t.height-e.height/n)/2):(n=e.height/t.height,i=(t.width-e.width/n)/2),{x:i,y:o,scale:n}}static preventDefaultCallback(e){e.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",Lm.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",Lm.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(e){var t;const n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize scanner: Cannot find container element either from 'container' property or with the containerId property provided.");return n}}var Pm=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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())}))};Wo.a;Wo.b;class _m extends Wo.c{constructor(e){var t;super(e),this.shouldComputeSize=!0,this.paused=!1,this.barcodeScannerHandle=null,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.backendurl=void 0,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=Im.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e){return Pm(this,void 0,void 0,(function*(){const t=Lm.findContainerOrThrow(e);return new Promise(((n,i)=>{Object(ro.render)(ro.default.createElement(_m,{container:t,configuration:e,onSuccess:n,onFailure:i}),t)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Pm(this,void 0,void 0,(function*(){Om.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){Om.warn("Barcode detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Pm(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeScannerHandle&&this.bridge.copyArgs.releaseObject(this.barcodeScannerHandle).catch((e=>{var t,n;return null===(n=(t=this.props.configuration).onError)||void 0===n?void 0:n.call(t,e)}))}updateDimensions(){return Pm(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Pm(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,i,o;return Pm(this,void 0,void 0,(function*(){if(!this.enabled)return;if(this.paused)return;if(null===(e=this.configuration.scanAndCount)||void 0===e?void 0:e.enabled)return;if(this.detectionRunning)return;let r=!1;try{this.detectionRunning=!0;const e=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!e)return;const a=new km(e);a.isEmpty()?this.configuration._onDetectionFailed&&(null===(t=this.configuration)||void 0===t||t._onDetectionFailed(e.originalImage)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(null===(i=this.finder)||void 0===i?void 0:i.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(e){console.log(e)}finally{this.detectionRunning=!1;const e=()=>requestAnimationFrame((()=>this.detect())),t=(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)?0:this.configuration.captureDelay;r&&0!=t?setTimeout(e,t):e()}}))}setUseBackendService(e){console.log("Now using backend service for recognition: ",e),this.backendurl=e}recognizeBarcodes(e,t){var n,i,o,r,a,s,c,l;return Pm(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(e=!1);const c=e?Wo.c.DEFAULT_DETECTION_RESOLUTION:Wo.c.DETECTION_RESULTION_4K,l=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:c;this.camera.finderFrame=null===(i=this.finder)||void 0===i?void 0:i.holeRect;const u=yield null===(o=this.camera)||void 0===o?void 0:o.createImageData(l,!1);if(!u)return;t&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:ji.wrapperToBase64(u)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",Wo.c.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));new bm.a(u.width,u.height);this.barcodeScannerHandle||(this.barcodeScannerHandle=yield this.bridge.copyArgs.createBarcodeScanner(new h.b(Object.assign(Object.assign({},this.configuration.detectionParameters),{live:e}))));const d=yield this.bridge.transferArgs.scanBarcodes(this.barcodeScannerHandle,u);if(!this.enabled)return;return null===d?void(null===(s=(a=this.props).onLicenseError)||void 0===s||s.call(a)):(this.camera.reusableImageBuffer=d.originalImage.data,d)}catch(e){return void(null===(l=(c=this.props.configuration).onError)||void 0===l||l.call(c,e))}}))}setRecognitionResolution(e){this.desiredRecognitionResolution=e}getResolution(){return Pm(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?e(bm.a.fromJson(n)):this.camera.didLoadVideo=()=>{const t=this.camera.videoSize();e(bm.a.fromJson(t))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}setZoom(e){this.setState({zoom:e})}setCameraDirection(e){this.camera.setDirection(e)}updateTorch(e){this.camera.videoStream.updateTorch(e)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var e,t,n,i,o,r,a;const s=(null===(e=this.configuration.scanAndCount)||void 0===e?void 0:e.enabled)?"Tap the shutter button to scan":void 0;return ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},ro.default.createElement(zo.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(n=this.state.zoom)&&void 0!==n?n:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),ro.default.createElement(wm,{top:null===(i=this.configuration.scanAndCount)||void 0===i?void 0:i.style.topLabelTop,text:s}),ro.default.createElement(Am,{ref:e=>this.scannedImage=e,image:this.state.image}),this.state.isFinderVisible&&ro.default.createElement(jo.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),ro.default.createElement(wm,{bottom:100,text:this.state.bottomHintText}),ro.default.createElement(Sm,{visible:"processing"===this.state.action}),(null===(o=this.configuration.overlay)||void 0===o?void 0:o.visible)&&ro.default.createElement(sm,{ref:e=>{e&&(this.overlay=e)},configuration:this.configuration.overlay,onPolygonSelected:e=>{const t=new km({barcodes:[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:Em,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&ro.default.createElement(Cm,{ref:e=>this.bottomActionBar=e,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(Xo.PushBottom,this.barcodes)},onShutterButtonClick:()=>Pm(this,void 0,void 0,(function*(){(new Hi).flash(),this.setState({action:"processing"});const e=(new Date).getTime();let t=yield this.recognizeBarcodes(!1,!1);const n=new km(null!=t?t:{barcodes:[]});console.log("Recognition took:",((new Date).getTime()-e)/1e3);const i=this.countLabelText(n.barcodes);this.setState({action:"manual",bottomHintText:i}),this.scannedImage.update(n),this.barcodes.push(...n.barcodes),this.bottomActionBar.update(this.barcodes),n.barcodes.length>0&&this.configuration.onBarcodesDetected(n)})),onScanMoreClick:()=>{this.resetCountImage()}}),ro.default.createElement(Ko,{ref:e=>this.popup=e,style:null===(a=this.configuration.scanAndCount)||void 0===a?void 0:a.style,onDeleteClick:()=>{if(confirm("Are you sure you want to delete all scanned barcodes?")){for(;this.barcodes.length>0;)this.barcodes.pop();console.log("Cleared barcodes",this.barcodes.length),this.popup.update(this.barcodes),this.bottomActionBar.update(void 0),this.resetCountImage(),this.popup.reset()}}}))}resetCountImage(){this.scannedImage.reset(),this.setState({image:void 0,bottomHintText:void 0})}countLabelText(e){return 0==e.length?"No codes scanned. Try again?":1==e.length?"1 Code Scanned":`${e.length} Codes Scanned`}}function Rm(e,t){return e&&(e.hasFacingOptions&&t.flipCameraButton.visible||e.isTorchAvailable&&t.flashButton.visible)||t.zoomButton.visible}function Fm(e){const t=e.zoomSteps.findIndex((t=>t==e.defaultZoomFactor)),[n,i]=Object(ro.useState)(e.torchEnabledInitially),[o,r]=Object(ro.useState)(t),a=e.zoomSteps[o],[s,c]=Object(ro.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,o=()=>i?i.getBoundingClientRect():null,[r,a]=Object(ro.useState)(o());return Object(ro.useEffect)((()=>{if(i){const e=()=>a(o());e();const t=new ResizeObserver(e);return t.observe(i),()=>{t.disconnect()}}}),[i]),r}(e.scanner),u=!!l;if(Object(ro.useEffect)((()=>{var t;(null===(t=e.capabilities)||void 0===t?void 0:t.isTorchAvailable)&&u&&e.scanner.setTorchState(n)}),[e.capabilities,u,n]),Object(ro.useEffect)((()=>{var t;u&&(null===(t=e.scanner)||void 0===t||t.setZoom(a))}),[u,a]),!e.capabilities||!l)return null;if(!Rm(e.capabilities,e.config))return null;const d=l.height-e.bottomPadding-48;return ro.default.createElement(co.Box,{style:{position:"absolute",marginTop:d,marginLeft:l.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},ro.default.createElement(_o,Object.assign({},e.config.flashButton,{visible:e.capabilities.isTorchAvailable&&e.config.flashButton.visible,icon:n?co.FlashlightOn:co.FlashlightOff,active:n,onClick:()=>i(!n)})),ro.default.createElement("div",{style:{width:20}}),ro.default.createElement(_o,Object.assign({},e.config.zoomButton,{text:`${a.toFixed(1)}x`,active:o!==t,onClick:()=>r((o+1)%e.zoomSteps.length)})),ro.default.createElement("div",{style:{width:20}}),ro.default.createElement(_o,Object.assign({},e.config.flipCameraButton,{visible:e.capabilities.hasFacingOptions&&e.config.flipCameraButton.visible,active:"user"===s,icon:co.FlipCameraIos,onClick:()=>{var t;const n="environment"===s?"user":"environment";c(n),null===(t=e.scanner)||void 0===t||t.setCameraDirection(n)}})))}const Nm=Object(ro.createContext)(null);class Mm{static compute(e,t,n){const i=(Xd.a.lowestY(e)+Xd.a.highestY(e))/2,o={badgeY:i,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},o),{labelY:Math.max(Xd.a.highestY(e)+Mm.LABEL_AND_BADGE_PADDING,t?i-Mm.AR_BADGE_SIZE/2-Mm.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},o),{labelY:Math.min(Xd.a.lowestY(e)-Mm.LABEL_AND_BADGE_PADDING,t.visible?i+Mm.AR_BADGE_SIZE/2+Mm.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:i,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${Mm.LABEL_AND_BADGE_PADDING/2}px))`},labelY:i,labelStyle:{transform:t.visible?`translateX(-50%) translateY(${Mm.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},o),{labelY:0,labelStyle:{display:"none"}}):void 0}}Mm.AR_BADGE_SIZE=48,Mm.LABEL_AND_BADGE_PADDING=10;var Vm=Mm;function Wm(e){return e.style.visible?""==e.content?null:ro.default.createElement(Yd.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},e.positionBadge),animate:e.animateToPoints?e.positionBadge:{},transition:e.transition},ro.default.createElement(vo,{polygonConfig:Object.assign(Object.assign({},e.style.background),{cornerRadius:Vm.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},e.verticalPositions.badgeStyle),{width:Vm.AR_BADGE_SIZE,height:Vm.AR_BADGE_SIZE,color:uo.b.getColorValue(e.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==e?void 0:e.onClick()},ro.default.createElement(co.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e.content))):null}var zm=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};class jm extends Em{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:o}=this.props;const r=n,a=this.state.element,s=null!==(e=this.props.animateToPoints)&&void 0!==e?e:a.points,c=a.code,l=a.highlighted,u=(Xd.a.lowestX(s)+Xd.a.highestX(s))/2;void 0===i&&(i="BELOW");const d=Vm.compute(s,o,i),m=void 0===r||!1===r.titleDeselected.visible&&!1===r.subtitleDeselected.visible,h={x:u,y:Math.round(d.labelY)},f={x:u,y:Math.round(d.badgeY)},p={duration:.25,easing:"linear"};return ro.default.createElement(ro.default.Fragment,null,r&&ro.default.createElement(Yd.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},ro.default.createElement(vo,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:m?"inline-block":"block",zIndex:1500},d.labelStyle),polygonConfig:l?r.backgroundSelected:r.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var e;return null===(e=this.props)||void 0===e?void 0:e.onClick(a)}},ro.default.createElement(Hm,{barcode:c,barcodeImageVisible:r.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:l?r.titleSelected:r.titleDeselected,barcodeSubtitle:l?r.subtitleSelected:r.subtitleDeselected}))),ro.default.createElement(Wm,{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:o,positionBadge:f,content:this.badgeContent(),verticalPositions:d,transition:p,animateToPoints:this.props.animateToPoints}))}}function Hm(e){var{barcode:t}=e,n=zm(e,["barcode"]);const i=Object(ro.useContext)(Nm).useBarcodeMappedData(t);return ro.default.createElement(Bo,Object.assign({barcodeMappedData:i},n))}var Um=n(10);function Zm(e){const t=Object(ro.useRef)(),n=Object(ro.useRef)(null),[i,o]=(Object(ro.useContext)(Eo),Object(ro.useState)(void 0)),[r,a]=Object(ro.useState)(!1);Object(ro.useEffect)((()=>{var n,i;e.scanningPaused?null===(n=t.current)||void 0===n||n.pause():null===(i=t.current)||void 0===i||i.resume()}),[e.scanningPaused]);const s=function(e){const t=new Dm;t.visible=e.visible;const n=e.polygon instanceof Um.c,i=e.polygon,o=e,r=n?i.selected:o.polygon.partiallyScanned,a=n?i.deselected:o.polygon.partiallyScanned;return e.polygon.visible?(t.style.highlightedPolygonFillColor=uo.b.getColorValue(r.fillColor),t.style.highlightedPolygonStrokeColor=uo.b.getColorValue(r.strokeColor),t.style.highlightedPolygonStrokeWidth=r.strokeWidth,t.style.highlightedPolygonCornerRadius=r.cornerRadius,t.style.polygonFillColor=uo.b.getColorValue(a.fillColor),t.style.polygonStrokeColor=uo.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 o,r,a,s,c,l;null===(o=n.current)||void 0===o||o.update(null===(a=null===(r=t.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,i.originalImageSize,i.barcodes),null===(l=(c=e.barcodeScannerViewConfig).onBarcodesDetected)||void 0===l||l.call(c,i)},_onDetectionFailed:i=>{var o,r,a,s,c,l;null===(o=n.current)||void 0===o||o.update(null===(a=null===(r=t.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=t.current)||void 0===s?void 0:s.camera,new bm.a(i.width,i.height),[]),null===(l=(c=e.barcodeScannerViewConfig)._onDetectionFailed)||void 0===l||l.call(c,i)}});return Object(ro.useEffect)((()=>{const t=Rm(i,e.actionBarConfig);e.setActionButtonsVisible(t),a(t)}),[i,e.actionBarConfig]),ro.default.createElement(ro.default.Fragment,null,e.arOverlay.visible&&ro.default.createElement(sm,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:jm,labelComponentConfig:e.arOverlay,onBarcodeFound:e.arOnBarcodeEnter,onPolygonClick:e.arOnBarcodeClick,configuration:s}),ro.default.createElement(Fm,{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}),ro.default.createElement(_m,{ref:t,viewFinderPadding:e.viewFinderPadding,configuration:c,onSuccess:()=>class{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})}}.setFromScanner(t,o),onFailure:e.onCameraPermissionDenied,onLicenseError:e.onLicenseError}))}function Gm(e){return Object(ro.useMemo)((()=>{const t=(new Im).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=[],o={regexFilter:n.barcodesRegexFilter,minimum1DQuietZoneSize:n.minimum1DBarcodesQuietZone,minimumSizeScore:n.minimumSizeScore,minimumTextLength:n.minimumTextLength,maximumTextLength:n.maximumTextLength,stripCheckDigits:n.stripCheckDigits,gs1Handling:n.gs1Handling};var r;return i.push(new m.j(Object.assign({formats:n.barcodeFormats.length>0?n.barcodeFormats:void 0},o))),e.scannerConfiguration.barcodeFormats.includes("MSI_PLESSEY")&&i.push(new m.y(Object.assign({checksumAlgorithms:[n.msiPlesseyChecksumAlgorithm]},o))),e.scannerConfiguration.barcodeFormats.includes("IATA_2_OF_5")&&i.push(new m.g(Object.assign({useIATA2OF5Checksum:n.useIATA2OF5Checksum},o))),e.scannerConfiguration.barcodeFormats.includes("CODE_11")&&i.push(new m.e(Object.assign({checksum:n.useCode11Checksum},o))),e.scannerConfiguration.barcodeFormats.includes("AUSTRALIA_POST")&&i.push(new m.b(Object.assign({australiaPostCustomerFormat:n.australiaPostCustomerFormat},o))),e.scannerConfiguration.barcodeFormats.includes("UPC_E")&&i.push(new m.H(Object.assign({extensions:(r=n.barcodesExtensionFilter,"NO_FILTER"===r?"ALLOW_ANY":"ONLY_WITH_EXTENSIONS"===r?"REQUIRE_ANY":"ONLY_WITHOUT_EXTENSIONS"===r?"IGNORE":"ALLOW_ANY")},o))),{videoConstraints:t,backgroundColor:uo.b.getColorValue(e.backgroundColor),userGuidance:e.userGuidance,finder:e.viewFinder,desiredRecognitionResolution:n.maximumRecognizerResolution,detectionParameters:new h.b({live:!0,engineMode:n.engineMode,barcodeFormatConfigurations:i,extractedDocumentFormats:n.extractedDocumentFormats})}}),[e])}var Ym=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Qm(e){const[t,n]=Object(ro.useState)(null),[i,o]=Object(ro.useState)(!0),r=Object(ro.useMemo)((()=>"__sb_"+Math.random()),[]),a=e.barcodeMapper,s=e.configuration.useCase,c=Object.assign(Object.assign({},Gm(e.configuration)),{onBarcodesDetected:t=>{t.barcodes.length>0&&!s.arOverlay.visible&&e.scanningEnabled.current&&n(t.barcodes[0])},onError:e.onError,containerId:r,captureDelay:0}),l=n=>Ym(this,void 0,void 0,(function*(){let i;i=null===t?[]:[new so.BarcodeScannerUiItem({count:1,barcode:n})];const o={items:i};e.onSubmit(o)}));Object(ro.useEffect)((()=>{t&&(No.INSTANCE.beep(e.configuration.sound),Vo.INSTANCE.vibrate(e.configuration.vibration))}),[t]),Object(ro.useEffect)((()=>{null===t||s.confirmationSheetEnabled||l(t)}),[t,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(t);Object(ro.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(ro.useContext)(Eo);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Nm.Provider,{value:e.barcodeMapper},ro.default.createElement(Lo,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{l(t)},barcodeMappedData:u},{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})),ro.default.createElement(co.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},ro.default.createElement(Zm,{cameraConfiguration:e.configuration.cameraConfiguration,scanningPaused:null!==t,setActionButtonsVisible:o,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:i?80:0},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:r,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:e.onCameraPermissionDenied,onLicenseError:e.onError}))));var m}function Xm(e){const t=Object.assign(Object.assign({},e.title),{text:uo.b.getLocalizedText(e.title.text,e.textReplacementArgs)});return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(wo,Object.assign({},e.leftButton)),ro.default.createElement(co.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},ro.default.createElement(po.a,{config:t})),ro.default.createElement(wo,Object.assign({},e.rightButton)))}function qm(){return ro.default.createElement("div",{style:{width:30,height:6,backgroundColor:co.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function Km(e){return ro.default.createElement(co.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:e.innerRef},e.dragProps),ro.default.createElement(qm,null),ro.default.createElement(Xm,Object.assign({},e.drawerHeaderContentProps)))}function Jm(e){return ro.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},ro.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 $m(e){return e.isVisible?ro.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},e.style.placeholderIcon.visible&&ro.default.createElement(co.Avatar,{style:{backgroundColor:uo.b.getColorValue(e.style.placeholderIconBackground),width:100,height:100}},ro.default.createElement(Jm,{color:uo.b.getColorValue(e.style.placeholderIcon.color)})),ro.default.createElement(co.Typography,{style:{marginTop:20},variant:"h6"},ro.default.createElement(po.a,{config:e.style.placeholderTitle})),ro.default.createElement(co.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},ro.default.createElement(po.a,{config:e.style.placeholderSubtitle})),e.onStartClick&&e.style.startScanningButton.visible&&ro.default.createElement(Io,Object.assign({style:{width:"60%",marginTop:20}},e.style.startScanningButton,{visible:!0,onClick:e.onStartClick}))):null}function eh(e,t,n){const i=Object(ro.useRef)(),o=Object(ro.useRef)(null),[r,a]=Object(ro.useState)(),[s,c]=Object(ro.useState)(!1),l=Object(ro.useRef)([]),u=e=>{let n="none";if(l.current.length>0){const t=200,i=((e,t)=>{let n=e[0],i=Math.abs(n.time-t);for(let o=1;o<e.length;o++){const r=Math.abs(e[o].time-t);r<i&&(n=e[o],i=r)}return n})(l.current,e.timeStamp-t),o=i.y-e.clientY,r=100;o>r?n="up":o<-r&&(n="down")}l.current.splice(0,l.current.length),t(new Xd.a(e.clientX,e.clientY),n)},d={onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),c(!0),o.current=new Xd.a(e.clientX,e.clientY),a(Xd.a.empty()),e.stopPropagation()},onPointerMove:t=>{if(!s)return;const n=new Xd.a(t.clientX,t.clientY);i.current=t,a(n),e(n),l.current.push({x:t.clientX,y:t.clientY,time:t.timeStamp})},onPointerUp:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),u(e)},onPointerCancel:e=>{e.target.releasePointerCapture(e.pointerId),c(!1),n()}};return{startPoint:o,currentPoint:r,props:d,stop:()=>{i.current.stopPropagation()},dragOngoing:s}}var th=n(31);function nh(e){const[t,n]=Object(ro.useState)(0),[i,o]=Object(ro.useState)(!1),r=Object(ro.useRef)(null),a=Object(ro.useContext)(Eo).height,s=e=>{n(e),o(!0),setTimeout((()=>{o(!1)}),500)},c=t=>{const n=t-l.startPoint.current.y;return Object(th.a)((e.isOpen?100:0)-100*n/(window.innerHeight-a-e.closedSheetVisibleHeight),0,100)},l=eh((e=>{n(c(e.y))}),((t,n)=>{if(t.y===l.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(ro.useEffect)((()=>{i||l.dragOngoing||!r||(e.isOpen||0===t?e.isOpen&&100!==t&&s(100):s(0))}),[e.isOpen,t,l.dragOngoing]),ro.createElement("div",null,ro.createElement(lo.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${mo} - ${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:uo.b.getColorValue(e.contentStyle.sheetColor)},elevation:24}},ro.createElement(Km,{innerRef:e=>{r.current=e},drawerHeaderContentProps:e.drawerHeaderContentProps,dragProps:l.props}),e.children,ro.createElement($m,{isVisible:e.isPlaceholderVisible,style:e.contentStyle,onStartClick:()=>e.onSwipe("swipe-to-close")})))}var ih=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 o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};function oh(e){var{inputRef:t}=e,n=ih(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 ro.default.createElement("input",Object.assign({},i,{ref:t}))}function rh(e){const t=!!e.barcode,[n,i]=ro.default.useState(""),o=ro.default.useRef(null),r={backgroundColor:uo.b.getColorValue(e.dialogStyling.sheetColor)};return Object(ro.useEffect)((()=>{t&&i(String(e.barcode.count))}),[t]),ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Oo,{open:t,modalOverlayColor:e.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var e;return null===(e=o.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)}}},ro.default.createElement(co.DialogContent,{style:r},ro.default.createElement(co.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},ro.default.createElement(po.a,{config:e.dialogStyling.title})),ro.default.createElement(co.Typography,{fontSize:14,textAlign:"center"},ro.default.createElement(po.a,{config:e.dialogStyling.info})),ro.default.createElement(co.Box,{sx:{display:"flex",border:"2px solid",borderColor:uo.b.getColorValue(e.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},ro.default.createElement(oh,{inputRef:o,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&&ro.default.createElement(lo.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>i(""),htmlColor:uo.b.getColorValue(e.dialogStyling.clearTextButton.color)}))),ro.default.createElement(co.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},ro.default.createElement(lo.a,{container:!0,spacing:2},ro.default.createElement(lo.a,{item:!0,xs:12},ro.default.createElement(lo.a,{color:uo.b.getColorValue(e.dialogStyling.dividerColor)})),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},onClick:e.onCancel},e.dialogStyling.cancelButton))),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({icon:co.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},e.dialogStyling.updateButton)))))))}function ah(e){return ro.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:uo.b.getColorValue(e.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},ro.default.createElement(lo.a,{style:{height:"100%",color:uo.b.getColorValue(e.config.iconColor),paddingRight:e.visibleOffset/2,cursor:"pointer"}}))}const sh=0,ch=800,lh=1200;function uh(e){switch(e){case"mobile":return Object(co.useMediaQuery)("(min-width:"+sh+"px) and (max-width:"+(ch-1)+"px)");case"tablet":return Object(co.useMediaQuery)("(min-width:"+ch+"px) and (max-width:"+(lh-1)+"px)");case"desktop":return Object(co.useMediaQuery)("(min-width:"+lh+"px)")}}function dh(e){switch(e){case"mobile":return Object(co.useMediaQuery)("(min-width:"+sh+"px)");case"tablet":return Object(co.useMediaQuery)("(min-width:"+ch+"px)");case"desktop":return Object(co.useMediaQuery)("(min-width:"+lh+"px)")}}const mh=150;function hh(e){const[t,n]=Object(ro.useState)(0),[i,o]=Object(ro.useState)(!1);let r;const a=eh((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?()=>{l(0)}:void 0;l(mh,t)}else l(0)}),(()=>{l(0)})),s=Object(ro.useContext)(Nm),c=s.useBarcodeMappedData(e.barcode);Object(ro.useEffect)((()=>{const t={barcode:e.barcode,callback:()=>e.onDelete(e.barcode)};return s.addOnEvictionListener(t),()=>{s.removeOnEvictionListener(t)}}),[]);const l=(t,i)=>{const a=t>=mh,s=-r.getBoundingClientRect().width;n(a?s:0),o(!0),setTimeout((()=>{o(!1),a&&e.onDelete(e.barcode),i&&i()}),200)},u=uh("desktop")&&e.swipeToDeleteConfig.enabled,d=!u&&e.swipeToDeleteConfig.enabled;return Object(ro.useEffect)((()=>{d||l(0)}),[d]),ro.default.createElement(co.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:e=>{e&&(r=e)}},ro.default.createElement(ah,{config:e.swipeToDeleteConfig,visibleOffset:mh}),ro.default.createElement(co.Box,Object.assign({sx:{width:"100%",backgroundColor:uo.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:{}),ro.default.createElement(Bo,Object.assign({barcodeMappedData:c},e,{readonlyCount:e.readonlyCount})),null!==e.readonlyCount&&ro.default.createElement(co.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",paddingRight:"16px",color:uo.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",e.readonlyCount),u&&ro.default.createElement(lo.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",paddingRight:"16px",color:uo.b.getColorValue("?sbColorOnSurface")},onClick:()=>e.onDelete(e.barcode)}),ro.default.createElement(co.Box,{sx:{width:"0px"}})))}function fh(e){const t=uo.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),uo.b.getColorValue(i)};return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Divider,{style:{borderColor:t}}),e.barcodes.length>0&&ro.default.createElement(lo.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},ro.default.createElement(lo.a,{sx:{p:0}},e.barcodes.map((({barcode:o,count:r},a)=>{const s=e.expectedBarcodes.find((e=>e.barcodeValue===o.text));return ro.default.createElement(lo.a,{key:a,sx:{padding:0,borderBottom:`1px solid ${t}`}},e.indicatorColor&&ro.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:i(s,r),position:"absolute"}}),ro.default.createElement(hh,{barcode:o,animateBackAfterDelete:e.animateBackAfterDelete,onDelete:()=>e.onBarcodeChange({type:"remove",barcode:o}),counterForm:n&&{counter:r,manualCountChangeColor:e.sheetContent.manualCountChangeColor,manualCountOutlineColor:e.sheetContent.manualCountOutlineColor,addButtonEnabled:void 0===s||s.count>r,removeButtonEnabled:void 0===s||r>0,setCounter:t=>{e.onBarcodeChange({type:"setCount",barcodes:[o],computeNewCount:()=>t})},onNumberClick:()=>e.onNumberClick({barcode:o,count:r})},readonlyCount:"COUNTING"!==e.mode||e.sheetContent.manualCountChangeEnabled?null:r,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 ph(e){const t=e.badgeStyle||{},n=e.overlap||"circular";return ro.default.createElement(co.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 gh(e){if(!e.buttonStyling.visible)return null;return ro.default.createElement(co.Box,{style:e.style},ro.default.createElement(ph,{text:e.text,backgroundColor:uo.b.getColorValue(e.buttonStyling.badgeBackgroundColor),foregroundColor:uo.b.getColorValue(e.buttonStyling.badgeForegroundColor)},ro.default.createElement(co.IconButton,{sx:{backgroundColor:uo.b.getColorValue(e.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:uo.b.getColorValue(e.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:e.onClick,disableRipple:!0,disableFocusRipple:!0},ro.default.createElement(lo.a,{sx:{color:uo.b.getColorValue(e.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:uo.b.getColorValue(e.buttonStyling.activeForegroundColor)}}}))))}const vh=(e,t)=>(null===e.format||null===t.format||e.format===t.format)&&e.text===t.text,Ch=(e,t)=>e.find((e=>((e,t)=>e.barcodeValue===t.text)(e,t)));class yh{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 bh(e){const t=Object(ro.useContext)(uo.a).getColorValue,n={backgroundColor:t(e.sheetColor)};return ro.default.createElement(Oo,{modalOverlayColor:e.modalOverlayColor,open:e.open},ro.default.createElement(co.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},ro.default.createElement(co.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},ro.default.createElement(po.a,{config:e.title})),ro.default.createElement(co.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},ro.default.createElement(po.a,{config:e.subtitle}))),ro.default.createElement(co.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},ro.default.createElement(lo.a,{container:!0,spacing:2},ro.default.createElement(lo.a,{item:!0,xs:12},ro.default.createElement(lo.a,{color:t(e.dividerColor)})),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},icon:e.cancelButton.icon,onClick:e.cancelButton.onClick},e.cancelButton.style))),ro.default.createElement(lo.a,{item:!0,xs:6},ro.default.createElement(Io,Object.assign({style:{width:"100%"},icon:e.okButton.icon,onClick:e.okButton.onClick},e.okButton.style))))))}function Ah(e){return e.open?ro.default.createElement(bh,{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 Sh{constructor(e,t,n){this.barcodeItemSubtitleText=e,this.foundBarcodes=t,this.expectedBarcodes=n}useBarcodeMappedData(e){var t,n,i;const o=null!==(n=null===(t=this.foundBarcodes.find((t=>vh(t.barcode,e))))||void 0===t?void 0:t.count.toString())&&void 0!==n?n:"0",r=Ch(this.expectedBarcodes,e);return{state:"LOADED",value:{title:`${null!==(i=r.title)&&void 0!==i?i:e.text}`,subtitle:uo.b.getLocalizedText(this.barcodeItemSubtitleText,[o,null==r?void 0:r.count.toString()]),barcodeImage:r.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function wh(e){const t=Object(ro.useContext)(Eo);return ro.default.createElement(lo.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:t.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:uo.b.getColorValue(e.sheetContent.sheetColor)}},ro.default.createElement(lo.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},ro.default.createElement(Xm,Object.assign({},e.headerProps))),e.barcodeList,ro.default.createElement($m,{isVisible:e.isEmptyStateVisible,style:e.sheetContent}))}var Eh=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 xh(e){const t=Object(ro.useRef)(),n=Object(ro.useRef)(new Date("2001-01-01")),[i,o]=Object(ro.useReducer)(function(e,t,n,i){return(o,r)=>{const a=e.useCase,s="FindAndPickScanningMode"===a._type,c=s?"COUNTING":a.mode,l=s?a.expectedBarcodes:[],u=e=>{let t=[...o];const n=r.barcodes||[r.barcode];for(const i of n){const n=t.findIndex((e=>vh(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 o;if(t.current=new Date,!n)return e;const r=null===(o=Ch(l,n.barcode))||void 0===o?void 0:o.count;return void 0===r||r===e?e:(i(),e+1)};switch(r.type){case"onBarcodesDetected":{if((new Date).getTime()-t.current.getTime()<a.countingRepeatDelay||!n.current)return[...o];if(s)return a.arOverlay.automaticSelectionEnabled?u(d):[...o];const e=a.arOverlay;if(!e.visible||e.automaticSelectionEnabled){let e=!1;return u((n=>{let o="COUNTING"===c?n+1:1;return o===n||e||(t.current=new Date,i()),o}))}return u((e=>e))}case"onARCodeClick":return u(((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=()=>r.count||0;if(s){const t=Ch(l,r.barcode);r.count>t.count&&(e=()=>t.count)}return u(e)}case"setCount":return u(r.computeNewCount);case"remove":return o.map((e=>Object.assign(Object.assign({},e),{count:vh(e.barcode,r.barcode)?0:e.count})));case"clear":return o.map((e=>Object.assign(Object.assign({},e),{count:0})));case"setHtmlElements":let e=!1;const m=o.map((t=>vh(t.barcode,r.barcode)?(e=!0,Object.assign(Object.assign({},t),{polygonElement:r.polygonElement,labelElement:r.labelElement})):t));return e||m.push({barcode:r.barcode,count:0,labelElement:r.labelElement,polygonElement:r.polygonElement}),m}}}(e.configuration,n,e.scanningEnabled,(()=>{No.INSTANCE.beep(e.configuration.sound),Vo.INSTANCE.vibrate(e.configuration.vibration)})),[]),[r,a]=ro.default.useState(null),[s,c]=Object(ro.useState)(!1),l=Object(ro.useMemo)((()=>"__sb_"+Math.random()),[]),[u,d]=Object(ro.useState)(!0),m=e.barcodeMapper,[f,p]=Object(ro.useState)(null),g="FindAndPickScanningMode"===e.configuration.useCase._type,v=e.configuration.useCase,C=g?"COUNTING":v.mode,y=Object(ro.useRef)(Object.assign(Object.assign({},Gm(e.configuration)),{onBarcodesDetected:e=>{o({type:"onBarcodesDetected",barcodes:e.barcodes})},_onDetectionFailed(e){},onError:e.onError,captureDelay:1e3/60}));Object(ro.useEffect)((()=>{if(g){const t=S();for(const n of t){const t=[(e=n.barcodeValue,new h.a({text:e,format:null,quad:[],quadNormalized:[],sourceImage:null,rawBytes:null,upcEanExtension:null,extractedDocument:null}))];o({type:"setCount",barcodes:t,computeNewCount:()=>0})}}var e}),[]),Object(ro.useEffect)((()=>{y.current.container=t.current}),[t]),Object(ro.useEffect)((()=>{if(g)for(const e of i){const t=v.arOverlay,n=e.polygonElement,i=e.labelElement;if(E(e.barcode)){const o=R(e.barcode);let r=e.count+"/"+o.expectedCount;v.arOverlay.automaticSelectionEnabled||0!==e.count||(r=ro.default.createElement(co.TouchApp,null)),o.isFulFilled()?(null==n||n.style(uo.b.getPolygonColorValues(t.polygon.completed,t.polygon.visible)),null==i||i.styleBadge(t.badge.completed,ro.default.createElement(co.Check,null))):(null==n||n.style(uo.b.getPolygonColorValues(t.polygon.partiallyScanned,t.polygon.visible)),null==i||i.styleBadge(t.badge.partiallyScanned,r))}else null==n||n.style(uo.b.getPolygonColorValues(t.polygon.rejected,t.polygon.visible)),null==i||i.styleBadge(t.badge.rejected,ro.default.createElement(co.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(uo.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=>Ch(S(),e),E=e=>!!w(e),x=()=>g?i.filter((e=>E(e.barcode))):i.filter((e=>e.count>0)),D=()=>Eh(this,void 0,void 0,(function*(){const t=x().map((e=>new so.BarcodeScannerUiItem({count:"COUNTING"===C?e.count:1,barcode:e.barcode})));e.onSubmit({items:t})})),T=ro.default.createElement(fh,{expectedBarcodes:S(),barcodes:x(),animateBackAfterDelete:g,onBarcodeChange:o,sheetContent:v.sheetContent,onNumberClick:e=>a(e),mode:C,indicatorColor:g&&{partial:v.scanningPartiallyColor,complete:v.scanningCompletedColor,notScanned:v.scanningNotScannedColor}}),B={textReplacementArgs:[b.toString()],leftButton:Object.assign(Object.assign({},v.sheetContent.clearAllButton),{onClick:()=>o({type:"clear"})}),rightButton:Object.assign(Object.assign({},v.sheetContent.submitButton),{onClick:()=>Eh(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 D()}else yield D()})),disabled:!g&&!v.allowEmptySubmission&&0===b}),title:v.sheetContent.title},I=uh("mobile"),k="BUTTON"!==v.sheet.mode&&I?"SMALL"===v.sheet.collapsedVisibleHeight?69:128:0,O=I&&"BUTTON"===v.sheet.mode,L=O?76:0,P=(u?80:0)+L,_=Object(ro.useContext)(Eo),R=e=>{const t=i.find((t=>t.barcode.text===e.text)),n=w(e);return new yh(null==n?void 0:n.count,null==t?void 0:t.count)},F=S().reduce(((e,t)=>e+t.count),0);g&&B.textReplacementArgs.push(F.toString());const N=g?new Sh(v.sheetContent.barcodeItemSubtitle.text,i,S()):m,M=!g&&0===b;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Nm.Provider,{value:N},ro.default.createElement(lo.a,{container:!0,sx:{display:"flex",flexDirection:I?"column":"row",height:`calc(${_.remainingVisibleBodyHeight} - ${k}px)`},alignItems:"stretch"},ro.default.createElement(lo.a,{id:l,item:!0,ref:t,component:"div",xs:I?12:7,zIndex:100},O&&ro.default.createElement(gh,{style:{position:"absolute",marginTop:`calc(${_.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:g?`${b}/${F}`:b.toString(),onClick:()=>c(!s),buttonStyling:v.sheet.listButton}),ro.default.createElement(Zm,{viewFinderPadding:{minTopPadding:_.minTopPaddingForContent,minBottomPadding:P},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"===C})})})(),containerId:l,barcodeScannerViewConfig:y.current,onCameraPermissionDenied:e.onCameraPermissionDenied,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16+L,setActionButtonsVisible:d,arOnBarcodeClick:e=>{o({type:"onARCodeClick",barcode:e})},arOnBarcodeEnter:(e,t,n)=>{if(!n||!t)return;o({type:"setHtmlElements",barcode:e,labelElement:n,polygonElement:t})},scanningPaused:s&&I,cameraConfiguration:e.configuration.cameraConfiguration,onLicenseError:e.onError}),I&&ro.default.createElement(nh,{closedSheetVisibleHeight:k,sheetStyle:v.sheet,contentStyle:v.sheetContent,manualCountEditDialog:v.manualCountEditDialog,isPlaceholderVisible:M,onBarcodeChange:e=>o(e),drawerHeaderContentProps:B,isOpen:s,onSwipe:e=>{c("swipe-to-open"===e)}},T)),dh("tablet")&&ro.default.createElement(wh,{headerProps:B,sheetContent:v.sheetContent,isEmptyStateVisible:M,barcodeList:T})),ro.default.createElement(rh,{barcode:r,dialogStyling:v.manualCountEditDialog,onCancel:()=>a(null),setCounter:(e,t)=>{o({type:"onCountEditDialogChange",barcode:e,count:t}),a(null)}}),ro.default.createElement(Ah,{open:null!==f,style:f,onDismiss:()=>p(null),onSubmit:D})))}const Dh=Object(ro.createContext)(null),Th={didCatch:!1,error:null};class Bh extends ro.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Th}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,i=arguments.length,o=new Array(i),r=0;r<i;r++)o[r]=arguments[r];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:o,reason:"imperative-api"}),this.setState(Th)}}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 o,r;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===(o=(r=this.props).onReset)||void 0===o||o.call(r,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Th))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:o,error:r}=this.state;let a=e;if(o){const e={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)a=t(e);else if(n)a=Object(ro.createElement)(n,e);else{if(null!==i&&!Object(ro.isValidElement)(i))throw r;a=i}}return Object(ro.createElement)(Dh.Provider,{value:{didCatch:o,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Ih(){const e=Object(ro.useRef)(!0);return Object(ro.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function kh(e){const t=Ih(),[,n]=Object(ro.useReducer)((e=>e+1),0),i=Object(ro.useRef)();return Object(ro.useMemo)((()=>{i.current={loading:!0,value:void 0,error:null}}),[e]),function(e,t){Object(ro.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 Oh=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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{constructor(e,t){this.barcodeItemMapper=e,this.onError=t,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=e=>Go(e),this.onEvictionListeners=new Set}getBarcodeMappedData(e){const t=this.hash(e);if(!this.cache.has(t)){const n=(()=>Oh(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const t=new so.BarcodeScannerUiItem({count:1,barcode:e});return this.barcodeItemMapper(t)}{const t=yield ji.toDataUrl(yield wC.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(ro.useRef)(!1),n=kh(e&&this.getBarcodeMappedData(e));if(Object(ro.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)}}so.BarcodeItemErrorState;function Ph(e){return ro.default.createElement(bh,{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:co.Replay,onClick:e.handleRetry}})}function _h(e){const t=Object(ro.useContext)(Eo);return ro.default.createElement(co.Box,{sx:{paddingTop:t.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:uo.b.getColorValue(e.config.background)}},ro.default.createElement(co.Box,{sx:{height:t.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},e.config.icon.visible&&ro.default.createElement(co.Box,null,ro.default.createElement(co.Avatar,{sx:{width:100,height:100,backgroundColor:uo.b.getColorValue(e.config.iconBackground),margin:"24px"}},ro.default.createElement(lo.a,{sx:{fontSize:50,color:uo.b.getColorValue(e.config.icon.color)}}))),ro.default.createElement(co.Typography,{sx:{fontSize:20,textAlign:"center"}},ro.default.createElement(po.a,{config:e.config.enableCameraTitle})),ro.default.createElement(co.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},ro.default.createElement(po.a,{config:e.config.enableCameraExplanation})),ro.default.createElement(co.Box,{sx:{paddingTop:"16px"}},ro.default.createElement(wo,Object.assign({},e.config.closeButton,{onClick:e.onAppClose})))))}function Rh(e){const t=Object(ro.useRef)(Object(co.createTheme)({palette:{primary:{main:qo.ScanbotPrimary},secondary:{main:qo.DarkGray}}})),[n,i]=Object(ro.useState)(!1),[o,r]=Object(ro.useState)(!1),[a,s]=Object(ro.useState)(e.configuration.timeouts.initialScanDelay<=0),c=Object(ro.useRef)(!1),l=Object(ro.useRef)(),u=Object(ro.useRef)(),d=e.configuration.useCase,m="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,h=Object(ro.useMemo)((()=>new Lh(null==m?void 0:m.barcodeItemMapper,((e,t)=>{i(!0),l.current=()=>{i(!1),e()},u.current=()=>{i(!1),t()}}))),[]);let f;if(Object(ro.useMemo)((()=>{uo.b.setPalette(e.configuration.palette),uo.b.setLocalization(e.configuration.localization)}),[e.configuration]),Object(ro.useEffect)((()=>{if(e.configuration.timeouts.autoCancelTimeout>0){const t=setTimeout((()=>{e.onClose()}),e.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(t)}}}),[]),Object(ro.useEffect)((()=>{if(e.configuration.timeouts.initialScanDelay>0){const t=setTimeout((()=>{s(!0)}),e.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(t)}}}),[]),Object(ro.useEffect)((()=>{c.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)f=ro.default.createElement(Qm,{configuration:e.configuration,barcodeMapper:h,onClose:e.onClose,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:c});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");f=ro.default.createElement(xh,{configuration:e.configuration,barcodeMapper:h,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:c})}return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(ho,null),ro.default.createElement(Bh,{onError:e.onError,fallback:ro.default.createElement("div",null,"Error")},ro.default.createElement(uo.a.Provider,{value:Object(uo.c)(e.configuration.palette)},ro.default.createElement(co.ThemeProvider,{theme:t.current},m&&ro.default.createElement(Ph,Object.assign({open:n,handleCancel:u.current,handleRetry:l.current,modalOverlayColor:m.modalOverlayColor,dividerColor:m.dividerColor,sheetColor:m.sheetColor},m.errorState)),ro.default.createElement(lo.a,{sx:{height:`100 * ${mo}`,width:"100vw",backgroundColor:uo.b.getColorValue(e.configuration.backgroundColor)}},ro.default.createElement(xo,Object.assign({onBackPress:e.onClose},e.configuration.topBar),!o&&f,o&&ro.default.createElement(_h,{onAppClose:e.onClose,config:e.configuration.cameraPermission})))))))}class Fh{constructor(e){this.document=e}}var Nh=n(16);function Mh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.489746)",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M172.051 142.95V124.876L96.3274 152.397V170.471L172.051 142.95Z",fill:t})))}function Vh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.237671)",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M172.844 188.832H86.629V113.394L172.844 148.212V188.832Z",fill:"url(#paint0_linear_557_1465)"})),ro.default.createElement("defs",null,ro.default.createElement("linearGradient",{id:"paint0_linear_557_1465",x1:"130.151",y1:"118.368",x2:"129.736",y2:"188.832",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),ro.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function Wh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M172.844 188.594H86.629V113.156L172.844 147.974V188.594Z",fill:"url(#paint0_linear_557_1462)"})),ro.default.createElement("defs",null,ro.default.createElement("linearGradient",{id:"paint0_linear_557_1462",x1:"130.151",y1:"118.13",x2:"129.736",y2:"188.594",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),ro.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function zh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.252197)",fill:"transparent"}),ro.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}),ro.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.232 131.072H70.4609V134.579H192.232V131.072Z",fill:t}),ro.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.023 124.445H70.4609V127.951H137.023V124.445Z",fill:t}),ro.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}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M124.937 70.8245H143.011L115.49 146.438H97.4164L124.937 70.8245Z",fill:t})),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M157.336 70.8245H162.725L134.954 146.438H129.565L157.336 70.8245Z",fill:t})))}function jh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.371094)",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.default.createElement("path",{d:"M166.838 91.7213H128.493V88.658H166.838V91.7213Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M167.041 103.232H128.696V100.169H167.041V103.232Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M177.817 140.631H74.0316V137.568H177.817V140.631Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M208.701 108.301H191.401V105.238H208.701V108.301Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M208.904 119.812H191.603V116.748H208.904V119.812Z",fill:"#A5A5A5"}),ro.default.createElement("path",{d:"M191.401 128.035V131.098H208.904V128.035H191.401Z",fill:"#A5A5A5"}),ro.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"}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M126.999 68.3479H145.072L117.552 150.417H99.4783L126.999 68.3479Z",fill:t})),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M164.554 68.3479H169.942L142.171 150.417H136.783L164.554 68.3479Z",fill:t})))}function Hh(e){const{color:t}=e;return ro.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.118896)",fill:"transparent"}),ro.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}),ro.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}),ro.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}),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M111.248 68.0957H129.322L101.801 150.165H83.7275L111.248 68.0957Z",fill:t})),ro.default.createElement("g",{style:{mixBlendMode:"soft-light"}},ro.default.createElement("path",{d:"M154.606 68.0957H159.994L132.223 150.165H126.835L154.606 68.0957Z",fill:t})))}function Uh(e){if(e.source instanceof Nh.j)return null;const t="#FFFFFF";return ro.default.createElement(co.Box,{sx:{backgroundColor:"rgb(191, 191, 191)",borderRadius:1,width:"100%",height:250}},ro.default.createElement(co.Box,{sx:{padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - 20px)"}},(()=>{if(e.source instanceof Nh.k)return ro.default.createElement(Mh,{color:t});if(e.source instanceof Nh.i)return ro.default.createElement(Vh,{color:t});if(e.source instanceof Nh.d)return ro.default.createElement(Wh,{color:t});if(e.source instanceof Nh.a)return ro.default.createElement(zh,{color:t});if(e.source instanceof Nh.e)return ro.default.createElement(jh,{color:t});if(e.source instanceof Nh.b)return ro.default.createElement(Hh,{color:t});if(e.source instanceof Nh.c){const n=e.source;return ro.default.createElement("img",{src:n.uri,style:{color:t,backgroundColor:"rgb(191, 191, 191)",maxHeight:"100%",maxWidth:"100%"},alt:""})}throw new Error("Unknown intro image type")})()))}function Zh(e){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Oo,{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 * ${mo} - 2 * 24px)`,backgroundColor:uo.b.getColorValue(e.config.backgroundColor)}}},ro.default.createElement(co.Typography,{component:"div"},ro.default.createElement(co.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},ro.default.createElement(po.a,{style:Object.assign({fontWeight:600,fontSize:16},Do(1)),config:e.config.title}),ro.default.createElement(co.Box,null,ro.default.createElement(wo,{onClick:e.onClose,visible:e.config.topBarDoneButton.visible,text:e.config.topBarDoneButton.text,background:e.config.topBarDoneButton.background,foreground:e.config.topBarDoneButton.foreground,icon:ro.default.createElement(lo.a,{sx:{fontSize:24}}),debugName:"close-introduction"}))),ro.default.createElement(co.Box,{sx:{width:"100%",border:`1px solid ${uo.b.getColorValue(e.config.dividerColor)}`,marginBottom:"12px"}}),ro.default.createElement(po.a,{config:e.config.subtitle,style:{fontSize:16,paddingBottom:"10px"}}),e.config.items.map(((e,t)=>{const n=e.image instanceof Nh.j;return ro.default.createElement(co.Box,{key:t,sx:{display:"flex",flexDirection:"column"}},ro.default.createElement(co.Box,{sx:{pt:n?0:"10px",pb:n?0:"10px"}},ro.default.createElement(Uh,{source:e.image})),ro.default.createElement(po.a,{style:{fontWeight:500,fontSize:14,padding:1,paddingLeft:15,textIndent:-15},config:e.text}))})))))}function Gh(e){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{sx:{backgroundColor:uo.b.getColorValue(e.backgroundColor),display:"flex",justifyContent:"space-between",alignItems:"center",height:50,width:"100vw"}},ro.default.createElement(co.Box,{style:{flexBasis:0,flexGrow:1}},e.leftContent),ro.default.createElement(co.Box,null,ro.default.createElement("h1",{style:{fontSize:18,fontWeight:500,textAlign:"center"}},ro.default.createElement(po.a,{config:e.centerTitle,replacementArgs:e.centerTitleReplacementArgs}))),ro.default.createElement(co.Box,{style:{flexBasis:0,flexGrow:1,textAlign:"right",whiteSpace:"nowrap"}},e.rightContent)))}function Yh(e){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Menu,{anchorEl:e.anchor,open:null!==e.anchor,onClose:e.onClose,MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:uo.b.getColorValue(e.backgroundColor),minWidth:e.minWidth}}}},e.children))}function Qh(e){const t=uo.b.getColorValue(e.textColor);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.MenuItem,{tabIndex:0,disabled:e.disabled,autoFocus:e.autoFocus,"aria-label":uo.b.getLocalizedText(e.ariaLabel),onClick:e.onClick,sx:Object.assign(Object.assign({"&, &:hover, &:focus":{backgroundColor:"transparent"}},Co(t)),{paddingX:"8px",marginX:"8px"})},e.children))}function Xh(e){const[t,n]=ro.default.useState(!1),[i,o]=ro.default.useState(null),r=Boolean(i),a=e.config.screens.camera.topBarCameraSelect;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(wo,{id:"sb-button-camera-select",ariaLabel:uo.b.getLocalizedText(a.button.accessibilityDescription),onClick:e=>o(e.currentTarget),visible:a.button.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:a.button.color,iconVisible:!0,useShadow:!1},icon:ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(lo.a,null),!r&&ro.default.createElement(lo.a,{sx:{marginX:"-4px"}}),r&&ro.default.createElement(lo.a,{sx:{marginX:"-4px"}})),buttonWidth:48}),ro.default.createElement(Yh,{anchor:i,ariaLabelledBy:"sb-button-camera-select",backgroundColor:a.backgroundColor,onClose:()=>o(null),minWidth:"calc(min(100% - 40px, 323px))"},ro.default.createElement(co.MenuItem,{disabled:!0,sx:{borderBottomColor:uo.b.getColorValue(a.dividerColor),borderBottomStyle:"solid",borderBottomWidth:"1px",fontSize:14,marginTop:"-4px",marginBottom:"4px",marginX:"4px",width:"calc(100% - 8px)",opacity:"1 !important"}},ro.default.createElement(po.a,{config:a.title})),e.cameraSelectConfig.availableCameras.map((i=>{const r=i.deviceId===e.cameraSelectConfig.activeCamera.deviceId,s=r?a.menuEntryActive:a.menuEntry;return ro.default.createElement(Qh,{disabled:t,key:i.deviceId,autoFocus:r,ariaLabel:s.accessibilityDescription,textColor:s.title.color,onClick:()=>{o(null),n(!0),e.cameraSelectConfig.onSelect(i).finally((()=>n(!1)))}},s.icon.visible&&ro.default.createElement(lo.a,{style:{color:uo.b.getColorValue(s.icon.color),marginRight:"8px"}}),ro.default.createElement(co.Typography,{variant:"inherit",noWrap:!0},ro.default.createElement(po.a,{config:Object.assign(Object.assign({},s.title),{text:i.label})})),r&&ro.default.createElement(lo.a,{style:{color:uo.b.getColorValue(s.icon.color),marginLeft:"auto",paddingLeft:15,fontSize:16}}))}))))}function qh(e){const t=e.config.screens.camera;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Gh,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:ro.default.createElement(wo,{ariaLabel:uo.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:ro.default.createElement(lo.a,{sx:{fontSize:24}}),debugName:"close-camera-screen"}),centerTitle:t.topBarTitle,rightContent:ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{style:{display:"flex",justifyContent:"space-around",alignItems:"center",whiteSpace:"nowrap",maxWidth:120,marginLeft:"auto"}},ro.default.createElement(Xh,{config:e.config,cameraSelectConfig:e.cameraSelectConfig}),ro.default.createElement(wo,{ariaLabel:uo.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:ro.default.createElement(lo.a,{sx:{fontSize:24}}),onClick:e.onShowIntroButtonClick,buttonWidth:20})))}))}function Kh(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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}),ro.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 Jh(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement(ro.default.Fragment,null,ro.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}},ro.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}),ro.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 $h(e){return"NoButtonMode"===e.config._type?ro.default.createElement(ro.default.Fragment,null):"PagePreviewMode"===e.config._type?ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Button,{"data-sb-button-preview":!0,"arial-label":uo.b.getLocalizedText(e.config.accessibilityDescription),disabled:!e.enabled,sx:Object.assign({paddingY:"11px"},Co(e.config.pageCounter.background.fillColor)),onClick:e.onClick},ro.default.createElement(ph,{text:`${e.count}`,backgroundColor:uo.b.getColorValue(e.config.pageCounter.background.fillColor),badgeStyle:{borderColor:uo.b.getColorValue(e.config.pageCounter.background.strokeColor),borderWidth:e.config.pageCounter.background.strokeWidth,borderStyle:"solid"},overlap:"rectangular",foregroundColor:uo.b.getColorValue(e.config.pageCounter.foregroundColor)},e.previewImageUrl&&ro.default.createElement("img",{style:{maxWidth:40,maxHeight:56},src:e.previewImageUrl,alt:"Preview image of the last page"}),!e.previewImageUrl&&ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(e.config.imagePlaceholderColor),width:40,height:56}})))):"TextButtonMode"===e.config._type?ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Button,{"data-sb-button-preview":!0,disabled:!e.enabled,onClick:e.onClick,"aria-label":uo.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign(Object.assign({},Co(e.config.style.color)),{textTransform:"none"})},ro.default.createElement(po.a,{config:e.config.style,replacementArgs:[`${e.count}`]}))):void 0}function ef(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"65",height:"65",viewBox:"0 0 65 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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)"},ro.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"})),ro.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)"},ro.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"})),ro.default.createElement("defs",null,ro.default.createElement("linearGradient",{id:"paint0_linear_779_506",x1:"60.3614",y1:"33.7149",x2:"37.0173",y2:"64.479",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{stopColor:t}),ro.default.createElement("stop",{offset:"0.847585",stopColor:t,stopOpacity:"0"})),ro.default.createElement("linearGradient",{id:"paint1_linear_779_506",x1:"8.69831",y1:"51.1273",x2:"20.179",y2:"68.157",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{stopColor:t}),ro.default.createElement("stop",{offset:"0.370714",stopColor:t,stopOpacity:"0"})))))}function tf(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("g",{clipPath:"url(#clip0_780_4723)"},ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.4s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.2s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.0s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.8s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.6s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.4s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.2s",repeatCount:"indefinite"})),ro.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"},ro.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"0s",repeatCount:"indefinite"}))),ro.default.createElement("defs",null,ro.default.createElement("clipPath",{id:"clip0_780_4723"},ro.default.createElement("rect",{width:"44",height:"44",fill:t,transform:"translate(0.5)"})))))}function nf(e){const t=uo.b.getColorValue(e.innerColor),n=uo.b.getColorValue(e.outerColor);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"65",height:"64",viewBox:"0 0 65 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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}),ro.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 of(e){const t="manual"===e.state||"auto"===e.state&&e.config.enabledInAutoSnappingMode;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Button,{disabled:!t,onClick:e.onClick,"aria-label":uo.b.getLocalizedText(e.config.accessibilityDescription),"data-sb-button-shutter":!0,sx:Object.assign({width:56,margin:0,padding:0},Co(e.config.innerColor))},"auto"===e.state&&ro.default.createElement(ef,{key:"auto",color:e.config.outerColor}),"loading"===e.state&&ro.default.createElement(tf,{key:"loading",color:e.config.outerColor}),"manual"===e.state&&ro.default.createElement(nf,{key:"manual",innerColor:e.config.innerColor,outerColor:e.config.outerColor})))}function rf(e){const t={backgroundColor:uo.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,[o,r]=ro.default.useState(!0);Object(ro.useEffect)((()=>{r(e.open)}),[e.open]);const a=o?1:.5;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Oo,{modalOverlayColor:e.config.modalOverlayColor,open:e.open,PaperProps:{style:{borderRadius:"8px"}},onClose:e.onCancelClick},ro.default.createElement(co.DialogContent,{sx:Object.assign(Object.assign({},t),{p:2,pb:1,textAlign:"center"})},ro.default.createElement(co.Typography,{sx:{fontSize:"16px",fontWeight:"bold"}},ro.default.createElement(po.a,{config:e.config.title})),ro.default.createElement(co.Typography,{sx:{fontSize:"14px",lineHeight:"16pt",pt:1}},ro.default.createElement(po.a,{config:e.config.subtitle}))),ro.default.createElement(co.DialogActions,{sx:Object.assign(Object.assign({},t),{pt:1})},ro.default.createElement(lo.a,{container:!0,spacing:2},ro.default.createElement(lo.a,{item:!0,xs:12},ro.default.createElement(lo.a,{color:uo.b.getColorValue(e.config.dividerColor)})),n.map(((e,t)=>{return ro.default.createElement(lo.a,{item:!0,xs:i,key:t},ro.default.createElement(Io,{disabled:!o,style:Object.assign({width:"100%",opacity:a},(n=e.config,So(uo.b.getColorValue(n.background.fillColor))?Co(n.foreground.color):Object.assign(Object.assign({},yo(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:()=>{r(!1),e.onClick()},visible:e.config.visible,text:e.config.text,foreground:e.config.foreground,background:e.config.background,debugName:e.debugName,accessibilityDescription:uo.b.getLocalizedText(e.config.accessibilityDescription)}));var n}))))))}const af=["image/jpeg","image/jpg","image/png","image/bmp","image/dib","image/tiff"];var sf=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 cf(e){const t=e.config.screens.camera.bottomBar,n="auto"===e.buttonStates.snappingModeState?t.autoSnappingModeButton:t.manualSnappingModeButton,i="auto"===e.buttonStates.snappingModeState?Kh:Jh,o="on"===e.buttonStates.torchState?t.torchOnButton:t.torchOffButton,r=ro.default.createRef();Object(ro.useEffect)((()=>{r.current&&(r.current.oncancel=e.onFileSelectDialogClosed)}),[r.current]);const[a,s]=ro.default.useState(!1),c=()=>s(!0);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{"data-sb-bottom-bar":!0,sx:{backgroundColor:uo.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:112,display:"flex",alignItems:"center",justifyContent:"center"}},ro.default.createElement(co.Box,{sx:{maxWidth:400,display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)"}},ro.default.createElement("div",null,ro.default.createElement(bo,{onClick:e.scanLimitReached?c:e.onFileSelectDialogOpened,enabled:e.buttonStates.importButtonEnabled,config:t.importButton,iconButtonComponent:e.scanLimitReached?"button":"label",icon:({color:e})=>ro.default.createElement(lo.a,{sx:{color:e}}),debugName:"import"},!e.scanLimitReached&&ro.default.createElement("input",{hidden:!0,type:"file",accept:af.join(", "),ref:r,onChange:t=>{var n,i;e.onFileSelectDialogClosed();const o=null===(i=null===(n=null==t?void 0:t.target)||void 0===n?void 0:n.files)||void 0===i?void 0:i[0];o&&(()=>{sf(this,void 0,void 0,(function*(){const t=e.sdk.detectAndCropDocument(yield o.arrayBuffer(),"CONSUME_IMAGE");e.onFileUploaded(t)}))})()},value:""}))),ro.default.createElement("div",null,ro.default.createElement(bo,{enabled:e.buttonStates.snappingModeButtonEnabled,config:n,icon:i,onClick:e.snappingModeButtonClick,debugName:"snapping-mode"})),ro.default.createElement(of,{state:e.buttonStates.shutterButtonState,onClick:e.scanLimitReached?c:e.onShutterButtonClick,config:e.config.screens.camera.bottomBar.shutterButton}),ro.default.createElement("div",null,ro.default.createElement(bo,{enabled:e.buttonStates.torchButtonEnabled,config:o,icon:t=>(e.buttonStates.torchState,ro.default.createElement(lo.a,{sx:t})),onClick:e.onTorchButtonClick,debugName:"torch"})),ro.default.createElement("div",null,ro.default.createElement($h,{enabled:e.buttonStates.reviewButtonEnabled,config:t.previewButton,count:e.buttonStates.reviewButtonCount,previewImageUrl:e.buttonStates.reviewButtonPreviewImageUrl,onClick:e.onReviewButtonClick})))),ro.default.createElement(rf,{open:a,config:e.config.screens.camera.limitReachedAlertDialog,onCancelClick:()=>{},onActionClick:()=>{},onOkClick:()=>{s(!1)}}))}function lf(e){const t=uo.b.getColorValue(e.color),n=221/376,i=`calc(${e.maxHeight} - ${e.paddingTop}px - ${e.paddingBottom}px)`,o=e.maxWidth,r=`min(${`calc(${i} * ${n})`}, ${o})`,a=`min(${i}, ${`calc(${o} / ${n})`})`;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{style:{width:r,height:a,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom},viewBox:"0 0 221 376",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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"}),ro.default.createElement("defs",null,ro.default.createElement("linearGradient",{id:"paint0_linear_441_9693",x1:"110.664",y1:"375.7",x2:"110.664",y2:"1",gradientUnits:"userSpaceOnUse"},ro.default.createElement("stop",{offset:"0.029183",stopColor:t,stopOpacity:"0"}),ro.default.createElement("stop",{offset:"0.204626",stopColor:t})))))}function uf(e){return ro.default.createElement(ro.default.Fragment,null,e.config.visible&&ro.default.createElement(vo,{polygonConfig:{strokeColor:e.config.background.strokeColor,fillColor:e.config.background.fillColor,cornerRadius:0,strokeWidth:0},sx:{height:40,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",width:"100%"}},ro.default.createElement(po.a,{config:e.config.title})))}function df(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.badAspectRatio,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 ro.default.createElement(po.a,{config:Object.assign(Object.assign({},e.config.screens.camera.userGuidance.title),{text:uo.b.getLocalizedText(i[e.text])})})}const mf=`calc(100 * ${mo} - 50px - 112px)`,hf="0.5s";function ff(e){const t=e.config.screens.camera,n=e.bottomUserGuidanceVisible?56:0;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:mf}},e.documentScannerView),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:mf,backgroundColor:"white",opacity:e.showCameraBlink?1:0,transition:e.showCameraBlink?"":"opacity 0.5s ease-in"}}),ro.default.createElement(co.Box,{sx:{height:mf,position:"relative"}},ro.default.createElement(uf,{config:t.topUserGuidance}),e.bottomUserGuidanceVisible&&ro.default.createElement(co.Box,{key:"bottomUserGuidance",sx:{position:"absolute",marginTop:`calc(${mf} - ${n}px)`,width:"100%",display:"flex",justifyContent:"center"}},ro.default.createElement(vo,{polygonConfig:{fillColor:t.userGuidance.background.fillColor,strokeColor:t.userGuidance.background.strokeColor,strokeWidth:t.userGuidance.background.strokeWidth,cornerRadius:4},sx:{padding:"6px 10px"}},ro.default.createElement(df,{config:e.config,text:e.userGuidanceText,snappingMode:e.snappingMode}))),t.scanAssistanceOverlay.visible&&!t.viewFinder.visible&&ro.default.createElement(co.Box,{key:"scanAssistanceOverlay",sx:{backgroundColor:uo.b.getColorValue(t.scanAssistanceOverlay.backgroundColor),height:"100%",display:"flex",justifyContent:"center",alignItems:"center",opacity:e.showHand?1:0,transition:"opacity 0.5s"}},ro.default.createElement(lf,{color:t.scanAssistanceOverlay.foregroundColor,maxWidth:"80%",maxHeight:`min(calc(${mf} * 0.85), 600px)`,paddingTop:40,paddingBottom:n}))))}const pf={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 gf{constructor(e){this.initializing={enabled:!0,value:"Initializing..."},this.hint=e}}class vf{constructor(){this.outline=new Cf,this.captureButton=new Sf}}class Cf{constructor(){this.polygon=new yf,this.path=new bf,this.label=new Af}}class yf{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent",this.strokeWidthCapturing=2,this.strokeWidthSearching=2}}class bf{constructor(){this.stroke="green",this.strokeWidth=4}}class Af{}class Sf{constructor(){this.color="#FFF"}}class wf extends qi.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new x,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new gf(pf),this.style=new vf,this.onDocumentDetected=function(e){},this.finder=Object(Ki.b)(),this.finder.visible=!1}static fromJson(e){var t,n;const i=new wf;if(qi.a.mapValuesDeep(null!==(t=e.finder)&&void 0!==t?t:{},i.finder),this.mapValues(e,i,["text","style","videoConstraints","detectionParameters","finder"]),i.detectionParameters=new x(null!==(n=e.detectionParameters)&&void 0!==n?n:{}),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 o=t.label;o&&this.mapValues(o,i.style.outline.label)}const n=e.style.captureButton;n&&this.mapValues(n,i.style.captureButton)}return this.mapVideoConstraints(e,i),i}}class Ef extends ro.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return ro.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(ro.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()))}}Ef.CLASSNAME="scanbot-document-outline";class xf extends ro.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 o={points:e,animatedPoints:t,isOk:n,isVisible:i};this.setState(o)}pointStringOrLatestValidPoints(e){return e&&e.length>0?Xd.a.toSvgString(e):Xd.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=hm()(Ef.CLASSNAME,{[`${Ef.CLASSNAME}-ok`]:this.state.isOk},{[`${Ef.CLASSNAME}-visible`]:this.state.isVisible},{[`${Ef.CLASSNAME}-hidden`]:!this.state.isVisible});return ro.default.createElement(Yd.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 Df=xf;class Tf extends ro.default.Component{constructor(e){super(e),this.state={path:void 0}}render(){var e,t;return this.state.path?ro.default.createElement(Yd.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:`${Ef.CLASSNAME}-path`}):null}animate(e){const t="M"+Xd.a.toSvgString(e)+"z";this.setState({path:t})}clear(){this.setState({path:void 0})}}class Bf extends ro.default.Component{render(){return ro.default.createElement(Yd.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},ro.default.createElement(Df,{ref:e=>this.polygon=e,style:this.props.polygonStyle}),ro.default.createElement(Tf,{ref:e=>this.path=e,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(e,t,n){var i;const o="processing"!==n&&!!e,r=null!==(i=this.previous)&&void 0!==i?i:e,a=this.previous?e:void 0;this.polygon.update(r,a,t,o),this.previous=e,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class If extends ro.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 ro.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},ro.default.createElement(Bf,{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}),ro.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 kf{static isConvex(e){if(e.length<4)return!0;let t=!1,n=e.length;for(let i=0;i<n;i++){const o=e[(i+2)%n].x-e[(i+1)%n].x,r=e[(i+2)%n].y-e[(i+1)%n].y,a=e[i].x-e[(i+1)%n].x,s=o*(e[i].y-e[(i+1)%n].y)-r*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=Xd.a.subtract(e[1],n),o=t[0],r=Xd.a.subtract(t[1],o);if(0===Xd.a.cross(i,r))return;const a=Xd.a.cross(Xd.a.subtract(o,n),i)/Xd.a.cross(i,r);return Xd.a.add(o,Xd.a.multiply(r,a))}}class Of{constructor(e,t=Of.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 kf.distanceBetweenPoints(e,t)/this.maxDistance>this.sensitivity}calculateMaxDistance(e){let t=new Xd.a(0,0),n=new Xd.a(e.width,e.height);return kf.distanceBetweenPoints(t,n)}}Of.DEFAULT_SENSITIVITY=.5;var Lf=n(15),Pf=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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())}))};Wo.b;Wo.a;class _f extends Wo.c{constructor(e){if(super(e),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>Pf(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=wf.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 Pf(this,void 0,void 0,(function*(){const n=Lm.findContainerOrThrow(e);return new Promise(((i,o)=>{Object(ro.render)(ro.default.createElement(_f,{container:n,configuration:e,onSuccess:i,onFailure:o,sdk:t}),n)}))}))}detectAndCrop(){var e,t,n,i;return Pf(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 n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(_f.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);return n?(oo.a.debug("Detect & Crop document of size: "+n.height*n.width),yield this.bridge.transferArgs.detectAndCropDocument(n)):null}}catch(e){return null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,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}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Pf(this,void 0,void 0,(function*(){e.componentDidMount.call(this),this.detect(),this.scannerToken=this.bridge.copyArgs.createDocumentScanner(new x(this.configuration.detectionParameters)),this.scannerToken.catch((e=>{var t,n;return null===(n=(t=this.configuration).onError)||void 0===n?void 0:n.call(t,e)}))}))}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return Pf(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield this.props.sdk.release(yield this.scannerToken,"Document Scanner")}))}detect(){var e,t,n,i;return Pf(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.data;const i=this.getStatusString(n),o="OK"===i,r=i.startsWith("OK")?this.scalePolygonPointsToPixels(n.pointsNormalized):void 0;this.outline.update(o,r,Wi.getProperty(this.configuration.text.hint,i)),null===(t=(e=this.props).onStatusStringUpdate)||void 0===t||t.call(e,i),yield this.handleAutoCapture(o,r)}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;return Pf(this,void 0,void 0,(function*(){try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Wo.c.DEFAULT_DETECTION_RESOLUTION,!1);return n&&this.enabled?yield this.bridge.transferArgs.documentScannerDetect(yield this.scannerToken,n):null}catch(e){return null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e),null}}))}handleAutoCapture(e,t){return Pf(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 Of(e)}if(this.runMovementPredicate(t))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>Pf(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const e=yield this.detectAndCrop();if(null==e?void 0:e.pointsNormalized){const t=this.scalePolygonPointsToPixels(e.pointsNormalized);if(this.runMovementPredicate(t))return}(null==e?void 0:e.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:o}=this.state,{configuration:r}=this,a=null===(e=r.style)||void 0===e?void 0:e.captureButton,s=!(null!==(t=this.props.hideShutterButton)&&void 0!==t&&t);return ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(n=this.configuration)||void 0===n?void 0:n.spinnerColor),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},ro.default.createElement(zo.a,{configuration:this.configuration,videoConstraints:r.videoConstraints,mirrored:r.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}}),s&&ro.default.createElement(pm,{color:(null==a?void 0:a.color)?a.color:"FFF",action:o,onClick:this.enabled?r.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}})),this.configuration.finder.visible&&ro.default.createElement(jo.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:new Lf.b({visible:!1}),configuration:r.finder}),ro.default.createElement(If,{ref:e=>{this.outline=e},style:null===(i=r.style)||void 0===i?void 0:i.outline,initializationText:r.text.initializing,action:o,autoCaptureSensitivity:this.autoCaptureSensitivity}))}scalePolygonPointsToPixels(e){var t;if(e){const n=this.getCameraFrameSize(),i=bm.a.fromHtmlElement(this.camera.video),o=Lm.findScale(i,n);(null===(t=this.finder)||void 0===t?void 0:t.holeRect)&&(e=e.map((e=>new Xd.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=Lm.convertToViewportPointsFromParentSize(n,e))?void 0:e.map((e=>Xd.a.scaleToPoint(e,o.x,o.y,o.scale)))}return e}runMovementPredicate(e){const t=this.polygonMovementPredicate.check(e);return this.polygonMovementPredicate.update(e),t}getCameraFrameSize(){return this.camera.calculateFrameSize(Wo.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}_f.DETECT_AND_CROP_RESOLUTION=0;var Rf=_f;function Ff(e){const[t,n]=Object(ro.useState)(!1);return Object(ro.useEffect)((()=>{const t=setTimeout((()=>{n(!0)}),e);return()=>clearTimeout(t)}),[]),t}var Nf=n(12);function Mf(e){if(!e.visible)return null;const t=e.config.screens.camera.cameraPermission;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Dialog,{fullScreen:!0,open:e.visible,transitionDuration:0},ro.default.createElement(Gh,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:null,rightContent:null,centerTitle:e.config.screens.camera.topBarTitle}),ro.default.createElement(co.Box,{style:{height:`calc(100 * ${mo} - 50px)`,backgroundColor:uo.b.getColorValue(t.background),display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(t.iconBackground),borderRadius:40,width:80,height:80,display:"flex",justifyContent:"center",alignItems:"center"}},ro.default.createElement(lo.a,{style:{color:uo.b.getColorValue(t.icon.color)},sx:{fontSize:40}})),ro.default.createElement("h4",{style:{margin:12}},ro.default.createElement(po.a,{style:{fontSize:18,fontWeight:500},config:t.enableCameraTitle})),ro.default.createElement(co.Box,{style:{marginBottom:"12px",maxWidth:350,textAlign:"center"}},ro.default.createElement(po.a,{config:t.enableCameraExplanation})),ro.default.createElement(co.Box,null,ro.default.createElement(wo,{icon:ro.default.createElement(co.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"}})))))}class Vf{constructor(){}static get(e,t){const n=localStorage.getItem(this.getKey(e));return null===n?t:JSON.parse(n)}static set(e,t){localStorage.setItem(this.getKey(e),JSON.stringify(t))}static clear(){localStorage.clear()}static getKey(e){return`sb_document_rtu_ui_${e}`}}var Wf=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 zf(e,t){return Wf(this,void 0,void 0,(function*(){return{value:yield e,source:t}}))}var jf=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Hf(e){var t;const n=e.configuration.screens.camera,[i,o]=Object(ro.useState)(n.cameraConfiguration.autoSnappingEnabled?"auto":"manual"),[r,a]=Object(ro.useState)(n.cameraConfiguration.flashEnabled),[s,c]=ro.default.useState(!1),l=Object(ro.useRef)(null);const[u,d]=Object(ro.useState)((()=>!Vf.get("hasSeenIntroduction",!1)||n.introduction.showAutomatically));Object(ro.useEffect)((()=>{e.scanLimitReached&&o("manual")}),[e.scanLimitReached]);const m=null===(t=e.pages)||void 0===t?void 0:t[e.pages.length-1],[h,f]=Object(ro.useState)(null),p=kh(null==m?void 0:m.finalImageUrl());Object(ro.useEffect)((()=>{0===e.pages.length?f(null):p.value&&f(p.value)}),[p,e.pages.length]);const g="ENABLED"===n.userGuidance.visibility||"AUTO_CAPTURE_ONLY"===n.userGuidance.visibility&&"auto"===i,v={minTopPadding:20+(n.topUserGuidance.visible?40:0),minBottomPadding:20+(g?56:0)},[C,y]=Object(ro.useState)(!1),b=0===n.timeouts.initialScanDelay||Ff(n.timeouts.initialScanDelay),[A,S]=Object(ro.useState)("START"),[w,E]=Object(ro.useState)(!0),{documentScannerView:x,documentScannerViewRef:D,torchSupported:T,scannerInitialized:B,activeCamera:I,availableCameras:k,setActiveCamera:O}=function(e){const t=e.configuration.screens.camera,n=t.cameraConfiguration,i=!e.pauseAR&&("ENABLED"===t.polygon.visibility||"AUTO_CAPTURE_ONLY"===t.polygon.visibility&&"auto"===e.snappingMode),o=e=>i?uo.b.getColorValue(e):"#00000000",r=(new wf).videoConstraints;r.width.ideal=n.idealPreviewResolution.width,r.height.ideal=n.idealPreviewResolution.height,r.facingMode="FRONT"===n.cameraModule?"user":"environment";const a=!e.scanningPaused&&"auto"===e.snappingMode,s={videoConstraints:r,onError:e.onError,backgroundColor:uo.b.getColorValue(t.backgroundColor),onDocumentDetected:e.onImageCaptured,autoCaptureEnabled:a,autoCaptureDelay:n.autoSnappingDelay,autoCaptureSensitivity:n.autoSnappingSensitivity,ignoreBadAspectRatio:n.ignoreBadAspectRatio,detectionParameters:{aspectRatios:n.requiredAspectRatios,acceptedAngleScore:n.acceptedAngleScore,acceptedBrightnessThreshold:n.acceptedBrightnessThreshold,acceptedSizeScore:n.acceptedSizeScore},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},c=Object(ro.useRef)(null);Object(ro.useEffect)((()=>()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.dispose()}),[]),Object(ro.useEffect)((()=>{c.current&&(a?c.current.enableAutoCapture():c.current.disableAutoCapture())}),[e.scanningPaused,e.snappingMode,c.current]);const[l,u]=Object(ro.useState)(!1);Object(ro.useEffect)((()=>{c.current&&l&&c.current.setTorchState(e.torchEnabled).catch((e=>{}))}),[e.torchEnabled,c.current,l]);const[d,m]=Object(ro.useState)(!1),[h,f]=Object(ro.useState)(null),[p,g]=Object(ro.useState)([]);Object(ro.useEffect)((()=>{c.current||m(!1)}),[c.current]);const v=ro.default.createElement(Rf,{sdk:e.sdk,ref:c,configuration:s,onSuccess:function(){var e,t,n;u(null===(e=c.current)||void 0===e?void 0:e.getActiveCameraInfo().supportsTorchControl),m(!0);const i=null===(t=c.current)||void 0===t?void 0:t.getActiveCameraInfo();f(null!=i?i:null),g(i?[i]:[]),null===(n=c.current)||void 0===n||n.fetchAvailableCameras().then(g)},onFailure:e.onError,hideShutterButton:!0,onStatusStringUpdate:e.onUserGuidanceTextUpdate,viewFinderPadding:e.viewFinderPadding,pauseAR:e.pauseAR});return{documentScannerView:v,documentScannerViewRef:c,torchSupported:l,scannerInitialized:d,activeCamera:h,availableCameras:p,setActiveCamera:function(e){var t;return f(e),null===(t=c.current)||void 0===t?void 0:t.switchCamera(e.deviceId)}}}({sdk:e.sdk,configuration:e.configuration,onImageCaptured:e=>{R(zf(Promise.resolve(e),"AUTO_SNAP"))},onUserGuidanceTextUpdate:function(e){(!w||"ERROR_NOTHING_DETECTED"!==e&&L)&&(S(e),E(!1))},snappingMode:i,scanningPaused:e.scanningPaused||!b,torchEnabled:r,onError:t=>{t instanceof Nf.a?y(!0):e.onError(t)},viewFinderPadding:v,pauseAR:!e.visible||e.scanningPaused||!b}),L=Ff(1e3),[P,_]=Object(ro.useState)(!1);Object(ro.useEffect)((()=>{requestAnimationFrame((()=>_(!1)))}),[P]);function R(t){_(n.captureFeedback.cameraBlinkEnabled),Vo.INSTANCE.vibrate(e.configuration.screens.camera.vibration),e.onImageCaptured(t)}return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{display:e.visible?"block":"none","data-sb-screen-camera":!0,style:{position:"absolute",width:"100vw"}},ro.default.createElement(Zh,{config:n.introduction,isOpen:u,onClose:()=>{d(!1),Vf.set("hasSeenIntroduction",!0)}}),ro.default.createElement(qh,{cameraSelectConfig:{availableCameras:k,activeCamera:I,onSelect:e=>jf(this,void 0,void 0,(function*(){yield O(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)}),ro.default.createElement(ff,{config:e.configuration,sdk:e.sdk,documentScannerView:x,showHand:w,userGuidanceText:A,bottomUserGuidanceVisible:g,snappingMode:i,showCameraBlink:P}),ro.default.createElement(cf,{buttonStates:{importButtonEnabled:!e.scanningPaused,snappingModeState:i,snappingModeButtonEnabled:!e.scanLimitReached,torchState:r&&T?"on":"off",torchButtonEnabled:T,reviewButtonCount:e.pages.length,reviewButtonPreviewImageUrl:h,reviewButtonEnabled:e.pages.length>0,shutterButtonState:e.scanningPaused||!B?"loading":i},sdk:e.sdk,onFileSelectDialogOpened:function(){l.current=i,o("manual")},onFileSelectDialogClosed:function(){l.current&&(o(l.current),l.current=null)},onFileUploaded:t=>e.onImageCaptured(zf(t,"IMPORTED")),snappingModeButtonClick:()=>o((e=>function(e){return"auto"===e?"manual":"auto"}(e))),onTorchButtonClick:()=>a((e=>!e)),onReviewButtonClick:e.onReviewButtonClick,onShutterButtonClick:function(){var e;return jf(this,void 0,void 0,(function*(){E(!1),R(zf(null===(e=D.current)||void 0===e?void 0:e.detectAndCrop(),"MANUAL_SNAP"))}))},scanLimitReached:e.scanLimitReached,config:e.configuration}),ro.default.createElement(rf,{open:s,config:e.configuration.screens.camera.cancelAlertDialog,onCancelClick:()=>c(!1),onActionClick:()=>{},onOkClick:e.onClose}),ro.default.createElement(Mf,{visible:C,onCloseClick:e.onClose,config:e.configuration})))}function Uf(e){const t=Object(ro.useMemo)((()=>Object(co.createTheme)({components:{MuiButtonBase:{styleOverrides:{root:{"&:hover, &:focus":{outline:"none"}}},defaultProps:{disableRipple:!0}}}})),[]);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.ThemeProvider,{theme:t},ro.default.createElement(co.Typography,{component:"div"},e.children)))}function Zf(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_856_1211",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_856_1211)"},ro.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 Gf(e){const t=e.config,n=e.isQualityAcceptable?t.acceptWhenOkButton:t.acceptWhenNotOkButton;return ro.default.createElement(co.Box,{sx:{backgroundColor:uo.b.getColorValue(e.backgroundColor),height:78,display:"flex",width:"100%",zIndex:1e3,justifyContent:"center"}},ro.default.createElement(co.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)",maxWidth:400}},ro.default.createElement(bo,{config:e.config.retakeButton,icon:Zf,enabled:!0,debugName:"ack-retake",onClick:e.onRetake}),ro.default.createElement(bo,{config:n,icon:e=>ro.default.createElement(co.Check,{style:e}),enabled:!0,debugName:"ack-use-scan",onClick:e.onAccept})))}function Yf(e){if(!e.config.visible)return null;const t=uo.b.getColorValue(e.config.color);return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_447_6066",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_447_6066)"},ro.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}),ro.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 Qf(e){if(!e.visible||!e.config.visible)return null;const t=e.config.background;return ro.default.createElement(co.Box,{style:Object.assign({backgroundColor:uo.b.getColorValue(t.fillColor),borderWidth:t.strokeWidth,borderColor:uo.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)},ro.default.createElement(Yf,{config:e.config.icon}),ro.default.createElement(po.a,{style:{marginLeft:"10px",fontSize:"14px",lineHeight:"16px",fontWeight:400},config:e.config.title}))}function Xf(e){return ro.default.createElement("img",{"data-sb-acknowledgment-image":!0,style:{display:"block",maxWidth:"90%",objectFit:"contain",flex:1,height:`calc(100 * ${mo} - 78px - 52px - 20px)`,paddingTop:10},src:e.image,alt:""})}function qf(e){if(!e.visible)return null;const t=e.isQualityAcceptable;return ro.default.createElement("div",{style:{display:"inherit",flexDirection:"inherit",justifyContent:"inherit",alignItems:"inherit",height:"100%",width:"100%"}},ro.default.createElement(Xf,{image:e.base64Image}),ro.default.createElement(Qf,{visible:!t,config:e.banner.config}),ro.default.createElement(Gf,{isQualityAcceptable:t,backgroundColor:e.bottomBar.backgroundColor,config:e.bottomBar.config,onRetake:e.bottomBar.onRetake,onAccept:e.bottomBar.onAccept}))}function Kf(e){const t=uo.b.getColorValue(e.config.checkMarkColor),n=uo.b.getColorValue(e.config.checkMarkBackgroundColor);return ro.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"},ro.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}),ro.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 Jf(e){if(!e.visible)return null;if("PageSnapFeedbackNone"===e.mode._type)return null;if("PageSnapFunnelAnimation"===e.mode._type)return ro.default.createElement(Xf,{image:e.base64Image});if("PageSnapCheckMarkAnimation"===e.mode._type)return ro.default.createElement(Kf,{config:e.mode});throw new Error(`Unknown PageSnapFeedbackMode: ${e.mode}`)}var $f=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 ep(e){const t=kh(e.croppedDetectionResult);Object(ro.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,o=e.configuration.outputSettings,r=n.acknowledgementMode,[a,s]=ro.default.useState(null),[c,l]=ro.default.useState(null),u=ro.default.useRef(null),d=null!==c,m=()=>"ALWAYS"===r||"NONE"!==r&&(!!d&&("BAD_QUALITY"===r&&!c)),h=t=>{setTimeout((()=>{f(),e.onAccept(t,u.current)}),1500)},f=()=>{s(null),l(null)},p={null:-1,VERY_POOR:0,POOR:1,REASONABLE:2,GOOD:3,EXCELLENT:4};let g;Object(ro.useEffect)((()=>{var a;if(null==t?void 0:t.value){const c=t.value.value;let d=null!==(a=c.croppedImage)&&void 0!==a?a:c.originalImage;function m(){return $f(this,void 0,void 0,(function*(){null!==o.defaultFilter&&"FILTERED_DOCUMENT"===o.documentAnalysisMode&&(d=yield e.sdk.imageFilter(d,o.defaultFilter,"COPY_IMAGE"));if("PageSnapFunnelAnimation"===i.snapFeedbackMode._type||"ALWAYS"===r||"BAD_QUALITY"===r){const t=yield e.sdk.imageToJpeg(d),n=yield ji.toBase64(t,!1);s(n)}if("NONE"===r)return l(!0),void h(t.value);if(null===c.croppedImage)return void l(!1);const a=yield e.sdk.createDocumentQualityAnalyzer(),m=yield a.analyze(d);u.current=m.quality,yield a.release();const f=p[m.quality]>=p[n.minimumQuality];l(f),f&&"BAD_QUALITY"===r&&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=uo.b.getColorValue(g);const v=i.cameraBlinkEnabled?hf:"0s";return ro.default.createElement(lo.a,{open:e.visible},ro.default.createElement(co.Fade,{tabIndex:-1,"data-sb-screen-acknowledgment":!0,in:e.visible,timeout:250,style:{position:"absolute",width:"100vw",height:`calc(100 * ${mo})`,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",transitionDelay:e.visible?v:"0s"}},ro.default.createElement(co.Box,{style:{display:e.visible?"flex":"none",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:g,zIndex:1e3}},ro.default.createElement(Jf,{visible:!m()&&d,base64Image:a,mode:i.snapFeedbackMode}),ro.default.createElement(qf,{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,u.current)}}}))))}function tp(e){const t=e.config.screens.review,[n,i]=ro.default.useState(null);return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(Gh,{backgroundColor:uo.b.getColorValue(e.config.appearance.topBarBackgroundColor),leftContent:ro.default.createElement(wo,{disabled:!e.buttonsEnabled,onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:ro.default.createElement(lo.a,{sx:{fontSize:24}}),debugName:"close-review-screen"}),centerTitle:t.topBarTitle,centerTitleReplacementArgs:[`${e.numPages}`],rightContent:ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(wo,{disabled:!e.buttonsEnabled,onClick:e=>i(e.currentTarget),visible:t.topBarMoreButton.visible,text:"",background:new Po.a({strokeColor:"transparent",fillColor:"transparent",strokeWidth:0}),foreground:new Po.f({color:t.topBarMoreButton.color,iconVisible:!0}),icon:ro.default.createElement(lo.a,{sx:{fontSize:24}}),debugName:"more",id:"sb-button-review-more",ariaLabel:uo.b.getLocalizedText(t.topBarMoreButton.accessibilityDescription)}),ro.default.createElement(co.Menu,{anchorEl:n,open:null!==n,onClose:()=>i(null),MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:uo.b.getColorValue(t.morePopup.backgroundColor)}}}},ro.default.createElement(Qh,{disabled:!1,autoFocus:!0,ariaLabel:t.morePopup.deleteAll.accessibilityDescription,onClick:()=>{i(null),e.onDeleteButtonClick()},textColor:t.morePopup.deleteAll.title.color},ro.default.createElement(lo.a,{sx:{color:uo.b.getColorValue(t.morePopup.deleteAll.icon.color),visibility:t.morePopup.deleteAll.icon.visible?"visible":"hidden"}}),ro.default.createElement(po.a,{config:t.morePopup.deleteAll.title,style:{marginLeft:8}}))))}))}function np(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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}),ro.default.createElement("path",{d:"M16.8624 19V22H18.8624V19H21.8624V17H18.8624V14H16.8624V17H13.8624V19H16.8624Z",fill:t}))}function ip(e){const t=uo.b.getColorValue(e.color);return ro.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.default.createElement("mask",{id:"mask0_856_1229",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},ro.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),ro.default.createElement("g",{mask:"url(#mask0_856_1229)"},ro.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 op(){return dh("tablet")?80:160}function rp(e){const t=dh("tablet"),n=e.config.screens.review,i=ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(vo,{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})},ro.default.createElement(po.a,{config:{text:uo.b.getLocalizedText(n.bottomBar.submitButton.text),visible:!0,color:n.bottomBar.submitButton.foreground.color,useShadow:n.bottomBar.submitButton.foreground.useShadow}}))),o=Object.assign(Object.assign({padding:"4px"},yo(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 ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:op(),width:"100%"}},ro.default.createElement(co.Box,{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:t?"space-between":"center",height:80}},t&&ro.default.createElement(co.Box,{visibility:"hidden"}),ro.default.createElement(co.Box,{style:{display:"flex",flexDirection:"row",maxWidth:"600px",justifyContent:"space-around",flexGrow:1}},ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.addButton,icon:np,onClick:e.onAddPageClick,debugName:"add-page"}),ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.retakeButton,icon:Zf,onClick:e.onRetakeClick,debugName:"retake"}),ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.cropButton,icon:e=>ro.default.createElement(lo.a,{sx:{color:e}}),onClick:e.onCropClick,debugName:"crop-button"}),ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.rotateButton,icon:e=>ro.default.createElement(lo.a,{sx:{color:e}}),onClick:e.onRotateClick,debugName:"rotate-button"}),ro.default.createElement(bo,{enabled:e.buttonsEnabled,config:n.bottomBar.deleteButton,icon:ip,onClick:e.onDeleteClick,debugName:"delete-button"})),t&&ro.default.createElement(co.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":uo.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:172,marginX:"4px"},o),onClick:e.onSubmitClick},i)),!t&&ro.default.createElement(co.Box,{style:{padding:"12px",display:"flex"}},ro.default.createElement(co.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":uo.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:600,margin:"0 auto"},o),onClick:e.onSubmitClick},i))))}function ap(e){const t=e.config.pageCounter;return ro.default.createElement(co.Box,{style:{display:"flex",width:"100%",backgroundColor:uo.b.getColorValue(e.config.backgroundColor),justifyContent:"space-between",alignItems:"end",padding:"16px 0"}},ro.default.createElement(co.Box,{style:{width:72,height:20}}),ro.default.createElement(co.Box,null,ro.default.createElement(vo,{polygonConfig:{strokeColor:t.background.strokeColor,fillColor:t.background.fillColor,strokeWidth:t.background.strokeWidth,cornerRadius:4},style:{visibility:t.visible?"visible":"hidden"}},ro.default.createElement(po.a,{config:t.title,replacementArgs:[`${e.currentPage}`,`${e.totalNumPages}`],style:{fontSize:14,padding:"8px 12px"}}))),ro.default.createElement(co.Box,null,ro.default.createElement(co.IconButton,{onClick:e.onZoomButtonClick,"aria-label":uo.b.getLocalizedText(e.config.zoomButton.accessibilityDescription),sx:Object.assign({backgroundColor:uo.b.getColorValue(e.config.zoomButton.backgroundColor),color:uo.b.getColorValue(e.config.zoomButton.foregroundColor),margin:"0 16px",visibility:e.config.zoomButton.visible?"visible":"hidden","&:hover":{backgroundColor:uo.b.getColorValue(e.config.zoomButton.activeBackgroundColor),color:uo.b.getColorValue(e.config.zoomButton.activeForegroundColor)}},yo(e.config.zoomButton.foregroundColor))},ro.default.createElement(lo.a,null))))}function sp(){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ro.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"},ro.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"})),ro.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"},ro.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 cp(e){return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Dialog,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},slotProps:{backdrop:{style:{backgroundColor:"transparent"}}},open:e.open,transitionDuration:100},ro.default.createElement(co.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"}},ro.default.createElement(sp,null))))}function lp(e){const t=e.config.visible&&e.active;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement("div",{style:{width:"40px"}},ro.default.createElement(co.Button,{[`data-sb-button-${e.debugName}`]:!0,sx:Object.assign({color:uo.b.getColorValue(e.config.color),minWidth:"auto",visibility:t?"visible":"hidden",paddingX:"4px",marginX:"4px"},Co(e.config.color)),onClick:e.onClick,"aria-label":uo.b.getLocalizedText(e.config.accessibilityDescription)},ro.default.createElement(e.icon,null))))}var up=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 dp(e){var t,n;const i=kh(e.page.finalImageUrl()),[o,r]=ro.default.useState(null),[a,s]=ro.default.useState(!1);Object(ro.useEffect)((()=>{(()=>{up(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})),r(i.value),s(!1)),e.animateRotation&&s(!0)}))})()}),[i.value,e.animateRotation]);const c=ro.default.useRef(null),l=(()=>{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),o=t.clientWidth/t.clientHeight;n=t.clientHeight>e.naturalWidth&&t.clientWidth>e.naturalHeight?Math.max(e.naturalHeight/t.clientHeight,1):i<o?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===o&&null!==e.onAnimateRotationDone.current?(null===(n=(t=e.onAnimateRotationDone).current)||void 0===n||n.call(t),null):ro.default.createElement(ro.default.Fragment,null,o&&ro.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),l),src:o,alt:`Page ${e.index}`}))}function mp(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function hp(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],o=t[n];return"function"==typeof i?`${i}`==`${o}`:mp(i)&&mp(o)?hp(i,o):i===o}))}function fp(e){return e.concat().sort(((e,t)=>e.name>t.name?1:-1)).map((e=>e.options))}function pp(e){return"number"==typeof e}function gp(e){return"string"==typeof e}function vp(e){return"boolean"==typeof e}function Cp(e){return"[object Object]"===Object.prototype.toString.call(e)}function yp(e){return Math.abs(e)}function bp(e){return Math.sign(e)}function Ap(e,t){return yp(e-t)}function Sp(e){return Tp(e).map(Number)}function wp(e){return e[Ep(e)]}function Ep(e){return Math.max(0,e.length-1)}function xp(e,t){return t===Ep(e)}function Dp(e,t=0){return Array.from(Array(e),((e,n)=>t+n))}function Tp(e){return Object.keys(e)}function Bp(e,t){return[e,t].reduce(((e,t)=>(Tp(t).forEach((n=>{const i=e[n],o=t[n],r=Cp(i)&&Cp(o);e[n]=r?Bp(i,o):o})),e)),{})}function Ip(e,t){return"undefined"!=typeof t.MouseEvent&&e instanceof t.MouseEvent}function kp(){let e=[];const t={add:function(n,i,o,r={passive:!0}){let a;if("addEventListener"in n)n.addEventListener(i,o,r),a=()=>n.removeEventListener(i,o,r);else{const e=n;e.addListener(o),a=()=>e.removeListener(o)}return e.push(a),t},clear:function(){e=e.filter((e=>e()))}};return t}function Op(e,t,n,i){const o=kp(),r=1e3/60;let a=null,s=0,c=0;function l(e){if(!c)return;a||(a=e);const o=e-a;for(a=e,s+=o;s>=r;)n(r),s-=r;i(s/r),c&&t.requestAnimationFrame(l)}function u(){t.cancelAnimationFrame(c),a=null,s=0,c=0}return{init:function(){o.add(e,"visibilitychange",(()=>{e.hidden&&(a=null,s=0)}))},destroy:function(){u(),o.clear()},start:function(){c||(c=t.requestAnimationFrame(l))},stop:u,update:()=>n(r),render:i}}function Lp(e=0,t=0){const n=yp(e-t);function i(t){return t<e}function o(e){return e>t}function r(e){return i(e)||o(e)}return{length:n,max:t,min:e,constrain:function(n){return r(n)?i(n)?e:t:n},reachedAny:r,reachedMax:o,reachedMin:i,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}}}function Pp(e,t,n){const{constrain:i}=Lp(0,e),o=e+1;let r=a(t);function a(e){return n?yp((o+e)%o):i(e)}function s(){return r}function c(){return Pp(e,s(),n)}const l={get:s,set:function(e){return r=a(e),l},add:function(e){return c().set(s()+e)},clone:c};return l}function _p(e,t,n,i,o,r,a,s,c,l,u,d,m,h,f,p,g,v,C){const{cross:y,direction:b}=e,A=["INPUT","SELECT","TEXTAREA"],S={passive:!1},w=kp(),E=kp(),x=Lp(50,225).constrain(h.measure(20)),D={mouse:300,touch:400},T={mouse:500,touch:600},B=f?43:25;let I=!1,k=0,O=0,L=!1,P=!1,_=!1,R=!1;function F(e){if(!Ip(e,i)&&e.touches.length>=2)return N(e);const t=r.readPoint(e),n=r.readPoint(e,y),a=Ap(t,k),c=Ap(n,O);if(!P&&!R){if(!e.cancelable)return N(e);if(P=a>c,!P)return N(e)}const u=r.pointerMove(e);a>p&&(_=!0),l.useFriction(.3).useDuration(.75),s.start(),o.add(b(u)),e.preventDefault()}function N(e){const t=u.byDistance(0,!1).index!==d.get(),n=r.pointerUp(e)*(f?T:D)[R?"mouse":"touch"],i=function(e,t){const n=d.add(-1*bp(e)),i=u.byDistance(e,!f).distance;return f||yp(e)<x?i:g&&t?.5*i:u.byIndex(n.get(),0).distance}(b(n),t),o=function(e,t){if(0===e||0===t)return 0;if(yp(e)<=yp(t))return 0;const n=Ap(yp(e),yp(t));return yp(n/e)}(n,i),a=B-10*o,s=v+o/50;P=!1,L=!1,E.clear(),l.useDuration(a).useFriction(s),c.distance(i,!f),R=!1,m.emit("pointerUp")}function M(e){_&&(e.stopPropagation(),e.preventDefault(),_=!1)}return{init:function(e){if(!C)return;function s(s){(vp(C)||C(e,s))&&function(e){const s=Ip(e,i);if(R=s,_=f&&s&&!e.buttons&&I,I=Ap(o.get(),a.get())>=2,s&&0!==e.button)return;if(function(e){const t=e.nodeName||"";return A.includes(t)}(e.target))return;L=!0,r.pointerDown(e),l.useFriction(0).useDuration(0),o.set(a),function(){const e=R?n:t;E.add(e,"touchmove",F,S).add(e,"touchend",N).add(e,"mousemove",F,S).add(e,"mouseup",N)}(),k=r.readPoint(e),O=r.readPoint(e,y),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",N).add(c,"contextmenu",N).add(c,"click",M,!0)},destroy:function(){w.clear(),E.clear()},pointerDown:function(){return L}}}function Rp(e,t){let n,i;function o(e){return e.timeStamp}function r(n,i){const o="client"+("x"===(i||e.scroll)?"X":"Y");return(Ip(n,t)?n:n.touches[0])[o]}return{pointerDown:function(e){return n=e,i=e,r(e)},pointerMove:function(e){const t=r(e)-r(i),a=o(e)-o(n)>170;return i=e,a&&(n=e),t},pointerUp:function(e){if(!n||!i)return 0;const t=r(i)-r(n),a=o(e)-o(n),s=o(e)-o(i)>170,c=t/a;return a&&!s&&yp(c)>.1?c:0},readPoint:r}}function Fp(e,t,n,i,o,r,a){const s=[e].concat(i);let c,l,u=[],d=!1;function m(e){return o.measureSize(a.measure(e))}return{init:function(o){r&&(l=m(e),u=i.map(m),c=new ResizeObserver((n=>{(vp(r)||r(o,n))&&function(n){for(const r of n){if(d)return;const n=r.target===e,a=i.indexOf(r.target),s=n?l:u[a];if(yp(m(n?e:i[a])-s)>=.5){o.reInit(),t.emit("resize");break}}}(n)})),n.requestAnimationFrame((()=>{s.forEach((e=>c.observe(e)))})))},destroy:function(){d=!0,c&&c.disconnect()}}}function Np(e,t,n,i,o){const r=o.measure(10),a=o.measure(50),s=Lp(.1,.99);let c=!1;function l(){return!c&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:l,constrain:function(o){if(!l())return;const c=e.reachedMin(t.get())?"min":"max",u=yp(e[c]-t.get()),d=n.get()-t.get(),m=s.constrain(u/a);n.subtract(d*m),!o&&yp(d)<r&&(n.set(e.constrain(n.get())),i.useDuration(25).useBaseFriction())},toggleActive:function(e){c=!e}}}function Mp(e,t,n,i){const o=t.min+.1,r=t.max+.1,{reachedMin:a,reachedMax:s}=Lp(o,r);return{loop:function(t){if(!function(e){return 1===e?s(n.get()):-1===e&&a(n.get())}(t))return;const o=e*(-1*t);i.forEach((e=>e.add(o)))}}}function Vp(e,t,n,i,o){const{reachedAny:r,removeOffset:a,constrain:s}=i;function c(e){return e.concat().sort(((e,t)=>yp(e)-yp(t)))[0]}function l(t,i){const o=[t,t+n,t-n];if(!e)return t;if(!i)return c(o);const r=o.filter((e=>bp(e)===i));return r.length?c(r):wp(o)-n}const u={byDistance:function(n,i){const c=o.get()+n,{index:u,distance:d}=function(n){const i=e?a(n):s(n),o=t.map(((e,t)=>({diff:l(e-i,0),index:t}))).sort(((e,t)=>yp(e.diff)-yp(t.diff))),{index:r}=o[0];return{index:r,distance:i}}(c),m=!e&&r(c);return!i||m?{index:u,distance:n}:{index:u,distance:n+l(t[u]-d,0)}},byIndex:function(e,n){return{index:e,distance:l(t[e]-o.get(),n)}},shortcut:l};return u}function Wp(e,t,n,i,o,r,a,s){const c={passive:!0,capture:!0};let l=0;function u(e){"Tab"===e.code&&(l=(new Date).getTime())}return{init:function(d){s&&(r.add(document,"keydown",u,!1),t.forEach(((t,u)=>{r.add(t,"focus",(t=>{(vp(s)||s(d,t))&&function(t){if((new Date).getTime()-l>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const r=n.findIndex((e=>e.includes(t)));pp(r)&&(o.useDuration(0),i.index(r,0),a.emit("slideFocus"))}(u)}),c)})))}}}function zp(e){let t=e;function n(e){return pp(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 jp(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 o=!1;return{clear:function(){o||(i.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){o||(i.transform=n(e.direction(t)))},toggleActive:function(e){o=!e}}}function Hp(e,t,n,i,o,r,a,s,c){const l=Sp(o),u=Sp(o).reverse(),d=function(){const e=a[0];return f(h(u,e),n,!1)}().concat(function(){const e=t-a[0]-1;return f(h(l,e),-n,!0)}());function m(e,t){return e.reduce(((e,t)=>e-o[t]),t)}function h(e,t){return e.reduce(((e,n)=>m(e,t)>0?e.concat([n]):e),[])}function f(o,a,l){const u=function(e){return r.map(((n,o)=>({start:n-i[o]+.5+e,end:n+t-.5+e})))}(a);return o.map((t=>{const i=l?0:-n,o=l?n:0,r=l?"end":"start",a=u[t][r];return{index:t,loopPoint:a,slideLocation:zp(-1),translate:jp(e,c[t]),target:()=>s.get()>a?i:o}}))}return{canLoop:function(){return d.every((({index:e})=>m(l.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,o=t();o!==i.get()&&(n.to(o),i.set(o))}))},loopPoints:d}}function Up(e,t,n){let i,o=!1;return{init:function(r){n&&(i=new MutationObserver((e=>{o||(vp(n)||n(r,e))&&function(e){for(const n of e)if("childList"===n.type){r.reInit(),t.emit("slidesChanged");break}}(e)})),i.observe(e,{childList:!0}))},destroy:function(){i&&i.disconnect(),o=!0}}}function Zp(e,t,n,i){const o={};let r,a=null,s=null,c=!1;return{init:function(){r=new IntersectionObserver((e=>{c||(e.forEach((e=>{const n=t.indexOf(e.target);o[n]=e})),a=null,s=null,n.emit("slidesInView"))}),{root:e.parentElement,threshold:i}),t.forEach((e=>r.observe(e)))},destroy:function(){r&&r.disconnect(),c=!0},get:function(e=!0){if(e&&a)return a;if(!e&&s)return s;const t=function(e){return Tp(o).reduce(((t,n)=>{const i=parseInt(n),{isIntersecting:r}=o[i];return(e&&r||!e&&!r)&&t.push(i),t}),[])}(e);return e&&(a=t),e||(s=t),t}}}function Gp(e,t,n,i,o,r,a,s,c){const{startEdge:l,endEdge:u,direction:d}=e,m=pp(n);return{groupSlides:function(e){return m?function(e,t){return Sp(e).filter((e=>e%t==0)).map((n=>e.slice(n,n+t)))}(e,n):function(e){return e.length?Sp(e).reduce(((n,m,h)=>{const f=wp(n)||0,p=0===f,g=m===Ep(e),v=o[l]-r[f][l],C=o[l]-r[m][u],y=!i&&p?d(a):0,b=yp(C-(!i&&g?d(s):0)-(v+y));return h&&b>t+c&&n.push(m),g&&n.push(e.length),n}),[]).map(((t,n,i)=>{const o=Math.max(i[n-1]||0);return e.slice(o,t)})):[]}(e)}}}function Yp(e,t,n,i,o,r,a){const{align:s,axis:c,direction:l,startIndex:u,loop:d,duration:m,dragFree:h,dragThreshold:f,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:C,watchResize:y,watchSlides:b,watchDrag:A,watchFocus:S}=r,w={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:i,offsetHeight:o}=e;return{top:t,right:n+i,bottom:t+o,left:n,width:i,height:o}}},E=w.measure(t),x=n.map(w.measure),D=function(e,t){const n="rtl"===t,i="y"===e,o=!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*o}}}(c,l),T=D.measureSize(E),B=function(e){return{measure:function(t){return e*(t/100)}}}(T),I=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,o){return gp(e)?n[e](i):e(t,i,o)}}}(s,T),k=!d&&!!C,O=d||!!C,{slideSizes:L,slideSizesWithGaps:P,startGap:_,endGap:R}=function(e,t,n,i,o,r){const{measureSize:a,startEdge:s,endEdge:c}=e,l=n[0]&&o,u=function(){if(!l)return 0;const e=n[0];return yp(t[s]-e[s])}(),d=function(){if(!l)return 0;const e=r.getComputedStyle(wp(i));return parseFloat(e.getPropertyValue(`margin-${c}`))}(),m=n.map(a),h=n.map(((e,t,n)=>{const i=!t,o=xp(n,t);return i?m[t]+u:o?m[t]+d:n[t+1][s]-e[s]})).map(yp);return{slideSizes:m,slideSizesWithGaps:h,startGap:u,endGap:d}}(D,E,x,n,O,o),F=Gp(D,T,g,d,E,x,_,R,2),{snaps:N,snapsAligned:M}=function(e,t,n,i,o){const{startEdge:r,endEdge:a}=e,{groupSlides:s}=o,c=s(i).map((e=>wp(e)[a]-e[0][r])).map(yp).map(t.measure),l=i.map((e=>n[r]-e[r])).map((e=>-yp(e))),u=s(l).map((e=>e[0])).map(((e,t)=>e+c[t]));return{snaps:l,snapsAligned:u}}(D,I,E,x,F),V=-wp(N)+wp(P),{snapsContained:W,scrollContainLimit:z}=function(e,t,n,i,o){const r=Lp(-t+e,0),a=n.map(((e,t)=>{const{min:i,max:o}=r,a=r.constrain(e),s=!t,l=xp(n,t);return s?o:l||c(i,a)?i:c(o,a)?o:a})).map((e=>parseFloat(e.toFixed(3)))),s=function(){const e=a[0],t=wp(a);return Lp(a.lastIndexOf(e),a.indexOf(t)+1)}();function c(e,t){return Ap(e,t)<1}return{snapsContained:function(){if(t<=e+o)return[r.max];if("keepSnaps"===i)return a;const{min:n,max:c}=s;return a.slice(n,c)}(),scrollContainLimit:s}}(T,V,M,C,2),j=k?W:M,{limit:H}=function(e,t,n){const i=t[0];return{limit:Lp(n?i-e:wp(t),i)}}(V,j,d),U=Pp(Ep(j),u,d),Z=U.clone(),G=Sp(n),Y=Op(i,o,(e=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:i}},o)=>{i||n.constrain(e.pointerDown()),t.seek(o)})(se,e)),(e=>(({scrollBody:e,translate:t,location:n,offsetLocation:i,scrollLooper:o,slideLooper:r,dragHandler:a,animation:s,eventHandler:c,scrollBounds:l,options:{loop:u}},d)=>{const m=e.settled(),h=!l.shouldConstrain(),f=u?m:m&&h;f&&!a.pointerDown()&&(s.stop(),c.emit("settle")),f||c.emit("scroll");const p=n.get()*d+q.get()*(1-d);i.set(p),u&&(o.loop(e.direction()),r.loop()),t.to(i.get())})(se,e))),Q=j[U.get()],X=zp(Q),q=zp(Q),K=zp(Q),J=zp(Q),$=function(e,t,n,i,o,r){let a=0,s=0,c=o,l=r,u=e.get(),d=0;function m(e){return c=e,f}function h(e){return l=e,f}const f={direction:function(){return s},duration:function(){return c},velocity:function(){return a},seek:function(t){const o=t/1e3,r=c*o,m=i.get()-e.get();let h=0;return c?(n.set(e),a+=m/r,a*=l,u+=a,e.add(a*o),h=u-d):(a=0,n.set(i),e.set(i),h=m),s=bp(h),d=u,f},settled:function(){return yp(i.get()-t.get())<.001},useBaseFriction:function(){return h(r)},useBaseDuration:function(){return m(o)},useFriction:h,useDuration:m};return f}(X,K,q,J,m,.68),ee=Vp(d,j,V,H,J),te=function(e,t,n,i,o,r,a){function s(o){const s=o.distance,c=o.index!==t.get();r.add(s),s&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),c&&(n.set(t.get()),t.set(o.index),a.emit("select"))}return{distance:function(e,t){s(o.byDistance(e,t))},index:function(e,n){const i=t.clone().set(e);s(o.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=kp(),oe=Zp(t,n,a,p),{slideRegistry:re}=function(e,t,n,i,o,r){const{groupSlides:a}=o,{min:s,max:c}=i;return{slideRegistry:function(){const i=a(r),o=!e||"keepSnaps"===t;return 1===n.length?[r]:o?i:i.slice(s,c).map(((e,t,n)=>{const i=!t,o=xp(n,t);return i?Dp(wp(n[0])+1):o?Dp(Ep(r)-wp(n)[0]+1,wp(n)[0]):e}))}()}}(k,C,j,z,F,G),ae=Wp(e,n,re,te,$,ie,a,S),se={ownerDocument:i,ownerWindow:o,eventHandler:a,containerRect:E,slideRects:x,animation:Y,axis:D,dragHandler:_p(D,e,i,o,J,Rp(D,o),X,Y,te,$,ee,U,a,B,h,f,v,.68,A),eventStore:ie,percentOfView:B,index:U,indexPrevious:Z,limit:H,location:X,offsetLocation:K,previousLocation:q,options:r,resizeHandler:Fp(t,a,o,n,D,y,w),scrollBody:$,scrollBounds:Np(H,K,J,$,B),scrollLooper:Mp(V,H,K,[X,K,q,J]),scrollProgress:ne,scrollSnapList:j.map(ne.get),scrollSnaps:j,scrollTarget:ee,scrollTo:te,slideLooper:Hp(D,T,V,L,P,N,j,K,n),slideFocus:ae,slidesHandler:Up(t,a,b),slidesInView:oe,slideIndexes:G,slideRegistry:re,slidesToScroll:F,target:J,translate:jp(D,t)};return se}const Qp={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 Xp(e){function t(e,t){return Bp(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const i=n.breakpoints||{},o=Tp(i).filter((t=>e.matchMedia(t).matches)).map((e=>i[e])).reduce(((e,n)=>t(e,n)),{});return t(n,o)},optionsMediaQueries:function(t){return t.map((e=>Tp(e.breakpoints||{}))).reduce(((e,t)=>e.concat(t)),[]).map(e.matchMedia)}};return n}function qp(e,t,n){const i=e.ownerDocument,o=i.defaultView,r=Xp(o),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()))}}}(r),s=kp(),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,o){return t[e]=n(e).filter((e=>e!==o)),i},on:function(e,o){return t[e]=n(e).concat([o]),i},clear:function(){t={}}};return i}(),{mergeOptions:l,optionsAtMedia:u,optionsMediaQueries:d}=r,{on:m,off:h,emit:f}=c,p=D;let g,v,C,y,b=!1,A=l(Qp,qp.globalOptions),S=l(A),w=[];function E(t){const n=Yp(e,C,y,i,o,t,c);if(t.loop&&!n.slideLooper.canLoop()){return E(Object.assign({},t,{loop:!1}))}return n}function x(t,n){b||(A=l(A,t),S=u(A),w=n||w,function(){const{container:t,slides:n}=S,i=gp(t)?e.querySelector(t):t;C=i||e.children[0];const o=gp(n)?C.querySelectorAll(n):n;y=[].slice.call(o||C.children)}(),g=E(S),d([A,...w.map((({options:e})=>e))]).forEach((e=>s.add(e,"change",D))),S.active&&(g.translate.to(g.location.get()),g.animation.init(),g.slidesInView.init(),g.slideFocus.init(k),g.eventHandler.init(k),g.resizeHandler.init(k),g.slidesHandler.init(k),g.options.loop&&g.slideLooper.loop(),C.offsetParent&&y.length&&g.dragHandler.init(k),v=a.init(k,w)))}function D(e,t){const n=I();T(),x(l({startIndex:n},e),t),c.emit("reInit")}function T(){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 B(e,t,n){S.active&&!b&&(g.scrollBody.useBaseFriction().useDuration(!0===t?0:S.duration),g.scrollTo.index(e,n||0))}function I(){return g.index.get()}const k={canScrollNext:function(){return g.index.add(1).get()!==I()},canScrollPrev:function(){return g.index.add(-1).get()!==I()},containerNode:function(){return C},internalEngine:function(){return g},destroy:function(){b||(b=!0,s.clear(),T(),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){B(g.index.add(1).get(),e,-1)},scrollPrev:function(e){B(g.index.add(-1).get(),e,1)},scrollProgress:function(){return g.scrollProgress.get(g.location.get())},scrollSnapList:function(){return g.scrollSnapList},scrollTo:B,selectedScrollSnap:I,slideNodes:function(){return y},slidesInView:function(){return g.slidesInView.get()},slidesNotInView:function(){return g.slidesInView.get(!1)}};return x(t,n),setTimeout((()=>c.emit("init")),0),k}function Kp(e={},t=[]){const n=Object(ro.useRef)(e),i=Object(ro.useRef)(t),[o,r]=Object(ro.useState)(),[a,s]=Object(ro.useState)(),c=Object(ro.useCallback)((()=>{o&&o.reInit(n.current,i.current)}),[o]);return Object(ro.useEffect)((()=>{hp(n.current,e)||(n.current=e,c())}),[e,c]),Object(ro.useEffect)((()=>{(function(e,t){if(e.length!==t.length)return!1;const n=fp(e),i=fp(t);return n.every(((e,t)=>hp(e,i[t])))})(i.current,t)||(i.current=t,c())}),[t,c]),Object(ro.useEffect)((()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){qp.globalOptions=Kp.globalOptions;const e=qp(a,n.current,i.current);return r(e),()=>e.destroy()}r(void 0)}),[a,r]),[s,o]}qp.globalOptions=void 0,Kp.globalOptions=void 0;function Jp(e){var t,n,i;const o=Object(ro.useMemo)((()=>{var t;return null!==(t=e.currentPosition)&&void 0!==t?t:0}),[]),r={duration:20,startIndex:o},[a,s]=Kp(r);Object(ro.useEffect)((()=>{s&&s.on("select",(()=>{e.onGoToPage(null==s?void 0:s.selectedScrollSnap())}))}),[s]),Object(ro.useEffect)((()=>{s&&(e.buttonsEnabled?s.reInit({watchDrag:!0}):s.reInit({watchDrag:!1}))}),[e.buttonsEnabled]);const c=op();return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{sx:{flexGrow:1,backgroundColor:uo.b.getColorValue(e.configuration.screens.review.backgroundColor),width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"32px"}},ro.default.createElement(lp,{config:e.configuration.screens.review.switchPreviousPageButton,icon:lo.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition-1),active:e.currentPosition>0,debugName:"carousel-back"}),ro.default.createElement("div",{className:"embla",ref:a,style:{overflow:"hidden",width:"100%",height:"100%"}},ro.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)=>ro.default.createElement("div",{className:"embla__slide",key:t.id,style:{position:"relative",minWidth:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0"}},ro.default.createElement(dp,{page:t,animateRotation:t.id===e.currentlyRotatingPageId,onAnimateRotationDone:e.onRotationAnimationDone,index:n+1,style:{maxHeight:`calc(100 * ${mo} - ${50+c+72+32}px)`,maxWidth:"100%"}})))))),ro.default.createElement(lp,{config:e.configuration.screens.review.switchNextPageButton,icon:lo.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 $p=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 eg(e){var t,n,i,o,r,a;const s=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),[c,l]=ro.default.useState(!1);Object(ro.useEffect)((()=>{e.visible&&!e.configuration.screens.review.enabled&&e.onSubmit()}),[e.visible]),Object(ro.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[u,d]=Object(ro.useState)(!0),[m,h]=Object(ro.useState)(null),f=Object(ro.useRef)(null),[p,g]=Object(ro.useState)(!1),[v,C]=Object(ro.useState)(!1);return Object(ro.useEffect)((()=>{d(!p&&!v)}),[p,v]),e.visible?ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(cp,{open:c}),ro.default.createElement(rf,{open:p,config:e.configuration.screens.review.deletePageAlertDialog,onCancelClick:()=>g(!1),onActionClick:()=>{g(!1),e.onRetakeImage(e.currentPosition)},onOkClick:()=>$p(this,void 0,void 0,(function*(){var t,n,i;l(!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),l(!1),g(!1)}))}),ro.default.createElement(rf,{open:v,config:e.configuration.screens.review.deleteAllPagesAlertDialog,onCancelClick:()=>C(!1),onOkClick:()=>$p(this,void 0,void 0,(function*(){var t;l(!0),yield null===(t=e.document)||void 0===t?void 0:t.deleteAllPages(),l(!1),C(!1)}))}),ro.default.createElement(co.Box,{"data-sb-screen-review":!0,display:e.visible?"flex":"none",style:{position:"absolute",width:"100vw",height:`calc(100 * ${mo})`,flexDirection:"column",alignItems:"center",justifyContent:"center"}},ro.default.createElement(tp,{config:e.configuration,numPages:null===(o=null===(i=e.document)||void 0===i?void 0:i.pages)||void 0===o?void 0:o.length,onCloseButtonClick:e.onClose,onDeleteButtonClick:()=>C(!0),buttonsEnabled:u}),ro.default.createElement(Jp,{buttonsEnabled:u,document:e.document,currentPosition:e.currentPosition,onGoToPage:e.onGoToPage,configuration:e.configuration,onRotationAnimationDone:f,currentlyRotatingPageId:m}),ro.default.createElement(ap,{config:e.configuration.screens.review,currentPage:e.currentPosition+1,totalNumPages:null===(a=null===(r=e.document)||void 0===r?void 0:r.pages)||void 0===a?void 0:a.length,onZoomButtonClick:()=>e.onZoomButtonClick(e.currentPosition)}),ro.default.createElement(rp,{config:e.configuration,onSubmitClick:e.onSubmit,onAddPageClick:()=>{e.onInsertImage(e.currentPosition+1)},onRetakeClick:()=>e.onRetakeImage(e.currentPosition),onCropClick:()=>e.onCropButtonClick(e.currentPosition),onRotateClick:()=>$p(this,void 0,void 0,(function*(){var t,n;if(null!==f.current)return;d(!1),l(!0);const i=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),o=new Promise((e=>{f.current=e,h(i.id)})),r=null===(n=e.document)||void 0===n?void 0:n.cropAndRotatePage(i,null,1);yield Promise.all([o,r]),yield i.finalImageUrl(),f.current=null,h(null),d(!0),l(!1)})),onDeleteClick:()=>g(!0),buttonsEnabled:u}))):null}var tg=function(e,t){return Number(e.toFixed(t))},ng=function(e,t,n){n&&"function"==typeof n&&n(e,t)},ig={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}},og=function(e){"number"==typeof e&&cancelAnimationFrame(e)},rg=function(e){e.mounted&&(og(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function ag(e,t,n,i){if(e.mounted){var o=(new Date).getTime();rg(e),e.animation=function(){if(!e.mounted)return og(e.animation);var r=(new Date).getTime()-o,a=(0,ig[t])(r/n);r>=n?(i(1),e.animation=null):e.animation&&(i(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function sg(e,t,n,i){var o=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&&o){var r=e.setTransformState,a=e.transformState,s=a.scale,c=a.positionX,l=a.positionY,u=t.scale-s,d=t.positionX-c,m=t.positionY-l;0===n?r(t.scale,t.positionX,t.positionY):ag(e,i,n,(function(e){r(s+u*e,c+d*e,l+m*e)}))}}var cg=function(e,t){var n=e.wrapperComponent,i=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!i)throw new Error("Components are not mounted");var r=function(e,t,n){var i=e.offsetWidth,o=e.offsetHeight,r=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:i,wrapperHeight:o,newContentWidth:r,newDiffWidth:i-r,newContentHeight:a,newDiffHeight:o-a}}(n,i,t),a=r.wrapperWidth,s=r.wrapperHeight,c=function(e,t,n,i,o,r,a){var s=e>t?n*(a?1:.5):0,c=i>o?r*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:i-o-c,maxPositionY:c}}(a,r.newContentWidth,r.newDiffWidth,s,r.newContentHeight,r.newDiffHeight,Boolean(o));return c},lg=function(e,t,n,i){return tg(i?e<t?t:e>n?n:e:e,2)},ug=function(e,t){var n=cg(e,t);return e.bounds=n,n};function dg(e,t,n,i,o,r,a){var s=n.minPositionX,c=n.minPositionY,l=n.maxPositionX,u=n.maxPositionY,d=0,m=0;return a&&(d=o,m=r),{x:lg(e,s-d,l+d,i),y:lg(t,c-m,u+m,i)}}function mg(e,t,n,i,o,r){var a=e.transformState,s=a.scale,c=a.positionX,l=a.positionY,u=i-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:c,y:l}):dg(c-t*u,l-n*u,o,r,0,0,null)}function hg(e,t,n,i,o){var r=t-(o?i:0);return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=r?r:e}var fg=function(e,t){var n=e.setup.panning.excluded,i=e.isInitialized,o=e.wrapperComponent,r=t.target,a="shadowRoot"in r&&"composedPath"in t?t.composedPath().some((function(e){return e instanceof Element&&(null==o?void 0:o.contains(e))})):null==o?void 0:o.contains(r);return!!(i&&r&&a)&&!Yg(r,n)},pg=function(e){var t=e.isInitialized,n=e.isPanning,i=e.setup.panning.disabled;return!(!t||!n||i)};function gg(e,t,n,i,o){var r=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,c=e.transformState,l=c.scale,u=c.positionX,d=c.positionY;if(null!==a&&null!==s&&(t!==u||n!==d)){var m=dg(t,n,s,r,i,o,a),h=m.x,f=m.y;e.setTransformState(l,h,f)}}var vg=function(e,t){var n=e.setup,i=e.transformState.scale,o=n.minScale,r=n.disablePadding;return t>0&&i>=o&&!r?t:0};function Cg(e,t,n,i,o,r,a,s,c,l){if(o){var u;if(t>a&&n>a)return(u=a+(e-a)*l)>c?c:u<a?a:u;if(t<r&&n<r)return(u=r+(e-r)*l)<s?s:u>r?r:u}return i?t:lg(e,r,a,o)}function yg(e,t){var n=function(e){var t=e.mounted,n=e.setup,i=n.disabled,o=n.velocityAnimation,r=e.transformState.scale;return!(o.disabled&&!(r>1)&&i&&!t)}(e);if(n){var i=e.lastMousePosition,o=e.velocityTime,r=e.setup,a=e.wrapperComponent,s=r.velocityAnimation.equalToMove,c=Date.now();if(i&&o&&a){var l=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-i.x,d=t.y-i.y,m=u/l,h=d/l,f=c-o,p=u*u+d*d,g=Math.sqrt(p)/f;e.velocity={velocityX:m,velocityY:h,total:g}}e.lastMousePosition=t,e.velocityTime=c}}function bg(e,t){var n=e.transformState.scale;rg(e),ug(e,n),void 0!==window.TouchEvent&&t instanceof TouchEvent?function(e,t){var n=t.touches,i=e.transformState,o=i.positionX,r=i.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-r}}}(e,t):function(e,t){var n=e.transformState,i=n.positionX,o=n.positionY;e.isPanning=!0;var r=t.clientX,a=t.clientY;e.startCoords={x:r-i,y:a-o}}(e,t)}function Ag(e){var t=e.transformState.scale,n=e.setup,i=n.minScale,o=n.alignmentAnimation,r=o.disabled,a=o.sizeX,s=o.sizeY,c=o.animationTime,l=o.animationType;if(!(r||t<i||!a&&!s)){var u=function(e){var t=e.transformState,n=t.positionX,i=t.positionY,o=t.scale,r=e.setup,a=r.disabled,s=r.limitToBounds,c=r.centerZoomedOut,l=e.wrapperComponent;if(!a&&l&&e.bounds){var u=e.bounds,d=u.maxPositionX,m=u.minPositionX,h=u.maxPositionY,f=u.minPositionY,p=n>d||n<m,g=i>h||i<f,v=mg(e,n>d?l.offsetWidth:e.setup.minPositionX||0,i>h?l.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||c),C=v.x,y=v.y;return{scale:o,positionX:p?C:n,positionY:g?y:i}}}(e);u&&sg(e,u,c,l)}}function Sg(e,t,n){var i=e.startCoords,o=e.setup.alignmentAnimation,r=o.sizeX,a=o.sizeY;if(i){var s=function(e,t,n){var i=e.startCoords,o=e.transformState,r=e.setup.panning,a=r.lockAxisX,s=r.lockAxisY,c=o.positionX,l=o.positionY;if(!i)return{x:c,y:l};var u=t-i.x,d=n-i.y;return{x:a?c:u,y:s?l:d}}(e,t,n),c=s.x,l=s.y,u=vg(e,r),d=vg(e,a);yg(e,{x:c,y:l}),gg(e,c,l,u,d)}}function wg(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,i=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var r=null==i?void 0:i.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==r?void 0:r.width)||0,c=(null==r?void 0:r.height)||0,l=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s<l||c<u;!t&&n&&(null==n?void 0:n.total)>.1&&d?function(e){var t=e.velocity,n=e.bounds,i=e.setup,o=e.wrapperComponent,r=function(e){var t=e.mounted,n=e.velocity,i=e.bounds,o=e.setup,r=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&r&&!t||!n||!i)}(e);if(r&&t&&n&&o){var a=t.velocityX,s=t.velocityY,c=t.total,l=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,m=n.minPositionY,h=i.limitToBounds,f=i.alignmentAnimation,p=i.zoomAnimation,g=i.panning,v=g.lockAxisY,C=g.lockAxisX,y=p.animationType,b=f.sizeX,A=f.sizeY,S=f.velocityAlignmentTime,w=function(e,t){var n=e.setup.velocityAnimation,i=n.equalToMove,o=n.animationTime,r=n.sensitivity;return i?o*t*r:o}(e,c),E=Math.max(w,S),x=vg(e,b),D=vg(e,A),T=x*o.offsetWidth/100,B=D*o.offsetHeight/100,I=l+T,k=u-T,O=d+B,L=m-B,P=e.transformState,_=(new Date).getTime();ag(e,y,E,(function(t){var n=e.transformState,i=n.scale,o=n.positionX,r=n.positionY,c=((new Date).getTime()-_)/S,p=1-(0,ig[f.animationType])(Math.min(1,c)),g=1-t,y=o+a*g,b=r+s*g,A=Cg(y,P.positionX,o,C,h,u,l,k,I,p),w=Cg(b,P.positionY,r,v,h,m,d,L,O,p);o===y&&r===b||e.setTransformState(i,A,w)}))}}(e):Ag(e)}}function Eg(e,t,n,i){var o=e.setup,r=o.minScale,a=o.maxScale,s=o.limitToBounds,c=hg(tg(t,2),r,a,0,!1),l=mg(e,n,i,c,ug(e,c),s);return{scale:c,positionX:l.x,positionY:l.y}}function xg(e,t,n){var i=e.transformState.scale,o=e.wrapperComponent,r=e.setup,a=r.minScale,s=r.limitToBounds,c=r.zoomAnimation,l=c.disabled,u=c.animationTime,d=c.animationType,m=l||i>=a;if((i>=1||s)&&Ag(e),!m&&o&&e.mounted){var h=Eg(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);h&&sg(e,h,u,d)}}var Dg=function(){return Dg=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Dg.apply(this,arguments)};function Tg(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}var Bg=1,Ig=0,kg=0,Og={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}},Lg=function(e){var t,n,i,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:Bg,scale:null!==(n=e.initialScale)&&void 0!==n?n:Bg,positionX:null!==(i=e.initialPositionX)&&void 0!==i?i:Ig,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:kg}},Pg=function(e){var t=Dg({},Og);return Object.keys(e).forEach((function(n){var i="undefined"!=typeof e[n];if("undefined"!=typeof Og[n]&&i){var o=Object.prototype.toString.call(Og[n]),r="[object Object]"===o,a="[object Array]"===o;t[n]=r?Dg(Dg({},Og[n]),e[n]):a?Tg(Tg([],Og[n],!0),e[n],!0):e[n]}})),t},_g=function(e,t,n){var i=e.transformState.scale,o=e.wrapperComponent,r=e.setup,a=r.maxScale,s=r.minScale,c=r.zoomAnimation,l=r.smooth,u=c.size;if(!o)throw new Error("Wrapper is not mounted");var d=l?i*Math.exp(t*n):i+t*n;return hg(tg(d,3),s,a,u,!1)};function Rg(e,t,n,i,o){var r=e.wrapperComponent,a=e.transformState,s=a.scale,c=a.positionX,l=a.positionY;if(!r)return console.error("No WrapperComponent found");var u=(r.offsetWidth/2-c)/s,d=(r.offsetHeight/2-l)/s,m=Eg(e,_g(e,t,n),u,d);if(!m)return console.error("Error during zoom event. New transformation state was not calculated.");sg(e,m,i,o)}function Fg(e,t,n,i){var o=e.setup,r=e.wrapperComponent,a=o.limitToBounds,s=Lg(e.props),c=e.transformState,l=c.scale,u=c.positionX,d=c.positionY;if(r){var m=cg(e,s.scale),h=dg(s.positionX,s.positionY,m,a,0,0,r),f={scale:s.scale,positionX:h.x,positionY:h.y};l===s.scale&&u===s.positionX&&d===s.positionY||(null==i||i(),sg(e,f,t,n))}}var Ng=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Rg(e,1,t,n,i)}},Mg=function(e){return function(t,n,i){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===i&&(i="easeOut"),Rg(e,-1,t,n,i)}},Vg=function(e){return function(t,n,i,o,r){void 0===o&&(o=300),void 0===r&&(r="easeOut");var a=e.transformState,s=a.positionX,c=a.positionY,l=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var m={positionX:Number.isNaN(t)?s:t,positionY:Number.isNaN(n)?c:n,scale:Number.isNaN(i)?l:i};sg(e,m,o,r)}}},Wg=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),Fg(e,t,n)}},zg=function(e){return function(t,n,i){void 0===n&&(n=200),void 0===i&&(i="easeOut");var o=e.transformState,r=e.wrapperComponent,a=e.contentComponent;if(r&&a){var s=Xg(t||o.scale,r,a);sg(e,s,n,i)}}},jg=function(e){return function(t,n,i,o){void 0===i&&(i=600),void 0===o&&(o="easeOut"),rg(e);var r=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(r&&a&&r.contains(a)){var s=function(e,t,n){var i=e.wrapperComponent,o=e.contentComponent,r=e.transformState,a=e.setup,s=a.limitToBounds,c=a.minScale,l=a.maxScale;if(!i||!o)return r;var u,d,m,h,f,p,g,v,C=i.getBoundingClientRect(),y=t.getBoundingClientRect(),b=(u=i,d=o,m=r,h=t.getBoundingClientRect(),f=u.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=y.width/r.scale,E=y.height/r.scale,x=i.offsetWidth/w,D=i.offsetHeight/E,T=hg(n||Math.min(x,D),c,l,0,!1),B=(C.width-w*T)/2,I=(C.height-E*T)/2,k=dg((C.left-A)*T+B,(C.top-S)*T+I,cg(e,T),s,0,0,i);return{positionX:k.x,positionY:k.y,scale:T}}(e,a,n);sg(e,s,i,o)}}},Hg=function(e){return{instance:e,zoomIn:Ng(e),zoomOut:Mg(e),setTransform:Vg(e),resetTransform:Wg(e),centerView:zg(e),zoomToElement:jg(e)}},Ug=function(e){return{instance:e,state:e.transformState}},Zg=function(e){var t={};return Object.assign(t,Ug(e)),Object.assign(t,Hg(e)),t};function Gg(){try{return{get passive(){return!0,!1}}}catch(e){return!1}}var Yg=function(e,t){return t.some((function(t){return e.matches("".concat(t,", .").concat(t,", ").concat(t," *, .").concat(t," *"))}))},Qg=function(e){e&&clearTimeout(e)},Xg=function(e,t,n){var i=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-i)/2,positionY:(t.offsetHeight-o)/2}};function qg(e,t,n){var i=t.getBoundingClientRect(),o=0,r=0;if("clientX"in e)o=(e.clientX-i.left)/n,r=(e.clientY-i.top)/n;else{var a=e.touches[0];o=(a.clientX-i.left)/n,r=(a.clientY-i.top)/n}return(Number.isNaN(o)||Number.isNaN(r))&&console.error("No mouse or touch offset found"),{x:o,y:r}}var Kg=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))},Jg=function(e,t){var n=e.props,i=n.onWheel,o=n.onZoom,r=e.contentComponent,a=e.setup,s=e.transformState.scale,c=a.limitToBounds,l=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,m=a.disablePadding,h=a.smooth,f=u.size,p=u.disabled,g=d.step,v=d.smoothStep;if(!r)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var C=function(e,t){var n,i,o=function(e){return e?e.deltaY<0?1:-1:0}(e);return i=o,"number"==typeof(n=t)?n:i}(t,null),y=function(e,t,n,i,o){var r=e.transformState.scale,a=e.wrapperComponent,s=e.setup,c=s.maxScale,l=s.minScale,u=s.zoomAnimation,d=s.disablePadding,m=u.size,h=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=r+t*n;if(o)return f;var p=!i&&!h;return hg(tg(f,3),l,c,m,p&&!d)}(e,C,h?v*Math.abs(t.deltaY):g,!t.ctrlKey);if(s!==y){var b=ug(e,y),A=qg(t,r,s),S=c&&(p||0===f||l||m),w=mg(e,A.x,A.y,y,b,S),E=w.x,x=w.y;e.previousWheelEvent=t,e.setTransformState(y,E,x),ng(Zg(e),t,i),ng(Zg(e),t,o)}},$g=function(e,t){var n=e.props,i=n.onWheelStop,o=n.onZoomStop;Qg(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(xg(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var r=function(e,t){var n=e.previousWheelEvent,i=e.transformState.scale,o=e.setup,r=o.maxScale,a=o.minScale;return!!n&&(i<r||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);r&&(Qg(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,ng(Zg(e),t,i),ng(Zg(e),t,o))}),160))},ev=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}},tv=function(e,t){var n=e.contentComponent,i=e.pinchStartDistance,o=e.wrapperComponent,r=e.transformState.scale,a=e.setup,s=a.limitToBounds,c=a.centerZoomedOut,l=a.zoomAnimation,u=a.alignmentAnimation,d=l.disabled,m=l.size;if(null!==i&&n){var h=function(e,t,n){var i=n.getBoundingClientRect(),o=e.touches,r=tg(o[0].clientX-i.left,5),a=tg(o[0].clientY-i.top,5);return{x:(r+tg(o[1].clientX-i.left,5))/2/t,y:(a+tg(o[1].clientY-i.top,5))/2/t}}(t,r,n);if(Number.isFinite(h.x)&&Number.isFinite(h.y)){var f=Kg(t),p=function(e,t){var n=e.pinchStartScale,i=e.pinchStartDistance,o=e.setup,r=o.maxScale,a=o.minScale,s=o.zoomAnimation,c=o.disablePadding,l=s.size,u=s.disabled;if(!n||null===i||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:hg(tg(t/i*n,2),a,r,l,!u&&!c)}(e,f),g=ev(t),v=g.x-(e.pinchLastCenterX||0),C=g.y-(e.pinchLastCenterY||0);if(p!==r||0!==v||0!==C){e.pinchLastCenterX=g.x,e.pinchLastCenterY=g.y;var y=ug(e,p),b=s&&(d||0===m||c),A=mg(e,h.x,h.y,p,y,b),S=A.x,w=A.y;e.pinchMidpoint=h,e.lastDistance=f;var E=u.sizeX,x=u.sizeY,D=dg(S+v,w+C,y,s,vg(e,E),vg(e,x),o),T=D.x,B=D.y;e.setTransformState(p,T,B)}}}},nv=function(e,t){var n=e.props.onZoomStop,i=e.setup.doubleClick.animationTime;Qg(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout((function(){e.doubleClickStopEventTimer=null,ng(Zg(e),t,n)}),i)};function iv(e,t){var n=e.setup,i=e.doubleClickStopEventTimer,o=e.transformState,r=e.contentComponent,a=o.scale,s=e.props,c=s.onZoomStart,l=s.onZoom,u=n.doubleClick,d=u.disabled,m=u.mode,h=u.step,f=u.animationTime,p=u.animationType;if(!d&&!i){if("reset"===m)return function(e,t){var n=e.props,i=n.onZoomStart,o=n.onZoom,r=e.setup.doubleClick,a=r.animationTime,s=r.animationType;ng(Zg(e),t,i),Fg(e,a,s,(function(){return ng(Zg(e),t,o)})),nv(e,t)}(e,t);if(!r)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=_g(e,g,h);if(a!==v){ng(Zg(e),t,c);var C=qg(t,r,a),y=Eg(e,v,C.x,C.y);if(!y)return console.error("Error during zoom event. New transformation state was not calculated.");ng(Zg(e),t,l),sg(e,y,f,p),nv(e,t)}}}var ov=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,ug(t,t.transformState.scale),t.setup=Pg(e)},this.initializeWindowEvents=function(){var e,n,i=Gg(),o=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==o?void 0:o.defaultView;null===(n=t.wrapperComponent)||void 0===n||n.addEventListener("wheel",t.onWheelPanning,i),null==r||r.addEventListener("mousedown",t.onPanningStart,i),null==r||r.addEventListener("mousemove",t.onPanning,i),null==r||r.addEventListener("mouseup",t.onPanningStop,i),null==o||o.addEventListener("mouseleave",t.clearPanning,i),null==r||r.addEventListener("keyup",t.setKeyUnPressed,i),null==r||r.addEventListener("keydown",t.setKeyPressed,i)},this.cleanupWindowEvents=function(){var e,n,i=Gg(),o=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==o?void 0:o.defaultView;null==r||r.removeEventListener("mousedown",t.onPanningStart,i),null==r||r.removeEventListener("mousemove",t.onPanning,i),null==r||r.removeEventListener("mouseup",t.onPanningStop,i),null==o||o.removeEventListener("mouseleave",t.clearPanning,i),null==r||r.removeEventListener("keyup",t.setKeyUnPressed,i),null==r||r.removeEventListener("keydown",t.setKeyPressed,i),document.removeEventListener("mouseleave",t.clearPanning,i),rg(t),null===(n=t.observer)||void 0===n||n.disconnect()},this.handleInitializeWrapperEvents=function(e){var n=Gg();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(Zg(t))})),n&&(t.setCenter(),t.observer=new ResizeObserver((function(){var n,i=e.offsetWidth,o=e.offsetHeight;(i>0||o>0)&&(t.onInitCallbacks.forEach((function(e){return e(Zg(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,o=n.wheelDisabled,r=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,c=e.isPanning,l=t.target;return!(!s||c||i||!l||o&&!t.ctrlKey||r&&t.ctrlKey||Yg(l,a))}(t,e);n&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(function(e,t){var n=e.props,i=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(rg(e),ng(Zg(e),t,i),ng(Zg(e),t,o))}(t,e),Jg(t,e),$g(t,e))}},this.onWheelPanning=function(e){var n=t.setup,i=n.disabled,o=n.wheel,r=n.panning;if(t.wrapperComponent&&t.contentComponent&&!i&&o.wheelDisabled&&!r.disabled&&r.wheelPanning&&!e.ctrlKey){e.preventDefault(),e.stopPropagation();var a=t.transformState,s=a.positionX,c=a.positionY,l=s-e.deltaX,u=c-e.deltaY,d=r.lockAxisX?s:l,m=r.lockAxisY?c:u,h=t.setup.alignmentAnimation,f=h.sizeX,p=h.sizeY,g=vg(t,f),v=vg(t,p);d===s&&m===c||gg(t,d,m,g,v)}},this.onPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;n||fg(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(),rg(t),bg(t,e),ng(Zg(t),e,i))},this.onPanning=function(e){var n=t.setup.disabled,i=t.props.onPanning;n||pg(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Sg(t,e.clientX,e.clientY),ng(Zg(t),e,i))},this.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(wg(t),ng(Zg(t),e,n))},this.onPinchStart=function(e){var n=t.setup.disabled,i=t.props,o=i.onPinchingStart,r=i.onZoomStart;if(!n){var a=function(e,t){var n=e.setup.pinch,i=n.disabled,o=n.excluded,r=e.isInitialized,a=t.target;return!(!r||i||!a||Yg(a,o))}(t,e);a&&(function(e,t){var n=Kg(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1;var i=ev(t);e.pinchLastCenterX=i.x,e.pinchLastCenterY=i.y,rg(e)}(t,e),rg(t),ng(Zg(t),e,o),ng(Zg(t),e,r))}},this.onPinch=function(e){var n=t.setup.disabled,i=t.props,o=i.onPinching,r=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(),tv(t,e),ng(Zg(t),e,o),ng(Zg(t),e,r))}},this.onPinchStop=function(e){var n,i,o=t.props,r=o.onPinchingStop,a=o.onZoomStop;t.pinchStartScale&&(i=(n=t).pinchMidpoint,n.velocity=null,n.lastDistance=null,n.pinchMidpoint=null,n.pinchStartScale=null,n.pinchStartDistance=null,xg(n,null==i?void 0:i.x,null==i?void 0:i.y),ng(Zg(t),e,r),ng(Zg(t),e,a))},this.onTouchPanningStart=function(e){var n=t.setup.disabled,i=t.props.onPanningStart;if(!n&&fg(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,rg(t);var o=e.touches,r=1===o.length,a=2===o.length;r&&(rg(t),bg(t,e),ng(Zg(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(!pg(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];Sg(t,o.clientX,o.clientY),ng(Zg(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,o=e.wrapperComponent,r=i.doubleClick,a=r.disabled,s=r.excluded,c=t.target,l=null==o?void 0:o.contains(c);return!(!(n&&c&&l)||a||Yg(c,s))}(t,e);n&&iv(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 o=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 r=Zg(t);t.onChangeCallbacks.forEach((function(e){return e(r)})),ng(r,{scale:e,positionX:n,positionY:i},o)}},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Xg(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,o=e.positionY,r=t.handleTransformStyles(i,o,n);t.contentComponent.style.transform=r}},this.getContext=function(){return Zg(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,ug(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(n),t.initializeWindowEvents(),t.isInitialized=!0;var i=Zg(t);ng(i,void 0,t.props.onInit)},this.props=e,this.setup=Pg(this.props),this.transformState=Lg(this.props)},rv=ro.default.createContext(null),av=ro.default.forwardRef((function(e,t){var n,i,o=Object(ro.useRef)(new ov(e)).current,r=(n=e.children,i=Hg(o),"function"==typeof n?n(i):n);return Object(ro.useImperativeHandle)(t,(function(){return Hg(o)}),[o]),Object(ro.useEffect)((function(){o.update(e)}),[o,e]),ro.default.createElement(rv.Provider,{value:o},r)}));ro.default.forwardRef((function(e,t){var n,i=Object(ro.useRef)(null),o=Object(ro.useContext)(rv);return Object(ro.useEffect)((function(){return o.onChange((function(e){if(i.current){i.current.style.transform=o.handleTransformStyles(0,0,1/e.instance.transformState.scale)}}))}),[o]),ro.default.createElement("div",Dg({},e,{ref:(n=[i,t],function(e){n.forEach((function(t){"function"==typeof t?t(e):null!=t&&(t.current=e)}))})}))}));var sv="transform-component-module_wrapper__SPB86",cv="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],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.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 lv=function(e){var t=e.children,n=e.wrapperClass,i=void 0===n?"":n,o=e.contentClass,r=void 0===o?"":o,a=e.wrapperStyle,s=e.contentStyle,c=e.wrapperProps,l=void 0===c?{}:c,u=e.contentProps,d=void 0===u?{}:u,m=Object(ro.useContext)(rv),h=m.init,f=m.cleanupWindowEvents,p=Object(ro.useRef)(null),g=Object(ro.useRef)(null);return Object(ro.useEffect)((function(){var e=p.current,t=g.current;return null!==e&&null!==t&&h&&(null==h||h(e,t)),function(){null==f||f()}}),[]),ro.default.createElement("div",Dg({},l,{ref:p,className:"react-transform-wrapper ".concat(sv," ").concat(i),style:a}),ro.default.createElement("div",Dg({},d,{ref:g,className:"react-transform-component ".concat(cv," ").concat(r),style:s}),t))};function uv(e){var t;const n=kh(null===(t=e.page)||void 0===t?void 0:t.finalImageUrl());if(!(e.visible&&n.value))return null;const i=e.config.closeButton;return ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(co.Box,{style:{touchAction:"none",backgroundColor:uo.b.getColorValue(e.config.overlayColor)}},ro.default.createElement(co.Box,{style:{textAlign:"right",height:"45px",paddingRight:8}},ro.default.createElement(wo,{onClick:e.onCloseButtonClick,visible:i.visible,text:i.text,background:i.background,foreground:i.foreground,ariaLabel:uo.b.getLocalizedText(i.accessibilityDescription),iconPosition:"right",icon:ro.default.createElement(lo.a,{style:{paddingLeft:4}})})),ro.default.createElement(av,{centerOnInit:!0},ro.default.createElement(lv,{wrapperStyle:{width:"100%"},contentStyle:{width:"100%"}},ro.default.createElement(co.Box,{style:{width:"100%",height:`calc(100 *${mo} - 45px)`,display:"flex",justifyContent:"center",alignItems:"center",touchAction:"none"}},ro.default.createElement("img",{src:n.value,alt:"Zoomed image",style:{maxWidth:"100%",maxHeight:"100%"}}))))))}var dv=n(39);class mv{constructor(){this.disabled=!1,this.color="transparent"}}class hv{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20,this.filter=""}}class fv{constructor(){this.color="#1ec31e",this.width=4}}class pv{constructor(){this.padding=10}}class gv{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class vv{constructor(){this.width=2,this.color="white"}}class Cv{constructor(){this.size=20,this.color="white"}}class yv extends dv.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new pv,this.style.magneticLines=new mv,this.style.polygon=new fv,this.style.polygon.handles=new hv,this.style.magnifier=new gv,this.style.magnifier.border=new vv,this.style.magnifier.crosshair=new Cv}static fromJson(e){const t=new yv;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 bv extends ro.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(e){return ro.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},ro.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,o,r;return ro.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===(r=null===(o=null===(i=this.props.lines)||void 0===i?void 0:i.vertical)||void 0===o?void 0:o.scaled)||void 0===r?void 0:r.map((e=>this.fromPoint(e))))}snapToClosestIfAnyAreClose(){var e,t,n,i;const o=this.props.movingLine;let r=null===(t=null===(e=this.props.lines)||void 0===e?void 0:e.vertical)||void 0===t?void 0:t.scaled;if(o.isHorizontal&&(r=null===(i=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===i?void 0:i.scaled),!r||0===r.length)return;const a=this.midPoint(o.points[0].coordinates,o.points[1].coordinates),s=r.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:o})}distanceToLine(e,t){const n=t.x-e.start.x,i=t.y-e.start.y,o=e.end.x-e.start.x,r=e.end.y-e.start.y,a=o*o+r*r;if(0===a)return 1/0;const s=(n*o+i*r)/a;let c;return c=s<=0?e.start:s>=1?e.end:new Xd.a(e.start.x+s*o,e.start.y+s*r),Xd.a.distance(t,c)}midPoint(e,t){return new Xd.a((e.x+t.x)/2,(e.y+t.y)/2)}}class Av extends ro.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 Sv extends Av{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=ro.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},ro.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));e.push(i)}return e}cornerTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=Xd.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],o=Xd.a.fromHtmlElement(i);this.parentOffset=new Xd.a(n.x-o.x,n.y-o.y),this.props.cornerMoveStart({index:t,point:this.props.points[t]})}cornerTouchMove(e,t){if(!this.parentOffset)return;const n=Xd.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),{x:i,y:o}=Object(th.b)({x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},this.pointSize,this.props.containerSize),r=this.pointSize/2,a=this.props.points[t];this.props.points[t]=new Xd.a(i+r,o+r),kf.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 ro.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 wv extends Av{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 o=ro.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},ro.default.createElement("div",{style:this.invisibleHandleStyle}));e.push(o)}return e}lineTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=Xd.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.items[t],o=Xd.a.fromHtmlElement(i),r=this.props.points[t],a=this.props.points[this.nextIndex(t)];this.point0Start=Wi.copy(this.props.points[this.previousIndex(t)]),this.point1Start=Wi.copy(r),this.point2Start=Wi.copy(a),this.point3Start=Wi.copy(this.props.points[this.nextIndex(this.nextIndex(t))]),this.point1Offset=new Xd.a(r.x-o.x,r.y-o.y),this.point2Offset=new Xd.a(a.x-o.x,a.y-o.y),this.parentOffset=new Xd.a(n.x-o.x,n.y-o.y)}lineTouchMove(e,t){if(!this.parentOffset)return;const n=Xd.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),i=this.props.points[this.previousIndex(t)];let o=new Xd.a(null,null),r=new Xd.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;o.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),r.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),o.y=e,r.y=t}else{const e=s+this.point1Offset.x,t=s+this.point2Offset.x,n=e-this.point1Start.x;o.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),r.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),o.x=e,r.x=t}o=Xd.a.clamp(o,this.props.containerSize),r=Xd.a.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,o,i,this.isHorizontal(t)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(t)?"y":"x")||this.areEdgesCrossing(i,o,r,a)||kf.isConvex([i,o,r,a])&&(this.props.points[t].x=o.x,this.props.points[t].y=o.y,this.props.points[this.nextIndex(t)].x=r.x,this.props.points[this.nextIndex(t)].y=r.y,this.props.lineMoved({points:[{index:t,coordinates:o},{index:this.nextIndex(t),coordinates:r}],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 o=e.x,r=e.y,a=t.x,s=t.y,c=n.x,l=n.y,u=i.x,d=i.y;return((o-c)*(s-l)-(r-l)*(a-c))*((o-u)*(s-d)-(r-d)*(a-u))<0&&((c-o)*(d-r)-(l-r)*(u-o))*((c-a)*(d-s)-(l-s)*(u-a))<0}render(){return ro.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class Ev extends ro.default.Component{render(){return ro.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},ro.default.createElement(Sv,{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}),ro.default.createElement(wv,{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]=kf.intersection(t,i),this.props.coordinatePoints[e.polygonLine.points[1].index]=kf.intersection(n,i),this.props.cornerMoveEnd(),this.setFrame()}}class xv extends ro.default.Component{constructor(e){super(e),this.state={movingLine:void 0}}render(){return ro.default.createElement("div",null,ro.default.createElement(Ev,{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})}}),ro.default.createElement(bv,{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()}}),ro.default.createElement(Ef,{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 Dv extends ro.default.Component{render(){return ro.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 Tv extends ro.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:o}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=Ho.b`
|
|
35
35
|
from {transform: rotate(${r}deg) scale(${this.previousScale}); }
|
|
36
36
|
to {transform: rotate(${a}deg) scale(${i});
|
|
37
|
-
}`,c=Ho.a.div`position: absolute; animation: ${s} ${o}s;`;return this.previousScale=i,ro.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:e=>this.container=e},ro.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 Bv extends ro.default.Component{componentDidMount(){Lm.disableScreenMovement()}componentWillUnmount(){Lm.enableScreenMovement()}render(){return ro.default.createElement("div",null)}}class Iv{constructor(e,t){this.element=e,this.size=t}}class kv{}class Ov extends ro.default.Component{render(){return ro.default.createElement("div",{style:this.props.style},ro.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const e=this.half();return ro.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 ro.default.createElement("line",{x1:0,y1:e,x2:this.props.size,y2:e,stroke:this.props.color,strokeWidth:"2"})}}class Lv extends ro.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:Vi.a.empty(),cropImageFitSize:bm.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?ro.default.createElement("div",{style:this.style().container},ro.default.createElement("img",{style:this.style().image,ref:e=>this.destination=e,src:this.props.src,alt:"."}),ro.default.createElement(Ov,{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=Vi.a.fromPoint(Xd.a.scaleUpTo(e.origin,new bm.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,o=e.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?i<a&&o<a:1===r?i<a&&o>t.height-a:2===r?i>t.width-a&&o>t.height-a:i>t.width-a&&o<a}setIsVisible(e,t){this.setState({visible:e},t)}normalizeRotations(e){return e%this.MAX_ROTATIONS}}var Pv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 _v extends ro.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:bm.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:Xd.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(e,t){return Pv(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize cropping component: Cannot find container element with the id provided.");return new Promise(((i,o)=>{Object(ro.render)(ro.default.createElement(_v,{sdk:t,onReady:i,onError:o,container:n,configuration:yv.fromJson(e)}),n)}))}))}componentDidMount(){var e,t,n;return Pv(this,void 0,void 0,(function*(){const i=null===(e=this.configuration)||void 0===e?void 0:e.image,o=yield this.sdk.detectAndCropDocument(i);let r=null!==(n=null===(t=this.configuration)||void 0===t?void 0:t.polygon)&&void 0!==n?n:o.pointsNormalized;0===r.length&&(r=_v.FULL_SIZE_POLYGON);const a=yield ji.toDataUrl(yield this.sdk.imageToJpeg(i));this.setState({documentDetectionResult:o,image:a,polygon:r,magneticLines:{vertical:{original:o.verticalLinesNormalized},horizontal:{original:o.horizontalLinesNormalized}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return Pv(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(e){return Pv(this,void 0,void 0,(function*(){bm.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=e,this.initializeSizes())}))}onResize(){const e=this.state.points.map((e=>new Xd.a(e.x/this.state.calculatedSize.width,e.y/this.state.calculatedSize.height)));this.initializeSizes(e)}initializeSizes(e,t,n){const i=new bm.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),o=new bm.a(this.container.width(),this.container.height()),r=ji.getObjectFitSize(o,i),a=new bm.a(r.width,r.height),s=null!=e?e:this.state.polygon,c=Lm.convertToViewportPointsFromParentSize(a,s),l=null!=t?t:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=Lm.convertLinesToViewportLines(a,l),m=Lm.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:c,magneticLines:{horizontal:{original:l,scaled:d},vertical:{original:u,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,o,r;const a=Ef.CLASSNAME,s=hm()({[a]:!0,[`${a}-visible`]:!0}),c=this.configuration.style.polygon.width,l=(null===(e=this.state.animation)||void 0===e?void 0:e.scale)?c/this.state.animation.scale:c,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return ro.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&ro.default.createElement(Bv,null),ro.default.createElement(Lv,{ref:e=>this.magnifier=e,style:this.configuration.style.magnifier}),ro.default.createElement(Tv,{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},ro.default.createElement(Dv,{src:this.state.image,onImageLoaded:e=>this.onImageLoaded(e)}),ro.default.createElement(xv,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${l}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(o=this.state.animation)||void 0===o?void 0:o.rotations,scale:null===(r=this.state.animation)||void 0===r?void 0:r.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 kv;return t.source=new Iv(this.htmlImage,this.state.calculatedSize),t.container=new bm.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 Pv(this,void 0,void 0,(function*(){const t=Xd.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),i=yield this.sdk.imageCrop(null===(e=this.configuration)||void 0===e?void 0:e.image,t);return{image:yield this.sdk.imageRotate(i,n,"CONSUME_IMAGE"),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 Pv(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 Pv(this,void 0,void 0,(function*(){const e=this.state.documentDetectionResult;0===e.pointsNormalized.length?this.resetPolygon():this.initializeSizes(e.pointsNormalized,e.horizontalLinesNormalized,e.verticalLinesNormalized)}))}resetPolygon(){const e=this.state.documentDetectionResult;this.initializeSizes(_v.FULL_SIZE_POLYGON,e.horizontalLinesNormalized,e.verticalLinesNormalized)}dispose(){const{container:e}=this.props;if(!e)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");Object(ro.render)(null,e)}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=yv.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}}}_v.FULL_SIZE_POLYGON=[new Xd.a(0,0),new Xd.a(1,0),new Xd.a(1,1),new Xd.a(0,1)];var Rv=_v,Fv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Nv(e){const t=e.config.screens.cropping,n=ro.default.useRef(null),i=ro.default.useRef(null),[o,r]=ro.default.useState(!0),a=Object(ro.useRef)(0),s=ro.default.useRef(Promise.resolve());return Object(ro.useEffect)((()=>{if(n.current&&e.page)return s.current=s.current.then((()=>Fv(this,void 0,void 0,(function*(){r(!0);const o=yield e.page.cropData();if(!n.current)return;a.current=o.rotations;const s=yield Rv.create({containerId:"sb-cropping-container",image:o.image,polygon:o.crop,rotations:o.rotations,style:{polygon:{color:uo.b.getColorValue(t.croppingPolygonColor),handles:{color:uo.b.getColorValue(t.croppingHandlerColor),border:"transparent",filter:"drop-shadow(0px 0px 2px #00000070)"}}}},e.sdk);i.current=s,r(!1)})))),()=>{s.current=s.current.then((()=>Fv(this,void 0,void 0,(function*(){var e;null===(e=i.current)||void 0===e||e.dispose()}))))}}),[n.current,e.page]),e.page?ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(cp,{open:o}),ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(t.backgroundColor),width:"100%",height:`calc(100 * ${mo})`,display:"flex",flexDirection:"column",touchAction:"none",userSelect:"none",WebkitTapHighlightColor:"transparent"}},ro.default.createElement(Gh,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:ro.default.createElement(wo,{ariaLabel:uo.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:o}),centerTitle:t.topBarTitle,rightContent:ro.default.createElement(wo,{ariaLabel:uo.b.getLocalizedText(t.topBarConfirmButton.accessibilityDescription),onClick:()=>Fv(this,void 0,void 0,(function*(){if(!i.current)return void e.onCloseButtonClick();const t=i.current;r(!0);const n=Xd.a.toPolygon(t.state.points,t.state.calculatedSize),o=(4+t.rotations-a.current)%4;yield e.onApplyCrop(n,o),r(!1)})),visible:t.topBarConfirmButton.visible,text:t.topBarConfirmButton.text,background:t.topBarConfirmButton.background,foreground:t.topBarConfirmButton.foreground,debugName:"cropping-screen-apply",disabled:o})}),ro.default.createElement(co.Box,{style:{flexGrow:1,width:"100%"},ref:n,id:"sb-cropping-container"}),ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:80,width:"100%",display:"flex",justifyContent:"center"}},ro.default.createElement(co.Box,{style:{maxWidth:400,display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1,padding:"0 20px"}},ro.default.createElement(bo,{enabled:!o,config:t.bottomBar.detectButton,icon:({color:e})=>ro.default.createElement(lo.a,{style:{color:e}}),onClick:()=>Fv(this,void 0,void 0,(function*(){var e;r(!0),yield null===(e=i.current)||void 0===e?void 0:e.detect(),r(!1)})),debugName:"retake"}),ro.default.createElement(bo,{enabled:!o,config:t.bottomBar.rotateButton,icon:({color:e})=>ro.default.createElement(lo.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.rotate(1)},debugName:"retake"}),ro.default.createElement(bo,{enabled:!o,config:t.bottomBar.resetButton,icon:({color:e})=>ro.default.createElement(lo.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.resetPolygon()},debugName:"retake"}))))):null}var Mv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Vv{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 wC.instance}loadOriginalImage(){return Mv(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(this.data.originalImageId)}))}loadDocumentImage(){return Mv(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:Vv.FULL_SIZE_POLYGON}cropData(){return Mv(this,void 0,void 0,(function*(){return{crop:this.getPolygon(),rotations:this.data.rotations,image:yield this.loadOriginalImage()}}))}finalRawImage(){return Mv(this,void 0,void 0,(function*(){if(null===this.data.documentImageId){let e=yield this.loadOriginalImage();const t=this.document.data.documentImageSizeLimit;0!==t?(e=yield this.sdk().imageResize(e,t,"COPY_IMAGE"),e=yield this.sdk().imageCrop(e,this.getPolygon(),"CONSUME_IMAGE")):e=yield this.sdk().imageCrop(e,this.getPolygon(),"COPY_IMAGE");const n=this.data.filters||[];for(let t of n)e=yield this.sdk().imageFilter(e,t,"CONSUME_IMAGE");const i=Vv.ROTATIONS[this.data.rotations%4];e=yield this.sdk().imageRotate(e,i,"CONSUME_IMAGE");const o=yield this.sdk().storage.insertSBPageImage(e);return qv._internal_updateProperty(this.data,"documentImageId",o),yield this.document.updateStorageDocument(),e}return yield this.loadDocumentImage()}))}finalImageUrl(){return null===this._finalImageUrl&&(this._finalImageUrl=(()=>Mv(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 Mv(this,void 0,void 0,(function*(){null!==this.data.documentImageId&&(yield this.sdk().storage.deleteImageById(this.data.documentImageId),qv._internal_updateProperty(this.data,"documentImageId",null)),yield this.document.updateStorageDocument(),URL.revokeObjectURL(yield this._finalImageUrl),this._finalImageUrl=null}))}}Vv.ROTATIONS=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],Vv.FULL_SIZE_POLYGON=[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];class Wv{constructor(e){this.name="SBStorageError",this.message=e}}var zv=n(6);const jv=["UNDEFINED","MANUAL_SNAP","AUTO_SNAP","IMPORTED"];var Hv=n(40);class Uv extends zv.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=>Hv.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&&T.includes(e.documentDetectionStatus)?e.documentDetectionStatus:null),void 0!==e.documentQuality&&(this.documentQuality=null!=e.documentQuality&&F.includes(e.documentQuality)?e.documentQuality:null),void 0!==e.source&&(this.source=null!=e.source&&jv.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 Zv extends zv.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 Uv(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 Gv extends Zv{constructor(){super(...arguments),this.pages=[]}}class Yv extends Uv{}var Qv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Xv{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 qv{getData(){return this.data}get isDraft(){return this.data.id===qv.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 Vv(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 Vv(this,e))))}sdk(){return wC.instance}get pageCount(){return this.pages.length}pageAtIndex(e){return this.pages[e]}movePage(e,t){return Qv(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 Qv(this,void 0,void 0,(function*(){const t=yield wC.instance.storage.getSBDocumentData(e);if(void 0===t)throw new Wv("Document not found in database.");return new qv(t)}))}static create(e){return Qv(this,void 0,void 0,(function*(){const t=wC.instance;let n;if(e.loadFromStorage())n=yield qv.loadFromStorage(e.documentId);else{const i=yield t.storage.getSBDocumentData(qv.DOCUMENT_DRAFT_ID),o=void 0!==i;if(e.cleanSession&&o){for(const e of i.pages)yield t.storage.deleteImages(e);qv._internal_updateProperty(i,"pages",[])}const r=o?i:new Gv({id:qv.DOCUMENT_DRAFT_ID,creationTimestamp:Date.now(),pages:[],documentImageSizeLimit:e.documentImageSizeLimit});n=new qv(r)}return n.data.filters=e.filters,yield n.updateStorageDocument(),n}))}updateStorageDocument(){return Qv(this,void 0,void 0,(function*(){return yield this.sdk().storage.insertSBDocument(this)}))}delete(){return Qv(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 Qv(this,void 0,void 0,(function*(){void 0===i&&(i=this.pages.length);const o=new Yv({id:Math.round(1e6*Math.random()),polygon:e.pointsNormalized,documentDetectionStatus:e.status,originalImageId:-1,source:n,documentQuality:t,filters:this.data.filters}),r=yield this.sdk().storage.insertSBPageImage(e.originalImage);qv._internal_updateProperty(o,"originalImageId",r),this.splicePage(i,0,o),yield this.updateStorageDocument()}))}deleteFromPosition(e){return Qv(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 Qv(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 Qv(this,void 0,void 0,(function*(){for(;this.pages.length>0;)yield this.deleteFromPosition(0)}))}cropAndRotateAtIndex(e,t,n){return Qv(this,void 0,void 0,(function*(){const i=this.pageAtIndex(e);yield this.cropAndRotatePage(i,t,n)}))}cropAndRotatePage(e,t,n){return Qv(this,void 0,void 0,(function*(){const i=this.data.pages[this.pages.indexOf(e)];4===(null==t?void 0:t.length)&&qv._internal_updateProperty(i,"polygon",t),null!=n&&(i.rotations+=n),yield e.invalidateImage(),yield this.updateStorageDocument()}))}updateDataProperty(e,t){qv._internal_updateProperty(this.data,e,t)}static _internal_updateProperty(e,t,n){e[t]=n}deleteId(){delete this.data.id}convertToFinalVersion(){return Qv(this,void 0,void 0,(function*(){if(this.isDraft){this.deleteId();const e=yield this.updateStorageDocument();qv._internal_updateProperty(this.data,"id",e),yield this.sdk().storage.deleteSBDocument(qv.DOCUMENT_DRAFT_ID)}return this}))}insertRenderedBuffer(e,t){return Qv(this,void 0,void 0,(function*(){const n=yield this.sdk().storage.insertSBPageImage(e);return qv._internal_updateProperty(this.data,t,n),e}))}createPdf(e){return Qv(this,void 0,void 0,(function*(){const t=yield this.sdk().beginPdf(e);yield t.addPages(this);const n=yield t.complete();return yield this.saveRenderedPdf(n),n}))}createTiff(e={},t={}){return Qv(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 Qv(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.pdfId)}))}loadTiff(){return Qv(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.tiffId)}))}loadBuffer(e){return Qv(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(e)}))}saveRenderedPdf(e){return Qv(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"pdfId")}))}saveRenderedTiff(e){return Qv(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"tiffId")}))}deletePdf(){return Qv(this,void 0,void 0,(function*(){return yield this.sdk().storage.deleteImageById(this.data.pdfId)}))}deleteTiff(){return Qv(this,void 0,void 0,(function*(){return yield this.sdk().storage.deleteImageById(this.data.tiffId)}))}}qv.DOCUMENT_DRAFT_ID=-1;var Kv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Jv(e){var t;Object(ro.useMemo)((()=>{uo.b.setPalette(e.configuration.palette),uo.b.setLocalization(e.configuration.localization)}),[e.configuration]);const n=Ih(),[i,o]=Object(ro.useState)(null);Object(ro.useEffect)((()=>{const t=new Xv({config:e.configuration,documentId:e.documentId});qv.create(t).then((t=>{var n;t instanceof qv?o(t):null===(n=e.onError)||void 0===n||n.call(e,t)}))}),[]);const[r,a]=ro.default.useState({screen:"camera",insertMode:{name:"insert back"}}),s="acknowledgment"===r.screen?r:null;return Object(ro.useEffect)((()=>{const t=e.configuration.screens.camera.timeouts.autoCancelTimeout;if(0!==t){const n=setTimeout(e.onClose,t);return()=>clearTimeout(n)}}),[]),ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(ho,null),ro.default.createElement(Uf,null,ro.default.createElement(ep,{visible:"acknowledgment"===r.screen,configuration:e.configuration,sdk:e.sdk,croppedDetectionResult:null==s?void 0:s.croppedDetectionResult,onAccept:(t,o)=>{if(!s)throw new Error("Internal error: Invalid routing state");let r;const c=[],l=e.configuration.outputSettings.pagesScanLimit;if("insert back"===s.insertMode.name){const e=i.addPage(t.value,o,t.source);c.push(e),r=l>0&&i.pages.length+1===l?{screen:"review",position:i.pages.length}:{screen:"camera",insertMode:{name:"insert back"}}}else{const e=s.insertMode.position,n=i.addPage(t.value,o,t.source,e);c.push(n),r={screen:"review",position:e},"replace"===s.insertMode.name&&c.push((()=>Kv(this,void 0,void 0,(function*(){yield i.deleteFromPosition(e),yield n})))())}Promise.all(c).then((()=>{n.current&&a((e=>"acknowledgment"===e.screen?r: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}),ro.default.createElement(Hf,{visible:["camera","acknowledgment"].includes(r.screen),scanningPaused:"camera"!==r.screen||null===i,configuration:e.configuration,onClose:()=>Kv(this,void 0,void 0,(function*(){(null==i?void 0:i.isDraft)&&(yield i.delete()),e.onClose()})),onImageCaptured:e=>{if("camera"!==r.screen)throw new Error("Internal error: Invalid routing state");a({screen:"acknowledgment",croppedDetectionResult:e,insertMode:r.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"!==r.screen||"replace"!==r.insertMode.name)&&(null===(t=null==i?void 0:i.pages)||void 0===t?void 0:t.length)>=e.configuration.outputSettings.pagesScanLimit)})(),onError:e.onError}),ro.default.createElement(eg,{document:i,currentPosition:"review"===r.screen?r.position:null,visible:"review"===r.screen,configuration:e.configuration,onClose:()=>a({screen:"camera",insertMode:{name:"insert back"}}),onSubmit:()=>Kv(this,void 0,void 0,(function*(){const t=yield i.convertToFinalVersion(),n=new Fh(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})}),ro.default.createElement(uv,{visible:"zoom"===r.screen,page:"zoom"===r.screen?i.pageAtIndex(r.position):null,config:e.configuration.screens.review.zoomOverlay,onCloseButtonClick:()=>a({screen:"review",position:"zoom"===r.screen?r.position:0})}),ro.default.createElement(Nv,{sdk:e.sdk,page:"crop"===r.screen?i.pageAtIndex(r.position):null,config:e.configuration,onCloseButtonClick:()=>a({screen:"review",position:"crop"===r.screen?r.position:0}),onApplyCrop:(e,t)=>Kv(this,void 0,void 0,(function*(){if("crop"!==r.screen)throw new Error("Internal error: Invalid routing state");yield i.cropAndRotateAtIndex(r.position,e,t),a({screen:"review",position:r.position})}))})))}var $v=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 eC{static createDocumentScanner(e,t){return new Promise(((n,i)=>{const{root:o,unmount:r}=this.createRoot(),a=e=>$v(this,void 0,void 0,(function*(){yield r(),i(e)}));o.render(ro.default.createElement(ro.default.StrictMode,null," ",ro.default.createElement(Jv,{configuration:e,documentId:t,onClose:()=>$v(this,void 0,void 0,(function*(){yield r(),n(null)})),onSubmit:e=>$v(this,void 0,void 0,(function*(){yield r(),n(e)})),onError:a,sdk:wC.instance}))),this.checkLicense(a)}))}static createBarcodeScanner(e){return new Promise(((t,n)=>{No.INSTANCE.initialize(e.sound);const{root:i,unmount:o}=this.createRoot(),r=e=>$v(this,void 0,void 0,(function*(){yield o(),n(e)}));i.render(ro.default.createElement(Rh,{configuration:e,onClose:()=>$v(this,void 0,void 0,(function*(){yield o(),t(null)})),onSubmit:e=>$v(this,void 0,void 0,(function*(){yield o(),t(e)})),onError:r})),this.checkLicense(r)}))}static createRoot(){const e=eC.createContainer("barcode-scanner-controller"),t=Object(ao.createRoot)(e);return{unmount:()=>$v(this,void 0,void 0,(function*(){return new Promise((n=>{window.setTimeout((()=>{t.unmount(),document.body.removeChild(e),n()}),0)}))})),root:t}}static checkLicense(e){(()=>{$v(this,void 0,void 0,(function*(){try{const t=yield wC.instance.getLicenseInfo();t.isValid()||(yield e(new eo(t)))}catch(t){yield e(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 * ${mo})`,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}}eC.SBDocument=qv,eC.Config=so;var tC=eC,nC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 iC{constructor(e,t){this._sdk=e,this._recognizer=t}recognize(e,t,n="COPY_IMAGE"){return nC(this,void 0,void 0,(function*(){const i=this._sdk.getBridge(n);return yield i.documentDataExtractorExtract(this._recognizer,e,t)}))}release(){return nC(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._recognizer)}))}}class oC extends Ki.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new xe,this.onMrzDetected=function(e){},this.finder.aspectRatio=new w.a({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(e){const t=new oC;return this.mapValues(e,t,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(t,e),this.mapVideoConstraints(e,t),t}}var rC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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())}))};Wo.a;Wo.b;class aC extends Wo.c{constructor(e){super(e),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this._configuration||(this._configuration=oC.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e,t){return rC(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,o)=>{Object(ro.render)(ro.default.createElement(aC,{container:n,configuration:e,onSuccess:i,onFailure:o,mrzRecognizer:t}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return rC(this,void 0,void 0,(function*(){Om.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){Om.warn("Mrz detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return rC(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return rC(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return rC(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,i,o;return rC(this,void 0,void 0,(function*(){const r=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let a=!1;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(aC.FRAME_RESOLUTION);if(!i)return;r&&this.forceUpdate();const o=yield this.props.mrzRecognizer.recognize(i,"CONSUME_IMAGE");if(!this.enabled)return;if(null===o)return;this.camera.reusableImageBuffer=null==o?void 0:o.originalImage.data,o.success?(delete o.originalImage,a=!0,this.configuration.onMrzDetected(o)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(o.originalImage))}catch(e){null===(o=(i=this.configuration).onError)||void 0===o||o.call(i,e)}finally{a?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}render(){var e;return ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},ro.default.createElement(zo.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&ro.default.createElement(jo.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}aC.FRAME_RESOLUTION=1200;var sC=aC,cC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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())}))};Wo.b;class lC extends Wo.c{constructor(e){super(e),this.shouldComputeSize=!0,this.paused=!1,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,t){return cC(this,void 0,void 0,(function*(){const n=document.getElementById(e.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,o)=>{Object(ro.render)(ro.default.createElement(lC,{container:n,configuration:e,onDetected:t.onDetected,onSuccess:i,onFailure:o,scanner:t.scanner}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return cC(this,void 0,void 0,(function*(){Om.warn("Text pattern detection resumed"),yield this.resume()}))}pauseDetection(){Om.warn("Text pattern detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return cC(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.scanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return cC(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return cC(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.scanner.cleanRecognitionQueue(),this.paused=!0}detect(){var e,t,n,i;return cC(this,void 0,void 0,(function*(){const o=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let r=!1;try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(lC.FRAME_RESOLUTION);if(!n)return;o&&this.forceUpdate();const i=yield this.props.scanner.recognize(n);if(!this.enabled)return;if(null===i)return;i&&(r=!0,this.props.onDetected(i),this.camera.reusableImageBuffer=i.originalImage.data)}catch(e){null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e)}finally{r?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){var e;return ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},ro.default.createElement(zo.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&ro.default.createElement(jo.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}lC.FRAME_RESOLUTION=1200;var uC=lC,dC=n(37),mC=n(27);var hC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 fC{constructor(){this.tokenCounter=0,this.taskMap=new Map,this.worker=function(){const e=n(51).default.replace("data:application/javascript;charset=utf-8;base64,",""),t=atob(e),i=new Blob([t],{type:"application/javascript"}),o=URL.createObjectURL(i);return new Worker(o)}(),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 hC(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 pC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 gC{persist(){return pC(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 pC(this,void 0,void 0,(function*(){yield navigator.storage.estimate();return!0}))}}var vC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 CC{constructor(){this.utils=new gC,this.db=new fC}clear(){return vC(this,void 0,void 0,(function*(){yield this.db.query({type:"clear"})}))}delete(){return vC(this,void 0,void 0,(function*(){yield this.db.query({type:"delete"})}))}getCroppedDetectionResults(e=!0){return vC(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 vC(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){var n,i;e.originalImage=null===(n=t.find((t=>t.documentId===e.id&&"original"===t.type)))||void 0===n?void 0:n.data,e.croppedImage=null===(i=t.find((t=>t.documentId===e.id&&"cropped"===t.type)))||void 0===i?void 0:i.data}getCroppedDetectionResultImages(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:e})}))}getCroppedDetectionResultImage(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:[e]})}))}storeCroppedDetectionResult(e){return vC(this,void 0,void 0,(function*(){const t=Object.create(e);t.croppedImage=null,t.originalImage=null;const n=yield this.db.query({type:"storeCroppedDetectionResult",data:t}),i=[{documentId:n,data:e.originalImage,type:"original"},{documentId:n,data:e.croppedImage,type:"cropped"}];return yield this.db.query({type:"storeImages",data:i}),n}))}getSBDocumentIds(){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocumentIds"})}))}getSBDocumentData(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocument",data:e})}))}insertSBDocument(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"insertSBDocument",data:e.getData()})}))}deleteSBDocument(e){return vC(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 vC(this,void 0,void 0,(function*(){const t={image:e};return yield this.db.query({type:"insertSBPageImage",data:t})}))}getSBPageImage(e){return vC(this,void 0,void 0,(function*(){return(yield this.db.query({type:"getSBPageImage",data:e})).image}))}deleteImageById(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"deleteSBPageImages",data:[e]})}))}deleteImages(e){return vC(this,void 0,void 0,(function*(){const t=e instanceof Vv?e.getData():e,n=[t.originalImageId];t.documentImageId&&n.push(t.documentImageId),yield this.db.query({type:"deleteSBPageImages",data:n})}))}destroy(){this.db.destroy()}}var yC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 bC{constructor(e,t){this._sdk=e,this._token=t}recognize(e,t="COPY_IMAGE"){return yC(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanVin(yield this._token,e)}))}cleanRecognitionQueue(){return yC(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanVinScanningQueue(yield this._token)}))}recognizeURL(e){return yC(this,void 0,void 0,(function*(){return this.recognize(yield ji.imageUrlToImageData(e))}))}release(){return yC(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._token)}))}}var AC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 SC{constructor(){this.storage=new CC}static get UI(){if(!o.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return SC._ui2}static initialize(e){var t;return AC(this,void 0,void 0,(function*(){const n=new SC,i=e.enginePath||SC.defaultEnginePath,o=!!e.allowThreads,a=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 s=[e.licenseKey,i,window.location.hostname,"",{captureConsole:!1,allowThreads:o,requestSuffix:a}];return n.bridge=new d(i,{allowSimd:!0,allowThreads:o,requestSuffix:a},s),SC.instance=n,window.scanbotSdk=n,oo.a.initialize(e.verboseLogging),e.allowThreads&&!Object(r.a)()&&(oo.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&oo.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 AC(this,void 0,void 0,(function*(){let t;try{return t=yield Rf.create(e,this),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createMrzScanner(e){var t;return AC(this,void 0,void 0,(function*(){let n;try{const i=new Zi(this,this.bridge.copyArgs.createMRZScanner(null!==(t=e.recognizerConfiguration)&&void 0!==t?t:{}));return n=yield sC.create(e,i),yield this.licenseCheck(),n}catch(e){throw n&&n.dispose(),e}}))}createBarcodeScanner(e){return AC(this,void 0,void 0,(function*(){let t;try{return t=yield _m.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}openCroppingView(e){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield Rv.create(e,this)}))}createTextPatternScanner(e){return AC(this,void 0,void 0,(function*(){let t;try{e=Ji.fromJson(e);const n=this.bridge.copyArgs.createTextPatternScanner(e.ocrConfiguration),i=new Xi(this,n);return t=yield uC.create(e,{onDetected:e.onTextDetected,scanner:i}),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createVinScanner(e){return AC(this,void 0,void 0,(function*(){let t;try{e=$i.fromJson(e);const n=t=>{""===t.textResult.rawText&&""===t.barcodeResult.extractedVIN||e.onVinDetected(t)},i=this.bridge.copyArgs.createVinScanner(e.detectionConfiguration),o=new bC(this,i);return t=yield uC.create(e,{scanner:o,onDetected:n}),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createDocumentDataExtractorScanner(e){return AC(this,void 0,void 0,(function*(){let t;try{const i=n(52).default;return t=yield i.create(this,e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}toDataUrl(e){return AC(this,void 0,void 0,(function*(){return to.throwIfMissingBuffer(e),yield ji.toDataUrl(e)}))}detectDocument(e,t={},n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){yield this.licenseCheck(),to.throwIfMissingBuffer(e);const i=yield this.bridge.copyArgs.createDocumentScanner(t),o=this.getBridge(n),r=yield o.documentScannerDetect(i,e);return yield this.release(i,"documentDetector"),r}))}detectAndCropDocument(e,t="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){yield this.licenseCheck(),to.throwIfMissingBuffer(e);const n=this.getBridge(t);return yield n.detectAndCropDocument(e)}))}detectBarcodes(e,t={},n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){yield this.licenseCheck(),to.throwIfMissingBuffer(e),"string"==typeof e&&(e=yield ji.loadFromUrl(e));const i=Object.assign({},t);i.live=!1;const o=yield this.bridge.copyArgs.createBarcodeScanner(i),r=yield this.getBridge(n).scanBarcodes(o,e);return yield this.release(o,"barcodeRecognizer"),r}))}parseBarcodeDocument(e,t){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.copyArgs.parseBarcodeDocument(e,t)}))}createSimpleMRZRecognizer(){return AC(this,void 0,void 0,(function*(){const e=new xe({frameAccumulationConfiguration:{maximumNumberOfAccumulatedFrames:0}});return new Zi(this,this.bridge.copyArgs.createMRZScanner(e))}))}createOcrEngine(){return AC(this,void 0,void 0,(function*(){return new Yi(this,yield this.bridge.copyArgs.createOcrEngine())}))}createDocumentQualityAnalyzer(e={}){return AC(this,void 0,void 0,(function*(){const t=yield this.bridge.copyArgs.createDocumentQualityAnalyzer(e);return new io(this,t)}))}imageRotate(e,t,n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageRotate(e,t)}))}imageFilter(e,t,n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageApplyFilter(e,t)}))}imageCrop(e,t,n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageCrop(e,t)}))}imageResize(e,t,n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageResize(e,t)}))}getLicenseInfo(){return AC(this,void 0,void 0,(function*(){const e=yield this.bridge.copyArgs.getLicenseInfo();return new _i(e)}))}beginPdf(e){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new Fi(this,yield this.bridge.copyArgs.beginPdf(e))}))}beginTiff(e={}){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new Mi(this,yield this.bridge.copyArgs.beginTiff(e))}))}createDocumentDataExtractor(e){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new iC(this,yield this.bridge.copyArgs.documentDataExtractorCreate(e))}))}imageToJpeg(e,t="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(t).encodeJpeg(e)}))}get version(){return o.VERSION}get utils(){return this._utils||(this._utils=new Hi),this._utils}release(e,t){return AC(this,void 0,void 0,(function*(){e&&(oo.a.debug(`Releasing object ${null!=t?t:"unknown"}`),yield this.bridge.copyArgs.releaseObject(e))}))}getBridge(e){return"CONSUME_IMAGE"===e?this.bridge.transferArgs:this.bridge.copyArgs}licenseCheck(){return AC(this,void 0,void 0,(function*(){const e=yield this.getLicenseInfo();if(!e.isValid())throw console.error(`LicenseError: ${e.status}`),new eo(e)}))}destroy(){this.bridge.destroy(),this.storage.destroy(),SC.instance=void 0}}SC.defaultEnginePath="",SC._ui2=o.BUILD_WITH_UI?tC:void 0,SC.cameras=mC.a.INSTANCE,SC.Config=i,SC._stats=dC.a.INSTANCE;var wC=t.a=SC},function(e,t,n){"use strict";var i=n(48),o=n.n(i)()((function(e){return e[1]}));o.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=o},function(e,t){var n,i,o=e.exports={};function r(){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===r||!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:r}catch(e){n=r}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c,l=[],u=!1,d=-1;function m(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&h())}function h(){if(!u){var e=s(m);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,u=!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(){}o.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];l.push(new f(e,t)),1!==l.length||u||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){const{render:i,hydrate:o,unmountComponentAtNode:r}=n(0);function a(e){return{render(t){i(t,e)},unmount(){r(e)}}}t.createRoot=a,t.hydrateRoot=function(e,t){return o(t,e),a(e)}},function(e,t){e.exports=function(e,t,n,i){var o=n?n.call(i,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<r.length;c++){var l=r[c];if(!s(l))return!1;var u=e[l],d=t[l];if(!1===(o=n?n.call(i,u,d,l):void 0)||void 0===o&&u!==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,o=function(){return"undefined"==typeof i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},r=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=[],o=0;o<e.length;o++){var r=e[o],c=t.base?r[0]+t.base:r[0],l=n[c]||0,u="".concat(c," ").concat(l);n[c]=l+1;var d=s(u),m={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(m)):a.push({identifier:u,updater:g(m,t),references:1}),i.push(u)}return i}function l(e){var t=document.createElement("style"),i=e.attributes||{};if("undefined"==typeof i.nonce){var o=n.nc;o&&(i.nonce=o)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var a=r(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 u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function m(e,t,n,i){var o=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=d(t,o);else{var r=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function h(e,t,n){var i=n.css,o=n.media,r=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),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,o;if(t.singleton){var r=p++;n=f||(f=l(t)),i=m.bind(null,n,r,!1),o=m.bind(null,n,r,!0)}else n=l(t),i=h.bind(null,n,t),o=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 o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());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 o=s(n[i]);a[o].references--}for(var r=c(e,t),l=0;l<n.length;l++){var u=s(n[l]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},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 o={};if(i)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(o[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);i&&o[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 r}));var o=/^((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)-.*))$/,r=i((function(e){return o.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(41).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+IGRvY3VtZW50SWRzLmluY2x1ZGVzKGltYWdlLmRvY3VtZW50SWQpKTsKICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogZmlsdGVyZWRJbWFnZXMgfSk7CiAgICAgICAgfTsKICAgICAgICByZXF1ZXN0Lm9uZXJyb3IgPSBldmVudCA9PiB7CiAgICAgICAgICAgIHRocm93RXhjZXB0aW9uKHRva2VuLCBxdWVyeSwgIkVycm9yIGdldHRpbmcgaW1hZ2VzIik7CiAgICAgICAgfTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImdldFNCRG9jdW1lbnRJZHMiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0QWxsS2V5cygpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImluc2VydFNCRG9jdW1lbnQiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUucHV0KHF1ZXJ5LmRhdGEpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCRG9jdW1lbnQiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZGVsZXRlKHF1ZXJ5LmRhdGEpOwogICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdG9rZW46IHRva2VuLCBkYXRhOiB0cnVlIH0pOwogICAgICAgIH07CiAgICAgICAgcmVxdWVzdC5vbmVycm9yID0gZXZlbnQgPT4gewogICAgICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksICJFcnJvciBkZWxldGluZyBTQiBkb2N1bWVudCIpOwogICAgICAgIH07CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJnZXRTQkRvY3VtZW50IikgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmdldChxdWVyeS5kYXRhKTsKICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCBxdWVyeSwgcmVxdWVzdCk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJpbnNlcnRTQlBhZ2VJbWFnZSIpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5JTUFHRVMpOwogICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5wdXQocXVlcnkuZGF0YSk7CiAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcXVlcnksIHJlcXVlc3QpOwogICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAiZ2V0U0JQYWdlSW1hZ2UiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0KHF1ZXJ5LmRhdGEpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCUGFnZUltYWdlcyIpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5JTUFHRVMpOwogICAgICAgIGNvbnN0IGlkcyA9IHF1ZXJ5LmRhdGE7CiAgICAgICAgZm9yIChjb25zdCBpZCBvZiBpZHMpIHsKICAgICAgICAgICAgc3RvcmUuZGVsZXRlKGlkKTsKICAgICAgICB9CiAgICAgICAgLy8gV2UgY2FuJ3QgcmVhbGx5IGRvIGFueXRoaW5nIGlmIHRoZSBkZWxldGUgZmFpbHMsIHNvIGl0IGRvZXNuJ3QgbWFrZSBzZW5zZSB0byBhd2FpdCB0aGUgcmVzdWx0LgogICAgICAgIC8vIEp1c3QgYXNzdW1lIGl0IHdvcmtlZCBhbmQgcmV0dXJuIHRoZSByZXN1bHQgaW1tZWRpYXRlbHkuCiAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgIH0gZWxzZSB7CiAgICAgICAgdGhyb3dFeGNlcHRpb24odG9rZW4sIHF1ZXJ5LCAiVW5rbm93biBxdWVyeSB0eXBlIik7CiAgICB9Cn07"},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return d}));var i=n(0),o=n(11),r=n(13),a=n(22);class s extends a.a{constructor(){super(r.a.DEFAULT_VIDEO_RESOLUTION_HD),this.finder.aspectRatio={width:2,height:1},this.userGuidance.title.visible=!1}static fromJson(e){const t=new s;return this.mapValues(e,t,["videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(t,e),this.mapVideoConstraints(e,t),t}}var c=n(25),l=n(24),u=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 d extends o.c{constructor(e){super(e),this.enabled=!0,this.configuration=e.configuration}static create(e,t){var n;return u(this,void 0,void 0,(function*(){const o=null!==(n=t.container)&&void 0!==n?n:document.getElementById(t.containerId);if(t=s.fromJson(t),!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,r)=>{Object(i.render)(i.default.createElement(d,{container:o,configuration:t,onSuccess:n,onFailure:r,sdk:e}),o)}))}))}componentDidMount(){var e,t;super.componentDidMount();try{this.documentDataExtractor=this.props.sdk.createDocumentDataExtractor(this.configuration.detectorParameters)}catch(n){null===(t=(e=this.configuration).onError)||void 0===t||t.call(e,n)}this.detect()}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return u(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.enabled=!1,yield(yield this.documentDataExtractor).release()}))}detect(){var e,t,n,i,r,a;return u(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 r=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(o.c.DEFAULT_DETECTION_RESOLUTION);if(!r)return;const a=yield(yield this.documentDataExtractor).recognize(r,{mode:"LIVE"},"CONSUME_IMAGE");if(!this.enabled)return;this.camera.reusableImageBuffer=a.originalImage.data,null===(i=(n=this.configuration).onDocumentDetected)||void 0===i||i.call(n,a)}catch(e){null===(a=(r=this.configuration).onError)||void 0===a||a.call(r,e)}finally{requestAnimationFrame((()=>this.detect()))}}))}render(){var e;const t=this.configuration;return i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},i.default.createElement(c.a,{key:"camera",configuration:this.configuration,videoConstraints:t.videoConstraints,mirrored:t.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.configuration.finder.visible&&i.default.createElement(l.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder})))}}},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)-.*))$/,o=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=o}])}));
|
|
37
|
+
}`,c=Ho.a.div`position: absolute; animation: ${s} ${o}s;`;return this.previousScale=i,ro.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:e=>this.container=e},ro.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 Bv extends ro.default.Component{componentDidMount(){Lm.disableScreenMovement()}componentWillUnmount(){Lm.enableScreenMovement()}render(){return ro.default.createElement("div",null)}}class Iv{constructor(e,t){this.element=e,this.size=t}}class kv{}class Ov extends ro.default.Component{render(){return ro.default.createElement("div",{style:this.props.style},ro.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const e=this.half();return ro.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 ro.default.createElement("line",{x1:0,y1:e,x2:this.props.size,y2:e,stroke:this.props.color,strokeWidth:"2"})}}class Lv extends ro.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:Vi.a.empty(),cropImageFitSize:bm.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?ro.default.createElement("div",{style:this.style().container},ro.default.createElement("img",{style:this.style().image,ref:e=>this.destination=e,src:this.props.src,alt:"."}),ro.default.createElement(Ov,{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=Vi.a.fromPoint(Xd.a.scaleUpTo(e.origin,new bm.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,o=e.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?i<a&&o<a:1===r?i<a&&o>t.height-a:2===r?i>t.width-a&&o>t.height-a:i>t.width-a&&o<a}setIsVisible(e,t){this.setState({visible:e},t)}normalizeRotations(e){return e%this.MAX_ROTATIONS}}var Pv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 _v extends ro.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:bm.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:Xd.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(e,t){return Pv(this,void 0,void 0,(function*(){const n=Lm.findContainerOrThrow(e);return new Promise(((i,o)=>{Object(ro.render)(ro.default.createElement(_v,{sdk:t,onReady:i,onError:o,container:n,configuration:yv.fromJson(e)}),n)}))}))}componentDidMount(){var e,t,n;return Pv(this,void 0,void 0,(function*(){const i=null===(e=this.configuration)||void 0===e?void 0:e.image,o=yield this.sdk.detectAndCropDocument(i);let r=null!==(n=null===(t=this.configuration)||void 0===t?void 0:t.polygon)&&void 0!==n?n:o.pointsNormalized;0===r.length&&(r=_v.FULL_SIZE_POLYGON);const a=yield ji.toDataUrl(yield this.sdk.imageToJpeg(i));this.setState({documentDetectionResult:o,image:a,polygon:r,magneticLines:{vertical:{original:o.verticalLinesNormalized},horizontal:{original:o.horizontalLinesNormalized}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return Pv(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(e){return Pv(this,void 0,void 0,(function*(){bm.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=e,this.initializeSizes())}))}onResize(){const e=this.state.points.map((e=>new Xd.a(e.x/this.state.calculatedSize.width,e.y/this.state.calculatedSize.height)));this.initializeSizes(e)}initializeSizes(e,t,n){const i=new bm.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),o=new bm.a(this.container.width(),this.container.height()),r=ji.getObjectFitSize(o,i),a=new bm.a(r.width,r.height),s=null!=e?e:this.state.polygon,c=Lm.convertToViewportPointsFromParentSize(a,s),l=null!=t?t:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=Lm.convertLinesToViewportLines(a,l),m=Lm.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:c,magneticLines:{horizontal:{original:l,scaled:d},vertical:{original:u,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,o,r;const a=Ef.CLASSNAME,s=hm()({[a]:!0,[`${a}-visible`]:!0}),c=this.configuration.style.polygon.width,l=(null===(e=this.state.animation)||void 0===e?void 0:e.scale)?c/this.state.animation.scale:c,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return ro.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&ro.default.createElement(Bv,null),ro.default.createElement(Lv,{ref:e=>this.magnifier=e,style:this.configuration.style.magnifier}),ro.default.createElement(Tv,{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},ro.default.createElement(Dv,{src:this.state.image,onImageLoaded:e=>this.onImageLoaded(e)}),ro.default.createElement(xv,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${l}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(o=this.state.animation)||void 0===o?void 0:o.rotations,scale:null===(r=this.state.animation)||void 0===r?void 0:r.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 kv;return t.source=new Iv(this.htmlImage,this.state.calculatedSize),t.container=new bm.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 Pv(this,void 0,void 0,(function*(){const t=Xd.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),i=yield this.sdk.imageCrop(null===(e=this.configuration)||void 0===e?void 0:e.image,t);return{image:yield this.sdk.imageRotate(i,n,"CONSUME_IMAGE"),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 Pv(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 Pv(this,void 0,void 0,(function*(){const e=this.state.documentDetectionResult;0===e.pointsNormalized.length?this.resetPolygon():this.initializeSizes(e.pointsNormalized,e.horizontalLinesNormalized,e.verticalLinesNormalized)}))}resetPolygon(){const e=this.state.documentDetectionResult;this.initializeSizes(_v.FULL_SIZE_POLYGON,e.horizontalLinesNormalized,e.verticalLinesNormalized)}dispose(){const{container:e}=this.props;if(!e)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");Object(ro.render)(null,e)}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=yv.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}}}_v.FULL_SIZE_POLYGON=[new Xd.a(0,0),new Xd.a(1,0),new Xd.a(1,1),new Xd.a(0,1)];var Rv=_v,Fv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Nv(e){const t=e.config.screens.cropping,n=ro.default.useRef(null),i=ro.default.useRef(null),[o,r]=ro.default.useState(!0),a=Object(ro.useRef)(0),s=ro.default.useRef(Promise.resolve());return Object(ro.useEffect)((()=>{if(n.current&&e.page)return s.current=s.current.then((()=>Fv(this,void 0,void 0,(function*(){r(!0);const o=yield e.page.cropData();if(!n.current)return;a.current=o.rotations;const s=yield Rv.create({containerId:"sb-cropping-container",image:o.image,polygon:o.crop,rotations:o.rotations,style:{polygon:{color:uo.b.getColorValue(t.croppingPolygonColor),handles:{color:uo.b.getColorValue(t.croppingHandlerColor),border:"transparent",filter:"drop-shadow(0px 0px 2px #00000070)"}}}},e.sdk);i.current=s,r(!1)})))),()=>{s.current=s.current.then((()=>Fv(this,void 0,void 0,(function*(){var e;null===(e=i.current)||void 0===e||e.dispose()}))))}}),[n.current,e.page]),e.page?ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(cp,{open:o}),ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(t.backgroundColor),width:"100%",height:`calc(100 * ${mo})`,display:"flex",flexDirection:"column",touchAction:"none",userSelect:"none",WebkitTapHighlightColor:"transparent"}},ro.default.createElement(Gh,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:ro.default.createElement(wo,{ariaLabel:uo.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:o}),centerTitle:t.topBarTitle,rightContent:ro.default.createElement(wo,{ariaLabel:uo.b.getLocalizedText(t.topBarConfirmButton.accessibilityDescription),onClick:()=>Fv(this,void 0,void 0,(function*(){if(!i.current)return void e.onCloseButtonClick();const t=i.current;r(!0);const n=Xd.a.toPolygon(t.state.points,t.state.calculatedSize),o=(4+t.rotations-a.current)%4;yield e.onApplyCrop(n,o),r(!1)})),visible:t.topBarConfirmButton.visible,text:t.topBarConfirmButton.text,background:t.topBarConfirmButton.background,foreground:t.topBarConfirmButton.foreground,debugName:"cropping-screen-apply",disabled:o})}),ro.default.createElement(co.Box,{style:{flexGrow:1,width:"100%"},ref:n,id:"sb-cropping-container"}),ro.default.createElement(co.Box,{style:{backgroundColor:uo.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:80,width:"100%",display:"flex",justifyContent:"center"}},ro.default.createElement(co.Box,{style:{maxWidth:400,display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1,padding:"0 20px"}},ro.default.createElement(bo,{enabled:!o,config:t.bottomBar.detectButton,icon:({color:e})=>ro.default.createElement(lo.a,{style:{color:e}}),onClick:()=>Fv(this,void 0,void 0,(function*(){var e;r(!0),yield null===(e=i.current)||void 0===e?void 0:e.detect(),r(!1)})),debugName:"retake"}),ro.default.createElement(bo,{enabled:!o,config:t.bottomBar.rotateButton,icon:({color:e})=>ro.default.createElement(lo.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.rotate(1)},debugName:"retake"}),ro.default.createElement(bo,{enabled:!o,config:t.bottomBar.resetButton,icon:({color:e})=>ro.default.createElement(lo.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.resetPolygon()},debugName:"retake"}))))):null}var Mv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Vv{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 wC.instance}loadOriginalImage(){return Mv(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(this.data.originalImageId)}))}loadDocumentImage(){return Mv(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:Vv.FULL_SIZE_POLYGON}cropData(){return Mv(this,void 0,void 0,(function*(){return{crop:this.getPolygon(),rotations:this.data.rotations,image:yield this.loadOriginalImage()}}))}finalRawImage(){return Mv(this,void 0,void 0,(function*(){if(null===this.data.documentImageId){let e=yield this.loadOriginalImage();const t=this.document.data.documentImageSizeLimit;0!==t?(e=yield this.sdk().imageResize(e,t,"COPY_IMAGE"),e=yield this.sdk().imageCrop(e,this.getPolygon(),"CONSUME_IMAGE")):e=yield this.sdk().imageCrop(e,this.getPolygon(),"COPY_IMAGE");const n=this.data.filters||[];for(let t of n)e=yield this.sdk().imageFilter(e,t,"CONSUME_IMAGE");const i=Vv.ROTATIONS[this.data.rotations%4];e=yield this.sdk().imageRotate(e,i,"CONSUME_IMAGE");const o=yield this.sdk().storage.insertSBPageImage(e);return qv._internal_updateProperty(this.data,"documentImageId",o),yield this.document.updateStorageDocument(),e}return yield this.loadDocumentImage()}))}finalImageUrl(){return null===this._finalImageUrl&&(this._finalImageUrl=(()=>Mv(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 Mv(this,void 0,void 0,(function*(){null!==this.data.documentImageId&&(yield this.sdk().storage.deleteImageById(this.data.documentImageId),qv._internal_updateProperty(this.data,"documentImageId",null)),yield this.document.updateStorageDocument(),URL.revokeObjectURL(yield this._finalImageUrl),this._finalImageUrl=null}))}}Vv.ROTATIONS=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],Vv.FULL_SIZE_POLYGON=[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];class Wv{constructor(e){this.name="SBStorageError",this.message=e}}var zv=n(6);const jv=["UNDEFINED","MANUAL_SNAP","AUTO_SNAP","IMPORTED"];var Hv=n(40);class Uv extends zv.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=>Hv.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&&T.includes(e.documentDetectionStatus)?e.documentDetectionStatus:null),void 0!==e.documentQuality&&(this.documentQuality=null!=e.documentQuality&&F.includes(e.documentQuality)?e.documentQuality:null),void 0!==e.source&&(this.source=null!=e.source&&jv.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 Zv extends zv.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 Uv(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 Gv extends Zv{constructor(){super(...arguments),this.pages=[]}}class Yv extends Uv{}var Qv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Xv{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 qv{getData(){return this.data}get isDraft(){return this.data.id===qv.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 Vv(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 Vv(this,e))))}sdk(){return wC.instance}get pageCount(){return this.pages.length}pageAtIndex(e){return this.pages[e]}movePage(e,t){return Qv(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 Qv(this,void 0,void 0,(function*(){const t=yield wC.instance.storage.getSBDocumentData(e);if(void 0===t)throw new Wv("Document not found in database.");return new qv(t)}))}static create(e){return Qv(this,void 0,void 0,(function*(){const t=wC.instance;let n;if(e.loadFromStorage())n=yield qv.loadFromStorage(e.documentId);else{const i=yield t.storage.getSBDocumentData(qv.DOCUMENT_DRAFT_ID),o=void 0!==i;if(e.cleanSession&&o){for(const e of i.pages)yield t.storage.deleteImages(e);qv._internal_updateProperty(i,"pages",[])}const r=o?i:new Gv({id:qv.DOCUMENT_DRAFT_ID,creationTimestamp:Date.now(),pages:[],documentImageSizeLimit:e.documentImageSizeLimit});n=new qv(r)}return n.data.filters=e.filters,yield n.updateStorageDocument(),n}))}updateStorageDocument(){return Qv(this,void 0,void 0,(function*(){return yield this.sdk().storage.insertSBDocument(this)}))}delete(){return Qv(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 Qv(this,void 0,void 0,(function*(){void 0===i&&(i=this.pages.length);const o=new Yv({id:Math.round(1e6*Math.random()),polygon:e.pointsNormalized,documentDetectionStatus:e.status,originalImageId:-1,source:n,documentQuality:t,filters:this.data.filters}),r=yield this.sdk().storage.insertSBPageImage(e.originalImage);qv._internal_updateProperty(o,"originalImageId",r),this.splicePage(i,0,o),yield this.updateStorageDocument()}))}deleteFromPosition(e){return Qv(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 Qv(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 Qv(this,void 0,void 0,(function*(){for(;this.pages.length>0;)yield this.deleteFromPosition(0)}))}cropAndRotateAtIndex(e,t,n){return Qv(this,void 0,void 0,(function*(){const i=this.pageAtIndex(e);yield this.cropAndRotatePage(i,t,n)}))}cropAndRotatePage(e,t,n){return Qv(this,void 0,void 0,(function*(){const i=this.data.pages[this.pages.indexOf(e)];4===(null==t?void 0:t.length)&&qv._internal_updateProperty(i,"polygon",t),null!=n&&(i.rotations+=n),yield e.invalidateImage(),yield this.updateStorageDocument()}))}updateDataProperty(e,t){qv._internal_updateProperty(this.data,e,t)}static _internal_updateProperty(e,t,n){e[t]=n}deleteId(){delete this.data.id}convertToFinalVersion(){return Qv(this,void 0,void 0,(function*(){if(this.isDraft){this.deleteId();const e=yield this.updateStorageDocument();qv._internal_updateProperty(this.data,"id",e),yield this.sdk().storage.deleteSBDocument(qv.DOCUMENT_DRAFT_ID)}return this}))}insertRenderedBuffer(e,t){return Qv(this,void 0,void 0,(function*(){const n=yield this.sdk().storage.insertSBPageImage(e);return qv._internal_updateProperty(this.data,t,n),e}))}createPdf(e){return Qv(this,void 0,void 0,(function*(){const t=yield this.sdk().beginPdf(e);yield t.addPages(this);const n=yield t.complete();return yield this.saveRenderedPdf(n),n}))}createTiff(e={},t={}){return Qv(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 Qv(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.pdfId)}))}loadTiff(){return Qv(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.tiffId)}))}loadBuffer(e){return Qv(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(e)}))}saveRenderedPdf(e){return Qv(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"pdfId")}))}saveRenderedTiff(e){return Qv(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"tiffId")}))}deletePdf(){return Qv(this,void 0,void 0,(function*(){return yield this.sdk().storage.deleteImageById(this.data.pdfId)}))}deleteTiff(){return Qv(this,void 0,void 0,(function*(){return yield this.sdk().storage.deleteImageById(this.data.tiffId)}))}}qv.DOCUMENT_DRAFT_ID=-1;var Kv=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 Jv(e){var t;Object(ro.useMemo)((()=>{uo.b.setPalette(e.configuration.palette),uo.b.setLocalization(e.configuration.localization)}),[e.configuration]);const n=Ih(),[i,o]=Object(ro.useState)(null);Object(ro.useEffect)((()=>{const t=new Xv({config:e.configuration,documentId:e.documentId});qv.create(t).then((t=>{var n;t instanceof qv?o(t):null===(n=e.onError)||void 0===n||n.call(e,t)}))}),[]);const[r,a]=ro.default.useState({screen:"camera",insertMode:{name:"insert back"}}),s="acknowledgment"===r.screen?r:null;return Object(ro.useEffect)((()=>{const t=e.configuration.screens.camera.timeouts.autoCancelTimeout;if(0!==t){const n=setTimeout(e.onClose,t);return()=>clearTimeout(n)}}),[]),ro.default.createElement(ro.default.Fragment,null,ro.default.createElement(ho,null),ro.default.createElement(Uf,null,ro.default.createElement(ep,{visible:"acknowledgment"===r.screen,configuration:e.configuration,sdk:e.sdk,croppedDetectionResult:null==s?void 0:s.croppedDetectionResult,onAccept:(t,o)=>{if(!s)throw new Error("Internal error: Invalid routing state");let r;const c=[],l=e.configuration.outputSettings.pagesScanLimit;if("insert back"===s.insertMode.name){const e=i.addPage(t.value,o,t.source);c.push(e),r=l>0&&i.pages.length+1===l?{screen:"review",position:i.pages.length}:{screen:"camera",insertMode:{name:"insert back"}}}else{const e=s.insertMode.position,n=i.addPage(t.value,o,t.source,e);c.push(n),r={screen:"review",position:e},"replace"===s.insertMode.name&&c.push((()=>Kv(this,void 0,void 0,(function*(){yield i.deleteFromPosition(e),yield n})))())}Promise.all(c).then((()=>{n.current&&a((e=>"acknowledgment"===e.screen?r: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}),ro.default.createElement(Hf,{visible:["camera","acknowledgment"].includes(r.screen),scanningPaused:"camera"!==r.screen||null===i,configuration:e.configuration,onClose:()=>Kv(this,void 0,void 0,(function*(){(null==i?void 0:i.isDraft)&&(yield i.delete()),e.onClose()})),onImageCaptured:e=>{if("camera"!==r.screen)throw new Error("Internal error: Invalid routing state");a({screen:"acknowledgment",croppedDetectionResult:e,insertMode:r.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"!==r.screen||"replace"!==r.insertMode.name)&&(null===(t=null==i?void 0:i.pages)||void 0===t?void 0:t.length)>=e.configuration.outputSettings.pagesScanLimit)})(),onError:e.onError}),ro.default.createElement(eg,{document:i,currentPosition:"review"===r.screen?r.position:null,visible:"review"===r.screen,configuration:e.configuration,onClose:()=>a({screen:"camera",insertMode:{name:"insert back"}}),onSubmit:()=>Kv(this,void 0,void 0,(function*(){const t=yield i.convertToFinalVersion(),n=new Fh(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})}),ro.default.createElement(uv,{visible:"zoom"===r.screen,page:"zoom"===r.screen?i.pageAtIndex(r.position):null,config:e.configuration.screens.review.zoomOverlay,onCloseButtonClick:()=>a({screen:"review",position:"zoom"===r.screen?r.position:0})}),ro.default.createElement(Nv,{sdk:e.sdk,page:"crop"===r.screen?i.pageAtIndex(r.position):null,config:e.configuration,onCloseButtonClick:()=>a({screen:"review",position:"crop"===r.screen?r.position:0}),onApplyCrop:(e,t)=>Kv(this,void 0,void 0,(function*(){if("crop"!==r.screen)throw new Error("Internal error: Invalid routing state");yield i.cropAndRotateAtIndex(r.position,e,t),a({screen:"review",position:r.position})}))})))}var $v=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 eC{static createDocumentScanner(e,t){return new Promise(((n,i)=>{const{root:o,unmount:r}=this.createRoot(),a=e=>$v(this,void 0,void 0,(function*(){yield r(),i(e)}));o.render(ro.default.createElement(ro.default.StrictMode,null," ",ro.default.createElement(Jv,{configuration:e,documentId:t,onClose:()=>$v(this,void 0,void 0,(function*(){yield r(),n(null)})),onSubmit:e=>$v(this,void 0,void 0,(function*(){yield r(),n(e)})),onError:a,sdk:wC.instance}))),this.checkLicense(a)}))}static createBarcodeScanner(e){return new Promise(((t,n)=>{No.INSTANCE.initialize(e.sound);const{root:i,unmount:o}=this.createRoot(),r=e=>$v(this,void 0,void 0,(function*(){yield o(),n(e)}));i.render(ro.default.createElement(Rh,{configuration:e,onClose:()=>$v(this,void 0,void 0,(function*(){yield o(),t(null)})),onSubmit:e=>$v(this,void 0,void 0,(function*(){yield o(),t(e)})),onError:r})),this.checkLicense(r)}))}static createRoot(){const e=eC.createContainer("barcode-scanner-controller"),t=Object(ao.createRoot)(e);return{unmount:()=>$v(this,void 0,void 0,(function*(){return new Promise((n=>{window.setTimeout((()=>{t.unmount(),document.body.removeChild(e),n()}),0)}))})),root:t}}static checkLicense(e){(()=>{$v(this,void 0,void 0,(function*(){try{const t=yield wC.instance.getLicenseInfo();t.isValid()||(yield e(new eo(t)))}catch(t){yield e(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 * ${mo})`,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}}eC.SBDocument=qv,eC.Config=so;var tC=eC,nC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 iC{constructor(e,t){this._sdk=e,this._recognizer=t}recognize(e,t,n="COPY_IMAGE"){return nC(this,void 0,void 0,(function*(){const i=this._sdk.getBridge(n);return yield i.documentDataExtractorExtract(this._recognizer,e,t)}))}release(){return nC(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._recognizer)}))}}class oC extends Ki.a{constructor(){super(qi.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new xe,this.onMrzDetected=function(e){},this.finder.aspectRatio=new w.a({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(e){const t=new oC;return this.mapValues(e,t,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(t,e),this.mapVideoConstraints(e,t),t}}var rC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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())}))};Wo.a;Wo.b;class aC extends Wo.c{constructor(e){super(e),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this._configuration||(this._configuration=oC.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e,t){return rC(this,void 0,void 0,(function*(){const n=Lm.findContainerOrThrow(e);return new Promise(((i,o)=>{Object(ro.render)(ro.default.createElement(aC,{container:n,configuration:e,onSuccess:i,onFailure:o,mrzRecognizer:t}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return rC(this,void 0,void 0,(function*(){Om.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){Om.warn("Mrz detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return rC(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return rC(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return rC(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,i,o;return rC(this,void 0,void 0,(function*(){const r=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let a=!1;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(aC.FRAME_RESOLUTION);if(!i)return;r&&this.forceUpdate();const o=yield this.props.mrzRecognizer.recognize(i,"CONSUME_IMAGE");if(!this.enabled)return;if(null===o)return;this.camera.reusableImageBuffer=null==o?void 0:o.originalImage.data,o.success?(delete o.originalImage,a=!0,this.configuration.onMrzDetected(o)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(o.originalImage))}catch(e){null===(o=(i=this.configuration).onError)||void 0===o||o.call(i,e)}finally{a?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(e){this.setState({isFinderVisible:e})}render(){var e;return ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},ro.default.createElement(zo.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&ro.default.createElement(jo.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}aC.FRAME_RESOLUTION=1200;var sC=aC,cC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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())}))};Wo.b;class lC extends Wo.c{constructor(e){super(e),this.shouldComputeSize=!0,this.paused=!1,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,t){return cC(this,void 0,void 0,(function*(){const n=Lm.findContainerOrThrow(e);return new Promise(((i,o)=>{Object(ro.render)(ro.default.createElement(lC,{container:n,configuration:e,onDetected:t.onDetected,onSuccess:i,onFailure:o,scanner:t.scanner}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return cC(this,void 0,void 0,(function*(){Om.warn("Text pattern detection resumed"),yield this.resume()}))}pauseDetection(){Om.warn("Text pattern detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return cC(this,void 0,void 0,(function*(){e.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.scanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return cC(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return cC(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.scanner.cleanRecognitionQueue(),this.paused=!0}detect(){var e,t,n,i;return cC(this,void 0,void 0,(function*(){const o=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let r=!1;try{this.camera.finderFrame=null===(e=this.finder)||void 0===e?void 0:e.holeRect;const n=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(lC.FRAME_RESOLUTION);if(!n)return;o&&this.forceUpdate();const i=yield this.props.scanner.recognize(n);if(!this.enabled)return;if(null===i)return;i&&(r=!0,this.props.onDetected(i),this.camera.reusableImageBuffer=i.originalImage.data)}catch(e){null===(i=(n=this.configuration).onError)||void 0===i||i.call(n,e)}finally{r?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){var e;return ro.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),ro.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},ro.default.createElement(zo.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.state.isFinderVisible&&ro.default.createElement(jo.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}lC.FRAME_RESOLUTION=1200;var uC=lC,dC=n(37),mC=n(27);var hC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 fC{constructor(){this.tokenCounter=0,this.taskMap=new Map,this.worker=function(){const e=n(51).default.replace("data:application/javascript;charset=utf-8;base64,",""),t=atob(e),i=new Blob([t],{type:"application/javascript"}),o=URL.createObjectURL(i);return new Worker(o)}(),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 hC(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 pC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 gC{persist(){return pC(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 pC(this,void 0,void 0,(function*(){yield navigator.storage.estimate();return!0}))}}var vC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 CC{constructor(){this.utils=new gC,this.db=new fC}clear(){return vC(this,void 0,void 0,(function*(){yield this.db.query({type:"clear"})}))}delete(){return vC(this,void 0,void 0,(function*(){yield this.db.query({type:"delete"})}))}getCroppedDetectionResults(e=!0){return vC(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 vC(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){var n,i;e.originalImage=null===(n=t.find((t=>t.documentId===e.id&&"original"===t.type)))||void 0===n?void 0:n.data,e.croppedImage=null===(i=t.find((t=>t.documentId===e.id&&"cropped"===t.type)))||void 0===i?void 0:i.data}getCroppedDetectionResultImages(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:e})}))}getCroppedDetectionResultImage(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:[e]})}))}storeCroppedDetectionResult(e){return vC(this,void 0,void 0,(function*(){const t=Object.create(e);t.croppedImage=null,t.originalImage=null;const n=yield this.db.query({type:"storeCroppedDetectionResult",data:t}),i=[{documentId:n,data:e.originalImage,type:"original"},{documentId:n,data:e.croppedImage,type:"cropped"}];return yield this.db.query({type:"storeImages",data:i}),n}))}getSBDocumentIds(){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocumentIds"})}))}getSBDocumentData(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocument",data:e})}))}insertSBDocument(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"insertSBDocument",data:e.getData()})}))}deleteSBDocument(e){return vC(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 vC(this,void 0,void 0,(function*(){const t={image:e};return yield this.db.query({type:"insertSBPageImage",data:t})}))}getSBPageImage(e){return vC(this,void 0,void 0,(function*(){return(yield this.db.query({type:"getSBPageImage",data:e})).image}))}deleteImageById(e){return vC(this,void 0,void 0,(function*(){return yield this.db.query({type:"deleteSBPageImages",data:[e]})}))}deleteImages(e){return vC(this,void 0,void 0,(function*(){const t=e instanceof Vv?e.getData():e,n=[t.originalImageId];t.documentImageId&&n.push(t.documentImageId),yield this.db.query({type:"deleteSBPageImages",data:n})}))}destroy(){this.db.destroy()}}var yC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 bC{constructor(e,t){this._sdk=e,this._token=t}recognize(e,t="COPY_IMAGE"){return yC(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanVin(yield this._token,e)}))}cleanRecognitionQueue(){return yC(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanVinScanningQueue(yield this._token)}))}recognizeURL(e){return yC(this,void 0,void 0,(function*(){return this.recognize(yield ji.imageUrlToImageData(e))}))}release(){return yC(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._token)}))}}var AC=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 SC{constructor(){this.storage=new CC}static get UI(){if(!o.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return SC._ui2}static initialize(e){var t;return AC(this,void 0,void 0,(function*(){const n=new SC,i=e.enginePath||SC.defaultEnginePath,o=!!e.allowThreads,a=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 s=[e.licenseKey,i,window.location.hostname,"",{captureConsole:!1,allowThreads:o,requestSuffix:a}];return n.bridge=new d(i,{allowSimd:!0,allowThreads:o,requestSuffix:a},s),SC.instance=n,window.scanbotSdk=n,oo.a.initialize(e.verboseLogging),e.allowThreads&&!Object(r.a)()&&(oo.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&oo.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 AC(this,void 0,void 0,(function*(){let t;try{return t=yield Rf.create(e,this),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createMrzScanner(e){var t;return AC(this,void 0,void 0,(function*(){let n;try{const i=new Zi(this,this.bridge.copyArgs.createMRZScanner(null!==(t=e.recognizerConfiguration)&&void 0!==t?t:{}));return n=yield sC.create(e,i),yield this.licenseCheck(),n}catch(e){throw n&&n.dispose(),e}}))}createBarcodeScanner(e){return AC(this,void 0,void 0,(function*(){let t;try{return t=yield _m.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}openCroppingView(e){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield Rv.create(e,this)}))}createTextPatternScanner(e){return AC(this,void 0,void 0,(function*(){let t;try{e=Ji.fromJson(e);const n=this.bridge.copyArgs.createTextPatternScanner(e.ocrConfiguration),i=new Xi(this,n);return t=yield uC.create(e,{onDetected:e.onTextDetected,scanner:i}),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createVinScanner(e){return AC(this,void 0,void 0,(function*(){let t;try{e=$i.fromJson(e);const n=t=>{""===t.textResult.rawText&&""===t.barcodeResult.extractedVIN||e.onVinDetected(t)},i=this.bridge.copyArgs.createVinScanner(e.detectionConfiguration),o=new bC(this,i);return t=yield uC.create(e,{scanner:o,onDetected:n}),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createDocumentDataExtractorScanner(e){return AC(this,void 0,void 0,(function*(){let t;try{const i=n(52).default;return t=yield i.create(this,e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}toDataUrl(e){return AC(this,void 0,void 0,(function*(){return to.throwIfMissingBuffer(e),yield ji.toDataUrl(e)}))}detectDocument(e,t={},n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){yield this.licenseCheck(),to.throwIfMissingBuffer(e);const i=yield this.bridge.copyArgs.createDocumentScanner(t),o=this.getBridge(n),r=yield o.documentScannerDetect(i,e);return yield this.release(i,"documentDetector"),r}))}detectAndCropDocument(e,t="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){yield this.licenseCheck(),to.throwIfMissingBuffer(e);const n=this.getBridge(t);return yield n.detectAndCropDocument(e)}))}detectBarcodes(e,t={},n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){yield this.licenseCheck(),to.throwIfMissingBuffer(e),"string"==typeof e&&(e=yield ji.loadFromUrl(e));const i=Object.assign({},t);i.live=!1;const o=yield this.bridge.copyArgs.createBarcodeScanner(i),r=yield this.getBridge(n).scanBarcodes(o,e);return yield this.release(o,"barcodeRecognizer"),r}))}parseBarcodeDocument(e,t){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.copyArgs.parseBarcodeDocument(e,t)}))}createSimpleMRZRecognizer(){return AC(this,void 0,void 0,(function*(){const e=new xe({frameAccumulationConfiguration:{maximumNumberOfAccumulatedFrames:0}});return new Zi(this,this.bridge.copyArgs.createMRZScanner(e))}))}createOcrEngine(){return AC(this,void 0,void 0,(function*(){return new Yi(this,yield this.bridge.copyArgs.createOcrEngine())}))}createDocumentQualityAnalyzer(e={}){return AC(this,void 0,void 0,(function*(){const t=yield this.bridge.copyArgs.createDocumentQualityAnalyzer(e);return new io(this,t)}))}imageRotate(e,t,n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageRotate(e,t)}))}imageFilter(e,t,n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageApplyFilter(e,t)}))}imageCrop(e,t,n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageCrop(e,t)}))}imageResize(e,t,n="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){to.throwIfMissingBuffer(e);const i=this.getBridge(n);return yield i.imageResize(e,t)}))}getLicenseInfo(){return AC(this,void 0,void 0,(function*(){const e=yield this.bridge.copyArgs.getLicenseInfo();return new _i(e)}))}beginPdf(e){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new Fi(this,yield this.bridge.copyArgs.beginPdf(e))}))}beginTiff(e={}){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new Mi(this,yield this.bridge.copyArgs.beginTiff(e))}))}createDocumentDataExtractor(e){return AC(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new iC(this,yield this.bridge.copyArgs.documentDataExtractorCreate(e))}))}imageToJpeg(e,t="COPY_IMAGE"){return AC(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(t).encodeJpeg(e)}))}get version(){return o.VERSION}get utils(){return this._utils||(this._utils=new Hi),this._utils}release(e,t){return AC(this,void 0,void 0,(function*(){e&&(oo.a.debug(`Releasing object ${null!=t?t:"unknown"}`),yield this.bridge.copyArgs.releaseObject(e))}))}getBridge(e){return"CONSUME_IMAGE"===e?this.bridge.transferArgs:this.bridge.copyArgs}licenseCheck(){return AC(this,void 0,void 0,(function*(){const e=yield this.getLicenseInfo();if(!e.isValid())throw console.error(`LicenseError: ${e.status}`),new eo(e)}))}destroy(){this.bridge.destroy(),this.storage.destroy(),SC.instance=void 0}}SC.defaultEnginePath="",SC._ui2=o.BUILD_WITH_UI?tC:void 0,SC.cameras=mC.a.INSTANCE,SC.Config=i,SC._stats=dC.a.INSTANCE;var wC=t.a=SC},function(e,t,n){"use strict";var i=n(48),o=n.n(i)()((function(e){return e[1]}));o.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=o},function(e,t){var n,i,o=e.exports={};function r(){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===r||!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:r}catch(e){n=r}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var c,l=[],u=!1,d=-1;function m(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&h())}function h(){if(!u){var e=s(m);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,u=!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(){}o.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];l.push(new f(e,t)),1!==l.length||u||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){const{render:i,hydrate:o,unmountComponentAtNode:r}=n(0);function a(e){return{render(t){i(t,e)},unmount(){r(e)}}}t.createRoot=a,t.hydrateRoot=function(e,t){return o(t,e),a(e)}},function(e,t){e.exports=function(e,t,n,i){var o=n?n.call(i,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<r.length;c++){var l=r[c];if(!s(l))return!1;var u=e[l],d=t[l];if(!1===(o=n?n.call(i,u,d,l):void 0)||void 0===o&&u!==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,o=function(){return"undefined"==typeof i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},r=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=[],o=0;o<e.length;o++){var r=e[o],c=t.base?r[0]+t.base:r[0],l=n[c]||0,u="".concat(c," ").concat(l);n[c]=l+1;var d=s(u),m={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(m)):a.push({identifier:u,updater:g(m,t),references:1}),i.push(u)}return i}function l(e){var t=document.createElement("style"),i=e.attributes||{};if("undefined"==typeof i.nonce){var o=n.nc;o&&(i.nonce=o)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var a=r(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 u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function m(e,t,n,i){var o=n?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=d(t,o);else{var r=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function h(e,t,n){var i=n.css,o=n.media,r=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),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,o;if(t.singleton){var r=p++;n=f||(f=l(t)),i=m.bind(null,n,r,!1),o=m.bind(null,n,r,!0)}else n=l(t),i=h.bind(null,n,t),o=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 o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());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 o=s(n[i]);a[o].references--}for(var r=c(e,t),l=0;l<n.length;l++){var u=s(n[l]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},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 o={};if(i)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(o[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);i&&o[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 r}));var o=/^((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)-.*))$/,r=i((function(e){return o.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(41).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+IGRvY3VtZW50SWRzLmluY2x1ZGVzKGltYWdlLmRvY3VtZW50SWQpKTsKICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogZmlsdGVyZWRJbWFnZXMgfSk7CiAgICAgICAgfTsKICAgICAgICByZXF1ZXN0Lm9uZXJyb3IgPSBldmVudCA9PiB7CiAgICAgICAgICAgIHRocm93RXhjZXB0aW9uKHRva2VuLCBxdWVyeSwgIkVycm9yIGdldHRpbmcgaW1hZ2VzIik7CiAgICAgICAgfTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImdldFNCRG9jdW1lbnRJZHMiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0QWxsS2V5cygpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImluc2VydFNCRG9jdW1lbnQiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUucHV0KHF1ZXJ5LmRhdGEpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCRG9jdW1lbnQiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuU0JfRE9DVU1FTlRTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZGVsZXRlKHF1ZXJ5LmRhdGEpOwogICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdG9rZW46IHRva2VuLCBkYXRhOiB0cnVlIH0pOwogICAgICAgIH07CiAgICAgICAgcmVxdWVzdC5vbmVycm9yID0gZXZlbnQgPT4gewogICAgICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksICJFcnJvciBkZWxldGluZyBTQiBkb2N1bWVudCIpOwogICAgICAgIH07CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJnZXRTQkRvY3VtZW50IikgewogICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmdldChxdWVyeS5kYXRhKTsKICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCBxdWVyeSwgcmVxdWVzdCk7CiAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJpbnNlcnRTQlBhZ2VJbWFnZSIpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5JTUFHRVMpOwogICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5wdXQocXVlcnkuZGF0YSk7CiAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcXVlcnksIHJlcXVlc3QpOwogICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAiZ2V0U0JQYWdlSW1hZ2UiKSB7CiAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0KHF1ZXJ5LmRhdGEpOwogICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHF1ZXJ5LCByZXF1ZXN0KTsKICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCUGFnZUltYWdlcyIpIHsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5JTUFHRVMpOwogICAgICAgIGNvbnN0IGlkcyA9IHF1ZXJ5LmRhdGE7CiAgICAgICAgZm9yIChjb25zdCBpZCBvZiBpZHMpIHsKICAgICAgICAgICAgc3RvcmUuZGVsZXRlKGlkKTsKICAgICAgICB9CiAgICAgICAgLy8gV2UgY2FuJ3QgcmVhbGx5IGRvIGFueXRoaW5nIGlmIHRoZSBkZWxldGUgZmFpbHMsIHNvIGl0IGRvZXNuJ3QgbWFrZSBzZW5zZSB0byBhd2FpdCB0aGUgcmVzdWx0LgogICAgICAgIC8vIEp1c3QgYXNzdW1lIGl0IHdvcmtlZCBhbmQgcmV0dXJuIHRoZSByZXN1bHQgaW1tZWRpYXRlbHkuCiAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgIH0gZWxzZSB7CiAgICAgICAgdGhyb3dFeGNlcHRpb24odG9rZW4sIHF1ZXJ5LCAiVW5rbm93biBxdWVyeSB0eXBlIik7CiAgICB9Cn07"},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return d}));var i=n(0),o=n(11),r=n(13),a=n(22);class s extends a.a{constructor(){super(r.a.DEFAULT_VIDEO_RESOLUTION_HD),this.finder.aspectRatio={width:2,height:1},this.userGuidance.title.visible=!1}static fromJson(e){const t=new s;return this.mapValues(e,t,["videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(t,e),this.mapVideoConstraints(e,t),t}}var c=n(25),l=n(24),u=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(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 d extends o.c{constructor(e){super(e),this.enabled=!0,this.configuration=e.configuration}static create(e,t){var n;return u(this,void 0,void 0,(function*(){const o=null!==(n=t.container)&&void 0!==n?n:document.getElementById(t.containerId);if(t=s.fromJson(t),!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,r)=>{Object(i.render)(i.default.createElement(d,{container:o,configuration:t,onSuccess:n,onFailure:r,sdk:e}),o)}))}))}componentDidMount(){var e,t;super.componentDidMount();try{this.documentDataExtractor=this.props.sdk.createDocumentDataExtractor(this.configuration.detectorParameters)}catch(n){null===(t=(e=this.configuration).onError)||void 0===t||t.call(e,n)}this.detect()}componentWillUnmount(){const e=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return u(this,void 0,void 0,(function*(){e.componentWillUnmount.call(this),this.enabled=!1,yield(yield this.documentDataExtractor).release()}))}detect(){var e,t,n,i,r,a;return u(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 r=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(o.c.DEFAULT_DETECTION_RESOLUTION);if(!r)return;const a=yield(yield this.documentDataExtractor).recognize(r,{mode:"LIVE"},"CONSUME_IMAGE");if(!this.enabled)return;this.camera.reusableImageBuffer=a.originalImage.data,null===(i=(n=this.configuration).onDocumentDetected)||void 0===i||i.call(n,a)}catch(e){null===(a=(r=this.configuration).onError)||void 0===a||a.call(r,e)}finally{requestAnimationFrame((()=>this.detect()))}}))}render(){var e;const t=this.configuration;return i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),i.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},i.default.createElement(c.a,{key:"camera",configuration:this.configuration,videoConstraints:t.videoConstraints,mirrored:t.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:e=>{this.camera=e}})),this.configuration.finder.visible&&i.default.createElement(l.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder})))}}},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)-.*))$/,o=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=o}])}));
|