scanbot-web-sdk 6.0.0-dev.6 → 7.0.0-dev.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.
Files changed (281) hide show
  1. package/@types/barcode-scanner-view.d.ts +1 -1
  2. package/@types/core/bridge/compiled/{BarcodeConfigs.d.ts → BarcodeConfigurationTypes.d.ts} +558 -173
  3. package/@types/core/bridge/compiled/BarcodeDocumentTypes.d.ts +14 -13
  4. package/@types/core/bridge/compiled/BarcodeScannerTypes.d.ts +25 -14
  5. package/@types/core/bridge/compiled/BarcodeTypes.d.ts +58 -56
  6. package/@types/core/bridge/compiled/CheckScannerTypes.d.ts +67 -0
  7. package/@types/core/bridge/compiled/CommonFieldType.d.ts +29 -28
  8. package/@types/core/bridge/compiled/CreditCardTypes.d.ts +35 -33
  9. package/@types/core/bridge/compiled/DocumentDataExtractorConfigurationTypes.d.ts +148 -0
  10. package/@types/core/bridge/compiled/DocumentDataExtractorTypes.d.ts +90 -0
  11. package/@types/core/bridge/compiled/DocumentQualityAnalyzerTypes.d.ts +28 -23
  12. package/@types/core/bridge/compiled/{DocumentDetectorTypes.d.ts → DocumentScannerTypes.d.ts} +49 -47
  13. package/@types/core/bridge/compiled/{EhicTypes.d.ts → EuropeanHealthInsuranceCardTypes.d.ts} +51 -108
  14. package/@types/core/bridge/compiled/FrameAccumulationTypes.d.ts +37 -14
  15. package/@types/core/bridge/compiled/GenericDocument.d.ts +17 -17
  16. package/@types/core/bridge/compiled/Geometry.d.ts +2 -2
  17. package/@types/core/bridge/compiled/ImageTypes.d.ts +1 -0
  18. package/@types/core/bridge/compiled/LicensePlateScannerTypes.d.ts +20 -19
  19. package/@types/core/bridge/compiled/MedicalCertificateTypes.d.ts +108 -105
  20. package/@types/core/bridge/compiled/MrzTypes.d.ts +73 -0
  21. package/@types/core/bridge/compiled/ParametricFilters.d.ts +4 -3
  22. package/@types/core/bridge/compiled/{PdfConfig.d.ts → PdfConfigurationTypes.d.ts} +48 -45
  23. package/@types/core/bridge/compiled/{GenericTextLineScannerTypes.d.ts → TextPatternScannerTypes.d.ts} +23 -22
  24. package/@types/core/bridge/compiled/TiffTypes.d.ts +48 -50
  25. package/@types/core/bridge/worker-bridge.d.ts +488 -364
  26. package/@types/core/worker/ScanbotSDK.Core.d.ts +21 -21
  27. package/@types/core-types.d.ts +10 -12
  28. package/@types/cropping-view.d.ts +8 -4
  29. package/@types/document-data-extractor-view.d.ts +22 -0
  30. package/@types/document-scanner-view.d.ts +16 -7
  31. package/@types/index.d.ts +36 -23
  32. package/@types/interfaces/i-cropping-view-handle.d.ts +2 -0
  33. package/@types/interfaces/i-document-data-extractor-scanner-handle.d.ts +3 -0
  34. package/@types/interfaces/{i-text-data-scanner-handle.d.ts → i-text-pattern-scanner-handle.d.ts} +1 -1
  35. package/@types/model/configuration/barcode-scanner-configuration.d.ts +1 -0
  36. package/@types/model/configuration/cropping-view-configuration.d.ts +1 -0
  37. package/@types/model/configuration/document-data-extractor-configuration.d.ts +9 -0
  38. package/@types/model/configuration/document-scanner-configuration.d.ts +8 -4
  39. package/@types/model/configuration/initialization-options.d.ts +1 -2
  40. package/@types/model/configuration/mrz-scanner-configuration.d.ts +4 -4
  41. package/@types/model/configuration/selection-overlay-configuration.d.ts +5 -0
  42. package/@types/model/configuration/text-pattern-scanner-configuration.d.ts +9 -0
  43. package/@types/model/configuration/view-finder-scanner-configuration.d.ts +2 -1
  44. package/@types/model/configuration/vin-scanner-configuration.d.ts +3 -3
  45. package/@types/scanbot-sdk.d.ts +269 -205
  46. package/@types/scanner-view.d.ts +2 -0
  47. package/@types/service/document-data-extractor.d.ts +13 -0
  48. package/@types/service/ocr-engine.d.ts +3 -3
  49. package/@types/service/pdf-generator.d.ts +6 -1
  50. package/@types/service/simple-mrz-recognizer.d.ts +4 -4
  51. package/@types/service/storage/indexed-db/sb-indexed-db.d.ts +60 -0
  52. package/@types/service/storage/local/sb-local-storage.d.ts +11 -0
  53. package/@types/service/storage/sb-storage.d.ts +33 -0
  54. package/@types/service/storage/utils/create-worker-vite.d.ts +1 -0
  55. package/@types/service/storage/utils/create-worker.d.ts +1 -0
  56. package/@types/service/storage/utils/sb-storage-error.d.ts +5 -0
  57. package/@types/service/storage/utils/sb-storage-utils.d.ts +10 -0
  58. package/@types/service/text-pattern-scanner.d.ts +14 -0
  59. package/@types/service/tiff-generator.d.ts +7 -4
  60. package/@types/{text-data-scanner-view.d.ts → text-pattern-scanner-view.d.ts} +9 -9
  61. package/@types/ui2/{controllers → barcode/controllers}/barcode-scanner-controller.d.ts +1 -1
  62. package/@types/ui2/{controllers → barcode/controllers}/multiple-scanning-mode-controller.d.ts +1 -1
  63. package/@types/ui2/{controllers → barcode/controllers}/single-scanning-mode-controller.d.ts +1 -1
  64. package/@types/ui2/{model → barcode/model}/counted-barcodes.d.ts +2 -2
  65. package/@types/ui2/{utils → barcode/utils}/barcode-mapper/expected-barcode-mapper.d.ts +2 -2
  66. package/@types/ui2/{utils → barcode/utils}/barcode-mapper/i-barcode-mapper.d.ts +2 -2
  67. package/@types/ui2/{utils → barcode/utils}/barcode-mapper/user-barcode-mapper.d.ts +1 -1
  68. package/@types/ui2/{utils → barcode/utils}/camera-config.d.ts +2 -2
  69. package/@types/ui2/{utils → barcode/utils}/styled-badge.d.ts +3 -1
  70. package/@types/ui2/{utils → barcode/utils}/styled-box.d.ts +1 -1
  71. package/@types/ui2/barcode/utils/styled-button.d.ts +14 -0
  72. package/@types/ui2/{utils → barcode/utils}/useScanningViewSize.d.ts +1 -1
  73. package/@types/ui2/{views → barcode/views}/action-button/action-button-container.d.ts +3 -3
  74. package/@types/ui2/{views → barcode/views}/action-button/action-button.d.ts +1 -1
  75. package/@types/ui2/{views → barcode/views}/ar/ar-badge.d.ts +2 -2
  76. package/@types/ui2/{views → barcode/views}/ar/ar-overlay-barcode-info.d.ts +2 -2
  77. package/@types/ui2/{views → barcode/views}/ar/vertical-positions.d.ts +2 -2
  78. package/@types/ui2/{views → barcode/views}/barcode-info/barcode-info.d.ts +1 -1
  79. package/@types/ui2/{views → barcode/views}/barcode-scanner.d.ts +8 -8
  80. package/@types/ui2/{views → barcode/views}/camera-permission-denied.d.ts +1 -1
  81. package/@types/ui2/{views → barcode/views}/dialog/barcode-info-dialog.d.ts +1 -1
  82. package/@types/ui2/{views → barcode/views}/dialog/barcode-mapping-error-dialog.d.ts +1 -1
  83. package/@types/ui2/{views → barcode/views}/dialog/base/confirmation-dialog.d.ts +1 -1
  84. package/@types/ui2/{views → barcode/views}/dialog/base/styled-dialog.d.ts +1 -0
  85. package/@types/ui2/{views → barcode/views}/dialog/count-edit-dialog.d.ts +1 -1
  86. package/@types/ui2/{views → barcode/views}/dialog/find-and-pick-submit-dialog.d.ts +1 -1
  87. package/@types/ui2/{views → barcode/views}/drawer/barcode-result-drawer.d.ts +1 -1
  88. package/@types/ui2/{views → barcode/views}/drawer/barcode-result-sidebar.d.ts +1 -1
  89. package/@types/ui2/{views → barcode/views}/drawer/counting-button.d.ts +1 -1
  90. package/@types/ui2/{views → barcode/views}/drawer/hooks/use-drag-listener.d.ts +1 -1
  91. package/@types/ui2/{views → barcode/views}/drawer/subviews/barcode-drawer-empty-state.d.ts +1 -1
  92. package/@types/ui2/{views → barcode/views}/drawer/subviews/barcode-list-item.d.ts +1 -1
  93. package/@types/ui2/{views → barcode/views}/drawer/subviews/barcode-list.d.ts +1 -1
  94. package/@types/ui2/{views → barcode/views}/drawer/subviews/drawer-header-content.d.ts +1 -1
  95. package/@types/ui2/{views → barcode/views}/drawer/subviews/swipe-underlay.d.ts +1 -1
  96. package/@types/ui2/{views → barcode/views}/form/dialog-button.d.ts +4 -1
  97. package/@types/ui2/{views → barcode/views}/navigation-bar.d.ts +1 -1
  98. package/@types/ui2/{views → barcode/views}/styled-text.d.ts +2 -1
  99. package/@types/ui2/configuration/DocumentQualityAnalyzerTypes.d.ts +1 -0
  100. package/@types/ui2/configuration/DocumentScannerTypes.d.ts +1 -0
  101. package/@types/ui2/configuration/Geometry.d.ts +1 -1
  102. package/@types/ui2/configuration/ParametricFilters.d.ts +1 -0
  103. package/@types/ui2/configuration/{ActionBarConfiguration.d.ts → barcode/ActionBarConfiguration.d.ts} +1 -1
  104. package/@types/ui2/configuration/{ArTrackingOverlayConfiguration.d.ts → barcode/ArTrackingOverlayConfiguration.d.ts} +1 -1
  105. package/@types/ui2/configuration/{BarcodeInfoMapping.d.ts → barcode/BarcodeInfoMapping.d.ts} +1 -1
  106. package/@types/ui2/configuration/{BarcodeRecognizerConfiguration.d.ts → barcode/BarcodeRecognizerConfiguration.d.ts} +3 -3
  107. package/@types/ui2/configuration/{BarcodeScannerConfiguration.d.ts → barcode/BarcodeScannerConfiguration.d.ts} +1 -1
  108. package/@types/ui2/configuration/barcode/BarcodeScannerTypes.d.ts +2 -0
  109. package/@types/ui2/configuration/{BarcodeScannerUIResult.d.ts → barcode/BarcodeScannerUIResult.d.ts} +1 -1
  110. package/@types/ui2/configuration/{BarcodeTextLocalization.d.ts → barcode/BarcodeTextLocalization.d.ts} +1 -1
  111. package/@types/ui2/configuration/barcode/BarcodeTypes.d.ts +1 -0
  112. package/@types/ui2/configuration/{CameraConfiguration.d.ts → barcode/CameraConfiguration.d.ts} +1 -1
  113. package/@types/ui2/configuration/{CameraPermission.d.ts → barcode/CameraPermission.d.ts} +1 -1
  114. package/@types/ui2/configuration/{Common.d.ts → barcode/Common.d.ts} +1 -1
  115. package/@types/ui2/configuration/barcode/CommonFieldType.d.ts +1 -0
  116. package/@types/ui2/configuration/{FindAndPickScanningModeUseCase.d.ts → barcode/FindAndPickScanningModeUseCase.d.ts} +1 -1
  117. package/@types/ui2/configuration/barcode/GenericDocument.d.ts +1 -0
  118. package/@types/ui2/configuration/barcode/Geometry.d.ts +1 -0
  119. package/@types/ui2/configuration/{MultipleScanningModeUseCase.d.ts → barcode/MultipleScanningModeUseCase.d.ts} +1 -1
  120. package/@types/ui2/configuration/{ScanbotAlertDialog.d.ts → barcode/ScanbotAlertDialog.d.ts} +1 -1
  121. package/@types/ui2/configuration/{SingleScanningModeUseCase.d.ts → barcode/SingleScanningModeUseCase.d.ts} +1 -1
  122. package/@types/ui2/configuration/{TopBarConfiguration.d.ts → barcode/TopBarConfiguration.d.ts} +1 -1
  123. package/@types/ui2/configuration/{UserGuidanceConfiguration.d.ts → barcode/UserGuidanceConfiguration.d.ts} +1 -1
  124. package/@types/ui2/configuration/{ViewFinderConfiguration.d.ts → barcode/ViewFinderConfiguration.d.ts} +1 -1
  125. package/@types/ui2/configuration/common/ActionBarConfiguration.d.ts +42 -0
  126. package/@types/ui2/configuration/common/CameraConfiguration.d.ts +60 -0
  127. package/@types/ui2/configuration/common/CameraPermission.d.ts +62 -0
  128. package/@types/ui2/configuration/common/Common.d.ts +467 -0
  129. package/@types/ui2/configuration/common/NavigationBarConfiguration.d.ts +11 -0
  130. package/@types/ui2/configuration/common/ScanbotAlertDialog.d.ts +74 -0
  131. package/@types/ui2/configuration/common/TopBarConfiguration.d.ts +55 -0
  132. package/@types/ui2/configuration/common/UserGuidanceConfiguration.d.ts +64 -0
  133. package/@types/ui2/configuration/common/ViewFinderConfiguration.d.ts +93 -0
  134. package/@types/ui2/configuration/document/AcknowledgementScreenConfiguration.d.ts +125 -0
  135. package/@types/ui2/configuration/document/CameraScreenConfiguration.d.ts +659 -0
  136. package/@types/ui2/configuration/document/CroppingConfiguration.d.ts +1 -0
  137. package/@types/ui2/configuration/document/CroppingResult.d.ts +1 -0
  138. package/@types/ui2/configuration/document/CroppingScreenConfiguration.d.ts +141 -0
  139. package/@types/ui2/configuration/document/CroppingTextLocalization.d.ts +1 -0
  140. package/@types/ui2/configuration/document/DocumentScannerCameraConfiguration.d.ts +60 -0
  141. package/@types/ui2/configuration/document/DocumentScannerGuidanceVisibility.d.ts +11 -0
  142. package/@types/ui2/configuration/document/DocumentScannerOutputSettings.d.ts +38 -0
  143. package/@types/ui2/configuration/document/DocumentScannerScreens.d.ts +26 -0
  144. package/@types/ui2/configuration/document/DocumentScannerTextLocalization.d.ts +608 -0
  145. package/@types/ui2/configuration/document/DocumentScannerUIResult.d.ts +5 -0
  146. package/@types/ui2/configuration/document/DocumentScannerUserGuidance.d.ts +99 -0
  147. package/@types/ui2/configuration/document/DocumentScanningFlow.d.ts +91 -0
  148. package/@types/ui2/configuration/document/IntroductionScreenConfiguration.d.ts +188 -0
  149. package/@types/ui2/configuration/document/ReorderPagesScreenConfiguration.d.ts +1 -0
  150. package/@types/ui2/configuration/document/ReviewScreenConfiguration.d.ts +372 -0
  151. package/@types/ui2/configuration/native/DocumentData.d.ts +37 -0
  152. package/@types/ui2/configuration/native/PageData.d.ts +58 -0
  153. package/@types/ui2/configuration/native/PageImageSource.d.ts +13 -0
  154. package/@types/ui2/configuration/utils.d.ts +8 -0
  155. package/@types/ui2/configuration.d.ts +46 -21
  156. package/@types/ui2/document/assets/auto-capture-disabled-icon.d.ts +4 -0
  157. package/@types/ui2/document/assets/auto-capture-icon.d.ts +4 -0
  158. package/@types/ui2/document/assets/captured-circle-icon.d.ts +5 -0
  159. package/@types/ui2/document/assets/delete-icon.d.ts +4 -0
  160. package/@types/ui2/document/assets/file-add-icon.d.ts +4 -0
  161. package/@types/ui2/document/assets/image-error-icon.d.ts +5 -0
  162. package/@types/ui2/document/assets/image-retake.d.ts +4 -0
  163. package/@types/ui2/document/assets/loading-spinner-icon.d.ts +2 -0
  164. package/@types/ui2/document/assets/shutter-button-auto-icon.d.ts +4 -0
  165. package/@types/ui2/document/assets/shutter-button-manual-icon.d.ts +5 -0
  166. package/@types/ui2/document/assets/shutter-button-spinner-icon.d.ts +4 -0
  167. package/@types/ui2/document/assets/the-hand.d.ts +10 -0
  168. package/@types/ui2/document/controller/acknowledgment-screen-controller.d.ts +16 -0
  169. package/@types/ui2/document/controller/camera-screen-controller.d.ts +20 -0
  170. package/@types/ui2/document/controller/cropping-screen-controller.d.ts +14 -0
  171. package/@types/ui2/document/controller/document-scanner-controller.d.ts +14 -0
  172. package/@types/ui2/document/controller/review-screen-controller.d.ts +18 -0
  173. package/@types/ui2/document/controller/zoom-screen-controller.d.ts +11 -0
  174. package/@types/ui2/document/model/document-detection-ui-result.d.ts +8 -0
  175. package/@types/ui2/document/model/sb-document.d.ts +62 -0
  176. package/@types/ui2/document/model/sb-page.d.ts +38 -0
  177. package/@types/ui2/document/model/utils/sb-document-data.d.ts +10 -0
  178. package/@types/ui2/document/model/utils/sb-page-data.d.ts +7 -0
  179. package/@types/ui2/document/utils/SBThemeProvider.d.ts +4 -0
  180. package/@types/ui2/document/utils/button-accessibility-styling.d.ts +40 -0
  181. package/@types/ui2/document/views/acknowledgement-screen/acknowledgement-confirmation.d.ts +19 -0
  182. package/@types/ui2/document/views/acknowledgement-screen/acknowledgement-fade.d.ts +9 -0
  183. package/@types/ui2/document/views/acknowledgement-screen/acknowledgement-image.d.ts +7 -0
  184. package/@types/ui2/document/views/acknowledgement-screen/acknowledgement-screen-bottom-bar.d.ts +12 -0
  185. package/@types/ui2/document/views/acknowledgement-screen/quality-insufficient-banner.d.ts +10 -0
  186. package/@types/ui2/document/views/camera-screen/bottom-bar.d.ts +33 -0
  187. package/@types/ui2/document/views/camera-screen/camera-permission-denied.d.ts +9 -0
  188. package/@types/ui2/document/views/camera-screen/camera-select-dropdown.d.ts +14 -0
  189. package/@types/ui2/document/views/camera-screen/introduction/assets/CheckIcon.d.ts +3 -0
  190. package/@types/ui2/document/views/camera-screen/introduction/assets/CreditCardsIcon.d.ts +3 -0
  191. package/@types/ui2/document/views/camera-screen/introduction/assets/DocumentsIcon.d.ts +3 -0
  192. package/@types/ui2/document/views/camera-screen/introduction/assets/IdCardsIcon.d.ts +3 -0
  193. package/@types/ui2/document/views/camera-screen/introduction/assets/MedicalCertsIcon.d.ts +3 -0
  194. package/@types/ui2/document/views/camera-screen/introduction/assets/Props.d.ts +3 -0
  195. package/@types/ui2/document/views/camera-screen/introduction/assets/ReceiptsIcon.d.ts +3 -0
  196. package/@types/ui2/document/views/camera-screen/introduction/introduction-image.d.ts +5 -0
  197. package/@types/ui2/document/views/camera-screen/introduction/introduction.d.ts +9 -0
  198. package/@types/ui2/document/views/camera-screen/preview-button.d.ts +11 -0
  199. package/@types/ui2/document/views/camera-screen/scanner-box.d.ts +21 -0
  200. package/@types/ui2/document/views/camera-screen/shutter-button.d.ts +10 -0
  201. package/@types/ui2/document/views/camera-screen/top-bar.d.ts +11 -0
  202. package/@types/ui2/document/views/camera-screen/top-user-guidance.d.ts +8 -0
  203. package/@types/ui2/document/views/camera-screen/use-document-scanner-view.d.ts +31 -0
  204. package/@types/ui2/document/views/camera-screen/user-guidance-text.d.ts +10 -0
  205. package/@types/ui2/document/views/common/alert-dialog.d.ts +11 -0
  206. package/@types/ui2/document/views/common/bar-button.d.ts +17 -0
  207. package/@types/ui2/document/views/common/common-top-bar.d.ts +12 -0
  208. package/@types/ui2/document/views/common/loading-spinner.d.ts +4 -0
  209. package/@types/ui2/document/views/common/styled-menu-item.d.ts +12 -0
  210. package/@types/ui2/document/views/common/styled-menu.d.ts +17 -0
  211. package/@types/ui2/document/views/review-screen/bottom-bar.d.ts +15 -0
  212. package/@types/ui2/document/views/review-screen/carousel-page.d.ts +13 -0
  213. package/@types/ui2/document/views/review-screen/carousel.d.ts +14 -0
  214. package/@types/ui2/document/views/review-screen/page-counter-and-zoom-button.d.ts +10 -0
  215. package/@types/ui2/document/views/review-screen/scroller-navigation-button.d.ts +11 -0
  216. package/@types/ui2/document/views/review-screen/top-bar.d.ts +11 -0
  217. package/@types/ui2/scanbot-sdk-ui.d.ts +4 -0
  218. package/@types/ui2/scanbot-ui-library.d.ts +7 -4
  219. package/@types/ui2/utils/text-styling.d.ts +8 -0
  220. package/@types/ui2/utils/use-time-since-first-render-has-passed.d.ts +1 -0
  221. package/@types/utils/constants.d.ts +0 -2
  222. package/@types/utils/dto/Frame.d.ts +2 -0
  223. package/@types/utils/image-utils.d.ts +1 -1
  224. package/@types/utils/parse-color.d.ts +9 -0
  225. package/@types/utils/react/useIsMounted.d.ts +2 -0
  226. package/@types/utils/react/usePromise.d.ts +4 -3
  227. package/@types/utils/supported-image-mime-types.d.ts +2 -0
  228. package/@types/utils/view-utils.d.ts +1 -1
  229. package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +8 -2
  230. package/@types/view/polygon/document-polygon.d.ts +1 -0
  231. package/@types/worker/worker-bridge.d.ts +498 -374
  232. package/Libraries.txt +1510 -36
  233. package/bundle/ScanbotSDK.min.js +4 -4
  234. package/bundle/ScanbotSDK.ui2.min.js +18 -18
  235. package/bundle/ScanbotSDK.ui2.min.js.LICENSE.txt +10 -0
  236. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  237. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  238. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  239. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  240. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  241. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  242. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  243. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  244. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  245. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  246. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  247. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  248. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  249. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  250. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  251. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  252. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  253. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  254. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  255. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  256. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  257. package/package.json +3 -3
  258. package/@types/core/bridge/compiled/CheckRecognizerTypes.d.ts +0 -29
  259. package/@types/core/bridge/compiled/FrameUtilities.d.ts +0 -18
  260. package/@types/core/bridge/compiled/GDRTypes.d.ts +0 -38
  261. package/@types/core/bridge/compiled/GenericDocumentRecognizerConfigs.d.ts +0 -150
  262. package/@types/core/bridge/compiled/GenericDocumentRecognizerTypes.d.ts +0 -83
  263. package/@types/core/bridge/compiled/GenericDocumentTypes.d.ts +0 -15
  264. package/@types/core/bridge/compiled/MRZTypes.d.ts +0 -52
  265. package/@types/generic-document-recognizer-view.d.ts +0 -22
  266. package/@types/interfaces/i-generic-document-recognizer-scanner-handle.d.ts +0 -3
  267. package/@types/model/configuration/generic-document-recognizer-configuration.d.ts +0 -9
  268. package/@types/model/configuration/text-data-scanner-configuration.d.ts +0 -9
  269. package/@types/service/generic-document-recognizer.d.ts +0 -13
  270. package/@types/service/text-data-recognizer.d.ts +0 -14
  271. package/@types/ui2/configuration/BarcodeScannerTypes.d.ts +0 -1
  272. package/@types/ui2/configuration/BarcodeTypes.d.ts +0 -1
  273. package/@types/ui2/configuration/CommonFieldType.d.ts +0 -1
  274. package/@types/ui2/configuration/GenericDocument.d.ts +0 -1
  275. package/@types/ui2/utils/styled-button.d.ts +0 -7
  276. /package/@types/core/bridge/compiled/{OcrElements.d.ts → OcrTypes.d.ts} +0 -0
  277. /package/@types/ui2/{utils → barcode/utils}/find-and-pick.ts/expected-barcode-counter.d.ts +0 -0
  278. /package/@types/ui2/{utils → barcode/utils}/styled-input.d.ts +0 -0
  279. /package/@types/ui2/{views → barcode/views}/drawer/subviews/barcode-drawer-header.d.ts +0 -0
  280. /package/@types/ui2/configuration/{BarcodeItemMapper.d.ts → barcode/BarcodeItemMapper.d.ts} +0 -0
  281. /package/@types/ui2/configuration/{BarcodeUseCase.d.ts → barcode/BarcodeUseCase.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see ScanbotSDK.min.js.LICENSE.txt */
2
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=47)}([function(t,e,n){"use strict";n.r(e),n.d(e,"Component",(function(){return C})),n.d(e,"Fragment",(function(){return y})),n.d(e,"createContext",(function(){return G})),n.d(e,"createElement",(function(){return v})),n.d(e,"createRef",(function(){return b})),n.d(e,"useCallback",(function(){return pt})),n.d(e,"useContext",(function(){return mt})),n.d(e,"useDebugValue",(function(){return gt})),n.d(e,"useEffect",(function(){return ct})),n.d(e,"useErrorBoundary",(function(){return vt})),n.d(e,"useId",(function(){return At})),n.d(e,"useImperativeHandle",(function(){return ht})),n.d(e,"useLayoutEffect",(function(){return ut})),n.d(e,"useMemo",(function(){return ft})),n.d(e,"useReducer",(function(){return lt})),n.d(e,"useRef",(function(){return dt})),n.d(e,"useState",(function(){return st})),n.d(e,"Children",(function(){return Ft})),n.d(e,"PureComponent",(function(){return Ot})),n.d(e,"StrictMode",(function(){return ye})),n.d(e,"Suspense",(function(){return jt})),n.d(e,"SuspenseList",(function(){return Vt})),n.d(e,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return ue})),n.d(e,"cloneElement",(function(){return me})),n.d(e,"createFactory",(function(){return he})),n.d(e,"createPortal",(function(){return Qt})),n.d(e,"default",(function(){return Oe})),n.d(e,"findDOMNode",(function(){return ve})),n.d(e,"flushSync",(function(){return be})),n.d(e,"forwardRef",(function(){return Pt})),n.d(e,"hydrate",(function(){return te})),n.d(e,"isElement",(function(){return Ee})),n.d(e,"isFragment",(function(){return pe})),n.d(e,"isValidElement",(function(){return fe})),n.d(e,"lazy",(function(){return Nt})),n.d(e,"memo",(function(){return Tt})),n.d(e,"render",(function(){return Jt})),n.d(e,"startTransition",(function(){return Ce})),n.d(e,"unmountComponentAtNode",(function(){return ge})),n.d(e,"unstable_batchedUpdates",(function(){return Ae})),n.d(e,"useDeferredValue",(function(){return Se})),n.d(e,"useInsertionEffect",(function(){return xe})),n.d(e,"useSyncExternalStore",(function(){return Le})),n.d(e,"useTransition",(function(){return we})),n.d(e,"version",(function(){return de}));var o,i,r,a,s,l,c,u,d={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,p=Array.isArray;function m(t,e){for(var n in e)t[n]=e[n];return t}function g(t){var e=t.parentNode;e&&e.removeChild(t)}function v(t,e,n){var i,r,a,s={};for(a in e)"key"==a?i=e[a]:"ref"==a?r=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===s[a]&&(s[a]=t.defaultProps[a]);return A(t,s,i,r,null)}function A(t,e,n,o,a){var s={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=i.vnode&&i.vnode(s),s}function b(){return{current:null}}function y(t){return t.children}function C(t,e){this.props=t,this.context=e}function S(t,e){if(null==e)return t.__?S(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?S(t):null}function w(t,e,n){var o,r=t.__v,a=r.__e,s=t.__P;if(s)return(o=m({},r)).__v=r.__v+1,i.vnode&&i.vnode(o),I(s,o,r,t.__n,void 0!==s.ownerSVGElement,32&r.__u?[a]:null,e,null==a?S(r):a,!!(32&r.__u),n),o.__v=r.__v,o.__.__k[o.__i]=o,o.__d=void 0,o.__e!=a&&x(o),o}function x(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return x(t)}}function E(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!L.__r++||s!==i.debounceRendering)&&((s=i.debounceRendering)||l)(L)}function L(){var t,e,n,o=[],r=[];for(a.sort(c);t=a.shift();)t.__d&&(n=a.length,e=w(t,o,r)||e,0===n||a.length>n?(W(o,e,r),r.length=o.length=0,e=void 0,a.sort(c)):e&&i.__c&&i.__c(e,h));e&&W(o,e,r),L.__r=0}function _(t,e,n,o,i,r,a,s,l,c,u){var f,p,m,g,v,A=o&&o.__k||h,b=e.length;for(n.__d=l,O(n,e,A),l=n.__d,f=0;f<b;f++)null!=(m=n.__k[f])&&"boolean"!=typeof m&&"function"!=typeof m&&(p=-1===m.__i?d:A[m.__i]||d,m.__i=f,I(t,m,p,i,r,a,s,l,c,u),g=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&j(p.ref,null,m),u.push(m.ref,m.__c||g,m)),null==v&&null!=g&&(v=g),65536&m.__u||p.__k===m.__k?l=T(m,l,t):"function"==typeof m.type&&void 0!==m.__d?l=m.__d:g&&(l=g.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=l,n.__e=v}function O(t,e,n){var o,i,r,a,s,l=e.length,c=n.length,u=c,d=0;for(t.__k=[],o=0;o<l;o++)null!=(i=t.__k[o]=null==(i=e[o])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?A(null,i,null,null,i):p(i)?A(y,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?A(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=t,i.__b=t.__b+1,s=D(i,n,a=o+d,u),i.__i=s,r=null,-1!==s&&(u--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>l-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==o+d&&(i.__u|=65536))):(r=n[o])&&null==r.key&&r.__e&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=S(r)),z(r,r,!1),n[o]=null,u--);if(u)for(o=0;o<c;o++)null!=(r=n[o])&&0==(131072&r.__u)&&(r.__e==t.__d&&(t.__d=S(r)),z(r,r))}function T(t,e,n){var o,i;if("function"==typeof t.type){for(o=t.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=t,e=T(o[i],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function k(t,e){return e=e||[],null==t||"boolean"==typeof t||(p(t)?t.some((function(t){k(t,e)})):e.push(t)),e}function D(t,e,n,o){var i=t.key,r=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&i==l.key&&r===l.type)return n;if(o>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return a;a--}if(s<e.length){if((l=e[s])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return s;s++}}return-1}function P(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||f.test(e)?n:n+"px"}function B(t,e,n,o,i){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||P(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||P(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=Date.now(),t.addEventListener(e,r?R:F,r)):t.removeEventListener(e,r?R:F,r);else{if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function F(t){if(this.l){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(i.event?i.event(t):t)}}function R(t){if(this.l)return this.l[t.type+!0](i.event?i.event(t):t)}function I(t,e,n,o,r,a,s,l,c,u){var d,h,f,g,v,A,b,S,w,x,E,L,O,T,k,D=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=e.__e=n.__e]),(d=i.__b)&&d(e);t:if("function"==typeof D)try{if(S=e.props,w=(d=D.contextType)&&o[d.__c],x=d?w?w.props.value:d.__:o,n.__c?b=(h=e.__c=n.__c).__=h.__E:("prototype"in D&&D.prototype.render?e.__c=h=new D(S,x):(e.__c=h=new C(S,x),h.constructor=D,h.render=N),w&&w.sub(h),h.props=S,h.state||(h.state={}),h.context=x,h.__n=o,f=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=D.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=m({},h.__s)),m(h.__s,D.getDerivedStateFromProps(S,h.__s))),g=h.props,v=h.state,h.__v=e,f)null==D.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==D.getDerivedStateFromProps&&S!==g&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(S,x),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(S,h.__s,x)||e.__v===n.__v)){for(e.__v!==n.__v&&(h.props=S,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),E=0;E<h._sb.length;E++)h.__h.push(h._sb[E]);h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(S,h.__s,x),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(g,v,A)}))}if(h.context=x,h.props=S,h.__P=t,h.__e=!1,L=i.__r,O=0,"prototype"in D&&D.prototype.render){for(h.state=h.__s,h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do{h.__d=!1,L&&L(e),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++O<25);h.state=h.__s,null!=h.getChildContext&&(o=m(m({},o),h.getChildContext())),f||null==h.getSnapshotBeforeUpdate||(A=h.getSnapshotBeforeUpdate(g,v)),_(t,p(k=null!=d&&d.type===y&&null==d.key?d.props.children:d)?k:[k],e,n,o,r,a,s,l,c,u),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),b&&(h.__E=h.__=null)}catch(t){e.__v=null,c||null!=a?(e.__e=l,e.__u|=c?160:32,a[a.indexOf(l)]=null):(e.__e=n.__e,e.__k=n.__k),i.__e(t,e,n)}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=M(n.__e,e,n,o,r,a,s,c,u);(d=i.diffed)&&d(e)}function W(t,e,n){for(var o=0;o<n.length;o++)j(n[o],n[++o],n[++o]);i.__c&&i.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){i.__e(t,e.__v)}}))}function M(t,e,n,i,r,a,s,l,c){var u,h,f,m,v,A,b,y=n.props,C=e.props,w=e.type;if("svg"===w&&(r=!0),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!w&&(w?v.localName===w:3===v.nodeType)){t=v,a[u]=null;break}if(null==t){if(null===w)return document.createTextNode(C);t=r?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,C.is&&C),a=null,l=!1}if(null===w)y===C||l&&t.data===C||(t.data=C);else{if(a=a&&o.call(t.childNodes),y=n.props||d,!l&&null!=a)for(y={},u=0;u<t.attributes.length;u++)y[(v=t.attributes[u]).name]=v.value;for(u in y)v=y[u],"children"==u||("dangerouslySetInnerHTML"==u?f=v:"key"===u||u in C||B(t,u,null,v,r));for(u in C)v=C[u],"children"==u?m=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?A=v:"checked"==u?b=v:"key"===u||l&&"function"!=typeof v||y[u]===v||B(t,u,v,y[u],r);if(h)l||f&&(h.__html===f.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(f&&(t.innerHTML=""),_(t,p(m)?m:[m],e,n,i,r&&"foreignObject"!==w,a,s,a?a[0]:n.__k&&S(n,0),l,c),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);l||(u="value",void 0!==A&&(A!==t[u]||"progress"===w&&!A||"option"===w&&A!==y[u])&&B(t,u,A,y[u],!1),u="checked",void 0!==b&&b!==t[u]&&B(t,u,b,y[u],!1))}return t}function j(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){i.__e(t,n)}}function z(t,e,n){var o,r;if(i.unmount&&i.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||j(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){i.__e(t,e)}o.base=o.__P=null,t.__c=void 0}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&z(o[r],e,n||"function"!=typeof t.type);n||null==t.__e||g(t.__e),t.__=t.__e=t.__d=void 0}function N(t,e,n){return this.constructor(t,n)}function V(t,e,n){var r,a,s,l;i.__&&i.__(t,e),a=(r="function"==typeof n)?null:n&&n.__k||e.__k,s=[],l=[],I(e,t=(!r&&n||e).__k=v(y,null,[t]),a||d,d,void 0!==e.ownerSVGElement,!r&&n?[n]:a?null:e.firstChild?o.call(e.childNodes):null,s,!r&&n?n:a?a.__e:e.firstChild,r,l),t.__d=void 0,W(s,t,l)}function U(t,e){V(t,e,U)}function H(t,e,n){var i,r,a,s,l=m({},t.props);for(a in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)"key"==a?i=e[a]:"ref"==a?r=e[a]:l[a]=void 0===e[a]&&void 0!==s?s[a]:e[a];return arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),A(t.type,l,i||t.key,r||t.ref,null)}function G(t,e){var n={__c:e="__cC"+u++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,o;return this.getChildContext||(n=[],(o={})[e]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,E(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}o=h.slice,i={__e:function(t,e,n,o){for(var i,r,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,o||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},r=0,C.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof t&&(t=t(m({},n),this.props)),t&&m(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),E(this))},C.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),E(this))},C.prototype.render=y,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(t,e){return t.__v.__b-e.__v.__b},L.__r=0,u=0;var Q,Y,Z,q,X=0,$=[],K=[],J=i,tt=J.__b,et=J.__r,nt=J.diffed,ot=J.__c,it=J.unmount,rt=J.__;function at(t,e){J.__h&&J.__h(Y,t,X||e),X=0;var n=Y.__H||(Y.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:K}),n.__[t]}function st(t){return X=1,lt(Et,t)}function lt(t,e,n){var o=at(Q++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Et(void 0,e),function(t){var e=o.__N?o.__N[0]:o.__[0],n=o.t(e,t);e!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=Y,!Y.u)){var i=function(t,e,n){if(!o.__c.__H)return!0;var i=o.__c.__H.__.filter((function(t){return!!t.__c}));if(i.every((function(t){return!t.__N})))return!r||r.call(this,t,e,n);var a=!1;return i.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),!(!a&&o.__c.props===t)&&(!r||r.call(this,t,e,n))};Y.u=!0;var r=Y.shouldComponentUpdate,a=Y.componentWillUpdate;Y.componentWillUpdate=function(t,e,n){if(this.__e){var o=r;r=void 0,i(t,e,n),r=o}a&&a.call(this,t,e,n)},Y.shouldComponentUpdate=i}return o.__N||o.__}function ct(t,e){var n=at(Q++,3);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,Y.__H.__h.push(n))}function ut(t,e){var n=at(Q++,4);!J.__s&&xt(n.__H,e)&&(n.__=t,n.i=e,Y.__h.push(n))}function dt(t){return X=5,ft((function(){return{current:t}}),[])}function ht(t,e,n){X=6,ut((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==n?n:n.concat(t))}function ft(t,e){var n=at(Q++,7);return xt(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function pt(t,e){return X=8,ft((function(){return t}),e)}function mt(t){var e=Y.context[t.__c],n=at(Q++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(Y)),e.props.value):t.__}function gt(t,e){J.useDebugValue&&J.useDebugValue(e?e(t):t)}function vt(t){var e=at(Q++,10),n=st();return e.__=t,Y.componentDidCatch||(Y.componentDidCatch=function(t,o){e.__&&e.__(t,o),n[1](t)}),[n[0],function(){n[1](void 0)}]}function At(){var t=at(Q++,11);if(!t.__){for(var e=Y.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function bt(){for(var t;t=$.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(St),t.__H.__h.forEach(wt),t.__H.__h=[]}catch(e){t.__H.__h=[],J.__e(e,t.__v)}}J.__b=function(t){Y=null,tt&&tt(t)},J.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),rt&&rt(t,e)},J.__r=function(t){et&&et(t),Q=0;var e=(Y=t.__c).__H;e&&(Z===Y?(e.__h=[],Y.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=K,t.__N=t.i=void 0}))):(e.__h.forEach(St),e.__h.forEach(wt),e.__h=[],Q=0)),Z=Y},J.diffed=function(t){nt&&nt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==$.push(e)&&q===J.requestAnimationFrame||((q=J.requestAnimationFrame)||Ct)(bt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==K&&(t.__=t.__V),t.i=void 0,t.__V=K}))),Z=Y=null},J.__c=function(t,e){e.some((function(t){try{t.__h.forEach(St),t.__h=t.__h.filter((function(t){return!t.__||wt(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],J.__e(n,t.__v)}})),ot&&ot(t,e)},J.unmount=function(t){it&&it(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{St(t)}catch(t){e=t}})),n.__H=void 0,e&&J.__e(e,n.__v))};var yt="function"==typeof requestAnimationFrame;function Ct(t){var e,n=function(){clearTimeout(o),yt&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);yt&&(e=requestAnimationFrame(n))}function St(t){var e=Y,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Y=e}function wt(t){var e=Y;t.__c=t.__(),Y=e}function xt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function Et(t,e){return"function"==typeof e?e(t):e}function Lt(t,e){for(var n in e)t[n]=e[n];return t}function _t(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var o in e)if("__source"!==o&&t[o]!==e[o])return!0;return!1}function Ot(t,e){this.props=t,this.context=e}function Tt(t,e){function n(t){var n=this.props.ref,o=n==t.ref;return!o&&n&&(n.call?n(null):n.current=null),e?!e(this.props,t)||!o:_t(this.props,t)}function o(e){return this.shouldComponentUpdate=n,v(t,e)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Ot.prototype=new C).isPureReactComponent=!0,Ot.prototype.shouldComponentUpdate=function(t,e){return _t(this.props,t)||_t(this.state,e)};var kt=i.__b;i.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),kt&&kt(t)};var Dt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Pt(t){function e(e){var n=Lt({},e);return delete n.ref,t(n,e.ref||null)}return e.$$typeof=Dt,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var Bt=function(t,e){return null==t?null:k(k(t).map(e))},Ft={map:Bt,forEach:Bt,count:function(t){return t?k(t).length:0},only:function(t){var e=k(t);if(1!==e.length)throw"Children.only";return e[0]},toArray:k},Rt=i.__e;i.__e=function(t,e,n,o){if(t.then)for(var i,r=e;r=r.__;)if((i=r.__c)&&i.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e);Rt(t,e,n,o)};var It=i.unmount;function Wt(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=Lt({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return Wt(t,e,n)}))),t}function Mt(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return Mt(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function jt(){this.__u=0,this.t=null,this.__b=null}function zt(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Nt(t){var e,n,o;function i(i){if(e||(e=t()).then((function(t){n=t.default||t}),(function(t){o=t})),o)throw o;if(!n)throw e;return v(n,i)}return i.displayName="Lazy",i.__f=!0,i}function Vt(){this.u=null,this.o=null}i.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),It&&It(t)},(jt.prototype=new C).__c=function(t,e){var n=e.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var i=zt(o.__v),r=!1,a=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--o.__u){if(o.state.__a){var t=o.state.__a;o.__v.__k[0]=Mt(t,t.__c.__P,t.__c.__O)}var e;for(o.setState({__a:o.__b=null});e=o.t.pop();)e.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},jt.prototype.componentWillUnmount=function(){this.t=[]},jt.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Wt(this.__b,n,o.__O=o.__P)}this.__b=null}var i=e.__a&&v(y,null,t.fallback);return i&&(i.__u&=-33),[v(y,null,e.__a?null:t.children),i]};var Ut=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function Ht(t){return this.getChildContext=function(){return t.context},t.children}function Gt(t){var e=this,n=t.i;e.componentWillUnmount=function(){V(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),V(v(Ht,{context:e.context},t.__v),e.l)}function Qt(t,e){var n=v(Gt,{__v:t,i:e});return n.containerInfo=e,n}(Vt.prototype=new C).__a=function(t){var e=this,n=zt(e.__v),o=e.o.get(t);return o[0]++,function(i){var r=function(){e.props.revealOrder?(o.push(i),Ut(e,t,o)):i()};n?n(r):r()}},Vt.prototype.render=function(t){this.u=null,this.o=new Map;var e=k(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Vt.prototype.componentDidUpdate=Vt.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Ut(t,n,e)}))};var Yt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Zt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,qt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xt=/[A-Z0-9]/g,$t="undefined"!=typeof document,Kt=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};function Jt(t,e,n){return null==e.__k&&(e.textContent=""),V(t,e),"function"==typeof n&&n(),t?t.__c:null}function te(t,e,n){return U(t,e),"function"==typeof n&&n(),t?t.__c:null}C.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(C.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var ee=i.event;function ne(){}function oe(){return this.cancelBubble}function ie(){return this.defaultPrevented}i.event=function(t){return ee&&(t=ee(t)),t.persist=ne,t.isPropagationStopped=oe,t.isDefaultPrevented=ie,t.nativeEvent=t};var re,ae={enumerable:!1,configurable:!0,get:function(){return this.class}},se=i.vnode;i.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,o={};for(var i in e){var r=e[i];if(!("value"===i&&"defaultValue"in e&&null==r||$t&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Kt(e.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":qt.test(i)?i=a:-1===n.indexOf("-")&&Zt.test(i)?i=i.replace(Xt,"-$&").toLowerCase():null===r&&(r=void 0):a=i="oninput","oninput"===a&&o[i=a]&&(i="oninputCapture"),o[i]=r}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=k(e.children).forEach((function(t){t.props.selected=-1!=o.value.indexOf(t.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=k(e.children).forEach((function(t){t.props.selected=o.multiple?-1!=o.defaultValue.indexOf(t.props.value):o.defaultValue==t.props.value}))),e.class&&!e.className?(o.class=e.class,Object.defineProperty(o,"className",ae)):(e.className&&!e.class||e.class&&e.className)&&(o.class=o.className=e.className),t.props=o}(t),t.$$typeof=Yt,se&&se(t)};var le=i.__r;i.__r=function(t){le&&le(t),re=t.__c};var ce=i.diffed;i.diffed=function(t){ce&&ce(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value),re=null};var ue={ReactCurrentDispatcher:{current:{readContext:function(t){return re.__n[t.__c].props.value}}}},de="17.0.2";function he(t){return v.bind(null,t)}function fe(t){return!!t&&t.$$typeof===Yt}function pe(t){return fe(t)&&t.type===y}function me(t){return fe(t)?H.apply(null,arguments):t}function ge(t){return!!t.__k&&(V(null,t),!0)}function ve(t){return t&&(t.base||1===t.nodeType&&t)||null}var Ae=function(t,e){return t(e)},be=function(t,e){return t(e)},ye=y;function Ce(t){t()}function Se(t){return t}function we(){return[!1,Ce]}var xe=ut,Ee=fe;function Le(t,e){var n=e(),o=st({h:{__:n,v:e}}),i=o[0].h,r=o[1];return ut((function(){i.__=n,i.v=e,_e(i)&&r({h:i})}),[t,n,e]),ct((function(){return _e(i)&&r({h:i}),t((function(){_e(i)&&r({h:i})}))}),[t]),n}function _e(t){var e,n,o=t.v,i=t.__;try{var r=o();return!((e=i)===(n=r)&&(0!==e||1/e==1/n)||e!=e&&n!=n)}catch(t){return!0}}var Oe={useState:st,useId:At,useReducer:lt,useEffect:ct,useLayoutEffect:ut,useInsertionEffect:ut,useTransition:we,useDeferredValue:Se,useSyncExternalStore:Le,startTransition:Ce,useRef:dt,useImperativeHandle:ht,useMemo:ft,useCallback:pt,useContext:mt,useDebugValue:gt,version:"17.0.2",Children:Ft,render:Jt,hydrate:te,unmountComponentAtNode:ge,createPortal:Qt,createElement:v,createContext:G,createFactory:he,cloneElement:me,createRef:b,Fragment:y,isValidElement:fe,isElement:fe,isFragment:pe,findDOMNode:ve,Component:C,PureComponent:Ot,memo:Tt,forwardRef:Pt,flushSync:be,unstable_batchedUpdates:Ae,StrictMode:y,Suspense:jt,SuspenseList:Vt,lazy:Nt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ue}},function(t,e,n){"use strict";n.d(e,"f",(function(){return i})),n.d(e,"j",(function(){return r})),n.d(e,"e",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"d",(function(){return c})),n.d(e,"h",(function(){return u})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return h})),n.d(e,"i",(function(){return f})),n.d(e,"l",(function(){return p})),n.d(e,"k",(function(){return m}));var o=n(7);class i extends o.a{constructor(t={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==t.sbColorPrimary&&(this.sbColorPrimary=t.sbColorPrimary),void 0!==t.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=t.sbColorPrimaryDisabled),void 0!==t.sbColorNegative&&(this.sbColorNegative=t.sbColorNegative),void 0!==t.sbColorPositive&&(this.sbColorPositive=t.sbColorPositive),void 0!==t.sbColorWarning&&(this.sbColorWarning=t.sbColorWarning),void 0!==t.sbColorSecondary&&(this.sbColorSecondary=t.sbColorSecondary),void 0!==t.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=t.sbColorSecondaryDisabled),void 0!==t.sbColorOnPrimary&&(this.sbColorOnPrimary=t.sbColorOnPrimary),void 0!==t.sbColorOnSecondary&&(this.sbColorOnSecondary=t.sbColorOnSecondary),void 0!==t.sbColorSurface&&(this.sbColorSurface=t.sbColorSurface),void 0!==t.sbColorOutline&&(this.sbColorOutline=t.sbColorOutline),void 0!==t.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=t.sbColorOnSurfaceVariant),void 0!==t.sbColorOnSurface&&(this.sbColorOnSurface=t.sbColorOnSurface),void 0!==t.sbColorSurfaceLow&&(this.sbColorSurfaceLow=t.sbColorSurfaceLow),void 0!==t.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=t.sbColorSurfaceHigh),void 0!==t.sbColorModalOverlay&&(this.sbColorModalOverlay=t.sbColorModalOverlay)}}class r extends o.a{constructor(t={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class a extends o.a{constructor(t={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.color&&(this.color=t.color)}}class s extends o.a{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,this.cornerRadius=0,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class l extends o.a{constructor(t={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.fillColor&&(this.fillColor=t.fillColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth)}}class c extends o.a{constructor(t={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==t.iconVisible&&(this.iconVisible=t.iconVisible),void 0!==t.color&&(this.color=t.color),void 0!==t.useShadow&&(this.useShadow=t.useShadow)}}class u extends o.a{constructor(t={}){super(),this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class d extends o.a{constructor(t={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==t.badgeBackgroundColor&&(this.badgeBackgroundColor=t.badgeBackgroundColor),void 0!==t.badgeForegroundColor&&(this.badgeForegroundColor=t.badgeForegroundColor),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor),void 0!==t.activeBackgroundColor&&(this.activeBackgroundColor=t.activeBackgroundColor),void 0!==t.activeForegroundColor&&(this.activeForegroundColor=t.activeForegroundColor)}}class h extends o.a{constructor(t={}){super(),this.visible=!0,this.text="",this.background=new l({}),this.foreground=new c({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.text&&(this.text=t.text),void 0!==t.background&&(this.background=new l(t.background)),void 0!==t.foreground&&(this.foreground=new c(t.foreground))}}class f extends o.a{constructor(t={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==t.successBeepEnabled&&(this.successBeepEnabled=t.successBeepEnabled),void 0!==t.soundType&&(this.soundType=t.soundType)}}class p extends o.a{constructor(t={}){super(),this.enabled=!1,void 0!==t.enabled&&(this.enabled=t.enabled)}}class m extends o.a{constructor(t={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==t.autoCancelTimeout&&(this.autoCancelTimeout=t.autoCancelTimeout),void 0!==t.initialScanDelay&&(this.initialScanDelay=t.initialScanDelay)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"e",(function(){return l}));var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function a(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}Object.create;function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function l(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}Object.create},function(t,e){t.exports=window["@mui"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{_marker(){}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return l}));var o=n(0),i=n(13),r=n(16);const a=Object(o.createContext)(null);function s(t){return{getColorValue:e=>{if(e){if(e.startsWith("?")){const n=e.slice(1);if(n in t)return t[n];r.a.debugWarn(`Color ${n} not found in palette`)}return e}r.a.debugWarn("Color is missing")}}}class l{static setPalette(t){this.palette=t}static setBarcodeTextLocalization(t){this.barcodeTextLocalization=t}static getColorValue(t){return s(l.palette).getColorValue(t)}static getPolygonColorValues(t,e){return new i.PolygonStyle({fillColor:e?l.getColorValue(t.fillColor):"transparent",strokeColor:e?l.getColorValue(t.strokeColor):"transparent",strokeWidth:t.strokeWidth,cornerRadius:t.cornerRadius})}static getLocalizedBarcodeText(t,e=[]){if(t.startsWith("?")){const e=t.slice(1);e in l.barcodeTextLocalization?t=l.barcodeTextLocalization[e]:r.a.debugWarn(`Barcode text localization key ${e} not found in localization`)}for(let n of e)t=t.replace("%d",n);return t}}l.palette=(new i.BarcodeScannerConfiguration).palette,l.barcodeTextLocalization=(new i.BarcodeScannerConfiguration).localization},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(31);class i{constructor(t,e){this.x=t,this.y=e}static toPolygon(t,e){return[i.scaleDownTo(t[0],e),i.scaleDownTo(t[1],e),i.scaleDownTo(t[2],e),i.scaleDownTo(t[3],e)]}static scaleToPoint(t,e,n,o){return new i(o*(t.x-e),o*(t.y-n))}static scaleListToHtmlElement(t,e,n){return t.map((t=>i.scaleToHtmlElement(t,e,n)))}static scaleToHtmlElement(t,e,n){return new i(t.x*(n.clientWidth/e.width),t.y*(n.clientHeight/e.height))}static scaleUpTo(t,e){return new i(t.x*e.width,t.y*e.height)}static scaleDownTo(t,e){return new i(t.x/e.width,t.y/e.height)}static fromHtmlElement(t){return new i(t.offsetLeft,t.offsetTop)}static withScale(t,e,n){return new i(t/n,e/n)}static fromCoordinates(t,e,n,o){if(!t||!e)return new i(0,0);const r=new i(t,e);return o=null!=o?o:1,1===(n=n?n%4:0)?i.withScale(r.y,-r.x,o):2===n?i.withScale(-r.x,-r.y,o):3===n?i.withScale(-r.y,r.x,o):i.withScale(r.x,r.y,o)}static centerOf(t){const e=t.reduce(((t,e)=>t+e.x),0)/t.length,n=t.reduce(((t,e)=>t+e.y),0)/t.length;return new i(e,n)}static smallerSizeOfQuad(t){const e=Math.max(...t.map((t=>t.x)))-Math.min(...t.map((t=>t.x))),n=Math.max(...t.map((t=>t.y)))-Math.min(...t.map((t=>t.y)));return Math.min(e,n)}static empty(){return new i(0,0)}static centerX(t){if(t)return(i.highestX(t)+i.lowestX(t))/2}static highestX(t){if(t)return Math.max(...t.map((t=>t.x)))}static lowestX(t){if(t)return Math.min(...t.map((t=>t.x)))}static lowestY(t){if(t)return Math.min(...t.map((t=>t.y)))}static highestY(t){if(t)return Math.max(...t.map((t=>t.y)))}static width(t){if(t)return i.highestX(t)-i.lowestX(t)}static left(t){if(t)return t.reduce(((t,e)=>t.x<e.x?t:e))}static right(t){if(t)return t.reduce(((t,e)=>t.x>e.x?t:e))}static toSvgString(t){if(void 0!==t)return t.map((t=>`${t.x.toFixed(2)},${t.y.toFixed(2)}`)).join(" ")}static toSvgPathStringWithRoundedCorners(t,e=0){if(void 0===t)return;function n(t,e,n){const o=Math.atan2(t.y-e.y,t.x-e.x);return{x:t.x-n*Math.cos(o),y:t.y-n*Math.sin(o)}}let o="";const r=n(t[0],t[1],i.distance(t[0],t[1])/2);o+=`M ${r.x} ${r.y}`;for(let r=0;r<t.length;r++){const a=t[r],s=t[(r+1)%t.length],l=t[(r+2)%t.length],c=n(s,l,i.distance(s,l)/2),u=Math.abs(Math.atan2(s.y-a.y,s.x-a.x)-Math.atan2(s.y-l.y,s.x-l.x)),d=u>Math.PI?2*Math.PI-u:u,h=Math.min(Math.sqrt(Math.pow(s.x-a.x,2)+Math.pow(s.y-a.y,2)),Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2))),f=Math.min(e,h*Math.tan(d/2)/2),p=Math.abs(f/Math.tan(d/2)),m=(s.x-a.x)*(s.y-l.y)-(s.x-l.x)*(s.y-a.y)<0?1:0,g=n(s,a,p),v=n(s,l,p);o+=` L${g.x} ${g.y}`,o+=` A${f} ${f} 0 0 ${m} ${v.x} ${v.y}`,o+=` L${c.x} ${c.y}`}return o+" Z"}static distance(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}static subtract(t,e){return new i(t.x-e.x,t.y-e.y)}static add(t,e){return new i(t.x+e.x,t.y+e.y)}static multiply(t,e){return new i(t.x*e,t.y*e)}static cross(t,e){return t.x*e.y-t.y*e.x}static clamp(t,e){return new i(Object(o.a)(t.x,0,e.width),Object(o.a)(t.y,0,e.height))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{}},function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"e",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"f",(function(){return c})),n.d(e,"g",(function(){return u})),n.d(e,"a",(function(){return d}));var o=n(1),i=n(7);class r extends i.a{constructor(t={}){super(),this.visible=!0,this.deselected=new o.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),this.selected=new o.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.deselected&&(this.deselected=new o.g(t.deselected)),void 0!==t.selected&&(this.selected=new o.g(t.selected))}}class a extends i.a{constructor(t={}){super(),this.imageVisible=!0,this.titleSelected=new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleSelected=new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.titleDeselected=new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleDeselected=new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.backgroundSelected=new o.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:0,cornerRadius:10}),this.backgroundDeselected=new o.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0,cornerRadius:10}),void 0!==t.imageVisible&&(this.imageVisible=t.imageVisible),void 0!==t.titleSelected&&(this.titleSelected=new o.j(t.titleSelected)),void 0!==t.subtitleSelected&&(this.subtitleSelected=new o.j(t.subtitleSelected)),void 0!==t.titleDeselected&&(this.titleDeselected=new o.j(t.titleDeselected)),void 0!==t.subtitleDeselected&&(this.subtitleDeselected=new o.j(t.subtitleDeselected)),void 0!==t.backgroundSelected&&(this.backgroundSelected=new o.g(t.backgroundSelected)),void 0!==t.backgroundDeselected&&(this.backgroundDeselected=new o.g(t.backgroundDeselected))}}class s extends i.a{constructor(t={}){if(super(),this.visible=!0,this.foregroundColor="?sbColorOnSurface",void 0!==t.visible&&(this.visible=t.visible),void 0===t.background)throw new Error("background must be present in constructor argument");this.background=new o.a(t.background),void 0!==t.foregroundColor&&(this.foregroundColor=t.foregroundColor)}}class l extends i.a{constructor(t={}){super(),this.visible=!1,this.counterBadge=new s({background:new o.a({}),foregroundColor:"?sbColorOnSurface"}),this.automaticSelectionEnabled=!1,this.barcodeItemInfoPosition="BELOW",this.polygon=new r({visible:!0,deselected:new o.g({}),selected:new o.g({})}),this.barcodeItemConfiguration=new a({imageVisible:!0,titleSelected:new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new o.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new o.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.counterBadge&&(this.counterBadge=new s(t.counterBadge)),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.barcodeItemInfoPosition&&(this.barcodeItemInfoPosition=t.barcodeItemInfoPosition),void 0!==t.polygon&&(this.polygon=new r(t.polygon)),void 0!==t.barcodeItemConfiguration&&(this.barcodeItemConfiguration=new a(t.barcodeItemConfiguration))}}class c extends i.a{constructor(t={}){super(),this.visible=!0,this.partiallyScanned=new o.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.rejected=new o.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.completed=new o.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.partiallyScanned&&(this.partiallyScanned=new o.g(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new o.g(t.rejected)),void 0!==t.completed&&(this.completed=new o.g(t.completed))}}class u extends i.a{constructor(t={}){super(),this.partiallyScanned=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.rejected=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorNegative",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.completed=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),void 0!==t.partiallyScanned&&(this.partiallyScanned=new s(t.partiallyScanned)),void 0!==t.rejected&&(this.rejected=new s(t.rejected)),void 0!==t.completed&&(this.completed=new s(t.completed))}}class d extends i.a{constructor(t={}){super(),this.visible=!1,this.automaticSelectionEnabled=!0,this.polygon=new c({}),this.badge=new u({}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.automaticSelectionEnabled&&(this.automaticSelectionEnabled=t.automaticSelectionEnabled),void 0!==t.polygon&&(this.polygon=new c(t.polygon)),void 0!==t.badge&&(this.badge=new u(t.badge))}}},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeConfigs",(function(){return L})),n.d(e,"BarcodeScannerTypes",(function(){return _})),n.d(e,"BarcodeTypes",(function(){return o})),n.d(e,"BarcodeDocumentTypes",(function(){return i})),n.d(e,"CheckRecognizerTypes",(function(){return r})),n.d(e,"CommonFieldType",(function(){return a})),n.d(e,"DocumentDetectorTypes",(function(){return s})),n.d(e,"DocumentQualityAnalyzerTypes",(function(){return l})),n.d(e,"EhicTypes",(function(){return c})),n.d(e,"GenericDocument",(function(){return D})),n.d(e,"GenericDocumentRecognizerConfigs",(function(){return u})),n.d(e,"GenericDocumentRecognizerTypes",(function(){return h})),n.d(e,"GenericDocumentTypes",(function(){return f})),n.d(e,"GenericTextLineScannerTypes",(function(){return p})),n.d(e,"Geometry",(function(){return j})),n.d(e,"LicensePlateScannerTypes",(function(){return m})),n.d(e,"MedicalCertificateTypes",(function(){return g})),n.d(e,"MRZTypes",(function(){return A})),n.d(e,"OcrElements",(function(){return b})),n.d(e,"ParametricFilters",(function(){return y})),n.d(e,"PdfConfig",(function(){return C})),n.d(e,"TiffTypes",(function(){return S})),n.d(e,"FrameUtilities",(function(){return v})),n.d(e,"FrameAccumulationTypes",(function(){return d})),n.d(e,"ImageTypes",(function(){return w})),n.d(e,"PartiallyConstructible",(function(){return O.a}));var o={};n.r(o),n.d(o,"BarcodeFormats",(function(){return T}));var i={};n.r(i),n.d(i,"BarcodeDocumentFormats",(function(){return k}));var r={};n.r(r),n.d(r,"RecognitionResult",(function(){return P}));var a={};n.r(a);var s={};n.r(s),n.d(s,"DocumentDetectorParameters",(function(){return z})),n.d(s,"DocumentDetectorConfiguration",(function(){return N})),n.d(s,"DocumentDetectionScores",(function(){return V})),n.d(s,"DocumentDetectionResult",(function(){return U}));var l={};n.r(l),n.d(l,"DocumentQualityThreshold",(function(){return H})),n.d(l,"DocumentQualityAnalyzerConfiguration",(function(){return G})),n.d(l,"DocumentQualityAnalyzerResult",(function(){return Q}));var c={};n.r(c),n.d(c,"RecognitionResult",(function(){return Y})),n.d(c,"RecognizerParameters",(function(){return Z}));var u={};n.r(u),n.d(u,"GDRConfig",(function(){return B})),n.d(u,"DateValidationConfig",(function(){return q})),n.d(u,"EuropeanHealthInsuranceCardConfig",(function(){return X})),n.d(u,"MRZFallbackConfig",(function(){return $})),n.d(u,"GDRGroupConfig",(function(){return K}));var d={};n.r(d),n.d(d,"ResultAccumulationConfig",(function(){return J}));var h={};n.r(h),n.d(h,"RecognitionResult",(function(){return tt})),n.d(h,"RecognitionParameters",(function(){return et})),n.d(h,"GenericDocumentRecognizerParameters",(function(){return nt}));var f={};n.r(f),n.d(f,"DocumentTypes",(function(){return ot}));var p={};n.r(p),n.d(p,"WordBox",(function(){return it})),n.d(p,"SymbolBox",(function(){return rt})),n.d(p,"ScannerResult",(function(){return at})),n.d(p,"ContentValidator",(function(){return F})),n.d(p,"DefaultContentValidator",(function(){return st})),n.d(p,"PresetContentValidator",(function(){return lt})),n.d(p,"PatternContentValidator",(function(){return ct})),n.d(p,"ScannerConfiguration",(function(){return ut}));var m={};n.r(m),n.d(m,"ScannerConfiguration",(function(){return dt})),n.d(m,"ScannerResult",(function(){return ht}));var g={};n.r(g),n.d(g,"RecognitionParameters",(function(){return ft})),n.d(g,"CheckBox",(function(){return pt})),n.d(g,"DateRecord",(function(){return mt})),n.d(g,"PatientInfoField",(function(){return gt})),n.d(g,"PatientInfoBox",(function(){return vt})),n.d(g,"RecognitionResult",(function(){return At}));var v={};n.r(v),n.d(v,"AccumulatedResultsVerifierConfig",(function(){return bt}));var A={};n.r(A),n.d(A,"RecognitionResult",(function(){return yt})),n.d(A,"RecognizerConfiguration",(function(){return Ct}));var b={};n.r(b),n.d(b,"OcrElement",(function(){return R})),n.d(b,"Glyph",(function(){return St})),n.d(b,"Word",(function(){return wt})),n.d(b,"Line",(function(){return xt})),n.d(b,"Block",(function(){return Et})),n.d(b,"Page",(function(){return Lt}));var y={};n.r(y),n.d(y,"ParametricFilter",(function(){return I})),n.d(y,"ScanbotBinarizationFilter",(function(){return _t})),n.d(y,"CustomBinarizationFilter",(function(){return Ot})),n.d(y,"ColorDocumentFilter",(function(){return Tt})),n.d(y,"BrightnessFilter",(function(){return kt})),n.d(y,"ContrastFilter",(function(){return Dt})),n.d(y,"GrayscaleFilter",(function(){return Pt})),n.d(y,"LegacyFilter",(function(){return Bt})),n.d(y,"WhiteBlackPointFilter",(function(){return Ft}));var C={};n.r(C),n.d(C,"PdfAttributes",(function(){return Rt})),n.d(C,"PdfConfig",(function(){return It}));var S={};n.r(S),n.d(S,"UserFieldValue",(function(){return W})),n.d(S,"UserFieldDoubleValue",(function(){return Wt})),n.d(S,"UserFieldStringValue",(function(){return Mt})),n.d(S,"UserFieldIntValue",(function(){return jt})),n.d(S,"UserField",(function(){return zt})),n.d(S,"TIFFWriterParameters",(function(){return Nt}));var w={};n.r(w);var x,E,L=n(32),_=n(35),O=n(4);class T extends O.a{constructor(t={}){super()}}(x=T||(T={})).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","UPC_A","UPC_E"],x.twod=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],x.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],x.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN"],x.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"],x.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","MAXICODE","MICRO_PDF_417","MICRO_QR_CODE","MSI_PLESSEY","PDF_417","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN","QR_CODE","RMQR_CODE","ROYAL_MAIL","ROYAL_TNT_POST","UPC_A","UPC_E","USPS_INTELLIGENT_MAIL"];class k extends O.a{constructor(t={}){super()}}(E=k||(k={})).all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],E.documentBarcodeFormats={AAMVA:["PDF_417"],ID_CARD_PDF_417:["PDF_417"],SEPA:["QR_CODE"],MEDICAL_CERTIFICATE:["PDF_417"],DE_MEDICAL_PLAN:["DATA_MATRIX"],BOARDING_PASS:["PDF_417","AZTEC"],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 D=n(19);class P extends O.a{constructor(t={}){if(super(),this.status="FAIL",void 0!==t.status&&(this.status=t.status),void 0===t.check)throw new Error("check must be present in constructor argument");this.check=null!=t.check?new D.GenericDocument(t.check):null}}var B,F,R,I,W,M,j=n(20);class z extends O.a{constructor(t={}){super(),this.isLive=!1,this.acceptedAngleScore=75,this.acceptedSizeScore=80,this.acceptedBrightnessThreshold=0,this.acceptedAspectRatioScore=85,this.aspectRatios=[],this.ignoreOrientationMismatch=!1,void 0!==t.isLive&&(this.isLive=t.isLive),void 0!==t.acceptedAngleScore&&(this.acceptedAngleScore=t.acceptedAngleScore),void 0!==t.acceptedSizeScore&&(this.acceptedSizeScore=t.acceptedSizeScore),void 0!==t.acceptedBrightnessThreshold&&(this.acceptedBrightnessThreshold=t.acceptedBrightnessThreshold),void 0!==t.acceptedAspectRatioScore&&(this.acceptedAspectRatioScore=t.acceptedAspectRatioScore),void 0!==t.aspectRatios&&(this.aspectRatios=t.aspectRatios.map((t=>new j.AspectRatio(t)))),void 0!==t.ignoreOrientationMismatch&&(this.ignoreOrientationMismatch=t.ignoreOrientationMismatch)}}class N extends O.a{constructor(t={}){super(),this.engineMode="ML",this.parameters=new z({}),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.parameters&&(this.parameters=new z(t.parameters))}}class V extends O.a{constructor(t={}){if(super(),void 0===t.totalScore)throw new Error("totalScore must be present in constructor argument");if(this.totalScore=t.totalScore,void 0===t.distanceScore)throw new Error("distanceScore must be present in constructor argument");if(this.distanceScore=t.distanceScore,void 0===t.angleScore)throw new Error("angleScore must be present in constructor argument");if(this.angleScore=t.angleScore,void 0===t.sizeScore)throw new Error("sizeScore must be present in constructor argument");if(this.sizeScore=t.sizeScore,void 0===t.aspectRatioScore)throw new Error("aspectRatioScore must be present in constructor argument");if(this.aspectRatioScore=t.aspectRatioScore,void 0===t.lineCoverageScore)throw new Error("lineCoverageScore must be present in constructor argument");if(this.lineCoverageScore=t.lineCoverageScore,void 0===t.widthScore)throw new Error("widthScore must be present in constructor argument");if(this.widthScore=t.widthScore,void 0===t.heightScore)throw new Error("heightScore must be present in constructor argument");this.heightScore=t.heightScore}}class U extends O.a{constructor(t={}){if(super(),this.status="NOT_ACQUIRED",this.averageBrightness=0,void 0!==t.status&&(this.status=t.status),void 0===t.detectionScores)throw new Error("detectionScores must be present in constructor argument");if(this.detectionScores=new V(t.detectionScores),void 0===t.points)throw new Error("points must be present in constructor argument");if(this.points=t.points.map((t=>({x:t.x,y:t.y}))),void 0===t.horizontalLines)throw new Error("horizontalLines must be present in constructor argument");if(this.horizontalLines=t.horizontalLines.map((t=>new j.LineSegmentInt(t))),void 0===t.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=t.verticalLines.map((t=>new j.LineSegmentInt(t))),void 0===t.pointsNormalized)throw new Error("pointsNormalized must be present in constructor argument");if(this.pointsNormalized=t.pointsNormalized.map((t=>({x:t.x,y:t.y}))),void 0===t.horizontalLinesNormalized)throw new Error("horizontalLinesNormalized must be present in constructor argument");if(this.horizontalLinesNormalized=t.horizontalLinesNormalized.map((t=>new j.LineSegmentFloat(t))),void 0===t.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=t.verticalLinesNormalized.map((t=>new j.LineSegmentFloat(t))),void 0===t.aspectRatio)throw new Error("aspectRatio must be present in constructor argument");this.aspectRatio=t.aspectRatio,void 0!==t.averageBrightness&&(this.averageBrightness=t.averageBrightness)}}class H extends O.a{constructor(t={}){if(super(),void 0===t.symbolQuality)throw new Error("symbolQuality must be present in constructor argument");if(this.symbolQuality=t.symbolQuality,void 0===t.symbolRatio)throw new Error("symbolRatio must be present in constructor argument");this.symbolRatio=t.symbolRatio}}class G extends O.a{constructor(t={}){super(),this.qualityThresholds=[new H({symbolQuality:.5,symbolRatio:.5}),new H({symbolQuality:.7,symbolRatio:.3}),new H({symbolQuality:.85,symbolRatio:.3}),new H({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!==t.qualityThresholds&&(this.qualityThresholds=t.qualityThresholds.map((t=>new H(t)))),void 0!==t.qualityIndices&&(this.qualityIndices=t.qualityIndices.map((t=>t))),void 0!==t.detectOrientation&&(this.detectOrientation=t.detectOrientation),void 0!==t.maxImageSize&&(this.maxImageSize=t.maxImageSize),void 0!==t.minEstimatedNumberOfSymbolsForDocument&&(this.minEstimatedNumberOfSymbolsForDocument=t.minEstimatedNumberOfSymbolsForDocument),void 0!==t.minProcessedFraction&&(this.minProcessedFraction=t.minProcessedFraction),void 0!==t.maxProcessedFraction&&(this.maxProcessedFraction=t.maxProcessedFraction),void 0!==t.earlyStopIfNSymbolsFound&&(this.earlyStopIfNSymbolsFound=t.earlyStopIfNSymbolsFound),void 0!==t.tileSize&&(this.tileSize=t.tileSize)}}class Q extends O.a{constructor(t={}){if(super(),void 0===t.documentFound)throw new Error("documentFound must be present in constructor argument");if(this.documentFound=t.documentFound,void 0===t.quality)throw new Error("quality must be present in constructor argument");if(this.quality=null!=t.quality?t.quality:null,void 0===t.orientation)throw new Error("orientation must be present in constructor argument");this.orientation=null!=t.orientation?t.orientation:null}}class Y extends O.a{constructor(t={}){if(super(),this.status="FAILED_DETECTION",void 0===t.fields)throw new Error("fields must be present in constructor argument");this.fields=t.fields.map((t=>new Y.Field(t))),void 0!==t.status&&(this.status=t.status)}}!function(t){class e extends O.a{constructor(t={}){if(super(),this.validationStatus="NOT_VALIDATED",void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=t.value,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=t.confidence,void 0!==t.validationStatus&&(this.validationStatus=t.validationStatus)}}t.Field=e}(Y||(Y={}));class Z extends O.a{constructor(t={}){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!==t.allowedCountries&&(this.allowedCountries=t.allowedCountries.map((t=>t))),void 0!==t.minBirthYear&&(this.minBirthYear=t.minBirthYear),void 0!==t.maxBirthYear&&(this.maxBirthYear=t.maxBirthYear),void 0!==t.minExpirationYear&&(this.minExpirationYear=t.minExpirationYear),void 0!==t.maxExpirationYear&&(this.maxExpirationYear=t.maxExpirationYear),void 0!==t.maxCountryDetectionAttempts&&(this.maxCountryDetectionAttempts=t.maxCountryDetectionAttempts),void 0!==t.minEqualFrameCount&&(this.minEqualFrameCount=t.minEqualFrameCount),void 0!==t.maxAccumulatedFrameCount&&(this.maxAccumulatedFrameCount=t.maxAccumulatedFrameCount)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"DateValidationConfig":return new q(t);case"EuropeanHealthInsuranceCardConfig":return new X(t);case"MRZFallbackConfig":return new $(t);case"GDRGroupConfig":return new K(t);default:throw`Unknown child class name: ${e}`}}}(B||(B={}));class q extends O.a{constructor(t={}){if(super(),this._type="DateValidationConfig",this.minYear=0,this.maxYear=2999,void 0!==t.minYear&&(this.minYear=t.minYear),void 0!==t.maxYear&&(this.maxYear=t.maxYear),void 0===t.fieldTypeName)throw new Error("fieldTypeName must be present in constructor argument");this.fieldTypeName=t.fieldTypeName}}class X extends O.a{constructor(t={}){super(),this._type="EuropeanHealthInsuranceCardConfig",this.expectedCountry=null,void 0!==t.expectedCountry&&(this.expectedCountry=null!=t.expectedCountry?t.expectedCountry:null)}}class $ extends O.a{constructor(t={}){super(),this._type="MRZFallbackConfig",this.acceptedCountries=[],this.acceptedMRZTypes=[],void 0!==t.acceptedCountries&&(this.acceptedCountries=t.acceptedCountries.map((t=>t))),void 0!==t.acceptedMRZTypes&&(this.acceptedMRZTypes=t.acceptedMRZTypes.map((t=>t)))}}class K extends O.a{constructor(t={}){if(super(),this._type="GDRGroupConfig",void 0===t.acceptedDocumentTypes)throw new Error("acceptedDocumentTypes must be present in constructor argument");this.acceptedDocumentTypes=t.acceptedDocumentTypes.map((t=>t))}}class J extends O.a{constructor(t={}){super(),this.confirmationMethod="EXACT",this.minConfirmations=3,this.minConfidenceForStableField=.8,this.autoClearThreshold=4,void 0!==t.confirmationMethod&&(this.confirmationMethod=t.confirmationMethod),void 0!==t.minConfirmations&&(this.minConfirmations=t.minConfirmations),void 0!==t.minConfidenceForStableField&&(this.minConfidenceForStableField=t.minConfidenceForStableField),void 0!==t.autoClearThreshold&&(this.autoClearThreshold=t.autoClearThreshold)}}class tt extends O.a{constructor(t={}){if(super(),void 0===t.status)throw new Error("status must be present in constructor argument");if(this.status=t.status,void 0===t.document)throw new Error("document must be present in constructor argument");if(this.document=null!=t.document?new D.GenericDocument(t.document):null,void 0===t.quad)throw new Error("quad must be present in constructor argument");this.quad=null!=t.quad?t.quad.map((t=>({x:t.x,y:t.y}))):null}}class et extends O.a{constructor(t={}){super(),this.mode="LIVE",void 0!==t.mode&&(this.mode=t.mode)}}class nt extends O.a{constructor(t={}){if(super(),this.resultAccumulationConfig=new J({}),this.fieldExcludeList=[],void 0!==t.resultAccumulationConfig&&(this.resultAccumulationConfig=new J(t.resultAccumulationConfig)),void 0!==t.fieldExcludeList&&(this.fieldExcludeList=t.fieldExcludeList.map((t=>t))),void 0===t.configurations)throw new Error("configurations must be present in constructor argument");this.configurations=t.configurations.map((t=>B.From(t)))}}class ot extends O.a{constructor(t={}){super()}}(ot||(ot={})).all=["DeIdCardFront","DeIdCardBack","DePassport","DeDriverLicenseFront","DeDriverLicenseBack","DeResidencePermitFront","DeResidencePermitBack","EuropeanHealthInsuranceCard","DeHealthInsuranceCardFront"];class it extends O.a{constructor(t={}){if(super(),this.recognitionConfidence=0,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.boundingRect)throw new Error("boundingRect must be present in constructor argument");this.boundingRect={x:t.boundingRect.x,y:t.boundingRect.y,width:t.boundingRect.width,height:t.boundingRect.height},void 0!==t.recognitionConfidence&&(this.recognitionConfidence=t.recognitionConfidence)}}class rt extends O.a{constructor(t={}){if(super(),void 0===t.symbol)throw new Error("symbol must be present in constructor argument");if(this.symbol=t.symbol,void 0===t.boundingRect)throw new Error("boundingRect must be present in constructor argument");if(this.boundingRect={x:t.boundingRect.x,y:t.boundingRect.y,width:t.boundingRect.width,height:t.boundingRect.height},void 0===t.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=t.recognitionConfidence}}class at extends O.a{constructor(t={}){if(super(),this.confidence=0,this.validationSuccessful=!1,void 0===t.rawText)throw new Error("rawText must be present in constructor argument");if(this.rawText=t.rawText,void 0===t.wordBoxes)throw new Error("wordBoxes must be present in constructor argument");if(this.wordBoxes=t.wordBoxes.map((t=>new it(t))),void 0===t.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=t.symbolBoxes.map((t=>new rt(t))),void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.validationSuccessful&&(this.validationSuccessful=t.validationSuccessful)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"DefaultContentValidator":return new st(t);case"PresetContentValidator":return new lt(t);case"PatternContentValidator":return new ct(t);default:throw`Unknown child class name: ${e}`}}}(F||(F={}));class st extends O.a{constructor(t={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==t.allowedCharacters&&(this.allowedCharacters=t.allowedCharacters)}}class lt extends O.a{constructor(t={}){if(super(),this._type="PresetContentValidator",void 0===t.preset)throw new Error("preset must be present in constructor argument");this.preset=t.preset}}class ct extends O.a{constructor(t={}){if(super(),this._type="PatternContentValidator",this.allowedCharacters="",this.matchSubstring=!1,void 0!==t.allowedCharacters&&(this.allowedCharacters=t.allowedCharacters),void 0===t.pattern)throw new Error("pattern must be present in constructor argument");this.pattern=t.pattern,void 0!==t.matchSubstring&&(this.matchSubstring=t.matchSubstring)}}class ut extends O.a{constructor(t={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,this.validator=new st({}),void 0!==t.ocrResolutionLimit&&(this.ocrResolutionLimit=t.ocrResolutionLimit),void 0!==t.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=t.maximumNumberOfAccumulatedFrames),void 0!==t.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=t.minimumNumberOfRequiredFramesWithEqualRecognitionResult),void 0!==t.validator&&(this.validator=F.From(t.validator))}}class dt extends O.a{constructor(t={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualScanningResult=2,this.scannerStrategy="ML",void 0!==t.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=t.maximumNumberOfAccumulatedFrames),void 0!==t.minimumNumberOfRequiredFramesWithEqualScanningResult&&(this.minimumNumberOfRequiredFramesWithEqualScanningResult=t.minimumNumberOfRequiredFramesWithEqualScanningResult),void 0!==t.scannerStrategy&&(this.scannerStrategy=t.scannerStrategy)}}class ht extends O.a{constructor(t={}){if(super(),this.confidence=0,this.validationSuccessful=!1,this.croppedImage=null,void 0===t.countryCode)throw new Error("countryCode must be present in constructor argument");if(this.countryCode=t.countryCode,void 0===t.licensePlate)throw new Error("licensePlate must be present in constructor argument");if(this.licensePlate=t.licensePlate,void 0===t.rawText)throw new Error("rawText must be present in constructor argument");this.rawText=t.rawText,void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.validationSuccessful&&(this.validationSuccessful=t.validationSuccessful),void 0!==t.croppedImage&&(this.croppedImage=null!=t.croppedImage?t.croppedImage:null)}}class ft extends O.a{constructor(t={}){super(),this.shouldCropDocument=!0,this.recognizePatientInfoBox=!0,this.recognizeBarcode=!0,this.extractCroppedImage=!1,this.preprocessInput=!1,void 0!==t.shouldCropDocument&&(this.shouldCropDocument=t.shouldCropDocument),void 0!==t.recognizePatientInfoBox&&(this.recognizePatientInfoBox=t.recognizePatientInfoBox),void 0!==t.recognizeBarcode&&(this.recognizeBarcode=t.recognizeBarcode),void 0!==t.extractCroppedImage&&(this.extractCroppedImage=t.extractCroppedImage),void 0!==t.preprocessInput&&(this.preprocessInput=t.preprocessInput)}}class pt extends O.a{constructor(t={}){if(super(),this.type="UNKNOWN",this.checked=!1,this.checkedConfidence=0,void 0!==t.type&&(this.type=t.type),void 0!==t.checked&&(this.checked=t.checked),void 0!==t.checkedConfidence&&(this.checkedConfidence=t.checkedConfidence),void 0===t.quad)throw new Error("quad must be present in constructor argument");this.quad=t.quad.map((t=>({x:t.x,y:t.y})))}}class mt extends O.a{constructor(t={}){if(super(),this.value="",this.rawString="",this.type="UNDEFINED",this.recognitionConfidence=0,void 0===t.quad)throw new Error("quad must be present in constructor argument");this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0!==t.value&&(this.value=t.value),void 0!==t.rawString&&(this.rawString=t.rawString),void 0!==t.type&&(this.type=t.type),void 0!==t.recognitionConfidence&&(this.recognitionConfidence=t.recognitionConfidence)}}class gt extends O.a{constructor(t={}){if(super(),void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=t.value,void 0===t.recognitionConfidence)throw new Error("recognitionConfidence must be present in constructor argument");this.recognitionConfidence=t.recognitionConfidence}}class vt extends O.a{constructor(t={}){if(super(),this.hasContents=!1,void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0===t.fields)throw new Error("fields must be present in constructor argument");this.fields=t.fields.map((t=>new gt(t))),void 0!==t.hasContents&&(this.hasContents=t.hasContents)}}class At extends O.a{constructor(t={}){if(super(),this.recognitionSuccessful=!1,this.formType="UNKNOWN",this.clockwiseRotations=0,this.croppedImage=null,this.scaleX=1,this.scaleY=1,void 0!==t.recognitionSuccessful&&(this.recognitionSuccessful=t.recognitionSuccessful),void 0===t.patientInfoBox)throw new Error("patientInfoBox must be present in constructor argument");if(this.patientInfoBox=new vt(t.patientInfoBox),void 0===t.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=t.checkBoxes.map((t=>new pt(t))),void 0===t.dates)throw new Error("dates must be present in constructor argument");if(this.dates=t.dates.map((t=>new mt(t))),void 0!==t.formType&&(this.formType=t.formType),void 0!==t.clockwiseRotations&&(this.clockwiseRotations=t.clockwiseRotations),void 0!==t.croppedImage&&(this.croppedImage=null!=t.croppedImage?t.croppedImage:null),void 0!==t.scaleX&&(this.scaleX=t.scaleX),void 0!==t.scaleY&&(this.scaleY=t.scaleY),void 0===t.documentRoi)throw new Error("documentRoi must be present in constructor argument");this.documentRoi=new U(t.documentRoi)}}class bt extends O.a{constructor(t={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,void 0!==t.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=t.maximumNumberOfAccumulatedFrames),void 0!==t.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=t.minimumNumberOfRequiredFramesWithEqualRecognitionResult)}}class yt extends O.a{constructor(t={}){if(super(),this.recognitionSuccessful=!1,void 0!==t.recognitionSuccessful&&(this.recognitionSuccessful=t.recognitionSuccessful),void 0===t.rawMRZ)throw new Error("rawMRZ must be present in constructor argument");if(this.rawMRZ=t.rawMRZ,void 0===t.document)throw new Error("document must be present in constructor argument");this.document=null!=t.document?new D.GenericDocument(t.document):null}}class Ct extends O.a{constructor(t={}){super(),this.accumulatedResultsVerifierConfig=new bt({}),void 0!==t.accumulatedResultsVerifierConfig&&(this.accumulatedResultsVerifierConfig=new bt(t.accumulatedResultsVerifierConfig))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"Glyph":return new St(t);case"Word":return new wt(t);case"Line":return new xt(t);case"Block":return new Et(t);case"Page":return new Lt(t);default:throw`Unknown child class name: ${e}`}}}(R||(R={}));class St extends O.a{constructor(t={}){if(super(),this._type="Glyph",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");this.roi=t.roi.map((t=>({x:t.x,y:t.y})))}}class wt extends O.a{constructor(t={}){if(super(),this._type="Word",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.glyphs)throw new Error("glyphs must be present in constructor argument");this.glyphs=t.glyphs.map((t=>new St(t)))}}class xt extends O.a{constructor(t={}){if(super(),this._type="Line",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.words)throw new Error("words must be present in constructor argument");this.words=t.words.map((t=>new wt(t)))}}class Et extends O.a{constructor(t={}){if(super(),this._type="Block",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.lines)throw new Error("lines must be present in constructor argument");this.lines=t.lines.map((t=>new xt(t)))}}class Lt extends O.a{constructor(t={}){if(super(),this._type="Page",void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");if(this.confidence=t.confidence,void 0===t.roi)throw new Error("roi must be present in constructor argument");if(this.roi=t.roi.map((t=>({x:t.x,y:t.y}))),void 0===t.blocks)throw new Error("blocks must be present in constructor argument");this.blocks=t.blocks.map((t=>new Et(t)))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"ScanbotBinarizationFilter":return new _t(t);case"CustomBinarizationFilter":return new Ot(t);case"ColorDocumentFilter":return new Tt(t);case"BrightnessFilter":return new kt(t);case"ContrastFilter":return new Dt(t);case"GrayscaleFilter":return new Pt(t);case"LegacyFilter":return new Bt(t);case"WhiteBlackPointFilter":return new Ft(t);default:throw`Unknown child class name: ${e}`}}}(I||(I={}));class _t extends O.a{constructor(t={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==t.outputMode&&(this.outputMode=t.outputMode)}}class Ot extends O.a{constructor(t={}){super(),this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==t.outputMode&&(this.outputMode=t.outputMode),void 0!==t.denoise&&(this.denoise=t.denoise),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.preset&&(this.preset=t.preset)}}class Tt extends O.a{constructor(t={}){super(),this._type="ColorDocumentFilter"}}class kt extends O.a{constructor(t={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==t.brightness&&(this.brightness=t.brightness)}}class Dt extends O.a{constructor(t={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==t.contrast&&(this.contrast=t.contrast)}}class Pt extends O.a{constructor(t={}){super(),this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==t.borderWidthFraction&&(this.borderWidthFraction=t.borderWidthFraction),void 0!==t.blackOutliersFraction&&(this.blackOutliersFraction=t.blackOutliersFraction),void 0!==t.whiteOutliersFraction&&(this.whiteOutliersFraction=t.whiteOutliersFraction)}}class Bt extends O.a{constructor(t={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==t.filterType&&(this.filterType=t.filterType)}}class Ft extends O.a{constructor(t={}){super(),this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==t.blackPoint&&(this.blackPoint=t.blackPoint),void 0!==t.whitePoint&&(this.whitePoint=t.whitePoint)}}class Rt extends O.a{constructor(t={}){super(),this.author="Created with ❤️ with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==t.author&&(this.author=t.author),void 0!==t.creator&&(this.creator=t.creator),void 0!==t.title&&(this.title=t.title),void 0!==t.subject&&(this.subject=t.subject),void 0!==t.keywords&&(this.keywords=t.keywords)}}class It extends O.a{constructor(t={}){super(),this.attributes=new Rt({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",void 0!==t.attributes&&(this.attributes=new Rt(t.attributes)),void 0!==t.pageSize&&(this.pageSize=t.pageSize),void 0!==t.pageDirection&&(this.pageDirection=t.pageDirection),void 0!==t.pageFit&&(this.pageFit=t.pageFit),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.resamplingMethod&&(this.resamplingMethod=t.resamplingMethod)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"UserFieldDoubleValue":return new Wt(t);case"UserFieldStringValue":return new Mt(t);case"UserFieldIntValue":return new jt(t);default:throw`Unknown child class name: ${e}`}}}(W||(W={}));class Wt extends O.a{constructor(t={}){if(super(),this._type="UserFieldDoubleValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class Mt extends O.a{constructor(t={}){if(super(),this._type="UserFieldStringValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class jt extends O.a{constructor(t={}){if(super(),this._type="UserFieldIntValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class zt extends O.a{constructor(t={}){if(super(),void 0===t.tag)throw new Error("tag must be present in constructor argument");if(this.tag=t.tag,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=W.From(t.value)}}class Nt extends O.a{constructor(t={}){super(),this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==t.compression&&(this.compression=t.compression),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.zipCompressionLevel&&(this.zipCompressionLevel=t.zipCompressionLevel),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.userFields&&(this.userFields=t.userFields.map((t=>new zt(t)))),void 0!==t.binarizationFilter&&(this.binarizationFilter=null!=t.binarizationFilter?I.From(t.binarizationFilter):null)}}(M=Nt||(Nt={})).defaultCompression="LZW",M.binaryDocumentOptimizedCompression="CCITTFAX4"},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(6);class i{constructor(t,e){this.width=t,this.height=e}isPortrait(){return this.height>this.width}ratio(t){return t?this.height/this.width:this.width/this.height}ratioDiff(t,e){return this.ratio(e)/t.ratio(e)}static isEmpty(t){return!t||(0===t.width||0===t.height)}static toPolygon(t){return[new o.a(0,0),new o.a(t.width,0),new o.a(t.width,t.height),new o.a(0,t.height)]}static fromHtmlElement(t){return t?new i(t.clientWidth,t.clientHeight):new i(0,0)}static fromJson(t){return new i(t.width,t.height)}static subtractFrom(t,e){return new i(t.width-e,t.height-e)}static empty(){return new i(0,0)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return a}));var o=n(0),i=n(5);function r(t){return{color:i.b.getColorValue(t.color),textShadow:t.useShadow?"1px 1px 2px":""}}function a(t){return t.config.visible?o.default.createElement("span",{ref:t.innerRef,style:Object.assign(Object.assign({},t.style),r(t.config))},i.b.getLocalizedBarcodeText(t.config.text)):null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return d}));var o=n(0),i=n(39);const r=n(24).a.svg`
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=52)}([function(e,t,n){"use strict";n.r(t),n.d(t,"Component",(function(){return A})),n.d(t,"Fragment",(function(){return y})),n.d(t,"createContext",(function(){return Z})),n.d(t,"createElement",(function(){return v})),n.d(t,"createRef",(function(){return b})),n.d(t,"useCallback",(function(){return fe})),n.d(t,"useContext",(function(){return pe})),n.d(t,"useDebugValue",(function(){return ge})),n.d(t,"useEffect",(function(){return ce})),n.d(t,"useErrorBoundary",(function(){return ve})),n.d(t,"useId",(function(){return Ce})),n.d(t,"useImperativeHandle",(function(){return he})),n.d(t,"useLayoutEffect",(function(){return ue})),n.d(t,"useMemo",(function(){return me})),n.d(t,"useReducer",(function(){return le})),n.d(t,"useRef",(function(){return de})),n.d(t,"useState",(function(){return se})),n.d(t,"Children",(function(){return _e})),n.d(t,"PureComponent",(function(){return Te})),n.d(t,"StrictMode",(function(){return yt})),n.d(t,"Suspense",(function(){return Ne})),n.d(t,"SuspenseList",(function(){return je})),n.d(t,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",(function(){return ut})),n.d(t,"cloneElement",(function(){return pt})),n.d(t,"createFactory",(function(){return ht})),n.d(t,"createPortal",(function(){return Ge})),n.d(t,"default",(function(){return Tt})),n.d(t,"findDOMNode",(function(){return vt})),n.d(t,"flushSync",(function(){return bt})),n.d(t,"forwardRef",(function(){return Le})),n.d(t,"hydrate",(function(){return et})),n.d(t,"isElement",(function(){return xt})),n.d(t,"isFragment",(function(){return ft})),n.d(t,"isValidElement",(function(){return mt})),n.d(t,"lazy",(function(){return ze})),n.d(t,"memo",(function(){return ke})),n.d(t,"render",(function(){return $e})),n.d(t,"startTransition",(function(){return At})),n.d(t,"unmountComponentAtNode",(function(){return gt})),n.d(t,"unstable_batchedUpdates",(function(){return Ct})),n.d(t,"useDeferredValue",(function(){return St})),n.d(t,"useInsertionEffect",(function(){return Et})),n.d(t,"useSyncExternalStore",(function(){return Bt})),n.d(t,"useTransition",(function(){return wt})),n.d(t,"version",(function(){return dt}));var o,i,r,a,s,l,c,u,d={},h=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function p(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n){var i,r,a,s={};for(a in t)"key"==a?i=t[a]:"ref"==a?r=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return C(e,s,i,r,null)}function C(e,t,n,o,a){var s={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=i.vnode&&i.vnode(s),s}function b(){return{current:null}}function y(e){return e.children}function A(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?S(e):null}function w(e,t,n){var o,r=e.__v,a=r.__e,s=e.__P;if(s)return(o=p({},r)).__v=r.__v+1,i.vnode&&i.vnode(o),F(s,o,r,e.__n,void 0!==s.ownerSVGElement,32&r.__u?[a]:null,t,null==a?S(r):a,!!(32&r.__u),n),o.__v=r.__v,o.__.__k[o.__i]=o,o.__d=void 0,o.__e!=a&&E(o),o}function E(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return E(e)}}function x(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!B.__r++||s!==i.debounceRendering)&&((s=i.debounceRendering)||l)(B)}function B(){var e,t,n,o=[],r=[];for(a.sort(c);e=a.shift();)e.__d&&(n=a.length,t=w(e,o,r)||t,0===n||a.length>n?(M(o,t,r),r.length=o.length=0,t=void 0,a.sort(c)):t&&i.__c&&i.__c(t,h));t&&M(o,t,r),B.__r=0}function I(e,t,n,o,i,r,a,s,l,c,u){var m,f,p,g,v,C=o&&o.__k||h,b=t.length;for(n.__d=l,T(n,t,C),l=n.__d,m=0;m<b;m++)null!=(p=n.__k[m])&&"boolean"!=typeof p&&"function"!=typeof p&&(f=-1===p.__i?d:C[p.__i]||d,p.__i=m,F(e,p,f,i,r,a,s,l,c,u),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&N(f.ref,null,p),u.push(p.ref,p.__c||g,p)),null==v&&null!=g&&(v=g),65536&p.__u||f.__k===p.__k?l=k(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:g&&(l=g.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=l,n.__e=v}function T(e,t,n){var o,i,r,a,s,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],o=0;o<l;o++)null!=(i=e.__k[o]=null==(i=t[o])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?C(null,i,null,null,i):f(i)?C(y,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?C(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=D(i,n,a=o+d,u),i.__i=s,r=null,-1!==s&&(u--,(r=n[s])&&(r.__u|=131072)),null==r||null===r.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>l-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==o+d&&(i.__u|=65536))):(r=n[o])&&null==r.key&&r.__e&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=S(r)),V(r,r,!1),n[o]=null,u--);if(u)for(o=0;o<c;o++)null!=(r=n[o])&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=S(r)),V(r,r))}function k(e,t,n){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=k(o[i],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function O(e,t){return t=t||[],null==e||"boolean"==typeof e||(f(e)?e.some((function(e){O(e,t)})):t.push(e)),t}function D(e,t,n,o){var i=e.key,r=e.type,a=n-1,s=n+1,l=t[n];if(null===l||l&&i==l.key&&r===l.type)return n;if(o>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((l=t[a])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return a;a--}if(s<t.length){if((l=t[s])&&0==(131072&l.__u)&&i==l.key&&r===l.type)return s;s++}}return-1}function L(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function P(e,t,n,o,i){var r;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||L(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||L(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o?n.u=o.u:(n.u=Date.now(),e.addEventListener(t,r?R:_,r)):e.removeEventListener(t,r?R:_,r);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function _(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(i.event?i.event(e):e)}}function R(e){if(this.l)return this.l[e.type+!0](i.event?i.event(e):e)}function F(e,t,n,o,r,a,s,l,c,u){var d,h,m,g,v,C,b,S,w,E,x,B,T,k,O,D=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=t.__e=n.__e]),(d=i.__b)&&d(t);e:if("function"==typeof D)try{if(S=t.props,w=(d=D.contextType)&&o[d.__c],E=d?w?w.props.value:d.__:o,n.__c?b=(h=t.__c=n.__c).__=h.__E:("prototype"in D&&D.prototype.render?t.__c=h=new D(S,E):(t.__c=h=new A(S,E),h.constructor=D,h.render=z),w&&w.sub(h),h.props=S,h.state||(h.state={}),h.context=E,h.__n=o,m=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=D.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=p({},h.__s)),p(h.__s,D.getDerivedStateFromProps(S,h.__s))),g=h.props,v=h.state,h.__v=t,m)null==D.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==D.getDerivedStateFromProps&&S!==g&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(S,E),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(S,h.__s,E)||t.__v===n.__v)){for(t.__v!==n.__v&&(h.props=S,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),x=0;x<h._sb.length;x++)h.__h.push(h._sb[x]);h._sb=[],h.__h.length&&s.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(S,h.__s,E),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(g,v,C)}))}if(h.context=E,h.props=S,h.__P=e,h.__e=!1,B=i.__r,T=0,"prototype"in D&&D.prototype.render){for(h.state=h.__s,h.__d=!1,B&&B(t),d=h.render(h.props,h.state,h.context),k=0;k<h._sb.length;k++)h.__h.push(h._sb[k]);h._sb=[]}else do{h.__d=!1,B&&B(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++T<25);h.state=h.__s,null!=h.getChildContext&&(o=p(p({},o),h.getChildContext())),m||null==h.getSnapshotBeforeUpdate||(C=h.getSnapshotBeforeUpdate(g,v)),I(e,f(O=null!=d&&d.type===y&&null==d.key?d.props.children:d)?O:[O],t,n,o,r,a,s,l,c,u),h.base=t.__e,t.__u&=-161,h.__h.length&&s.push(h),b&&(h.__E=h.__=null)}catch(e){t.__v=null,c||null!=a?(t.__e=l,t.__u|=c?160:32,a[a.indexOf(l)]=null):(t.__e=n.__e,t.__k=n.__k),i.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=W(n.__e,t,n,o,r,a,s,c,u);(d=i.diffed)&&d(t)}function M(e,t,n){for(var o=0;o<n.length;o++)N(n[o],n[++o],n[++o]);i.__c&&i.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){i.__e(e,t.__v)}}))}function W(e,t,n,i,r,a,s,l,c){var u,h,m,p,v,C,b,y=n.props,A=t.props,w=t.type;if("svg"===w&&(r=!0),null!=a)for(u=0;u<a.length;u++)if((v=a[u])&&"setAttribute"in v==!!w&&(w?v.localName===w:3===v.nodeType)){e=v,a[u]=null;break}if(null==e){if(null===w)return document.createTextNode(A);e=r?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,A.is&&A),a=null,l=!1}if(null===w)y===A||l&&e.data===A||(e.data=A);else{if(a=a&&o.call(e.childNodes),y=n.props||d,!l&&null!=a)for(y={},u=0;u<e.attributes.length;u++)y[(v=e.attributes[u]).name]=v.value;for(u in y)v=y[u],"children"==u||("dangerouslySetInnerHTML"==u?m=v:"key"===u||u in A||P(e,u,null,v,r));for(u in A)v=A[u],"children"==u?p=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?C=v:"checked"==u?b=v:"key"===u||l&&"function"!=typeof v||y[u]===v||P(e,u,v,y[u],r);if(h)l||m&&(h.__html===m.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(m&&(e.innerHTML=""),I(e,f(p)?p:[p],t,n,i,r&&"foreignObject"!==w,a,s,a?a[0]:n.__k&&S(n,0),l,c),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);l||(u="value",void 0!==C&&(C!==e[u]||"progress"===w&&!C||"option"===w&&C!==y[u])&&P(e,u,C,y[u],!1),u="checked",void 0!==b&&b!==e[u]&&P(e,u,b,y[u],!1))}return e}function N(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){i.__e(e,n)}}function V(e,t,n){var o,r;if(i.unmount&&i.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||N(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){i.__e(e,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&V(o[r],t,n||"function"!=typeof e.type);n||null==e.__e||g(e.__e),e.__=e.__e=e.__d=void 0}function z(e,t,n){return this.constructor(e,n)}function j(e,t,n){var r,a,s,l;i.__&&i.__(e,t),a=(r="function"==typeof n)?null:n&&n.__k||t.__k,s=[],l=[],F(t,e=(!r&&n||t).__k=v(y,null,[e]),a||d,d,void 0!==t.ownerSVGElement,!r&&n?[n]:a?null:t.firstChild?o.call(t.childNodes):null,s,!r&&n?n:a?a.__e:t.firstChild,r,l),e.__d=void 0,M(s,e,l)}function H(e,t){j(e,t,H)}function U(e,t,n){var i,r,a,s,l=p({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?i=t[a]:"ref"==a?r=t[a]:l[a]=void 0===t[a]&&void 0!==s?s[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),C(e.type,l,i||e.key,r||e.ref,null)}function Z(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,x(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}o=h.slice,i={__e:function(e,t,n,o){for(var i,r,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,o||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},r=0,A.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=p({},this.state),"function"==typeof e&&(e=e(p({},n),this.props)),e&&p(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),x(this))},A.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},A.prototype.render=y,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},B.__r=0,u=0;var G,Q,Y,X,K=0,q=[],J=[],$=i,ee=$.__b,te=$.__r,ne=$.diffed,oe=$.__c,ie=$.unmount,re=$.__;function ae(e,t){$.__h&&$.__h(Q,e,K||t),K=0;var n=Q.__H||(Q.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:J}),n.__[e]}function se(e){return K=1,le(xe,e)}function le(e,t,n){var o=ae(G++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):xe(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=Q,!Q.u)){var i=function(e,t,n){if(!o.__c.__H)return!0;var i=o.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!r||r.call(this,e,t,n);var a=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&o.__c.props===e)&&(!r||r.call(this,e,t,n))};Q.u=!0;var r=Q.shouldComponentUpdate,a=Q.componentWillUpdate;Q.componentWillUpdate=function(e,t,n){if(this.__e){var o=r;r=void 0,i(e,t,n),r=o}a&&a.call(this,e,t,n)},Q.shouldComponentUpdate=i}return o.__N||o.__}function ce(e,t){var n=ae(G++,3);!$.__s&&Ee(n.__H,t)&&(n.__=e,n.i=t,Q.__H.__h.push(n))}function ue(e,t){var n=ae(G++,4);!$.__s&&Ee(n.__H,t)&&(n.__=e,n.i=t,Q.__h.push(n))}function de(e){return K=5,me((function(){return{current:e}}),[])}function he(e,t,n){K=6,ue((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function me(e,t){var n=ae(G++,7);return Ee(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function fe(e,t){return K=8,me((function(){return e}),t)}function pe(e){var t=Q.context[e.__c],n=ae(G++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Q)),t.props.value):e.__}function ge(e,t){$.useDebugValue&&$.useDebugValue(t?t(e):e)}function ve(e){var t=ae(G++,10),n=se();return t.__=e,Q.componentDidCatch||(Q.componentDidCatch=function(e,o){t.__&&t.__(e,o),n[1](e)}),[n[0],function(){n[1](void 0)}]}function Ce(){var e=ae(G++,11);if(!e.__){for(var t=Q.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function be(){for(var e;e=q.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Se),e.__H.__h.forEach(we),e.__H.__h=[]}catch(t){e.__H.__h=[],$.__e(t,e.__v)}}$.__b=function(e){Q=null,ee&&ee(e)},$.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),re&&re(e,t)},$.__r=function(e){te&&te(e),G=0;var t=(Q=e.__c).__H;t&&(Y===Q?(t.__h=[],Q.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=J,e.__N=e.i=void 0}))):(t.__h.forEach(Se),t.__h.forEach(we),t.__h=[],G=0)),Y=Q},$.diffed=function(e){ne&&ne(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==q.push(t)&&X===$.requestAnimationFrame||((X=$.requestAnimationFrame)||Ae)(be)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==J&&(e.__=e.__V),e.i=void 0,e.__V=J}))),Y=Q=null},$.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Se),e.__h=e.__h.filter((function(e){return!e.__||we(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],$.__e(n,e.__v)}})),oe&&oe(e,t)},$.unmount=function(e){ie&&ie(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Se(e)}catch(e){t=e}})),n.__H=void 0,t&&$.__e(t,n.__v))};var ye="function"==typeof requestAnimationFrame;function Ae(e){var t,n=function(){clearTimeout(o),ye&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);ye&&(t=requestAnimationFrame(n))}function Se(e){var t=Q,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Q=t}function we(e){var t=Q;e.__c=e.__(),Q=t}function Ee(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function xe(e,t){return"function"==typeof t?t(e):t}function Be(e,t){for(var n in t)e[n]=t[n];return e}function Ie(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function Te(e,t){this.props=e,this.context=t}function ke(e,t){function n(e){var n=this.props.ref,o=n==e.ref;return!o&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!o:Ie(this.props,e)}function o(t){return this.shouldComponentUpdate=n,v(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Te.prototype=new A).isPureReactComponent=!0,Te.prototype.shouldComponentUpdate=function(e,t){return Ie(this.props,e)||Ie(this.state,t)};var Oe=i.__b;i.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Oe&&Oe(e)};var De="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Le(e){function t(t){var n=Be({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=De,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Pe=function(e,t){return null==e?null:O(O(e).map(t))},_e={map:Pe,forEach:Pe,count:function(e){return e?O(e).length:0},only:function(e){var t=O(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:O},Re=i.__e;i.__e=function(e,t,n,o){if(e.then)for(var i,r=t;r=r.__;)if((i=r.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);Re(e,t,n,o)};var Fe=i.unmount;function Me(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Be({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Me(e,t,n)}))),e}function We(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return We(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ne(){this.__u=0,this.t=null,this.__b=null}function Ve(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ze(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return v(n,i)}return i.displayName="Lazy",i.__f=!0,i}function je(){this.u=null,this.o=null}i.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Fe&&Fe(e)},(Ne.prototype=new A).__c=function(e,t){var n=t.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var i=Ve(o.__v),r=!1,a=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=We(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.t.pop();)t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},Ne.prototype.componentWillUnmount=function(){this.t=[]},Ne.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Me(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&v(y,null,e.fallback);return i&&(i.__u&=-33),[v(y,null,t.__a?null:e.children),i]};var He=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Ue(e){return this.getChildContext=function(){return e.context},e.children}function Ze(e){var t=this,n=e.i;t.componentWillUnmount=function(){j(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),j(v(Ue,{context:t.context},e.__v),t.l)}function Ge(e,t){var n=v(Ze,{__v:e,i:t});return n.containerInfo=t,n}(je.prototype=new A).__a=function(e){var t=this,n=Ve(t.__v),o=t.o.get(e);return o[0]++,function(i){var r=function(){t.props.revealOrder?(o.push(i),He(t,e,o)):i()};n?n(r):r()}},je.prototype.render=function(e){this.u=null,this.o=new Map;var t=O(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},je.prototype.componentDidUpdate=je.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){He(e,n,t)}))};var Qe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ye=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Xe=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ke=/[A-Z0-9]/g,qe="undefined"!=typeof document,Je=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function $e(e,t,n){return null==t.__k&&(t.textContent=""),j(e,t),"function"==typeof n&&n(),e?e.__c:null}function et(e,t,n){return H(e,t),"function"==typeof n&&n(),e?e.__c:null}A.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(A.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var tt=i.event;function nt(){}function ot(){return this.cancelBubble}function it(){return this.defaultPrevented}i.event=function(e){return tt&&(e=tt(e)),e.persist=nt,e.isPropagationStopped=ot,e.isDefaultPrevented=it,e.nativeEvent=e};var rt,at={enumerable:!1,configurable:!0,get:function(){return this.class}},st=i.vnode;i.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={};for(var i in t){var r=t[i];if(!("value"===i&&"defaultValue"in t&&null==r||qe&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===r?r="":"translate"===a&&"no"===r?r=!1:"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Je(t.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":Xe.test(i)?i=a:-1===n.indexOf("-")&&Ye.test(i)?i=i.replace(Ke,"-$&").toLowerCase():null===r&&(r=void 0):a=i="oninput","oninput"===a&&o[i=a]&&(i="oninputCapture"),o[i]=r}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=O(t.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=O(t.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",at)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=Qe,st&&st(e)};var lt=i.__r;i.__r=function(e){lt&&lt(e),rt=e.__c};var ct=i.diffed;i.diffed=function(e){ct&&ct(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),rt=null};var ut={ReactCurrentDispatcher:{current:{readContext:function(e){return rt.__n[e.__c].props.value}}}},dt="17.0.2";function ht(e){return v.bind(null,e)}function mt(e){return!!e&&e.$$typeof===Qe}function ft(e){return mt(e)&&e.type===y}function pt(e){return mt(e)?U.apply(null,arguments):e}function gt(e){return!!e.__k&&(j(null,e),!0)}function vt(e){return e&&(e.base||1===e.nodeType&&e)||null}var Ct=function(e,t){return e(t)},bt=function(e,t){return e(t)},yt=y;function At(e){e()}function St(e){return e}function wt(){return[!1,At]}var Et=ue,xt=mt;function Bt(e,t){var n=t(),o=se({h:{__:n,v:t}}),i=o[0].h,r=o[1];return ue((function(){i.__=n,i.v=t,It(i)&&r({h:i})}),[e,n,t]),ce((function(){return It(i)&&r({h:i}),e((function(){It(i)&&r({h:i})}))}),[e]),n}function It(e){var t,n,o=e.v,i=e.__;try{var r=o();return!((t=i)===(n=r)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var Tt={useState:se,useId:Ce,useReducer:le,useEffect:ce,useLayoutEffect:ue,useInsertionEffect:ue,useTransition:wt,useDeferredValue:St,useSyncExternalStore:Bt,startTransition:At,useRef:de,useImperativeHandle:he,useMemo:me,useCallback:fe,useContext:pe,useDebugValue:ge,version:"17.0.2",Children:_e,render:$e,hydrate:et,unmountComponentAtNode:gt,createPortal:Ge,createElement:v,createContext:Z,createFactory:ht,cloneElement:pt,createRef:b,Fragment:y,isValidElement:mt,isElement:mt,isFragment:ft,findDOMNode:vt,Component:A,PureComponent:Te,memo:ke,forwardRef:Le,flushSync:bt,unstable_batchedUpdates:Ct,StrictMode:y,Suspense:Ne,SuspenseList:je,lazy:ze,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ut}},function(e,t){e.exports=window["@mui"]},function(e,t,n){"use strict";n.r(t),n.d(t,"Palette",(function(){return i})),n.d(t,"StyledText",(function(){return r})),n.d(t,"IconStyle",(function(){return a})),n.d(t,"IconButton",(function(){return s})),n.d(t,"PolygonStyle",(function(){return l})),n.d(t,"BackgroundStyle",(function(){return c})),n.d(t,"ForegroundStyle",(function(){return u})),n.d(t,"BadgeStyle",(function(){return d})),n.d(t,"RoundButton",(function(){return h})),n.d(t,"BadgedButton",(function(){return m})),n.d(t,"ButtonConfiguration",(function(){return f})),n.d(t,"PopupMenuItem",(function(){return p})),n.d(t,"BarButtonConfiguration",(function(){return g})),n.d(t,"Sound",(function(){return v})),n.d(t,"Vibration",(function(){return C})),n.d(t,"Timeouts",(function(){return b}));var o=n(6);class i extends o.a{constructor(e={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==e.sbColorPrimary&&(this.sbColorPrimary=e.sbColorPrimary),void 0!==e.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=e.sbColorPrimaryDisabled),void 0!==e.sbColorNegative&&(this.sbColorNegative=e.sbColorNegative),void 0!==e.sbColorPositive&&(this.sbColorPositive=e.sbColorPositive),void 0!==e.sbColorWarning&&(this.sbColorWarning=e.sbColorWarning),void 0!==e.sbColorSecondary&&(this.sbColorSecondary=e.sbColorSecondary),void 0!==e.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=e.sbColorSecondaryDisabled),void 0!==e.sbColorOnPrimary&&(this.sbColorOnPrimary=e.sbColorOnPrimary),void 0!==e.sbColorOnSecondary&&(this.sbColorOnSecondary=e.sbColorOnSecondary),void 0!==e.sbColorSurface&&(this.sbColorSurface=e.sbColorSurface),void 0!==e.sbColorOutline&&(this.sbColorOutline=e.sbColorOutline),void 0!==e.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=e.sbColorOnSurfaceVariant),void 0!==e.sbColorOnSurface&&(this.sbColorOnSurface=e.sbColorOnSurface),void 0!==e.sbColorSurfaceLow&&(this.sbColorSurfaceLow=e.sbColorSurfaceLow),void 0!==e.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=e.sbColorSurfaceHigh),void 0!==e.sbColorModalOverlay&&(this.sbColorModalOverlay=e.sbColorModalOverlay)}}class r extends o.a{constructor(e={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class a extends o.a{constructor(e={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.color&&(this.color=e.color)}}class s extends o.a{constructor(e={}){super(),this.visible=!0,this.color="#FFFFFF",this.accessibilityDescription="",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.color&&(this.color=e.color),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription)}}class l extends o.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,this.cornerRadius=0,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class c extends o.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth)}}class u extends o.a{constructor(e={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==e.iconVisible&&(this.iconVisible=e.iconVisible),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class d extends o.a{constructor(e={}){super(),this.visible=!0,this.background=new c({}),this.foregroundColor="?sbColorOnSurface",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.background&&(this.background=new c(e.background)),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class h extends o.a{constructor(e={}){super(),this.visible=!0,this.accessibilityDescription="",this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class m extends o.a{constructor(e={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.badgeBackgroundColor&&(this.badgeBackgroundColor=e.badgeBackgroundColor),void 0!==e.badgeForegroundColor&&(this.badgeForegroundColor=e.badgeForegroundColor),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class f extends o.a{constructor(e={}){super(),this.visible=!0,this.text="",this.accessibilityDescription="",this.background=new c({}),this.foreground=new u({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.background&&(this.background=new c(e.background)),void 0!==e.foreground&&(this.foreground=new u(e.foreground))}}class p extends o.a{constructor(e={}){super(),this.title=new r({}),this.accessibilityDescription="",this.icon=new a({}),void 0!==e.title&&(this.title=new r(e.title)),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.icon&&(this.icon=new a(e.icon))}}class g extends o.a{constructor(e={}){super(),this.visible=!0,this.title=new r({}),this.accessibilityDescription="",this.background=new c({}),this.icon=new a({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new r(e.title)),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.background&&(this.background=new c(e.background)),void 0!==e.icon&&(this.icon=new a(e.icon))}}class v extends o.a{constructor(e={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==e.successBeepEnabled&&(this.successBeepEnabled=e.successBeepEnabled),void 0!==e.soundType&&(this.soundType=e.soundType)}}class C extends o.a{constructor(e={}){super(),this.enabled=!1,void 0!==e.enabled&&(this.enabled=e.enabled)}}class b extends o.a{constructor(e={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==e.autoCancelTimeout&&(this.autoCancelTimeout=e.autoCancelTimeout),void 0!==e.initialScanDelay&&(this.initialScanDelay=e.initialScanDelay)}}},function(e,t,n){"use strict";n.d(t,"f",(function(){return i})),n.d(t,"j",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"g",(function(){return s})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return c})),n.d(t,"h",(function(){return u})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"i",(function(){return m})),n.d(t,"l",(function(){return f})),n.d(t,"k",(function(){return p}));var o=n(6);class i extends o.a{constructor(e={}){super(),this.sbColorPrimary="#C8193C",this.sbColorPrimaryDisabled="#F5F5F5",this.sbColorNegative="#FF3737",this.sbColorPositive="#4EFFB4",this.sbColorWarning="#FFCE5C",this.sbColorSecondary="#FFEDEE",this.sbColorSecondaryDisabled="#F5F5F5",this.sbColorOnPrimary="#FFFFFF",this.sbColorOnSecondary="#C8193C",this.sbColorSurface="#FFFFFF",this.sbColorOutline="#EFEFEF",this.sbColorOnSurfaceVariant="#707070",this.sbColorOnSurface="#000000",this.sbColorSurfaceLow="#00000026",this.sbColorSurfaceHigh="#0000007A",this.sbColorModalOverlay="#000000A3",void 0!==e.sbColorPrimary&&(this.sbColorPrimary=e.sbColorPrimary),void 0!==e.sbColorPrimaryDisabled&&(this.sbColorPrimaryDisabled=e.sbColorPrimaryDisabled),void 0!==e.sbColorNegative&&(this.sbColorNegative=e.sbColorNegative),void 0!==e.sbColorPositive&&(this.sbColorPositive=e.sbColorPositive),void 0!==e.sbColorWarning&&(this.sbColorWarning=e.sbColorWarning),void 0!==e.sbColorSecondary&&(this.sbColorSecondary=e.sbColorSecondary),void 0!==e.sbColorSecondaryDisabled&&(this.sbColorSecondaryDisabled=e.sbColorSecondaryDisabled),void 0!==e.sbColorOnPrimary&&(this.sbColorOnPrimary=e.sbColorOnPrimary),void 0!==e.sbColorOnSecondary&&(this.sbColorOnSecondary=e.sbColorOnSecondary),void 0!==e.sbColorSurface&&(this.sbColorSurface=e.sbColorSurface),void 0!==e.sbColorOutline&&(this.sbColorOutline=e.sbColorOutline),void 0!==e.sbColorOnSurfaceVariant&&(this.sbColorOnSurfaceVariant=e.sbColorOnSurfaceVariant),void 0!==e.sbColorOnSurface&&(this.sbColorOnSurface=e.sbColorOnSurface),void 0!==e.sbColorSurfaceLow&&(this.sbColorSurfaceLow=e.sbColorSurfaceLow),void 0!==e.sbColorSurfaceHigh&&(this.sbColorSurfaceHigh=e.sbColorSurfaceHigh),void 0!==e.sbColorModalOverlay&&(this.sbColorModalOverlay=e.sbColorModalOverlay)}}class r extends o.a{constructor(e={}){super(),this.visible=!0,this.text="",this.color="#FFFFFF",this.useShadow=!1,void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class a extends o.a{constructor(e={}){super(),this.visible=!0,this.color="#FFFFFF",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.color&&(this.color=e.color)}}class s extends o.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,this.cornerRadius=0,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth),void 0!==e.cornerRadius&&(this.cornerRadius=e.cornerRadius)}}class l extends o.a{constructor(e={}){super(),this.strokeColor="#FFFFFFFF",this.fillColor="#FFFFFF30",this.strokeWidth=2,void 0!==e.strokeColor&&(this.strokeColor=e.strokeColor),void 0!==e.fillColor&&(this.fillColor=e.fillColor),void 0!==e.strokeWidth&&(this.strokeWidth=e.strokeWidth)}}class c extends o.a{constructor(e={}){super(),this.iconVisible=!0,this.color="#FFFFFF",this.useShadow=!1,void 0!==e.iconVisible&&(this.iconVisible=e.iconVisible),void 0!==e.color&&(this.color=e.color),void 0!==e.useShadow&&(this.useShadow=e.useShadow)}}class u extends o.a{constructor(e={}){super(),this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class d extends o.a{constructor(e={}){super(),this.badgeBackgroundColor="#FFFFFF",this.badgeForegroundColor="#C8193C",this.visible=!0,this.backgroundColor="#0000007A",this.foregroundColor="#FFFFFF",this.activeBackgroundColor="#FFCE5C",this.activeForegroundColor="#1C1B1F",void 0!==e.badgeBackgroundColor&&(this.badgeBackgroundColor=e.badgeBackgroundColor),void 0!==e.badgeForegroundColor&&(this.badgeForegroundColor=e.badgeForegroundColor),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor),void 0!==e.activeBackgroundColor&&(this.activeBackgroundColor=e.activeBackgroundColor),void 0!==e.activeForegroundColor&&(this.activeForegroundColor=e.activeForegroundColor)}}class h extends o.a{constructor(e={}){super(),this.visible=!0,this.text="",this.background=new l({}),this.foreground=new c({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.text&&(this.text=e.text),void 0!==e.background&&(this.background=new l(e.background)),void 0!==e.foreground&&(this.foreground=new c(e.foreground))}}class m extends o.a{constructor(e={}){super(),this.successBeepEnabled=!0,this.soundType="MODERN_BEEP",void 0!==e.successBeepEnabled&&(this.successBeepEnabled=e.successBeepEnabled),void 0!==e.soundType&&(this.soundType=e.soundType)}}class f extends o.a{constructor(e={}){super(),this.enabled=!1,void 0!==e.enabled&&(this.enabled=e.enabled)}}class p extends o.a{constructor(e={}){super(),this.autoCancelTimeout=0,this.initialScanDelay=0,void 0!==e.autoCancelTimeout&&(this.autoCancelTimeout=e.autoCancelTimeout),void 0!==e.initialScanDelay&&(this.initialScanDelay=e.initialScanDelay)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return l}));var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function a(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}Object.create;function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var o,i=0,r=t.length;i<r;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}Object.create},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 l})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return u}));var o=n(0),i=n(15),r=n(17);const a=Object(o.createContext)(null);function s(e){return{getColorValue:t=>c(t,e)}}class l{static setPalette(e){this.palette=e}static setLocalization(e){this.localization=e}static getColorValue(e){return c(e,this.palette)}static getPolygonColorValues(e,t){return new i.PolygonStyle({fillColor:t?l.getColorValue(e.fillColor):"transparent",strokeColor:t?l.getColorValue(e.strokeColor):"transparent",strokeWidth:e.strokeWidth,cornerRadius:e.cornerRadius})}static getLocalizedText(e,t=[]){return u(e,t,this.localization)}}function c(e,t){if(e){if(e.startsWith("?")){if(!t)throw new Error("Palette is not set");const n=e.slice(1);if(n in t)return t[n];r.a.debugWarn(`Color ${n} not found in palette`)}return e}r.a.debugWarn("Color is missing")}function u(e,t=[],n){if(e.startsWith("?")){if(!n)throw new Error("Localization is not set");const t=e.slice(1);t in n?e=n[t]:r.a.debugWarn(`Text localization key ${t} was not found in the localization table`)}for(let n of t)e=e.replace("%d",n);return e}l.palette=null,l.localization=null},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{_marker(){}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(33);class i{constructor(e,t){this.x=e,this.y=t}static toPolygon(e,t){return[i.scaleDownTo(e[0],t),i.scaleDownTo(e[1],t),i.scaleDownTo(e[2],t),i.scaleDownTo(e[3],t)]}static scaleToPoint(e,t,n,o){return new i(o*(e.x-t),o*(e.y-n))}static scaleListToHtmlElement(e,t,n){return e.map((e=>i.scaleToHtmlElement(e,t,n)))}static scaleToHtmlElement(e,t,n){return new i(e.x*(n.clientWidth/t.width),e.y*(n.clientHeight/t.height))}static scaleUpTo(e,t){return new i(e.x*t.width,e.y*t.height)}static scaleDownTo(e,t){return new i(e.x/t.width,e.y/t.height)}static fromHtmlElement(e){return new i(e.offsetLeft,e.offsetTop)}static withScale(e,t,n){return new i(e/n,t/n)}static fromCoordinates(e,t,n,o){if(!e||!t)return new i(0,0);const r=new i(e,t);return o=null!=o?o:1,1===(n=n?n%4:0)?i.withScale(r.y,-r.x,o):2===n?i.withScale(-r.x,-r.y,o):3===n?i.withScale(-r.y,r.x,o):i.withScale(r.x,r.y,o)}static centerOf(e){const t=e.reduce(((e,t)=>e+t.x),0)/e.length,n=e.reduce(((e,t)=>e+t.y),0)/e.length;return new i(t,n)}static smallerSizeOfQuad(e){const t=Math.max(...e.map((e=>e.x)))-Math.min(...e.map((e=>e.x))),n=Math.max(...e.map((e=>e.y)))-Math.min(...e.map((e=>e.y)));return Math.min(t,n)}static empty(){return new i(0,0)}static centerX(e){if(e)return(i.highestX(e)+i.lowestX(e))/2}static highestX(e){if(e)return Math.max(...e.map((e=>e.x)))}static lowestX(e){if(e)return Math.min(...e.map((e=>e.x)))}static lowestY(e){if(e)return Math.min(...e.map((e=>e.y)))}static highestY(e){if(e)return Math.max(...e.map((e=>e.y)))}static width(e){if(e)return i.highestX(e)-i.lowestX(e)}static left(e){if(e)return e.reduce(((e,t)=>e.x<t.x?e:t))}static right(e){if(e)return e.reduce(((e,t)=>e.x>t.x?e:t))}static toSvgString(e){if(void 0!==e)return e.map((e=>`${e.x.toFixed(2)},${e.y.toFixed(2)}`)).join(" ")}static toSvgPathStringWithRoundedCorners(e,t=0){if(void 0===e)return;function n(e,t,n){const o=Math.atan2(e.y-t.y,e.x-t.x);return{x:e.x-n*Math.cos(o),y:e.y-n*Math.sin(o)}}let o="";const r=n(e[0],e[1],i.distance(e[0],e[1])/2);o+=`M ${r.x} ${r.y}`;for(let r=0;r<e.length;r++){const a=e[r],s=e[(r+1)%e.length],l=e[(r+2)%e.length],c=n(s,l,i.distance(s,l)/2),u=Math.abs(Math.atan2(s.y-a.y,s.x-a.x)-Math.atan2(s.y-l.y,s.x-l.x)),d=u>Math.PI?2*Math.PI-u:u,h=Math.min(Math.sqrt(Math.pow(s.x-a.x,2)+Math.pow(s.y-a.y,2)),Math.sqrt(Math.pow(s.x-l.x,2)+Math.pow(s.y-l.y,2))),m=Math.min(t,h*Math.tan(d/2)/2),f=Math.abs(m/Math.tan(d/2)),p=(s.x-a.x)*(s.y-l.y)-(s.x-l.x)*(s.y-a.y)<0?1:0,g=n(s,a,f),v=n(s,l,f);o+=` L${g.x} ${g.y}`,o+=` A${m} ${m} 0 0 ${p} ${v.x} ${v.y}`,o+=` L${c.x} ${c.y}`}return o+" Z"}static distance(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}static subtract(e,t){return new i(e.x-t.x,e.y-t.y)}static add(e,t){return new i(e.x+t.x,e.y+t.y)}static multiply(e,t){return new i(e.x*t,e.y*t)}static cross(e,t){return e.x*t.y-e.y*t.x}static clamp(e,t){return new i(Object(o.a)(e.x,0,t.width),Object(o.a)(e.y,0,t.height))}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var o=n(0),i=n(5);function r(e){return{color:i.b.getColorValue(e.color),textShadow:e.useShadow?"1px 1px 2px":""}}function a(e){return e.config.visible?o.default.createElement("span",{ref:e.innerRef,style:Object.assign(Object.assign({},e.style),r(e.config))},i.b.getLocalizedText(e.config.text,e.replacementArgs)):null}},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"f",(function(){return c})),n.d(t,"g",(function(){return u})),n.d(t,"a",(function(){return d}));var o=n(3),i=n(6);class r extends i.a{constructor(e={}){super(),this.visible=!0,this.deselected=new o.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),this.selected=new o.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2,cornerRadius:2}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.deselected&&(this.deselected=new o.g(e.deselected)),void 0!==e.selected&&(this.selected=new o.g(e.selected))}}class a extends i.a{constructor(e={}){super(),this.imageVisible=!0,this.titleSelected=new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleSelected=new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.titleDeselected=new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.subtitleDeselected=new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.backgroundSelected=new o.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:0,cornerRadius:10}),this.backgroundDeselected=new o.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0,cornerRadius:10}),void 0!==e.imageVisible&&(this.imageVisible=e.imageVisible),void 0!==e.titleSelected&&(this.titleSelected=new o.j(e.titleSelected)),void 0!==e.subtitleSelected&&(this.subtitleSelected=new o.j(e.subtitleSelected)),void 0!==e.titleDeselected&&(this.titleDeselected=new o.j(e.titleDeselected)),void 0!==e.subtitleDeselected&&(this.subtitleDeselected=new o.j(e.subtitleDeselected)),void 0!==e.backgroundSelected&&(this.backgroundSelected=new o.g(e.backgroundSelected)),void 0!==e.backgroundDeselected&&(this.backgroundDeselected=new o.g(e.backgroundDeselected))}}class s extends i.a{constructor(e={}){if(super(),this.visible=!0,this.foregroundColor="?sbColorOnSurface",void 0!==e.visible&&(this.visible=e.visible),void 0===e.background)throw new Error("background must be present in constructor argument");this.background=new o.a(e.background),void 0!==e.foregroundColor&&(this.foregroundColor=e.foregroundColor)}}class l extends i.a{constructor(e={}){super(),this.visible=!1,this.counterBadge=new s({background:new o.a({}),foregroundColor:"?sbColorOnSurface"}),this.automaticSelectionEnabled=!1,this.barcodeItemInfoPosition="BELOW",this.polygon=new r({visible:!0,deselected:new o.g({}),selected:new o.g({})}),this.barcodeItemConfiguration=new a({imageVisible:!0,titleSelected:new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new o.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new o.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new o.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new o.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.counterBadge&&(this.counterBadge=new s(e.counterBadge)),void 0!==e.automaticSelectionEnabled&&(this.automaticSelectionEnabled=e.automaticSelectionEnabled),void 0!==e.barcodeItemInfoPosition&&(this.barcodeItemInfoPosition=e.barcodeItemInfoPosition),void 0!==e.polygon&&(this.polygon=new r(e.polygon)),void 0!==e.barcodeItemConfiguration&&(this.barcodeItemConfiguration=new a(e.barcodeItemConfiguration))}}class c extends i.a{constructor(e={}){super(),this.visible=!0,this.partiallyScanned=new o.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.rejected=new o.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),this.completed=new o.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.partiallyScanned&&(this.partiallyScanned=new o.g(e.partiallyScanned)),void 0!==e.rejected&&(this.rejected=new o.g(e.rejected)),void 0!==e.completed&&(this.completed=new o.g(e.completed))}}class u extends i.a{constructor(e={}){super(),this.partiallyScanned=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.rejected=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorNegative",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),this.completed=new s({visible:!0,background:new o.a({strokeColor:"#FFFFFF30",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),void 0!==e.partiallyScanned&&(this.partiallyScanned=new s(e.partiallyScanned)),void 0!==e.rejected&&(this.rejected=new s(e.rejected)),void 0!==e.completed&&(this.completed=new s(e.completed))}}class d extends i.a{constructor(e={}){super(),this.visible=!1,this.automaticSelectionEnabled=!0,this.polygon=new c({}),this.badge=new u({}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.automaticSelectionEnabled&&(this.automaticSelectionEnabled=e.automaticSelectionEnabled),void 0!==e.polygon&&(this.polygon=new c(e.polygon)),void 0!==e.badge&&(this.badge=new u(e.badge))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(8);class i{constructor(e,t){this.width=e,this.height=t}isPortrait(){return this.height>this.width}ratio(e){return e?this.height/this.width:this.width/this.height}ratioDiff(e,t){return this.ratio(t)/e.ratio(t)}static isEmpty(e){return!e||(0===e.width||0===e.height)}static toPolygon(e){return[new o.a(0,0),new o.a(e.width,0),new o.a(e.width,e.height),new o.a(0,e.height)]}static fromHtmlElement(e){return e?new i(e.clientWidth,e.clientHeight):new i(0,0)}static fromJson(e){return new i(e.width,e.height)}static subtractFrom(e,t){return new i(e.width-t,e.height-t)}static empty(){return new i(0,0)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return d}));var o=n(0),i=n(44);const r=n(26).a.svg`
3
3
  animation: rotate 2s linear infinite;
4
4
  width: 50px;
5
5
  height: 50px;
@@ -28,10 +28,10 @@
28
28
  stroke-dashoffset: -120;
29
29
  }
30
30
  }
31
- `;var a=t=>o.default.createElement(r,{viewBox:"0 0 50 50"},o.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:t.color||"black"})),s=n(25),l=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class c{}class u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d extends o.default.Component{constructor(t){super(t),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:t}=this.props;t&&t(this)}))},this.onVideoError=t=>{if(!0===this.state.videoReady){const{onError:e}=this.props.configuration;e?e(t):console.error(t)}else{const{onFailure:e}=this.props;e&&e(t),this.dispose()}},this.state=new u,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}get bridge(){return i.a.instance.bridge}dispose(){const{container:t}=this.props;t&&Object(o.render)(null,t)}componentDidMount(){this.disposed=!1}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(t){this.camera.swapCameraFacing(t)}switchCamera(t,e){return l(this,void 0,void 0,(function*(){this.camera.switchCamera(t,e)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return s.a.INSTANCE.load()}renderSpinner(t){return this.state.videoReady&&this.state.sdkReady?null:o.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},o.default.createElement(a,{color:t}))}setTorchState(t){return this.camera.setTorchState(t)}}d.DEFAULT_DETECTION_RESOLUTION=600,d.DETECTION_RESULTION_4K=3840},function(t,e,n){"use strict";n.r(e),n.d(e,"SingleScanningMode",(function(){return c})),n.d(e,"Resolution",(function(){return u})),n.d(e,"CameraConfiguration",(function(){return d})),n.d(e,"TopBarConfiguration",(function(){return f.a})),n.d(e,"ActionBarConfiguration",(function(){return p})),n.d(e,"BarcodeUseCase",(function(){return h})),n.d(e,"Palette",(function(){return i.f})),n.d(e,"StyledText",(function(){return i.j})),n.d(e,"IconStyle",(function(){return i.e})),n.d(e,"PolygonStyle",(function(){return i.g})),n.d(e,"BackgroundStyle",(function(){return i.a})),n.d(e,"ForegroundStyle",(function(){return i.d})),n.d(e,"RoundButton",(function(){return i.h})),n.d(e,"BadgedButton",(function(){return i.b})),n.d(e,"ButtonConfiguration",(function(){return i.c})),n.d(e,"Sound",(function(){return i.i})),n.d(e,"Vibration",(function(){return i.l})),n.d(e,"Timeouts",(function(){return i.k})),n.d(e,"ViewFinderConfiguration",(function(){return E})),n.d(e,"FinderStyle",(function(){return w})),n.d(e,"FinderCorneredStyle",(function(){return L})),n.d(e,"FinderStrokedStyle",(function(){return _})),n.d(e,"UserGuidanceConfiguration",(function(){return O})),n.d(e,"BarcodeItemErrorState",(function(){return a})),n.d(e,"BarcodeMappedData",(function(){return s})),n.d(e,"BarcodeInfoMapping",(function(){return l})),n.d(e,"ExpectedBarcode",(function(){return C})),n.d(e,"FindAndPickScanningMode",(function(){return S})),n.d(e,"BarcodeTextLocalization",(function(){return T})),n.d(e,"BarcodeRecognizerConfiguration",(function(){return k})),n.d(e,"ArOverlayPolygonConfiguration",(function(){return o.c})),n.d(e,"BarcodeItemConfiguration",(function(){return o.e})),n.d(e,"BadgeStyle",(function(){return o.d})),n.d(e,"ArOverlayGeneralConfiguration",(function(){return o.b})),n.d(e,"FindAndPickArOverlayPolygonConfiguration",(function(){return o.f})),n.d(e,"FindAndPickBadgeConfiguration",(function(){return o.g})),n.d(e,"ArOverlayFindAndPickConfiguration",(function(){return o.a})),n.d(e,"BarcodeScannerConfiguration",(function(){return P})),n.d(e,"BarcodeScannerUIItem",(function(){return F})),n.d(e,"BarcodeScannerUIResult",(function(){return R})),n.d(e,"OcrResult",(function(){return I.OcrResult})),n.d(e,"FieldParsedData",(function(){return I.FieldParsedData})),n.d(e,"FieldType",(function(){return I.FieldType})),n.d(e,"Field",(function(){return I.Field})),n.d(e,"GenericDocumentType",(function(){return I.GenericDocumentType})),n.d(e,"GenericDocument",(function(){return I.GenericDocument})),n.d(e,"Sheet",(function(){return m})),n.d(e,"SwipeToDelete",(function(){return g})),n.d(e,"ManualCountEditDialog",(function(){return v})),n.d(e,"SheetContent",(function(){return A})),n.d(e,"MultipleScanningMode",(function(){return b})),n.d(e,"ScanbotAlertDialog",(function(){return y})),n.d(e,"CameraPermissionScreen",(function(){return D})),n.d(e,"BarcodeItem",(function(){return B.BarcodeItem}));var o=n(8),i=n(1),r=n(7);class a extends r.a{constructor(t={}){super(),this.title=new i.j({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new i.j({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 i.c({}),this.cancelButton=new i.c({}),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.retryButton&&(this.retryButton=new i.c(t.retryButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton))}}class s extends r.a{constructor(t={}){if(super(),void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=t.title,void 0===t.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=t.subtitle,void 0===t.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=t.barcodeImage}}class l extends r.a{constructor(t={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new i.j({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new a({}),void 0!==t.barcodeItemMapper&&(this.barcodeItemMapper=null!=t.barcodeItemMapper?t.barcodeItemMapper:null),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.loadingMessage&&(this.loadingMessage=new i.j(t.loadingMessage)),void 0!==t.errorState&&(this.errorState=new a(t.errorState))}}class c extends r.a{constructor(t={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new i.c({visible:!0,text:"?singleModeConfirmationCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new l({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new i.c({text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new o.b({visible:!1,counterBadge:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new o.c({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new o.e({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.confirmationSheetEnabled&&(this.confirmationSheetEnabled=t.confirmationSheetEnabled),void 0!==t.barcodeImageVisible&&(this.barcodeImageVisible=t.barcodeImageVisible),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.barcodeTitle&&(this.barcodeTitle=new i.j(t.barcodeTitle)),void 0!==t.barcodeSubtitle&&(this.barcodeSubtitle=new i.j(t.barcodeSubtitle)),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new l(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new o.b(t.arOverlay))}}class u extends r.a{constructor(t={}){if(super(),void 0===t.width)throw new Error("width must be present in constructor argument");if(this.width=t.width,void 0===t.height)throw new Error("height must be present in constructor argument");this.height=t.height}}class d extends r.a{constructor(t={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new u({width:1920,height:1080}),void 0!==t.cameraModule&&(this.cameraModule=t.cameraModule),void 0!==t.zoomSteps&&(this.zoomSteps=t.zoomSteps.map((t=>t))),void 0!==t.defaultZoomFactor&&(this.defaultZoomFactor=t.defaultZoomFactor),void 0!==t.flashEnabled&&(this.flashEnabled=t.flashEnabled),void 0!==t.idealPreviewResolution&&(this.idealPreviewResolution=new u(t.idealPreviewResolution))}}var h,f=n(30);class p extends r.a{constructor(t={}){super(),this.flashButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==t.flashButton&&(this.flashButton=new i.h(t.flashButton)),void 0!==t.zoomButton&&(this.zoomButton=new i.h(t.zoomButton)),void 0!==t.flipCameraButton&&(this.flipCameraButton=new i.h(t.flipCameraButton))}}class m extends r.a{constructor(t={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new i.b({}),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.collapsedVisibleHeight&&(this.collapsedVisibleHeight=t.collapsedVisibleHeight),void 0!==t.listButton&&(this.listButton=new i.b(t.listButton))}}class g extends r.a{constructor(t={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.iconColor&&(this.iconColor=t.iconColor)}}class v extends r.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new i.j({text:"Update count",color:"?sbColorOnSurface"}),this.info=new i.j({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new i.c({visible:!0,text:"Update",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new i.c({visible:!0,text:"Cancel",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.info&&(this.info=new i.j(t.info)),void 0!==t.updateButton&&(this.updateButton=new i.c(t.updateButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.clearTextButton&&(this.clearTextButton=new i.e(t.clearTextButton))}}class A extends r.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new i.j({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new i.c({visible:!0,text:"Clear all",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new i.c({visible:!0,text:"Submit",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new i.c({visible:!0,text:"Start scanning",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new i.j({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new i.j({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 i.e({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new g({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.manualCountChangeEnabled&&(this.manualCountChangeEnabled=t.manualCountChangeEnabled),void 0!==t.manualCountOutlineColor&&(this.manualCountOutlineColor=t.manualCountOutlineColor),void 0!==t.manualCountChangeColor&&(this.manualCountChangeColor=t.manualCountChangeColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.clearAllButton&&(this.clearAllButton=new i.c(t.clearAllButton)),void 0!==t.barcodeItemTitle&&(this.barcodeItemTitle=new i.j(t.barcodeItemTitle)),void 0!==t.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new i.j(t.barcodeItemSubtitle)),void 0!==t.barcodeItemImageVisible&&(this.barcodeItemImageVisible=t.barcodeItemImageVisible),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.startScanningButton&&(this.startScanningButton=new i.c(t.startScanningButton)),void 0!==t.placeholderTitle&&(this.placeholderTitle=new i.j(t.placeholderTitle)),void 0!==t.placeholderSubtitle&&(this.placeholderSubtitle=new i.j(t.placeholderSubtitle)),void 0!==t.placeholderIconBackground&&(this.placeholderIconBackground=t.placeholderIconBackground),void 0!==t.placeholderIcon&&(this.placeholderIcon=new i.e(t.placeholderIcon)),void 0!==t.swipeToDelete&&(this.swipeToDelete=new g(t.swipeToDelete))}}class b extends r.a{constructor(t={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new m({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new i.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new A({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new i.j({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new i.c({visible:!0,text:"?sheetClearAllButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new i.c({visible:!0,text:"?sheetStartScanningButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new i.j({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new i.j({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new i.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new g({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new v({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new i.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new i.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new i.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new l({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new o.b({visible:!1,counterBadge:new o.d({visible:!0,background:new i.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new o.c({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new o.e({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.sheet&&(this.sheet=new m(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new A(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new v(t.manualCountEditDialog)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new l(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new o.b(t.arOverlay))}}class y extends r.a{constructor(t={}){if(super(),this.title=new i.j({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new i.j({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0===t.okButton)throw new Error("okButton must be present in constructor argument");if(this.okButton=new i.c(t.okButton),void 0===t.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new i.c(t.cancelButton)}}class C extends r.a{constructor(t={}){if(super(),this.count=1,void 0===t.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");this.barcodeValue=t.barcodeValue,void 0!==t.title&&(this.title=null!=t.title?t.title:null),void 0!==t.image&&(this.image=null!=t.image?t.image:null),void 0!==t.count&&(this.count=t.count)}}class S extends r.a{constructor(t={}){super(),this._type="FindAndPickScanningMode",this.scanningCompletedColor="?sbColorPositive",this.scanningPartiallyColor="?sbColorWarning",this.scanningNotScannedColor="?sbColorOutline",this.allowPartialScan=!1,this.expectedBarcodes=[],this.countingRepeatDelay=1e3,this.sheet=new m({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new i.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new A({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new i.j({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new i.c({visible:!0,text:"?sheetResetButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new i.j({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new i.c({visible:!0,text:"?sheetStartScanningButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new i.j({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new i.j({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new i.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new g({enabled:!1,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new v({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new i.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new i.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new i.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new o.a({visible:!1,automaticSelectionEnabled:!0,polygon:new o.f({partiallyScanned:new i.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new o.g({partiallyScanned:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new y({title:new i.j({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new i.c({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new y({title:new i.j({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new i.c({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),void 0!==t.scanningCompletedColor&&(this.scanningCompletedColor=t.scanningCompletedColor),void 0!==t.scanningPartiallyColor&&(this.scanningPartiallyColor=t.scanningPartiallyColor),void 0!==t.scanningNotScannedColor&&(this.scanningNotScannedColor=t.scanningNotScannedColor),void 0!==t.allowPartialScan&&(this.allowPartialScan=t.allowPartialScan),void 0!==t.expectedBarcodes&&(this.expectedBarcodes=t.expectedBarcodes.map((t=>new C(t)))),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.sheet&&(this.sheet=new m(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new A(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new v(t.manualCountEditDialog)),void 0!==t.arOverlay&&(this.arOverlay=new o.a(t.arOverlay)),void 0!==t.partialScannedAlertDialogEnabled&&(this.partialScannedAlertDialogEnabled=t.partialScannedAlertDialogEnabled),void 0!==t.partialScannedAlertDialog&&(this.partialScannedAlertDialog=new y(t.partialScannedAlertDialog)),void 0!==t.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=t.confirmationAlertDialogEnabled),void 0!==t.confirmationAlertDialog&&(this.confirmationAlertDialog=new y(t.confirmationAlertDialog))}}(h||(h={})).From=function(t){const e=t._type;switch(e){case"SingleScanningMode":return new c(t);case"MultipleScanningMode":return new b(t);case"FindAndPickScanningMode":return new S(t);default:throw`Unknown child class name: ${e}`}};var w,x=n(20);class E extends r.a{constructor(t={}){super(),this.visible=!0,this.style=new L({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new x.AspectRatio({width:1,height:1}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.style&&(this.style=w.From(t.style)),void 0!==t.overlayColor&&(this.overlayColor=t.overlayColor),void 0!==t.aspectRatio&&(this.aspectRatio=new x.AspectRatio(t.aspectRatio))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"FinderCorneredStyle":return new L(t);case"FinderStrokedStyle":return new _(t);default:throw`Unknown child class name: ${e}`}}}(w||(w={}));class L extends r.a{constructor(t={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class _ extends r.a{constructor(t={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class O extends r.a{constructor(t={}){super(),this.visible=!0,this.title=new i.j({color:"?sbColorOnPrimary"}),this.background=new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.background&&(this.background=new i.a(t.background))}}class T extends r.a{constructor(t={}){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!==t.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=t.cameraPermissionEnableCameraTitle),void 0!==t.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=t.cameraPermissionEnableCameraExplanation),void 0!==t.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=t.cameraPermissionCloseButton),void 0!==t.topBarCancelButton&&(this.topBarCancelButton=t.topBarCancelButton),void 0!==t.topBarTitle&&(this.topBarTitle=t.topBarTitle),void 0!==t.userGuidance&&(this.userGuidance=t.userGuidance),void 0!==t.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=t.barcodeInfoMappingLoadingMessage),void 0!==t.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=t.barcodeInfoMappingErrorStateTitle),void 0!==t.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=t.barcodeInfoMappingErrorStateSubtitle),void 0!==t.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=t.barcodeInfoMappingErrorStateRetryButton),void 0!==t.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=t.barcodeInfoMappingErrorStateCancelButton),void 0!==t.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=t.manualCountEditDialogTitle),void 0!==t.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=t.manualCountEditDialogInfo),void 0!==t.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=t.manualCountEditDialogUpdateButton),void 0!==t.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=t.manualCountEditDialogCancelButton),void 0!==t.sheetResetButton&&(this.sheetResetButton=t.sheetResetButton),void 0!==t.sheetClearAllButton&&(this.sheetClearAllButton=t.sheetClearAllButton),void 0!==t.sheetSubmitButton&&(this.sheetSubmitButton=t.sheetSubmitButton),void 0!==t.sheetStartScanningButton&&(this.sheetStartScanningButton=t.sheetStartScanningButton),void 0!==t.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=t.sheetPlaceholderTitle),void 0!==t.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=t.sheetPlaceholderSubtitle),void 0!==t.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=t.singleModeConfirmationCancelButton),void 0!==t.multipleModeSheetTitle&&(this.multipleModeSheetTitle=t.multipleModeSheetTitle),void 0!==t.findAndPickSheetTitle&&(this.findAndPickSheetTitle=t.findAndPickSheetTitle),void 0!==t.findAndPickSheetBarcodeItemSubtitle&&(this.findAndPickSheetBarcodeItemSubtitle=t.findAndPickSheetBarcodeItemSubtitle),void 0!==t.findAndPickPartialAlertTitle&&(this.findAndPickPartialAlertTitle=t.findAndPickPartialAlertTitle),void 0!==t.findAndPickPartialAlertSubtitle&&(this.findAndPickPartialAlertSubtitle=t.findAndPickPartialAlertSubtitle),void 0!==t.findAndPickPartialAlertCancelButton&&(this.findAndPickPartialAlertCancelButton=t.findAndPickPartialAlertCancelButton),void 0!==t.findAndPickPartialAlertSubmitButton&&(this.findAndPickPartialAlertSubmitButton=t.findAndPickPartialAlertSubmitButton),void 0!==t.findAndPickCompleteAlertTitle&&(this.findAndPickCompleteAlertTitle=t.findAndPickCompleteAlertTitle),void 0!==t.findAndPickCompleteAlertSubtitle&&(this.findAndPickCompleteAlertSubtitle=t.findAndPickCompleteAlertSubtitle),void 0!==t.findAndPickCompleteAlertCancelButton&&(this.findAndPickCompleteAlertCancelButton=t.findAndPickCompleteAlertCancelButton),void 0!==t.findAndPickCompleteAlertSubmitButton&&(this.findAndPickCompleteAlertSubmitButton=t.findAndPickCompleteAlertSubmitButton)}}class k extends r.a{constructor(t={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==t.barcodesRegexFilter&&(this.barcodesRegexFilter=t.barcodesRegexFilter),void 0!==t.barcodeFormats&&(this.barcodeFormats=t.barcodeFormats.map((t=>t))),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.maximumRecognizerResolution&&(this.maximumRecognizerResolution=t.maximumRecognizerResolution)}}class D extends r.a{constructor(t={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new i.e({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new i.c({text:"Close",background:new i.a({}),foreground:new i.d({})}),this.enableCameraTitle=new i.j({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new i.j({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==t.background&&(this.background=t.background),void 0!==t.iconBackground&&(this.iconBackground=t.iconBackground),void 0!==t.icon&&(this.icon=new i.e(t.icon)),void 0!==t.closeButton&&(this.closeButton=new i.c(t.closeButton)),void 0!==t.enableCameraTitle&&(this.enableCameraTitle=new i.j(t.enableCameraTitle)),void 0!==t.enableCameraExplanation&&(this.enableCameraExplanation=new i.j(t.enableCameraExplanation))}}class P extends r.a{constructor(t={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new i.f({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 T({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new f.a({title:new i.j({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new i.c({visible:!0,text:"?topBarCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new p({flashButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new E({visible:!0,style:new L({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new x.AspectRatio({width:1,height:1})}),this.userGuidance=new O({visible:!0,title:new i.j({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new D({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new i.e({visible:!0,color:"?sbColorOnSurface"}),closeButton:new i.c({visible:!0,text:"?cameraPermissionCloseButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new i.j({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new i.j({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new d({}),this.recognizerConfiguration=new k({}),this.useCase=new c({}),this.sound=new i.i({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new i.l({enabled:!0}),this.timeouts=new i.k({autoCancelTimeout:0,initialScanDelay:0}),void 0!==t.version&&(this.version=t.version),void 0!==t.screen&&(this.screen=t.screen),void 0!==t.palette&&(this.palette=new i.f(t.palette)),void 0!==t.localization&&(this.localization=new T(t.localization)),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.topBar&&(this.topBar=new f.a(t.topBar)),void 0!==t.actionBar&&(this.actionBar=new p(t.actionBar)),void 0!==t.viewFinder&&(this.viewFinder=new E(t.viewFinder)),void 0!==t.userGuidance&&(this.userGuidance=new O(t.userGuidance)),void 0!==t.cameraPermission&&(this.cameraPermission=new D(t.cameraPermission)),void 0!==t.cameraConfiguration&&(this.cameraConfiguration=new d(t.cameraConfiguration)),void 0!==t.recognizerConfiguration&&(this.recognizerConfiguration=new k(t.recognizerConfiguration)),void 0!==t.useCase&&(this.useCase=h.From(t.useCase)),void 0!==t.sound&&(this.sound=new i.i(t.sound)),void 0!==t.vibration&&(this.vibration=new i.l(t.vibration)),void 0!==t.timeouts&&(this.timeouts=new i.k(t.timeouts))}}var B=n(35);class F extends r.a{constructor(t={}){if(super(),void 0===t.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new B.BarcodeItem(t.barcode),void 0===t.count)throw new Error("count must be present in constructor argument");this.count=t.count}}class R extends r.a{constructor(t={}){super(),this.items=[],void 0!==t.items&&(this.items=t.items.map((t=>new F(t))))}}var I=n(19)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(36);class i extends o.a{constructor(t){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",this.videoConstraints={width:{ideal:t.width},height:{ideal:t.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(t,e){t.videoConstraints&&this.mapValues(t.videoConstraints,e.videoConstraints)}}i.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},i.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},i.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,i.DEFAULT_ACCEPTED_ANGLE_SCORE=75,i.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class i extends Error{constructor(t,e,n){super(e),this.name="",this.name=t,this.message=e,this.webApiError=n}static mediaDevicesUndefined(){return new i(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 i(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(t){return new i(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",t)}static permissionDenied(t){return new i(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",t)}static unknown(t){return new i(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 ",t)}static tryCheckPermission(){return o(this,void 0,void 0,(function*(){if(!this.permissionState)try{const t=yield navigator.permissions.query({name:"camera"});this.permissionState=t.state}catch(t){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}static createFromDOMException(t){return t instanceof DOMException?"NotAllowedError"===t.name?i.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===t.name?i.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:i.unknown(null==t?void 0:t.message)}}i.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},i.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{static initialize(t=!1){this.verbose=t}static debug(t){this.verbose&&console.log("ScanbotSDK:",t)}static debugWarn(t){this.verbose&&console.warn("ScanbotSDK:",t)}}},,,function(t,e,n){"use strict";n.r(e),n.d(e,"OcrResult",(function(){return i})),n.d(e,"FieldParsedData",(function(){return r})),n.d(e,"FieldType",(function(){return a})),n.d(e,"Field",(function(){return s})),n.d(e,"GenericDocumentType",(function(){return l})),n.d(e,"GenericDocument",(function(){return c}));var o=n(4);class i extends o.a{constructor(t={}){if(super(),void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=t.confidence}}class r extends o.a{constructor(t={}){if(super(),void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class a extends o.a{constructor(t={}){if(super(),this.listIndex=null,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");if(this.normalizedName=t.normalizedName,void 0===t.commonType)throw new Error("commonType must be present in constructor argument");this.commonType=null!=t.commonType?t.commonType:null,void 0!==t.listIndex&&(this.listIndex=null!=t.listIndex?t.listIndex:null)}}class s extends o.a{constructor(t={}){if(super(),this.confidenceWeight=1,this.image=null,this.validationStatus="NONE",this.parsedData=[],void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new a(t.type),void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=null!=t.value?new i(t.value):null,void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight),void 0!==t.image&&(this.image=null!=t.image?t.image:null),void 0===t.polygonInRoot)throw new Error("polygonInRoot must be present in constructor argument");this.polygonInRoot=t.polygonInRoot.map((t=>({x:t.x,y:t.y}))),void 0!==t.validationStatus&&(this.validationStatus=t.validationStatus),void 0!==t.parsedData&&(this.parsedData=t.parsedData.map((t=>new r(t))))}}class l extends o.a{constructor(t={}){if(super(),this.listIndex=null,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");this.normalizedName=t.normalizedName,void 0!==t.listIndex&&(this.listIndex=null!=t.listIndex?t.listIndex:null)}}class c extends o.a{constructor(t={}){if(super(),this.crop=null,this.confidence=0,this.confidenceWeight=0,void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new l(t.type),void 0===t.fields)throw new Error("fields must be present in constructor argument");if(this.fields=t.fields.map((t=>new s(t))),void 0===t.children)throw new Error("children must be present in constructor argument");if(this.children=t.children.map((t=>new c(t))),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=null!=t.quad?t.quad.map((t=>({x:t.x,y:t.y}))):null,void 0===t.quadInRoot)throw new Error("quadInRoot must be present in constructor argument");this.quadInRoot=null!=t.quadInRoot?t.quadInRoot.map((t=>({x:t.x,y:t.y}))):null,void 0!==t.crop&&(this.crop=null!=t.crop?t.crop:null),void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"LineSegmentInt",(function(){return i})),n.d(e,"LineSegmentFloat",(function(){return r})),n.d(e,"AspectRatio",(function(){return a}));var o=n(4);class i extends o.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class r extends o.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class a extends o.a{constructor(t={}){super(),this.width=1,this.height=1,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(t,e,n,o){this.x=t,this.y=e,this.width=n,this.height=o}scaleDown(t){return new o(this.x/t,this.y/t,this.width/t,this.height/t)}bottom(){return this.y+this.height}static withSize(t,e){return new o(0,0,t,e)}static empty(){return new o(0,0,0,0)}static fromRect(t){return t?new o(t.x,t.y,t.width,t.height):o.empty()}static fromPoint(t,e){return new o(t.x-e/2,t.y-e/2,e,e)}static fromDOMRect(t){return new o(t.x,t.y,t.width,t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(14),i=n(13);class r extends o.a{constructor(t){super(t);const e=new i.BarcodeScannerConfiguration;this.finder=e.viewFinder,this.userGuidance=e.userGuidance}static mapFinderConfiguration(t,e){var n,i;o.a.mapValuesDeep(null!==(n=e.finder)&&void 0!==n?n:{},t.finder),o.a.mapValuesDeep(null!==(i=e.userGuidance)&&void 0!==i?i:{},t.userGuidance)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var o=n(0),i=n(15),r=n(25),a=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class s extends o.default.Component{constructor(t){super(t),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(t){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(t){var e,n;return a(this,void 0,void 0,(function*(){const o=this.props.preferredCamera;if(o)try{const e=(yield navigator.mediaDevices.enumerateDevices()).find((t=>t.deviceId===o||t.label===o));if(e)return Object.assign(Object.assign({},t),{deviceId:e.deviceId})}catch(t){throw i.a.enumerateDevicesFailed()}else{const o={user:"front",environment:"back"},i=(null===(e=null==t?void 0:t.facingMode)||void 0===e?void 0:e.ideal)||(null===(n=null==t?void 0:t.facingMode)||void 0===n?void 0:n.exact)||(null==t?void 0:t.facingMode);if("string"==typeof i&&i in o){yield r.a.INSTANCE.load();const e=r.a.INSTANCE.getMainCamera(o[i]);if(e)return Object.assign(Object.assign({},t),{deviceId:e.deviceId})}}return t}))}componentDidMount(){return a(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var t,e,n,o,r,s,l,c;return a(this,void 0,void 0,(function*(){if(console.log("refreshStream",this),i.a.hasCheckedPermission()||(yield i.a.tryCheckPermission()),i.a.hasDeniedPermission())return void(null===(e=(t=this.props).onError)||void 0===e||e.call(t,i.a.permissionDenied()));const a={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const t=i.a.unknown();return null===(o=(n=this.props).onError)||void 0===o||o.call(n,t),void console.log(t)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(a);this.setState({stream:t},(()=>{var e,n,o,i;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(i=(o=this.props).onReady)||void 0===i||i.call(o)}))}catch(t){const e=i.a.mediaDeviceNotFound();return null===(s=(r=this.props).onError)||void 0===s||s.call(r,e),void console.error(e)}}catch(t){const e=i.a.createFromDOMException(t);return null===(c=(l=this.props).onError)||void 0===c||c.call(l,e),void console.error(e)}}))}stopCurrentStreams(){const t=this.state.stream,e=null==t?void 0:t.getTracks();e&&e.forEach((t=>{t.stop()}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationchangeCallback),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((t=>t.stop())),this.state.stream.getAudioTracks().forEach((t=>t.stop()))),this.setState({stream:void 0}))}render(){return this.props.children}updateTorch(t){return a(this,void 0,void 0,(function*(){const e=[{torch:t}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:e})}))}getCapabilities(){if(this.state.stream.getVideoTracks){const t=this.getVideoTrack();return s.getMediaTrackCapabilities(t)}}static getMediaTrackCapabilities(t){if(t&&t.getCapabilities)return t.getCapabilities()}getVideoTrack(){const t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}}var l=n(10),c=n(21),u=n(16),d=n(34);class h{static isSupported(){return!!document.createElement("canvas").getContext("webgl")}constructor(){this._type="WebGL",this.canvas=document.createElement("canvas");const t=this.gl=this.canvas.getContext("webgl",{willReadFrequently:!0}),e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);const n=t.createShader(t.VERTEX_SHADER);t.shaderSource(n,"attribute vec2 p;void main(){ gl_Position = vec4(p,0,1);}"),t.compileShader(n);const o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,"precision mediump float;uniform sampler2D texture; uniform vec2 scale; uniform vec2 offset; void main() { gl_FragColor=texture2D( texture, gl_FragCoord.xy * scale + offset );}"),t.compileShader(o);const i=this.program=t.createProgram();t.attachShader(i,n),t.attachShader(i,o),t.linkProgram(i),t.useProgram(i),t.uniform1i(t.getUniformLocation(i,"texture"),0),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.enableVertexAttribArray(0),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0)}getImageData(t,e,n,o,i,r,a,s){let l,c;if(r=Math.floor(r),a=Math.floor(a),e=Math.floor(e),n=Math.floor(n),o=Math.floor(o),i=Math.floor(i),t instanceof HTMLVideoElement)[c,l]=[t.videoWidth,t.videoHeight];else{if(!(t instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[c,l]=[t.width,t.height]}(c<e+o||l<n+i)&&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 h=this.gl;this.canvas.width=r,this.canvas.height=a,h.viewport(0,0,r,a);const f=[o/(r*c),i/(a*l)],p=[e/c,n/l];return h.uniform2fv(h.getUniformLocation(this.program,"scale"),f),h.uniform2fv(h.getUniformLocation(this.program,"offset"),p),h.texImage2D(h.TEXTURE_2D,0,h.RGB,h.RGB,h.UNSIGNED_BYTE,t),h.drawArrays(h.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)),h.readPixels(0,0,r,a,h.RGBA,h.UNSIGNED_BYTE,s),new ImageData(s,r,a)}}class f{constructor(){this._type="TwoD",this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0,alpha:!1}),this.ctx.imageSmoothingEnabled=!1}getImageData(t,e,n,o,i,r,a,s){return this.canvas.width=r,this.canvas.height=a,this.ctx.drawImage(t,e,n,o,i,0,0,r,a),this.ctx.getImageData(0,0,r,a)}}var p=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class m extends o.default.Component{constructor(t){super(t),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this._reusableImageBuffer=null,this.onStreamChanged=t=>{this.video.srcObject=t,this.updateCameraInfo(t),this.video.addEventListener("resize",(t=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(t=>{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:t,clientVideoHeight:e}=this.calculateClientVideoConstraints();return new l.a(t,e)}saveExtractedData(){this.save=!0}zoom(){var t;return null!==(t=this.props.zoom)&&void 0!==t?t:1}imageCapture(){if(this.capture)return this.capture;const t=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(t),this.capture}set reusableImageBuffer(t){this._reusableImageBuffer=t}createImageData(t=0,e){return p(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(e){const t=yield this.imageCapture().takePhoto(),e=yield createImageBitmap(t);u.a.debug("Bitmap size: "+e.width*e.height);const o=this.windowSize(),i=e.height/(o.height+o.y),r=o.width*i,a=o.height*i,s=e.width/2-r/2,l=o.y*i,d=new c.a(s,l,r,a);return u.a.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height),n.getImageData(this.video,d.x,d.y,e.width,e.height,d.width,d.height,this._reusableImageBuffer)}let{videoWidth:o,videoHeight:i}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const l=this.finderFrame||new c.a(0,0,r,a),d=this.zoom(),h=(o-r/d)/2,f=(i-a/d)/2,p=l.x/s+h,m=l.y/s+f,g=this.finderFrame?s:d,v=l.width/g,A=l.height/g,b=this.calculateFrameSize(t,v,A);return n.getImageData(this.video,p,m,v,A,b.width,b.height,this._reusableImageBuffer)}))}windowSize(){var t;const e=this.props.configuration,n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return c.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),o=t,i=e,r=1;return n.width/n.height<=t/e?(r=n.height/e,r>0&&(o=n.width/r)):(r=n.width/t,r>0&&(i=n.height/r)),{clientVideoWidth:o,clientVideoHeight:i,coef:r}}calculateFrameSize(t,e,n){let o=e,i=n;if(t>0&&0!=e&&0!=n){const r=e/n;e>n?(o=e>t?t:e,i=o/r):(i=n>t?t:n,o=i*r)}return new l.a(o,i)}getCanvasRenderingContext(){return this.video?0===this.video.videoWidth?null:(this.canvas&&!this.reloadCanvas||(this.canvas&&this.releaseCanvas(),this.canvas=h.isSupported()?new h:new f,this.reloadCanvas=!1),this.canvas):null}releaseCanvas(){this.canvas&&(this.canvas=null)}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){var t;const e={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(t=this.props.configuration)||void 0===t?void 0:t.backgroundColor};return this.state.mirrored&&(e.transform="scaleX(-1)"),e}zoomMargin(){const t=this.zoom();return 1===t?0:(1-t)/2*100}render(){const{videoConstraints:t,onReady:e,onError:n}=this.props;return o.default.createElement(s,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},o.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:t=>{this.video=t},style:this.style()}))}setDirection(t){this.props.videoConstraints.facingMode={ideal:t},this.setState({facingModeBack:"environment"===t,mirrored:"user"===t},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}swapCameraFacing(t){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const e=!this.state.facingModeBack,n=e?"environment":"user";this.props.videoConstraints.facingMode=!0===t?{exact:n}:{ideal:n},this.setState({facingModeBack:e,mirrored:!e},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(t,e){return p(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=e?e:this.state.mirrored,deviceId:t},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(t){this.activeCamera=r.a.getCameraInfoFromStream(t)}getActiveCameraInfo(){return this.activeCamera}setTorchState(t){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:t}]})}return Promise.reject("Torch is not supported for current camera.")}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return Qt})),n.d(e,"b",(function(){return Yt}));var o=n(2),i=(n(46),n(0)),r=n(44),a=n.n(r),s=n(28),l=n(45),c="undefined"!=typeof t&&void 0!==t.env&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",u="active",d="data-styled-version",h="6.1.8",f="/*!sc*/\n",p="undefined"!=typeof window&&"HTMLElement"in window,m=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==t.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&t.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function A(t,e,n){return void 0===n&&(n=v),t.theme!==n.theme&&t.theme||e||n.theme}var b=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"]),y=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,C=/(^-|-$)/g;function S(t){return t.replace(y,"-").replace(C,"")}var w=/(a)(d)/gi,x=function(t){return String.fromCharCode(t+(t>25?39:97))};function E(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=x(e%52)+n;return(x(e%52)+n).replace(w,"$1-$2")}var L,_=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},O=function(t){return _(5381,t)};function T(t){return E(O(t)>>>0)}function k(t){return t.displayName||t.name||"Component"}function D(t){return"string"==typeof t&&!0}var P="function"==typeof Symbol&&Symbol.for,B=P?Symbol.for("react.memo"):60115,F=P?Symbol.for("react.forward_ref"):60112,R={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},I={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},M=((L={})[F]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},L[B]=W,L);function j(t){return("type"in(e=t)&&e.type.$$typeof)===B?W:"$$typeof"in t?M[t.$$typeof]:R;var e}var z=Object.defineProperty,N=Object.getOwnPropertyNames,V=Object.getOwnPropertySymbols,U=Object.getOwnPropertyDescriptor,H=Object.getPrototypeOf,G=Object.prototype;function Q(t,e,n){if("string"!=typeof e){if(G){var o=H(e);o&&o!==G&&Q(t,o,n)}var i=N(e);V&&(i=i.concat(V(e)));for(var r=j(t),a=j(e),s=0;s<i.length;++s){var l=i[s];if(!(l in I||n&&n[l]||a&&l in a||r&&l in r)){var c=U(e,l);try{z(t,l,c)}catch(t){}}}}return t}function Y(t){return"function"==typeof t}function Z(t){return"object"==typeof t&&"styledComponentId"in t}function q(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function X(t,e){if(0===t.length)return"";for(var n=t[0],o=1;o<t.length;o++)n+=e?e+t[o]:t[o];return n}function $(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function K(t,e,n){if(void 0===n&&(n=!1),!n&&!$(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var o=0;o<e.length;o++)t[o]=K(t[o],e[o]);else if($(e))for(var o in e)t[o]=K(t[o],e[o]);return t}function J(t,e){Object.defineProperty(t,"toString",{value:e})}function tt(t){for(var e=[],n=1;n<arguments.length;n++)e[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(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var et=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;t>=i;)if((i<<=1)<0)throw tt(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),s=(r=0,e.length);r<s;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),o=n+e;this.groupSizes[t]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),i=o+n,r=o;r<i;r++)e+="".concat(this.tag.getRule(r)).concat(f);return e},t}(),nt=new Map,ot=new Map,it=1,rt=function(t){if(nt.has(t))return nt.get(t);for(;ot.has(it);)it++;var e=it++;return nt.set(t,e),ot.set(e,t),e},at=function(t,e){it=e+1,nt.set(t,e),ot.set(e,t)},st="style[".concat(c,"][").concat(d,'="').concat(h,'"]'),lt=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ct=function(t,e,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&t.registerName(e,o)},ut=function(t,e){for(var n,o=(null!==(n=e.textContent)&&void 0!==n?n:"").split(f),i=[],r=0,a=o.length;r<a;r++){var s=o[r].trim();if(s){var l=s.match(lt);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(at(u,c),ct(t,u,l[3]),t.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function dt(){return n.nc}var ht=function(t){var e=document.head,n=t||e,o=document.createElement("style"),i=function(t){var e=Array.from(t.querySelectorAll("style[".concat(c,"]")));return e[e.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(c,u),o.setAttribute(d,h);var a=dt();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},ft=function(){function t(t){this.element=ht(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,o=e.length;n<o;n++){var i=e[n];if(i.ownerNode===t)return i}throw tt(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),pt=function(){function t(t){this.element=ht(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),mt=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),gt=p,vt={isServer:!p,useCSSOMInjection:!m},At=function(){function t(t,e,n){void 0===t&&(t=v),void 0===e&&(e={});var i=this;this.options=Object(o.a)(Object(o.a)({},vt),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&p&&gt&&(gt=!1,function(t){for(var e=document.querySelectorAll(st),n=0,o=e.length;n<o;n++){var i=e[n];i&&i.getAttribute(c)!==u&&(ut(t,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),J(this,(function(){return function(t){for(var e=t.getTag(),n=e.length,o="",i=function(n){var i=function(t){return ot.get(t)}(n);if(void 0===i)return"continue";var r=t.names.get(i),a=e.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(c,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==r&&r.forEach((function(t){t.length>0&&(l+="".concat(t,","))})),o+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(f)},r=0;r<n;r++)i(r);return o}(i)}))}return t.registerId=function(t){return rt(t)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(Object(o.a)(Object(o.a)({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new mt(n):e?new ft(n):new pt(n)}(this.options),new et(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(rt(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(rt(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(rt(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),bt=/&/g,yt=/^\s*\/\/.*$/gm;function Ct(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=Ct(t.children,e)),t}))}function St(t){var e,n,o,i=void 0===t?v:t,r=i.options,a=void 0===r?v:r,l=i.plugins,c=void 0===l?g:l,u=function(t,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(e):t},d=c.slice();d.push((function(t){t.type===s.a&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(bt,n).replace(o,u))})),a.prefix&&d.push(s.d),d.push(s.g);var h=function(t,i,r,l){void 0===i&&(i=""),void 0===r&&(r=""),void 0===l&&(l="&"),e=l,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var c=t.replace(yt,""),u=s.b(r||i?"".concat(r," ").concat(i," { ").concat(c," }"):c);a.namespace&&(u=Ct(u,a.namespace));var h=[];return s.f(u,s.c(d.concat(s.e((function(t){return h.push(t)}))))),h};return h.hash=c.length?c.reduce((function(t,e){return e.name||tt(15),_(t,e.name)}),5381).toString():"",h}var wt=new At,xt=St(),Et=i.default.createContext({shouldForwardProp:void 0,styleSheet:wt,stylis:xt}),Lt=(Et.Consumer,i.default.createContext(void 0));function _t(){return Object(i.useContext)(Et)}function Ot(t){var e=Object(i.useState)(t.stylisPlugins),n=e[0],o=e[1],r=_t().styleSheet,s=Object(i.useMemo)((function(){var e=r;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target,r]),l=Object(i.useMemo)((function(){return St({options:{namespace:t.namespace,prefix:t.enableVendorPrefixes},plugins:n})}),[t.enableVendorPrefixes,t.namespace,n]);Object(i.useEffect)((function(){a()(n,t.stylisPlugins)||o(t.stylisPlugins)}),[t.stylisPlugins]);var c=Object(i.useMemo)((function(){return{shouldForwardProp:t.shouldForwardProp,styleSheet:s,stylis:l}}),[t.shouldForwardProp,s,l]);return i.default.createElement(Et.Provider,{value:c},i.default.createElement(Lt.Provider,{value:l},t.children))}var Tt=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=xt);var o=n.name+e.hash;t.hasNameForId(n.id,o)||t.insertRules(n.id,o,e(n.rules,o,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,J(this,(function(){throw tt(12,String(n.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=xt),this.name+t.hash},t}(),kt=function(t){return t>="A"&&t<="Z"};function Dt(t){for(var e="",n=0;n<t.length;n++){var o=t[n];if(1===n&&"-"===o&&"-"===t[0])return t;kt(o)?e+="-"+o.toLowerCase():e+=o}return e.startsWith("ms-")?"-"+e:e}var Pt=function(t){return null==t||!1===t||""===t},Bt=function(t){var e,n,i=[];for(var r in t){var a=t[r];t.hasOwnProperty(r)&&!Pt(a)&&(Array.isArray(a)&&a.isCss||Y(a)?i.push("".concat(Dt(r),":"),a,";"):$(a)?i.push.apply(i,Object(o.e)(Object(o.e)(["".concat(r," {")],Bt(a),!1),["}"],!1)):i.push("".concat(Dt(r),": ").concat((e=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in l.a||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function Ft(t,e,n,o){return Pt(t)?[]:Z(t)?[".".concat(t.styledComponentId)]:Y(t)?!Y(i=t)||i.prototype&&i.prototype.isReactComponent||!e?[t]:Ft(t(e),e,n,o):t instanceof Tt?n?(t.inject(n,o),[t.getName(o)]):[t]:$(t)?Bt(t):Array.isArray(t)?Array.prototype.concat.apply(g,t.map((function(t){return Ft(t,e,n,o)}))):[t.toString()];var i}function Rt(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(Y(n)&&!Z(n))return!1}return!0}var It=O(h),Wt=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Rt(t),this.componentId=e,this.baseHash=_(It,e),this.baseStyle=n,At.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))o=q(o,this.staticRulesId);else{var i=X(Ft(this.rules,t,e,n)),r=E(_(this.baseHash,i)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}o=q(o,r),this.staticRulesId=r}else{for(var s=_(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=X(Ft(u,t,e,n));s=_(s,d+c),l+=d}}if(l){var h=E(s>>>0);e.hasNameForId(this.componentId,h)||e.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),o=q(o,h)}}return o},t}(),Mt=i.default.createContext(void 0);Mt.Consumer;var jt={};new Set;function zt(t,e,n){var r=Z(t),a=t,s=!D(t),l=e.attrs,c=void 0===l?g:l,u=e.componentId,d=void 0===u?function(t,e){var n="string"!=typeof t?"sc":S(t);jt[n]=(jt[n]||0)+1;var o="".concat(n,"-").concat(T(h+n+jt[n]));return e?"".concat(e,"-").concat(o):o}(e.displayName,e.parentComponentId):u,f=e.displayName,p=void 0===f?function(t){return D(t)?"styled.".concat(t):"Styled(".concat(k(t),")")}(t):f,m=e.displayName&&e.componentId?"".concat(S(e.displayName),"-").concat(e.componentId):e.componentId||d,y=r&&a.attrs?a.attrs.concat(c).filter(Boolean):c,C=e.shouldForwardProp;if(r&&a.shouldForwardProp){var w=a.shouldForwardProp;if(e.shouldForwardProp){var x=e.shouldForwardProp;C=function(t,e){return w(t,e)&&x(t,e)}}else C=w}var E=new Wt(n,m,r?a.componentStyle:void 0);function L(t,e){return function(t,e,n){var r=t.attrs,a=t.componentStyle,s=t.defaultProps,l=t.foldedComponentIds,c=t.styledComponentId,u=t.target,d=i.default.useContext(Mt),h=_t(),f=t.shouldForwardProp||h.shouldForwardProp,p=A(e,d,s)||v,m=function(t,e,n){for(var i,r=Object(o.a)(Object(o.a)({},e),{className:void 0,theme:n}),a=0;a<t.length;a+=1){var s=Y(i=t[a])?i(r):i;for(var l in s)r[l]="className"===l?q(r[l],s[l]):"style"===l?Object(o.a)(Object(o.a)({},r[l]),s[l]):s[l]}return e.className&&(r.className=q(r.className,e.className)),r}(r,e,p),g=m.as||u,y={};for(var C in m)void 0===m[C]||"$"===C[0]||"as"===C||"theme"===C&&m.theme===p||("forwardedAs"===C?y.as=m.forwardedAs:f&&!f(C,g)||(y[C]=m[C]));var S=function(t,e){var n=_t();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(a,m),w=q(l,c);return S&&(w+=" "+S),m.className&&(w+=" "+m.className),y[D(g)&&!b.has(g)?"class":"className"]=w,y.ref=n,Object(i.createElement)(g,y)}(_,t,e)}L.displayName=p;var _=i.default.forwardRef(L);return _.attrs=y,_.componentStyle=E,_.displayName=p,_.shouldForwardProp=C,_.foldedComponentIds=r?q(a.foldedComponentIds,a.styledComponentId):"",_.styledComponentId=m,_.target=r?a.target:t,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0,i=e;o<i.length;o++)K(t,i[o],!0);return t}({},a.defaultProps,t):t}}),J(_,(function(){return".".concat(_.styledComponentId)})),s&&Q(_,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function Nt(t,e){for(var n=[t[0]],o=0,i=e.length;o<i;o+=1)n.push(e[o],t[o+1]);return n}var Vt=function(t){return Object.assign(t,{isCss:!0})};function Ut(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Y(t)||$(t))return Vt(Ft(Nt(g,Object(o.e)([t],e,!0))));var i=t;return 0===e.length&&1===i.length&&"string"==typeof i[0]?Ft(i):Vt(Ft(Nt(i,e)))}function Ht(t,e,n){if(void 0===n&&(n=v),!e)throw tt(1,e);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return t(e,n,Ut.apply(void 0,Object(o.e)([i],r,!1)))};return i.attrs=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),i))},i}var Gt=function(t){return Ht(zt,t)},Qt=Gt;b.forEach((function(t){Qt[t]=Gt(t)}));!function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=Rt(t),At.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,o){var i=o(X(Ft(this.rules,e,n,o)),""),r=this.componentId+t;n.insertRules(r,r,i)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,o){t>2&&At.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,o)}}();function Yt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=X(Ut.apply(void 0,Object(o.e)([t],e,!1))),r=T(i);return new Tt(r,i)}(function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString(),n=dt(),o=X([n&&'nonce="'.concat(n,'"'),"".concat(c,'="true"'),"".concat(d,'="').concat(h,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw tt(2);return t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)throw tt(2);var n=((e={})[c]="",e[d]=h,e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),r=dt();return r&&(n.nonce=r),[i.default.createElement("style",Object(o.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new At({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw tt(2);return i.default.createElement(Ot,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw tt(3)}})(),"__sc-".concat(c,"__")}).call(this,n(42))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(15),i=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class r{static get INSTANCE(){return r._INSTANCE||(r._INSTANCE=new r),r._INSTANCE}constructor(){this.listOfCameras=[],this.strategy="FAST_DEFERRED"}initialize(t){if(t&&(this.strategy=t),"SLOW"===t||"FAST"===t){const e=t;this.load(e)}}load(t){return i(this,void 0,void 0,(function*(){if(!t)if("SLOW_DEFERRED"===this.strategy||"SLOW"===this.strategy)t="SLOW";else if("FAST_DEFERRED"===this.strategy||"FAST"===this.strategy)t="FAST";else if("NONE"===this.strategy)return this.listOfCameras;let e;if("SLOW"===t)e=this.loadSlow();else{if("FAST"!==t)throw new Error(`Unknown mode ${t}`);e=this.loadFast()}try{return this.listOfCameras=yield e,this.listOfCameras}catch(t){throw this.loadSlowResult=void 0,o.a.createFromDOMException(t)}}))}loadSlow(){return this.loadSlowResult=this.loadSlowResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const t=[];for(const e of yield this.getVideoDevices()){let n;try{n=yield this.getUserMedia({video:{deviceId:e.deviceId}}),t.push(r.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((t=>setTimeout(t,0)))}}return t})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const t=[];for(const e of yield this.getVideoDevices()){const n=r.guessparseCameraLabelFacingMode(e.label),o=r.guessparseCameraLabelMaxNumPixels(e.label);t.push({maxNumPixels:o,facingMode:n,supportsTorchControl:void 0,deviceId:e.deviceId,label:e.label})}return t})))(),this.loadFastResult}getMainCamera(t){var e,n,o,i,r,a;return null!==(a=null===(r=null===(i=null===(o=null===(n=null===(e=this.listOfCameras)||void 0===e?void 0:e.filter((e=>e.facingMode===t)))||void 0===n?void 0:n.map(((t,e)=>({camera:t,index:e}))))||void 0===o?void 0:o.sort(((t,e)=>{var n;return-(+t.camera.supportsTorchControl||0)-(+e.camera.supportsTorchControl||0)||-((t.camera.maxNumPixels||0)-(e.camera.maxNumPixels||0))||(null===(n=t.camera.label)||void 0===n?void 0:n.localeCompare(e.camera.label))||t.index-e.index})))||void 0===i?void 0:i[0])||void 0===r?void 0:r.camera)&&void 0!==a?a:null}getVideoDevices(){return i(this,void 0,void 0,(function*(){let t=yield navigator.mediaDevices.enumerateDevices();if(t=t.filter((t=>"videoinput"===t.kind)),t.some((t=>""===t.label))){let e;try{e=yield this.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1}),t=yield navigator.mediaDevices.enumerateDevices(),t=t.filter((t=>"videoinput"===t.kind))}finally{this.stopStream(e)}}return t}))}stopStream(t){null==t||t.getTracks().forEach((t=>t.stop()))}static guessparseCameraLabelFacingMode(t){return function(t){const e=["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 e)if(t.toLowerCase().includes(n.toLowerCase()))return!0;return!1}(t)?"back":"front"}static guessparseCameraLabelMaxNumPixels(t){const e=RegExp(/\b([0-9]+)mp?\b/).exec(t.toLowerCase()),n=e?1e6*parseInt(e[1],10):NaN;return Number.isNaN(n)?void 0:n}assertPermissionsAreOk(){return i(this,void 0,void 0,(function*(){if(o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())throw o.a.permissionDenied();if(!navigator.mediaDevices)throw o.a.unknown()}))}static getCameraInfoFromStream(t){var e;return null===(e=t.getVideoTracks().map((t=>{var e,n,o,i,r,a;const s=null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t),l=null===(n=t.getSettings)||void 0===n?void 0:n.call(t),c=t.label;let u=function(t){if("user"===(null==t?void 0:t.toLowerCase()))return"front";if("environment"===(null==t?void 0:t.toLowerCase()))return"back";return"unknown"}(null!==(i=null===(o=null==s?void 0:s.facingMode)||void 0===o?void 0:o[0])&&void 0!==i?i:l.facingMode);"unknown"===u&&(u=this.guessparseCameraLabelFacingMode(c));let d=function(t){var e,n;let o=(null===(e=null==t?void 0:t.width)||void 0===e?void 0:e.max)*(null===(n=null==t?void 0:t.height)||void 0===n?void 0:n.max);if(!o||Number.isNaN(o))return;return o}(s);Number.isNaN(d)&&(d=this.guessparseCameraLabelMaxNumPixels(c));return{facingMode:u,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(r=null==s?void 0:s.torch)&&void 0!==r?r:"torch"in l)&&void 0!==a&&a,label:c,deviceId:l.deviceId}})).sort(((t,e)=>e.maxNumPixels-t.maxNumPixels)))||void 0===e?void 0:e[0]}getUserMedia(t){return i(this,void 0,void 0,(function*(){try{return yield navigator.mediaDevices.getUserMedia(t)}catch(t){throw o.a.mediaDeviceNotFound()}}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o=n(0),i=n(21),r=n(5),a=n(11);class s extends o.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(t){super(t),this.holePosition=i.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=t=>{var e,n,o,i;(null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)===(null===(n=t.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)===(null===(i=t.padding)||void 0===i?void 0:i.minBottomPadding)&&this.props.configuration===t.configuration&&this.props.guidanceConfiguration===t.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var t;return null!==(t=this.holeCanvas.getBoundingClientRect())&&void 0!==t?t:new DOMRect},this.scaleForRetinaDisplay=t=>{if(window.devicePixelRatio>1){var e=t.width,n=t.height;t.width=e*window.devicePixelRatio,t.height=n*window.devicePixelRatio,t.style.width=e+"px",t.style.height=n+"px",t.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var t,e,n,o,i;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,l=Math.max(20,(r-s)/2),c=Math.min(s,r-2*l),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=c,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-c/2;const d=(null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)+this.guidanceTextTopPadding||0,h=Math.max(10,null!==(n=null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)&&void 0!==n?n:0),f=a-h-Math.max(10,null!==(i=null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)&&void 0!==i?i:0)-d;this.holePosition.height>f?(this.holePosition.height=f,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=h):this.holePosition.y=h+(f-this.holePosition.height)/1.9;const p=this.holeCanvas.getContext("2d");p.save(),this.drawBackground(p),p.globalCompositeOperation="destination-out",this.drawHole();const m=this.crosshairCanvas.getContext("2d");m.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),p.restore(),m.restore()},this.drawBackground=t=>{const{width:e,height:n}=this.getVideoSize();t.clearRect(0,0,e,n),t.beginPath(),t.rect(0,0,e,n),t.fillStyle=r.b.getColorValue(this.props.configuration.overlayColor),t.fill()},this.drawHole=()=>{const t=this.holeCanvas.getContext("2d"),e=this.cornerRadius(),n=this.holePosition.x,o=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height;t.beginPath(),t.fillStyle="black",t.moveTo(n+e,o),t.arcTo(n+i,o,n+i,o+r,e),t.arcTo(n+i,o+r,n,o+r,e),t.arcTo(n,o+r,n,o,e),t.arcTo(n,o,n+i,o,e),t.closePath(),t.fill()},this.drawCrosshair=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;t.beginPath(),t.moveTo(e-10,n),t.lineTo(e+10,n),t.moveTo(e,n-10),t.lineTo(e,n+10),t.strokeStyle="white",t.fillStyle="white",t.lineWidth=1,t.stroke()},this.drawHoleCorners=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=15,s=this.style.strokeWidth,l=this.cornerRadius();t.beginPath(),t.moveTo(e,n+a),t.arcTo(e,n,e+o,n,l),t.lineTo(e+a,n),t.moveTo(e+o-a,n),t.arcTo(e+o,n,e+o,n+i,l),t.lineTo(e+o,n+a),t.moveTo(e+o,n+i-a),t.arcTo(e+o,n+i,e,n+i,l),t.lineTo(e+o-a,n+i),t.moveTo(e,n+i-a),t.arcTo(e,n+i,e+o,n+i,l),t.lineTo(e+a,n+i),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.drawHoleOutline=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;t.beginPath(),t.moveTo(e+a,n),t.arcTo(e+o,n,e+o,n+i,a),t.moveTo(e+o,n+a),t.arcTo(e+o,n+i,e,n+i,a),t.moveTo(e+o-a,n+i),t.arcTo(e,n+i,e,n,a),t.moveTo(e,n+i-a),t.arcTo(e,n,e+o,n,a),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.guidanceTextTopPadding=20,this.render=()=>o.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",textAlign:"left"},onClick:t=>{const e=this.holePosition;t.clientX>this.holePosition.x&&t.clientX<e.x+e.width&&t.clientY>e.y&&t.clientY<e.y+e.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},o.default.createElement("canvas",{ref:t=>{this.holeCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),o.default.createElement("canvas",{ref:t=>{this.crosshairCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&o.default.createElement("div",{ref:t=>{this.guidanceText=t},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},o.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 t,e;return this.holeRect.bottom()+(null!==(e=null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e: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(t,e,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var r=typeof o;if("string"===r||"number"===r)t.push(o);else if(Array.isArray(o)){if(o.length){var a=i.apply(null,o);a&&t.push(a)}}else if("object"===r)if(o.toString===Object.prototype.toString)for(var s in o)n.call(o,s)&&o[s]&&t.push(s);else t.push(o.toString())}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(o=function(){return i}.apply(e,[]))||(t.exports=o)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return Q})),n.d(e,"c",(function(){return tt})),n.d(e,"d",(function(){return nt})),n.d(e,"e",(function(){return et})),n.d(e,"f",(function(){return K})),n.d(e,"g",(function(){return J}));var o="-ms-",i="-moz-",r="-webkit-",a="comm",s="rule",l="decl",c="@keyframes",u=Math.abs,d=String.fromCharCode,h=Object.assign;function f(t){return t.trim()}function p(t,e){return(t=e.exec(t))?t[0]:t}function m(t,e,n){return t.replace(e,n)}function g(t,e,n){return t.indexOf(e,n)}function v(t,e){return 0|t.charCodeAt(e)}function A(t,e,n){return t.slice(e,n)}function b(t){return t.length}function y(t){return t.length}function C(t,e){return e.push(t),t}function S(t,e){return t.map(e).join("")}function w(t,e){return t.filter((function(t){return!p(t,e)}))}var x=1,E=1,L=0,_=0,O=0,T="";function k(t,e,n,o,i,r,a,s){return{value:t,root:e,parent:n,type:o,props:i,children:r,line:x,column:E,length:a,return:"",siblings:s}}function D(t,e){return h(k("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function P(t){for(;t.root;)t=D(t.root,{children:[t]});C(t,t.siblings)}function B(){return O=_<L?v(T,_++):0,E++,10===O&&(E=1,x++),O}function F(){return v(T,_)}function R(){return _}function I(t,e){return A(T,t,e)}function W(t){switch(t){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(t){return x=E=1,L=b(T=t),_=0,[]}function j(t){return T="",t}function z(t){return f(I(_-1,U(91===t?t+2:40===t?t+1:t)))}function N(t){for(;(O=F())&&O<33;)B();return W(t)>2||W(O)>3?"":" "}function V(t,e){for(;--e&&B()&&!(O<48||O>102||O>57&&O<65||O>70&&O<97););return I(t,R()+(e<6&&32==F()&&32==B()))}function U(t){for(;B();)switch(O){case t:return _;case 34:case 39:34!==t&&39!==t&&U(O);break;case 40:41===t&&U(t);break;case 92:B()}return _}function H(t,e){for(;B()&&t+O!==57&&(t+O!==84||47!==F()););return"/*"+I(e,_-1)+"*"+d(47===t?t:B())}function G(t){for(;!W(F());)B();return I(t,_)}function Q(t){return j(Y("",null,null,null,[""],t=M(t),0,[0],t))}function Y(t,e,n,o,i,r,a,s,l){for(var c=0,h=0,f=a,p=0,A=0,y=0,S=1,w=1,L=1,k=0,D="",P=i,I=r,W=o,M=D;w;)switch(y=k,k=B()){case 40:if(108!=y&&58==v(M,f-1)){-1!=g(M+=m(z(k),"&","&\f"),"&\f",u(c?s[c-1]:0))&&(L=-1);break}case 34:case 39:case 91:M+=z(k);break;case 9:case 10:case 13:case 32:M+=N(y);break;case 92:M+=V(R()-1,7);continue;case 47:switch(F()){case 42:case 47:C(q(H(B(),R()),e,n,l),l);break;default:M+="/"}break;case 123*S:s[c++]=b(M)*L;case 125*S:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+h:-1==L&&(M=m(M,/\f/g,"")),A>0&&b(M)-f&&C(A>32?X(M+";",o,n,f-1,l):X(m(M," ","")+";",o,n,f-2,l),l);break;case 59:M+=";";default:if(C(W=Z(M,e,n,c,h,i,s,D,P=[],I=[],f,r),r),123===k)if(0===h)Y(M,e,W,W,P,r,f,s,I);else switch(99===p&&110===v(M,3)?100:p){case 100:case 108:case 109:case 115:Y(t,W,W,o&&C(Z(t,W,W,0,0,i,s,D,i,P=[],f,I),I),i,I,f,s,o?P:I);break;default:Y(M,W,W,W,[""],I,0,s,I)}}c=h=A=0,S=L=1,D=M="",f=a;break;case 58:f=1+b(M),A=y;default:if(S<1)if(123==k)--S;else if(125==k&&0==S++&&125==(O=_>0?v(T,--_):0,E--,10===O&&(E=1,x--),O))continue;switch(M+=d(k),k*S){case 38:L=h>0?1:(M+="\f",-1);break;case 44:s[c++]=(b(M)-1)*L,L=1;break;case 64:45===F()&&(M+=z(B())),p=F(),h=f=b(D=M+=G(R())),k++;break;case 45:45===y&&2==b(M)&&(S=0)}}return r}function Z(t,e,n,o,i,r,a,l,c,d,h,p){for(var g=i-1,v=0===i?r:[""],b=y(v),C=0,S=0,w=0;C<o;++C)for(var x=0,E=A(t,g+1,g=u(S=a[C])),L=t;x<b;++x)(L=f(S>0?v[x]+" "+E:m(E,/&\f/g,v[x])))&&(c[w++]=L);return k(t,e,n,0===i?s:l,c,d,h,p)}function q(t,e,n,o){return k(t,e,n,a,d(O),A(t,2,-2),0,o)}function X(t,e,n,o,i){return k(t,e,n,l,A(t,0,o),A(t,o+1,-1),o,i)}function $(t,e,n){switch(function(t,e){return 45^v(t,0)?(((e<<2^v(t,0))<<2^v(t,1))<<2^v(t,2))<<2^v(t,3):0}(t,e)){case 5103:return r+"print-"+t+t;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+t+t;case 4789:return i+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return r+t+i+t+o+t+t;case 5936:switch(v(t,e+11)){case 114:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return r+t+o+t+t;case 6165:return r+t+o+"flex-"+t+t;case 5187:return r+t+m(t,/(\w+).+(:[^]+)/,r+"box-$1$2"+o+"flex-$1$2")+t;case 5443:return r+t+o+"flex-item-"+m(t,/flex-|-self/g,"")+(p(t,/flex-|baseline/)?"":o+"grid-row-"+m(t,/flex-|-self/g,""))+t;case 4675:return r+t+o+"flex-line-pack"+m(t,/align-content|flex-|-self/g,"")+t;case 5548:return r+t+o+m(t,"shrink","negative")+t;case 5292:return r+t+o+m(t,"basis","preferred-size")+t;case 6060:return r+"box-"+m(t,"-grow","")+r+t+o+m(t,"grow","positive")+t;case 4554:return r+m(t,/([^-])(transform)/g,"$1"+r+"$2")+t;case 6187:return m(m(m(t,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),t,"")+t;case 5495:case 3959:return m(t,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return m(m(t,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+o+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+t+t;case 4200:if(!p(t,/flex-|baseline/))return o+"grid-column-align"+A(t,e)+t;break;case 2592:case 3360:return o+m(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,p(t.props,/grid-\w+-end/)}))?~g(t+(n=n[e].value),"span",0)?t:o+m(t,"-start","")+t+o+"grid-row-span:"+(~g(n,"span",0)?p(n,/\d+/):+p(n,/\d+/)-+p(t,/\d+/))+";":o+m(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return p(t.props,/grid-\w+-start/)}))?t:o+m(m(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return m(t,/(.+)-inline(.+)/,r+"$1$2")+t;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(b(t)-1-e>6)switch(v(t,e+1)){case 109:if(45!==v(t,e+4))break;case 102:return m(t,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+i+(108==v(t,e+3)?"$3":"$2-$3"))+t;case 115:return~g(t,"stretch",0)?$(m(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return m(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,i,r,a,s,l){return o+n+":"+i+l+(r?o+n+"-span:"+(a?s:+s-+i)+l:"")+t}));case 4949:if(121===v(t,e+6))return m(t,":",":"+r)+t;break;case 6444:switch(v(t,45===v(t,14)?18:11)){case 120:return m(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(t,14)?"inline-":"")+"box$3$1"+r+"$2$3$1"+o+"$2box$3")+t;case 100:return m(t,":",":"+o)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return m(t,"scroll-","scroll-snap-")+t}return t}function K(t,e){for(var n="",o=0;o<t.length;o++)n+=e(t[o],o,t,e)||"";return n}function J(t,e,n,o){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case l:return t.return=t.return||t.value;case a:return"";case c:return t.return=t.value+"{"+K(t.children,o)+"}";case s:if(!b(t.value=t.props.join(",")))return""}return b(n=K(t.children,o))?t.return=t.value+"{"+n+"}":""}function tt(t){var e=y(t);return function(n,o,i,r){for(var a="",s=0;s<e;s++)a+=t[s](n,o,i,r)||"";return a}}function et(t){return function(e){e.root||(e=e.return)&&t(e)}}function nt(t,e,n,i){if(t.length>-1&&!t.return)switch(t.type){case l:return void(t.return=$(t.value,t.length,n));case c:return K([D(t,{value:m(t.value,"@","@"+r)})],i);case s:if(t.length)return S(n=t.props,(function(e){switch(p(e,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":P(D(t,{props:[m(e,/:(read-\w+)/,":-moz-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,i)});break;case"::placeholder":P(D(t,{props:[m(e,/:(plac\w+)/,":"+r+"input-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,":-moz-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,o+"input-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,i)})}return""}))}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(1),i=n(7);class r extends i.a{constructor(t={}){super(),this.title=new o.j({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new o.c({text:"Cancel",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.d({color:"?sbColorOnPrimary"})}),void 0!==t.title&&(this.title=new o.j(t.title)),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.cancelButton&&(this.cancelButton=new o.c(t.cancelButton))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}));var o=n(6);function i(t,e,n){return Math.min(Math.max(t,e),n)}function r(t,e,n){return new o.a(i(t.x,-e/2,n.width-e/2),i(t.y,-e/2,n.height-e/2))}},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeFormatConfigurationBase",(function(){return o})),n.d(e,"BarcodeFormatOneDConfigurationBase",(function(){return i})),n.d(e,"BarcodeFormatCodabarConfiguration",(function(){return l})),n.d(e,"BarcodeFormatCode11Configuration",(function(){return c})),n.d(e,"BarcodeFormatCode39Configuration",(function(){return u})),n.d(e,"BarcodeFormatCode93Configuration",(function(){return d})),n.d(e,"BarcodeFormatCode128Configuration",(function(){return h})),n.d(e,"BarcodeFormatCode2Of5Configuration",(function(){return f})),n.d(e,"BarcodeFormatDataBarConfiguration",(function(){return p})),n.d(e,"BarcodeFormatDataBarExpandedConfiguration",(function(){return m})),n.d(e,"BarcodeFormatDataBarLimitedConfiguration",(function(){return g})),n.d(e,"BarcodeFormatITFConfiguration",(function(){return v})),n.d(e,"BarcodeFormatMSIPlesseyConfiguration",(function(){return A})),n.d(e,"BarcodeFormatUpcEanConfiguration",(function(){return b})),n.d(e,"BarcodeFormatPharmaCodeConfiguration",(function(){return y})),n.d(e,"BarcodeFormatTwoDConfigurationBase",(function(){return r})),n.d(e,"BarcodeFormatAztecConfiguration",(function(){return C})),n.d(e,"BarcodeFormatQRCodeConfiguration",(function(){return S})),n.d(e,"BarcodeFormatPDF417Configuration",(function(){return w})),n.d(e,"BarcodeFormatMicroPDF417Configuration",(function(){return x})),n.d(e,"BarcodeFormatDataMatrixConfiguration",(function(){return E})),n.d(e,"BarcodeFormatMaxiCodeConfiguration",(function(){return L})),n.d(e,"BarcodeFormatFourStateConfigurationBase",(function(){return a})),n.d(e,"BarcodeFormatAustraliaPostConfiguration",(function(){return _})),n.d(e,"BarcodeFormatJapanPostConfiguration",(function(){return O})),n.d(e,"BarcodeFormatRoyalMailConfiguration",(function(){return T})),n.d(e,"BarcodeFormatRoyalTNTPostConfiguration",(function(){return k})),n.d(e,"BarcodeFormatUSPSIntelligentMailConfiguration",(function(){return D})),n.d(e,"BarcodeFormatPharmaCodeTwoTrackConfiguration",(function(){return P})),n.d(e,"BarcodeFormatGS1CompositeConfiguration",(function(){return B})),n.d(e,"BarcodeFormatCommonOneDConfiguration",(function(){return F})),n.d(e,"BarcodeFormatCommonTwoDConfiguration",(function(){return R})),n.d(e,"BarcodeFormatCommonFourStateConfiguration",(function(){return I})),n.d(e,"BarcodeFormatCommonConfiguration",(function(){return W}));var o,i,r,a,s=n(4);!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatCodabarConfiguration":return new l(t);case"BarcodeFormatCode11Configuration":return new c(t);case"BarcodeFormatCode39Configuration":return new u(t);case"BarcodeFormatCode93Configuration":return new d(t);case"BarcodeFormatCode128Configuration":return new h(t);case"BarcodeFormatCode2Of5Configuration":return new f(t);case"BarcodeFormatDataBarConfiguration":return new p(t);case"BarcodeFormatDataBarExpandedConfiguration":return new m(t);case"BarcodeFormatDataBarLimitedConfiguration":return new g(t);case"BarcodeFormatITFConfiguration":return new v(t);case"BarcodeFormatMSIPlesseyConfiguration":return new A(t);case"BarcodeFormatUpcEanConfiguration":return new b(t);case"BarcodeFormatPharmaCodeConfiguration":return new y(t);case"BarcodeFormatAztecConfiguration":return new C(t);case"BarcodeFormatQRCodeConfiguration":return new S(t);case"BarcodeFormatPDF417Configuration":return new w(t);case"BarcodeFormatMicroPDF417Configuration":return new x(t);case"BarcodeFormatDataMatrixConfiguration":return new E(t);case"BarcodeFormatMaxiCodeConfiguration":return new L(t);case"BarcodeFormatAustraliaPostConfiguration":return new _(t);case"BarcodeFormatJapanPostConfiguration":return new O(t);case"BarcodeFormatRoyalMailConfiguration":return new T(t);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(t);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new D(t);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new P(t);case"BarcodeFormatGS1CompositeConfiguration":return new B(t);case"BarcodeFormatCommonOneDConfiguration":return new F(t);case"BarcodeFormatCommonTwoDConfiguration":return new R(t);case"BarcodeFormatCommonFourStateConfiguration":return new I(t);case"BarcodeFormatCommonConfiguration":return new W(t);default:throw`Unknown child class name: ${e}`}}}(o||(o={})),function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatCodabarConfiguration":return new l(t);case"BarcodeFormatCode11Configuration":return new c(t);case"BarcodeFormatCode39Configuration":return new u(t);case"BarcodeFormatCode93Configuration":return new d(t);case"BarcodeFormatCode128Configuration":return new h(t);case"BarcodeFormatCode2Of5Configuration":return new f(t);case"BarcodeFormatDataBarConfiguration":return new p(t);case"BarcodeFormatDataBarExpandedConfiguration":return new m(t);case"BarcodeFormatDataBarLimitedConfiguration":return new g(t);case"BarcodeFormatITFConfiguration":return new v(t);case"BarcodeFormatMSIPlesseyConfiguration":return new A(t);case"BarcodeFormatUpcEanConfiguration":return new b(t);case"BarcodeFormatPharmaCodeConfiguration":return new y(t);default:throw`Unknown child class name: ${e}`}}}(i||(i={}));class l extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCodabarConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.returnStartEnd&&(this.returnStartEnd=t.returnStartEnd)}}class c extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode11Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksum=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksum&&(this.checksum=t.checksum)}}class u extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode39Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.code32&&(this.code32=t.code32),void 0!==t.code39&&(this.code39=t.code39),void 0!==t.pzn&&(this.pzn=t.pzn),void 0!==t.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=t.tryCode39ExtendedMode),void 0!==t.useCode39CheckDigit&&(this.useCode39CheckDigit=t.useCode39CheckDigit)}}class d extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode93Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class h extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode128Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class f extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode2Of5Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.iata2of5&&(this.iata2of5=t.iata2of5),void 0!==t.code25&&(this.code25=t.code25),void 0!==t.industrial2of5&&(this.industrial2of5=t.industrial2of5),void 0!==t.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=t.useIATA2OF5Checksum)}}class p extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class m extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarExpandedConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class g extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarLimitedConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class v extends s.a{constructor(t={}){super(),this._type="BarcodeFormatITFConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class A extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMSIPlesseyConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksumAlgorithms&&(this.checksumAlgorithms=t.checksumAlgorithms.map((t=>t)))}}class b extends s.a{constructor(t={}){super(),this._type="BarcodeFormatUpcEanConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="AllowAny",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.ean8&&(this.ean8=t.ean8),void 0!==t.ean13&&(this.ean13=t.ean13),void 0!==t.upca&&(this.upca=t.upca),void 0!==t.upce&&(this.upce=t.upce),void 0!==t.extensions&&(this.extensions=t.extensions)}}class y extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPharmaCodeConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue),void 0!==t.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=t.allowNarrowBarsOnly),void 0!==t.allowWideBarsOnly&&(this.allowWideBarsOnly=t.allowWideBarsOnly)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatAztecConfiguration":return new C(t);case"BarcodeFormatQRCodeConfiguration":return new S(t);case"BarcodeFormatPDF417Configuration":return new w(t);case"BarcodeFormatMicroPDF417Configuration":return new x(t);case"BarcodeFormatDataMatrixConfiguration":return new E(t);case"BarcodeFormatMaxiCodeConfiguration":return new L(t);default:throw`Unknown child class name: ${e}`}}}(r||(r={}));class C extends s.a{constructor(t={}){super(),this._type="BarcodeFormatAztecConfiguration",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class S extends s.a{constructor(t={}){super(),this._type="BarcodeFormatQRCodeConfiguration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.qr&&(this.qr=t.qr),void 0!==t.microQr&&(this.microQr=t.microQr),void 0!==t.rmqr&&(this.rmqr=t.rmqr)}}class w extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPDF417Configuration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class x extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMicroPDF417Configuration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class E extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataMatrixConfiguration",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class L extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMaxiCodeConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatAustraliaPostConfiguration":return new _(t);case"BarcodeFormatJapanPostConfiguration":return new O(t);case"BarcodeFormatRoyalMailConfiguration":return new T(t);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(t);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new D(t);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new P(t);default:throw`Unknown child class name: ${e}`}}}(a||(a={}));class _ extends s.a{constructor(t={}){super(),this._type="BarcodeFormatAustraliaPostConfiguration",this.regexFilter="",this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=t.australiaPostCustomerFormat)}}class O extends s.a{constructor(t={}){super(),this._type="BarcodeFormatJapanPostConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class T extends s.a{constructor(t={}){super(),this._type="BarcodeFormatRoyalMailConfiguration",this.regexFilter="",this.stripCheckDigits=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits)}}class k extends s.a{constructor(t={}){super(),this._type="BarcodeFormatRoyalTNTPostConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class D extends s.a{constructor(t={}){super(),this._type="BarcodeFormatUSPSIntelligentMailConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class P extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPharmaCodeTwoTrackConfiguration",this.regexFilter="",this.minimumValue=364,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue)}}class B extends s.a{constructor(t={}){super(),this._type="BarcodeFormatGS1CompositeConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class F extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonOneDConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,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","UPC_A","UPC_E"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class R extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonTwoDConfiguration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class I extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonFourStateConfiguration",this.regexFilter="",this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class W extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,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!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}},function(t,e,n){"use strict";(function(t){function o(t,e=!1){const n=[];if(e)return n;return function t(e){if(e)if(e.constructor===ImageData)n.push(e.data.buffer);else if(e.constructor===ArrayBuffer)n.push(e);else if(ArrayBuffer.isView(e))n.push(e.buffer);else if(Array.isArray(e))for(let n=0;n<e.length;++n)t(e[n]);else if(e.constructor===Object)for(const n in e)e.hasOwnProperty(n)&&t(e[n])}(t),n}function i(t){return t.startsWith("http:")||t.startsWith("https:")}function r(){if("undefined"!=typeof t&&"undefined"!=typeof t.versions&&"undefined"!=typeof t.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(t){return!1}}function a(t){const{allowSimd:e=!0,allowThreads:n=!0}=t||{};let o="";if(e&&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(t){return!1}}()){o+="-simd";n&&r()&&(o+="-threads")}return o}n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return a}))}).call(this,n(42))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(){this.values=new Map}}o.INSTANCE=new o},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeItem",(function(){return a})),n.d(e,"BarcodeScannerConfiguration",(function(){return s})),n.d(e,"BarcodeScannerResult",(function(){return l}));var o=n(32),i=n(4),r=n(19);class a extends i.a{constructor(t={}){if(super(),this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0!==t.format&&(this.format=t.format),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0!==t.isUpsideDown&&(this.isUpsideDown=t.isUpsideDown),void 0!==t.sourceImage&&(this.sourceImage=null!=t.sourceImage?t.sourceImage:null),void 0===t.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=t.rawBytes,void 0===t.upcEanExtension)throw new Error("upcEanExtension must be present in constructor argument");if(this.upcEanExtension=t.upcEanExtension,void 0!==t.isGS1Message&&(this.isGS1Message=t.isGS1Message),void 0!==t.isGS1CompositePart&&(this.isGS1CompositePart=t.isGS1CompositePart),void 0!==t.dataBarStackSize&&(this.dataBarStackSize=t.dataBarStackSize),void 0===t.parsedDocument)throw new Error("parsedDocument must be present in constructor argument");this.parsedDocument=null!=t.parsedDocument?new r.GenericDocument(t.parsedDocument):null}}class s extends i.a{constructor(t={}){super(),this.barcodeFormatConfigurations=[new o.BarcodeFormatCommonConfiguration({})],this.acceptedDocumentFormats=["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!==t.barcodeFormatConfigurations&&(this.barcodeFormatConfigurations=t.barcodeFormatConfigurations.map((t=>o.BarcodeFormatConfigurationBase.From(t)))),void 0!==t.acceptedDocumentFormats&&(this.acceptedDocumentFormats=t.acceptedDocumentFormats.map((t=>t))),void 0!==t.onlyAcceptDocuments&&(this.onlyAcceptDocuments=t.onlyAcceptDocuments),void 0!==t.returnBarcodeImage&&(this.returnBarcodeImage=t.returnBarcodeImage),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.live&&(this.live=t.live)}}class l extends i.a{constructor(t={}){if(super(),void 0===t.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=t.barcodes.map((t=>new a(t))),void 0===t.success)throw new Error("success must be present in constructor argument");this.success=t.success}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(t,e,n){Object.keys(t).forEach((o=>{(null==n?void 0:n.includes(o))||(e[o]=t[o])}))}static mapValuesDeep(t,e){const n=t=>t&&"object"==typeof t&&!Array.isArray(t);Object.keys(t).forEach((i=>{i in e&&n(t[i])&&n(e[i])?o.mapValuesDeep(t[i],e[i]):e[i]=t[i]}))}static _fromJson(t,e){return this.mapValuesDeep(e,t),t}}},function(t,e,n){"use strict";var o,i=function(){return"undefined"==typeof o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var t={};return function(e){if("undefined"==typeof t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function l(t,e){for(var n={},o=[],i=0;i<t.length;i++){var r=t[i],l=e.base?r[0]+e.base:r[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var d=s(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(h)):a.push({identifier:u,updater:g(h,e),references:1}),o.push(u)}return o}function c(t){var e=document.createElement("style"),o=t.attributes||{};if("undefined"==typeof o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var a=r(t.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(e)}return e}var u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=d(e,i);else{var r=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function f(t,e,n){var o=n.css,i=n.media,r=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var p=null,m=0;function g(t,e){var n,o,i;if(e.singleton){var r=m++;n=p||(p=c(e)),o=h.bind(null,n,r,!1),i=h.bind(null,n,r,!0)}else n=c(e),o=f.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<n.length;o++){var i=s(n[o]);a[i].references--}for(var r=l(t,e),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,o){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var l=[].concat(t[s]);o&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";var o="6.0.0-dev.6";class i{}i.VERSION=o,i.CDN_PATH="https://cdn.jsdelivr.net/npm/scanbot-web-sdk@6.0.0-dev.6/bundle/",i.DEFAULT_WASM_FOLDER="bin/complete/",i.BUILD_WITH_UI=!1;var r=n(33);class a{constructor(t,e){this.errorInWorker=null,this.createProxy=t=>new Proxy({},{get:(e,n,o)=>(...e)=>this.post(n,e,t)}),this.handleUnrecoverableError=t=>{this.errorInWorker=t;for(const e in this.continuations)this.continuations[e].reject(t),delete this.continuations[e]},this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer");const{requestSuffix:n=""}=e||{},o=Object(r.c)(e),i=`${t}${t.endsWith("/")?"":"/"}ScanbotSDK.Core${o}.js${n}`;if(Object(r.d)(i)){const t=new Blob([`importScripts("${i}")`]);this.instance=new Worker(URL.createObjectURL(t))}else this.instance=new Worker(i);this.continuations={},this.nextTicketId=1,this.instance.onmessage=t=>{const{log:e,logError:n}=t.data;if(e)return void console.log(...e);if(n)return void console.error(...n);const{ticket:o,result:i,recoverableError:r,unrecoverableError:a}=t.data,s=this.continuations[o];if(!s)return;const{resolve:l,reject:c}=s;delete this.continuations[o],a?(c(a),this.handleUnrecoverableError(a)):r?c(r):l(i)},this.instance.onerror=t=>{this.handleUnrecoverableError(t.error)}}post(t,e,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((o,i)=>{const a=Object(r.b)(e,"copy"==n),s=this.nextTicketId++;this.continuations[s]={resolve:o,reject:i},this.instance.postMessage({command:t,args:e,ticket:s},a)}))}destroy(){this.instance.terminate()}}var s=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class l extends Error{}class c extends Error{}class u{constructor(t,e,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),t||(t=i.CDN_PATH+i.DEFAULT_WASM_FOLDER),this.core=new a(t,e),this.coreInitializationSuccessful=(()=>s(this,void 0,void 0,(function*(){if(yield this.core.copyArgs.initialize(...n)){let e;try{e=yield this.core.copyArgs.version()}catch(t){e="Error"}const n=i.VERSION;return e!==n?new c(`Version mismatch! \nVersion of ScanbotSDK.(ui2.)min.js is "${n}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${e}". \nThe ScanbotSDK.Core*.js file was loaded from ${t}.`):"OK"}return new l("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(t){return new Proxy({},{get:(e,n,o)=>(...e)=>s(this,void 0,void 0,(function*(){const o=yield this.getCoreForCommand(n),i="copy"===t?o.copyArgs:o.transferArgs;return yield i[n](...e)}))})}getCoreForCommand(t=""){return s(this,void 0,void 0,(function*(){const e=yield this.coreInitializationSuccessful;if("OK"===e||"getLicenseInfo"===t&&e instanceof l)return this.core;throw e}))}destroy(){this.core.destroy(),this.core=void 0}}class d{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(t){const e=new d;return e.status=t.licenseStatus,e.description=t.description,e}}var h=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class f{constructor(t,e){this._sdk=t,this._pdfOperation=e}addPage(t,e="COPY_IMAGE"){return h(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);yield n.addPageToPdf(this._pdfOperation,t)}))}complete(){return h(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var p=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class m{constructor(t,e){this._sdk=t,this._tiffOperation=e}addPage(t,e={}){return p(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:o="COPY_IMAGE"}=e,i=this._sdk.getBridge(o);yield i.addPageToTiff(this._tiffOperation,t,n)}))}complete(){return p(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var g=n(21);class v{static toPixelSize(t){return t+"px"}static containsString(t,e){return!!t&&-1!==t.indexOf(e)}static copy(t){return JSON.parse(JSON.stringify(t))}static getProperty(t,e){if(t&&t.hasOwnProperty(e))return t[e]}static uuid(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;for(let o=0;o<5;o++)t+=e.charAt(Math.floor(Math.random()*n));return t}}var A=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class b{static toDataUrl(t){return new Promise(((e,n)=>{const o=new Blob([t],{type:"image/jpeg"}),i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>n(i.error),i.readAsDataURL(o)}))}static getObjectFitSize(t,e,n=!0){const o=e.width/e.height,i=t.width/t.height;let r=0,a=0;(n?o>i:o<i)?(r=t.width,a=r/o):(a=t.height,r=a*o);const s=(t.width-r)/2,l=(t.height-a)/2;return new g.a(s,l,r,a)}static loadFromUrl(t){return new Promise(((e,n)=>{const o=document.createElement("img");o.src=t,o.onload=()=>A(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=o.width,t.height=o.height;const n=t.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);e(i)})),o.onerror=n}))}static saveImageData(t){const e=this.createImageDataCanvas(t),n=" ("+t.width+"x"+t.height+")";e.toBlob((t=>this.saveBlob(t,v.uuid()+n+".png")))}static createImageDataCanvas(t){const e=document.createElement("canvas");return e.className="scanbot-sdk-canvas-element",e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t,0,0),e}static saveBlob(t,e){let n=document.createElement("a");n.setAttribute("download",e);let o=URL.createObjectURL(t);n.setAttribute("href",o),n.click()}static convertImageDataWrapperToImageData(t){if(t)return new ImageData(t.data,t.width,t.height)}static wrapperToBase64(t){return b.createImageDataCanvas(b.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}static toBase64(t){return A(this,void 0,void 0,(function*(){const e=yield new Promise((e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(new Blob([t]))}));return e.slice(e.indexOf(",")+1)}))}}class y{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=v.uuid()+".jpeg");let n=new Blob([t],{type:"image/jpeg"});b.saveBlob(n,e)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let t=this.findFlashElement();t.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{t.style.opacity="1.0",t.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(t,e){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=t,e()}),150)}getOrCreateElement(t,e){let n=this.getElementByClassName(t);return n||(this.createElement(t,e),n=this.getElementByClassName(t)),n}createElement(t,e){let n=document.createElement("div");n.className=t,n.style.cssText=this.cssToString(e),document.body.append(n)}cssToString(t){let e="";return Object.keys(t).forEach((n=>{e+=n+":"+t[n]+";"})),e}getElementByClassName(t){const e=document.getElementsByClassName(t);if(0!==e.length)return e[0]}}var C=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class S{constructor(t,e){this._sdk=t,this._mrzRecognizerToken=e}recognize(t,e="COPY_IMAGE"){return C(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.recognizeMRZ(yield this._mrzRecognizerToken,t)}))}recognizeURL(t){return C(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>C(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);e(r||void 0)}))}))}))}release(){return C(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var w=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class x{constructor(t,e){this._sdk=t,this._OcrEngineToken=e}performOcr(t,e="COPY_IMAGE"){return w(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.performOcr(this._OcrEngineToken,t)}))}recognizeURL(t){return w(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>w(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);e(r)}))}))}))}release(){return w(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var E=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class L{constructor(t,e){this._sdk=t,this._textDataScannerToken=e}recognize(t,e="COPY_IMAGE"){return E(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.recognizeTextLine(yield this._textDataScannerToken,t)}))}cleanRecognitionQueue(){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanTextLineRecognitionQueue(yield this._textDataScannerToken)}))}recognizeURL(t){return E(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>E(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i,"CONSUME_IMAGE");r&&e(r)}))}))}))}release(){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textDataScannerToken)}))}}var _=n(14),O=n(22),T=n(9);class k extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new T.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(t){const e=new k;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class D extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new T.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(t){const e=new D;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class P extends Error{constructor(t){super(t.description),this.name="LicenseError"}}class B{static throwIfMissingBuffer(t){B.throwIfMissing(t,"ImageBuffer may not be null")}static throwIfMissing(t,e){if(!t)throw new Error(e)}}var F=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class R{constructor(t,e){this._sdk=t,this._token=e}analyze(t,e="COPY_IMAGE"){return F(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const n=this._sdk.getBridge(e);return yield n.documentQualityAnalyzerAnalyze(this._token,t)}))}release(){return F(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var I=n(16),W=n(0),M=n(43),j=n(13),z=n(3),N=n.n(z),V=n(5);const U="var(--1-sb-dvh, 1vh)";function H(){const t=Object(W.useMemo)((()=>{var t,e;return null===(e=null===(t=null===window||void 0===window?void 0:window.CSS)||void 0===t?void 0:t.supports)||void 0===e?void 0:e.call(t,"height: 100dvh")}),[]),e=()=>{var e=t?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",e)};return Object(W.useEffect)((()=>{if(e(),!t)return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}})),null}var G=n(30),Q=n(11),Y=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function Z(t){const e=Object(W.useContext)(V.a).getColorValue,{styleConfig:n}=t,o=Y(t,["styleConfig"]),i=Object.assign(Object.assign({},t.style),{backgroundColor:e(n.fillColor),borderColor:e(n.strokeColor),borderWidth:n.strokeWidth,borderRadius:n.cornerRadius,borderStyle:"solid"});return W.default.createElement(z.Box,Object.assign({},o,{style:i}))}function q(t){var e;return t.visible?W.default.createElement(z.Button,{variant:"text",onClick:t.onClick,sx:Object.assign(Object.assign({flex:1},Object(Q.b)(t.foreground)),{textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},px:0}),disableRipple:!0},W.default.createElement(Z,{styleConfig:Object.assign(Object.assign({},t.background),{cornerRadius:4}),sx:{borderStyle:"solid",px:"8px"}},null!==(e=t.icon)&&void 0!==e?e:null,V.b.getLocalizedBarcodeText(t.text))):W.default.createElement("div",{style:{display:"flex",flex:1}})}G.a;const X=W.default.createContext(null);function $(t){const e=t.mode,n="HIDDEN"===e?0:48;Object(W.useEffect)((()=>{if("HIDDEN"===e)return;const n=document.createElement("meta");return n.name="theme-color",n.content=V.b.getColorValue(t.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[e]);const o="SOLID"===e?0:n,i={height:n,remainingVisibleBodyHeight:"SOLID"===e?`calc(100 * ${U} - ${n}px)`:`calc(100 * ${U})`,minTopPaddingForContent:o,minTopPaddingForViewFinder:10+o},r="SOLID"===e?{backgroundColor:V.b.getColorValue(t.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${V.b.getColorValue(t.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return W.default.createElement(W.default.Fragment,null,"HIDDEN"!==e&&W.default.createElement(z.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},W.default.createElement(z.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},W.default.createElement(z.Box,{sx:{flex:1}},t.cancelButton.visible&&W.default.createElement(W.default.Fragment,null,W.default.createElement(q,Object.assign({onClick:t.onBackPress,icon:t.cancelButton.foreground.iconVisible&&W.default.createElement(N.a,{sx:{fontSize:12,mr:"5px"}})},t.cancelButton)))),W.default.createElement(z.Box,null,W.default.createElement(z.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},W.default.createElement(Q.a,{config:t.title}))),W.default.createElement(z.Box,{sx:{flex:1}}))),W.default.createElement(X.Provider,{value:i},t.children))}function K(t){return{textOverflow:"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`,overflow:"hidden",whiteSpace:t>1?"normal":"nowrap",display:t>1?"-webkit-box":"block"}}function J(t){if(t.loading)return W.default.createElement(z.Skeleton,{variant:"rounded",width:t.imageSize,height:t.imageSize,style:{borderRadius:8}});if(null===t.data.barcodeImage){const e={width:t.imageSize,height:t.imageSize,backgroundColor:"#E0E0E0",borderRadius:3};return W.default.createElement(z.Box,{sx:e})}const e={width:t.imageSize,height:t.imageSize,borderRadius:8};return W.default.createElement("img",{src:t.data.barcodeImage,alt:t.data.title,style:e})}function tt(t){var e,n;const o=(null===(e=t.barcodeMappedData)||void 0===e?void 0:e.state)||"LOADING",i=(null===(n=t.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!t||"LOADED"!==o,a=t.imageSize,s=t.barcodeTitle.visible||t.barcodeSubtitle.visible||t.counterForm,l=t.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:V.b.getColorValue(t.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return W.default.createElement(z.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},t.barcodeImageVisible&&W.default.createElement(z.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},W.default.createElement(J,{data:i,imageSize:a,loading:r})),s&&W.default.createElement(z.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},t.barcodeTitle.visible&&W.default.createElement(z.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},W.default.createElement(z.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},K(t.maxNumberOfTitleLines)),Object(Q.b)(t.barcodeTitle))},r?W.default.createElement(z.Skeleton,{variant:"text"}):i.title),t.displayRightArrow&&!r&&W.default.createElement(N.a,{sx:{fontSize:16,fontWeight:"bold",color:V.b.getColorValue(t.barcodeTitle.color)}})),t.barcodeSubtitle.visible&&W.default.createElement(z.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},K(t.maxNumberOfSubtitleLines)),Object(Q.b)(t.barcodeSubtitle))},r?W.default.createElement(z.Skeleton,{variant:"text"}):i.subtitle),t.counterForm&&W.default.createElement(z.ButtonGroup,{variant:"outlined"},W.default.createElement(z.Button,{disabled:!t.counterForm.removeButtonEnabled,sx:l,style:{opacity:t.counterForm.removeButtonEnabled?1:.3},onClick:()=>t.counterForm.setCounter(t.counterForm.counter-1),disableRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.counterForm.manualCountChangeColor)}})),W.default.createElement(z.Button,{sx:Object.assign(Object.assign({},l),{color:V.b.getColorValue(t.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:t.counterForm.onNumberClick,disableRipple:!0},t.counterForm.counter),W.default.createElement(z.Button,{disabled:!t.counterForm.addButtonEnabled,sx:l,style:{opacity:t.counterForm.addButtonEnabled?1:.3},onClick:()=>t.counterForm.setCounter(t.counterForm.counter+1),disableRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.counterForm.manualCountChangeColor)}})))))}j.ButtonConfiguration;function et(t){const e=Object(W.useContext)(V.a).getColorValue;return t.visible?W.default.createElement(z.Button,{onClick:t.onClick,type:t.type,sx:Object.assign(Object.assign({},t.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:e(t.background.strokeColor),borderWidth:t.background.strokeWidth,backgroundColor:e(t.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},t.foreground.iconVisible&&t.icon&&W.default.createElement(t.icon,{sx:{color:e(t.foreground.color),pr:2}}),W.default.createElement(Q.a,{config:{visible:!0,text:t.text,color:t.foreground.color,useShadow:t.foreground.useShadow}})):null}var nt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function ot(t){var e,{modalOverlayColor:n}=t,o=nt(t,["modalOverlayColor"]);const i={backdrop:{style:{backgroundColor:V.b.getColorValue(n)}}},r=Object.assign(Object.assign({},o.PaperProps),{sx:Object.assign(Object.assign({},null===(e=o.PaperProps)||void 0===e?void 0:e.sx),{maxWidth:400})});return W.default.createElement(z.Dialog,Object.assign({},o,{componentsProps:i,PaperProps:r}))}function it(t){const e=Object(W.useContext)(V.a).getColorValue,n=!t.barcodeMappedData||"LOADED"!==t.barcodeMappedData.state,o={backgroundColor:e(n?t.sheetColorLoading:t.sheetColorLoaded)},[i,r]=W.default.useState(),a=Object(W.useRef)((()=>{}));Object(W.useEffect)((()=>{t.open&&r(!1)}),[t.open]);const s=()=>{a.current=t.handleCancel,r(!0)};return W.default.createElement(ot,{modalOverlayColor:t.modalOverlayColor,open:t.open&&!i,fullWidth:!0,TransitionProps:{onExited:()=>{i&&a.current()}},onClose:()=>{n||s()}},W.default.createElement(z.DialogContent,{style:o},W.default.createElement(tt,Object.assign({},t,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),W.default.createElement(z.DialogActions,{style:o},W.default.createElement(N.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:e(t.dividerColor)})),n?W.default.createElement(N.a,{item:!0,xs:12,sx:{textAlign:"center"}},W.default.createElement(z.Box,null,W.default.createElement(z.CircularProgress,{sx:{color:e(t.loadingMessage.color),verticalAlign:"middle",mr:2}}),W.default.createElement(Q.a,{config:t.loadingMessage}))):W.default.createElement(W.default.Fragment,null,W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:s},t.cancelButton))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:()=>{a.current=t.handleSubmit,r(!0)}},t.submitButton)))))))}var rt=n(1);rt.h;function at(t){if(!1===t.visible)return null;const e={backgroundColor:t.active?V.b.getColorValue(t.activeBackgroundColor):V.b.getColorValue(t.backgroundColor),color:t.active?V.b.getColorValue(t.activeForegroundColor):V.b.getColorValue(t.foregroundColor)};return W.default.createElement(z.IconButton,{sx:Object.assign(Object.assign({},e),{"&:hover, &:focus":Object.assign({outline:"none"},e),width:48,height:48}),onClick:t.onClick},t.text&&W.default.createElement("span",{style:{fontSize:15}},V.b.getLocalizedBarcodeText(t.text)),t.icon&&W.default.createElement(t.icon,{style:{padding:7}}))}var st=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class lt{constructor(){this.audioFile=new Audio}initialize(t){return st(this,void 0,void 0,(function*(){t.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"===t.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"===t.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(t){t.successBeepEnabled&&this.play()}play(){return st(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(t){}}))}}lt.INSTANCE=new lt;var ct=lt;class ut{constructor(){this.DURATION=200}vibrate(t){t.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}ut.INSTANCE=new ut;var dt=ut,ht=n(12),ft=n(23),pt=n(26),mt=n(24);class gt extends W.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return W.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},W.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},W.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},W.default.createElement("div",{style:{flex:1}},this.props.barcode.text),W.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),W.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}function vt(t,e){return t.format===e.format&&t.text===e.text}function At(t){return t.text+t.format}class bt extends W.default.Component{constructor(t){super(t),this.state={barcodes:this.toUniqueListWithDuplicateCounter(t.barcodes)}}toUniqueListWithDuplicateCounter(t){const e=[];return t.forEach((t=>{const n=e.findIndex((e=>vt(e,t)));-1===n?(t.count=1,e.push(t)):e[n].count++})),e}update(t){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(t)})}render(){return W.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>W.default.createElement(gt,{key:e,barcode:t,onClick:this.props.onClick}))))}}class yt{}yt.ScanbotPrimary="#c8193c",yt.LightGray="#F5F5F5",yt.Gray="#808080",yt.DarkGray="#333333",yt.Orange="#FF5533",yt.White="#FFFFFF",yt.TransparentGreen="rgba(0, 255, 0, 0.5)",yt.TransparentGray="rgba(50, 50, 50, 0.5)",yt.TransparentBlack="rgba(0, 0, 0, 0.3)",yt.SBNegative="#FF3737";var Ct,St=yt;!function(t){t[t.None=0]="None",t[t.PushRight=1]="PushRight",t[t.PushBottom=2]="PushBottom",t[t.Pop=3]="Pop"}(Ct||(Ct={}));class wt extends W.default.Component{constructor(t){super(t),this._isVisible=!1,this.state={animation:{type:Ct.None},elements:[]}}containerStyle(t){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:t,overflow:"scroll"}}render(){var t,e,n;if(this.state.animation.type===Ct.None)return null;const o=this.animation(this.state.animation.type),i=this.to(this.state.animation.type);this.previousDestination=i;const r=this.props.style;return W.default.createElement(o,{style:this.containerStyle(`${i}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},W.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},W.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:St.ScanbotPrimary}},W.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},W.default.createElement("div",{style:{backgroundColor:St.White,height:3,width:33,borderRadius:5}})),W.default.createElement("div",{style:{display:"flex",height:50}},W.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:St.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),W.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:St.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(e=null===(t=this.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)+" Codes"),W.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:St.White,justifyContent:"right",alignItems:"center",paddingRight:10}},W.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),W.default.createElement(bt,{ref:t=>{null!==t&&(this.list=t)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(t,e){this._isVisible=!0,this.barcodes=e,this.updateAnimationType(t)}update(t){this.barcodes=t,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(Ct.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===Ct.Pop&&this.updateAnimationType(Ct.None)}updateAnimationType(t,e){this.setState({animation:{type:t}},e)}animation(t){let e=this.from(t),n=this.to(t);this.previousDestination===n&&(e=this.previousDestination,n=this.previousDestination);const o=mt.b`from {transform: ${e};} to {transform: ${n};}`;return mt.a.div`animation: ${o} 0.5s;`}from(t){if(t===Ct.PushRight)return this.translate("X",100);if(t===Ct.PushBottom)return this.translate("Y",100);if(t===Ct.Pop){const t=this.pushType===Ct.PushRight?"X":"Y";return this.translate(t,0)}}to(t){if(t===Ct.PushRight)return this.translate("X",0);if(t===Ct.PushBottom)return this.translate("Y",0);if(t===Ct.Pop){const t=this.pushType===Ct.PushRight?"X":"Y";return this.translate(t,100)}}translate(t,e){return"translate"+t+"("+e+"%)"}componentWillUnmount(){this._isVisible=!1}}var xt=n(2),Et=function(t){return{isEnabled:function(e){return t.some((function(t){return!!e[t]}))}}},Lt={measureLayout:Et(["layout","layoutId","drag","_layoutResetTransform"]),animation:Et(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:Et(["exit"]),drag:Et(["drag","dragControls"]),focus:Et(["whileFocus"]),hover:Et(["whileHover","onHoverStart","onHoverEnd"]),tap:Et(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Et(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:Et(["layout","layoutId"])};var _t=Object(W.createContext)({strict:!1}),Ot=Object.keys(Lt),Tt=Ot.length;var kt=Object(W.createContext)({transformPagePoint:function(t){return t},isStatic:!1}),Dt=Object(W.createContext)({});var Pt=Object(W.createContext)(null);function Bt(t){var e=Object(W.useRef)(null);return null===e.current&&(e.current=t()),e.current}function Ft(){var t=Object(W.useContext)(Pt);if(null===t)return[!0,null];var e=t.isPresent,n=t.onExitComplete,o=t.register,i=Mt();Object(W.useEffect)((function(){return o(i)}),[]);return!e&&n?[!1,function(){return null==n?void 0:n(i)}]:[!0]}function Rt(t){return null===t||t.isPresent}var It=0,Wt=function(){return It++},Mt=function(){return Bt(Wt)},jt=Object(W.createContext)(null),zt="undefined"!=typeof window,Nt=zt?W.useLayoutEffect:W.useEffect;function Vt(t,e,n,o){var i=Object(W.useContext)(kt),r=Object(W.useContext)(_t),a=Object(W.useContext)(Dt).visualElement,s=Object(W.useContext)(Pt),l=function(t){var e=t.layoutId,n=Object(W.useContext)(jt);return n&&void 0!==e?n+"-"+e:e}(n),c=Object(W.useRef)(void 0);o||(o=r.renderer),!c.current&&o&&(c.current=o(t,{visualState:e,parent:a,props:Object(xt.a)(Object(xt.a)({},n),{layoutId:l}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=c.current;return Nt((function(){u&&(u.setProps(Object(xt.a)(Object(xt.a)(Object(xt.a)({},i),n),{layoutId:l})),u.isPresent=Rt(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(W.useEffect)((function(){var t;u&&(null===(t=u.animationState)||void 0===t||t.animateChanges())})),Nt((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function Ut(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ht(t){return Array.isArray(t)}function Gt(t){return"string"==typeof t||Ht(t)}function Qt(t,e,n,o,i){var r;return void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof e&&(e=null===(r=t.variants)||void 0===r?void 0:r[e]),"function"==typeof e?e(null!=n?n:t.custom,o,i):e}function Yt(t,e,n){var o=t.getProps();return Qt(o,e,null!=n?n:o.custom,function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.get()})),e}(t),function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.getVelocity()})),e}(t))}function Zt(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||Gt(t.initial)||Gt(t.animate)||Gt(t.whileHover)||Gt(t.whileDrag)||Gt(t.whileTap)||Gt(t.whileFocus)||Gt(t.exit)}function qt(t){return Boolean(Zt(t)||t.variants)}function Xt(t,e){var n=function(t,e){if(Zt(t)){var n=t.initial,o=t.animate;return{initial:!1===n||Gt(n)?n:void 0,animate:Gt(o)?o:void 0}}return!1!==t.inherit?e:{}}(t,Object(W.useContext)(Dt)),o=n.initial,i=n.animate;return Object(W.useMemo)((function(){return{initial:o,animate:i}}),e?[$t(o),$t(i)]:[])}function $t(t){return Array.isArray(t)?t.join(" "):t}function Kt(t){var e=t.preloadedFeatures,n=t.createVisualElement,o=t.useRender,i=t.useVisualState,r=t.Component;return e&&function(t){for(var e in t){var n=t[e];null!==n&&(Lt[e].Component=n)}}(e),Object(W.forwardRef)((function(t,e){var a=Object(W.useContext)(kt).isStatic,s=null,l=Xt(t,a),c=i(t,a);return!a&&zt&&(l.visualElement=Vt(r,c,t,n),s=function(t,e,n){var o=[];if(Object(W.useContext)(_t),!e)return null;for(var i=0;i<Tt;i++){var r=Ot[i],a=Lt[r],s=a.isEnabled,l=a.Component;s(t)&&l&&o.push(W.createElement(l,Object(xt.a)({key:r},t,{visualElement:e})))}return o}(t,l.visualElement)),W.createElement(W.Fragment,null,W.createElement(Dt.Provider,{value:l},o(r,t,function(t,e,n){return Object(W.useCallback)((function(o){var i;o&&(null===(i=t.mount)||void 0===i||i.call(t,o)),e&&(o?e.mount(o):e.unmount()),n&&("function"==typeof n?n(o):Ut(n)&&(n.current=o))}),[e])}(c,l.visualElement,e),c,a)),s)}))}function Jt(t){function e(e,n){return void 0===n&&(n={}),Kt(t(e,n))}var n=new Map;return new Proxy(e,{get:function(t,o){return n.has(o)||n.set(o,e(o)),n.get(o)}})}var te=["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 ee(t){return"string"==typeof t&&!t.includes("-")&&!!(te.indexOf(t)>-1||/[A-Z]/.test(t))}var ne={};var oe=["","X","Y","Z"],ie=["transformPerspective","x","y","z"];function re(t,e){return ie.indexOf(t)-ie.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return oe.forEach((function(e){return ie.push(t+e)}))}));var ae=new Set(ie);function se(t){return ae.has(t)}var le=new Set(["originX","originY","originZ"]);function ce(t){return le.has(t)}function ue(t,e){var n=e.layout,o=e.layoutId;return se(t)||ce(t)||(n||void 0!==o)&&(!!ne[t]||"opacity"===t)}var de=function(t){return null!==t&&"object"==typeof t&&t.getVelocity},he={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function fe(t){return t.startsWith("--")}var pe=function(t,e){return e&&"number"==typeof t?e.transform(t):t},me=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},ge=function(t){return t%1?Number(t.toFixed(5)):t},ve=/(-)?([\d]*\.?[\d])+/g,Ae=/(#[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,be=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function ye(t){return"string"==typeof t}var Ce=function(t){return{test:function(e){return ye(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},Se=Ce("deg"),we=Ce("%"),xe=Ce("px"),Ee=Ce("vh"),Le=Ce("vw"),_e=Object(xt.a)(Object(xt.a)({},we),{parse:function(t){return we.parse(t)/100},transform:function(t){return we.transform(100*t)}}),Oe={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},Te=Object(xt.a)(Object(xt.a)({},Oe),{transform:me(0,1)}),ke=Object(xt.a)(Object(xt.a)({},Oe),{default:1}),De=Object(xt.a)(Object(xt.a)({},Oe),{transform:Math.round}),Pe={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,size:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,rotate:Se,rotateX:Se,rotateY:Se,rotateZ:Se,scale:ke,scaleX:ke,scaleY:ke,scaleZ:ke,skew:Se,skewX:Se,skewY:Se,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:Te,originX:_e,originY:_e,originZ:xe,zIndex:De,fillOpacity:Te,strokeOpacity:Te,numOctaves:De};function Be(t,e,n,o,i,r,a,s){var l,c=t.style,u=t.vars,d=t.transform,h=t.transformKeys,f=t.transformOrigin;h.length=0;var p=!1,m=!1,g=!0;for(var v in e){var A=e[v];if(fe(v))u[v]=A;else{var b=Pe[v],y=pe(A,b);if(se(v)){if(p=!0,d[v]=y,h.push(v),!g)continue;A!==(null!==(l=b.default)&&void 0!==l?l:0)&&(g=!1)}else if(ce(v))f[v]=y,m=!0;else if((null==n?void 0:n.isHydrated)&&(null==o?void 0:o.isHydrated)&&ne[v]){var C=ne[v].process(A,o,n),S=ne[v].applyTo;if(S)for(var w=S.length,x=0;x<w;x++)c[S[x]]=C;else c[v]=C}else c[v]=y}}o&&n&&a&&s?(c.transform=a(o.deltaFinal,o.treeScale,p?d:void 0),r&&(c.transform=r(d,c.transform)),c.transformOrigin=s(o)):(p&&(c.transform=function(t,e,n,o){var i=t.transform,r=t.transformKeys,a=e.enableHardwareAcceleration,s=void 0===a||a,l=e.allowTransformNone,c=void 0===l||l,u="";r.sort(re);for(var d=!1,h=r.length,f=0;f<h;f++){var p=r[f];u+=(he[p]||p)+"("+i[p]+") ","z"===p&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),o?u=o(i,n?"":u):c&&n&&(u="none"),u}(t,i,g,r)),m&&(c.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,o=t.originY,i=void 0===o?"50%":o,r=t.originZ;return n+" "+i+" "+(void 0===r?0:r)}(f)))}var Fe=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Re(t,e,n){for(var o in e)de(e[o])||ue(o,n)||(t[o]=e[o])}function Ie(t,e,n){var o={};return Re(o,t.style||{},t),Object.assign(o,function(t,e,n){var o=t.transformTemplate;return Object(W.useMemo)((function(){var t={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};Be(t,e,void 0,void 0,{enableHardwareAcceleration:!n},o);var i=t.vars,r=t.style;return Object(xt.a)(Object(xt.a)({},i),r)}),[e])}(t,e,n)),t.transformValues&&(o=t.transformValues(o)),o}function We(t,e,n){var o={},i=Ie(t,e,n);return Boolean(t.drag)&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}var Me=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 je(t){return Me.has(t)}var ze=function(t){return!je(t)};try{var Ne=n(49).default;ze=function(t){return t.startsWith("on")?!je(t):Ne(t)}}catch(t){}function Ve(t,e,n){return"string"==typeof t?t:xe.transform(e+n*t)}var Ue=function(t,e){return xe.transform(t*e)},He={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ge={offset:"strokeDashoffset",array:"strokeDasharray"};function Qe(t,e,n,o,i,r,a,s){var l=e.attrX,c=e.attrY,u=e.originX,d=e.originY,h=e.pathLength,f=e.pathSpacing,p=void 0===f?1:f,m=e.pathOffset,g=void 0===m?0:m;Be(t,Object(xt.d)(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o,i,r,a,s),t.attrs=t.style,t.style={};var v=t.attrs,A=t.style,b=t.dimensions,y=t.totalPathLength;v.transform&&(b&&(A.transform=v.transform),delete v.transform),b&&(void 0!==u||void 0!==d||A.transform)&&(A.transformOrigin=function(t,e,n){return Ve(e,t.x,t.width)+" "+Ve(n,t.y,t.height)}(b,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==l&&(v.x=l),void 0!==c&&(v.y=c),void 0!==y&&void 0!==h&&function(t,e,n,o,i,r){void 0===o&&(o=1),void 0===i&&(i=0),void 0===r&&(r=!0);var a=r?He:Ge;t[a.offset]=Ue(-i,e);var s=Ue(n,e),l=Ue(o,e);t[a.array]=s+" "+l}(v,y,h,p,g,!1)}var Ye=function(){return Object(xt.a)(Object(xt.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Ze(t,e){var n=Object(W.useMemo)((function(){var n=Ye();return Qe(n,e,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),Object(xt.a)(Object(xt.a)({},n.attrs),{style:Object(xt.a)({},n.style)})}),[e]);if(t.style){var o={};Re(o,t.style,t),n.style=Object(xt.a)(Object(xt.a)({},o),n.style)}return n}function qe(t){void 0===t&&(t=!1);return function(e,n,o,i,r){var a=i.latestValues,s=(ee(e)?Ze:We)(n,a,r),l=function(t,e,n){var o={};for(var i in t)(ze(i)||!0===n&&je(i)||!e&&!je(i))&&(o[i]=t[i]);return o}(n,"string"==typeof e,t),c=Object(xt.a)(Object(xt.a)(Object(xt.a)({},l),s),{ref:o});return Object(W.createElement)(e,c)}}var Xe=/([a-z])([A-Z])/g,$e=function(t){return t.replace(Xe,"$1-$2").toLowerCase()};function Ke(t,e){var n=e.style,o=e.vars;for(var i in Object.assign(t.style,n),o)t.style.setProperty(i,o[i])}var Je=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function tn(t,e){for(var n in Ke(t,e),e.attrs)t.setAttribute(Je.has(n)?n:$e(n),e.attrs[n])}function en(t){var e=t.style,n={};for(var o in e)(de(e[o])||ue(o,t))&&(n[o]=e[o]);return n}function nn(t){var e=en(t);for(var n in t){if(de(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function on(t){return"object"==typeof t&&"function"==typeof t.start}var rn=function(t){return Array.isArray(t)};function an(t){var e,n=de(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n}function sn(t,e,n,o){var i=t.scrapeMotionValuesFromProps,r=t.createRenderState,a=t.onMount,s={latestValues:cn(e,n,o,i),renderState:r()};return a&&(s.mount=function(t){return a(e,t,s)}),s}var ln=function(t){return function(e,n){var o=Object(W.useContext)(Dt),i=Object(W.useContext)(Pt);return n?sn(t,e,o,i):Bt((function(){return sn(t,e,o,i)}))}};function cn(t,e,n,o){var i={},r=!1===(null==n?void 0:n.initial),a=o(t);for(var s in a)i[s]=an(a[s]);var l=t.initial,c=t.animate,u=Zt(t),d=qt(t);e&&d&&!u&&!1!==t.inherit&&(null!=l||(l=e.initial),null!=c||(c=e.animate));var h=r||!1===l?c:l;h&&"boolean"!=typeof h&&!on(h)&&(Array.isArray(h)?h:[h]).forEach((function(e){var n=Qt(t,e);if(n){var o=n.transitionEnd;n.transition;var r=Object(xt.d)(n,["transitionEnd","transition"]);for(var a in r)i[a]=r[a];for(var a in o)i[a]=o[a]}}));return i}var un={useVisualState:ln({scrapeMotionValuesFromProps:nn,createRenderState:Ye,onMount:function(t,e,n){var o=n.renderState,i=n.latestValues;try{o.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){o.dimensions={x:0,y:0,width:0,height:0}}"path"===e.tagName&&(o.totalPathLength=e.getTotalLength()),Qe(o,i,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),tn(e,o)}})};var dn,hn={useVisualState:ln({scrapeMotionValuesFromProps:en,createRenderState:Fe})};function fn(t,e,n,o){var i=e.forwardMotionProps,r=void 0!==i&&i,a=ee(t)?un:hn;return Object(xt.a)(Object(xt.a)({},a),{preloadedFeatures:n,useRender:qe(r),createVisualElement:o,Component:t})}function pn(t,e,n,o){return t.addEventListener(e,n,o),function(){return t.removeEventListener(e,n,o)}}function mn(t,e,n,o){Object(W.useEffect)((function(){var i=t.current;if(n&&i)return pn(i,e,n,o)}),[t,e,n,o])}function gn(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vn(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.Exit="exit"}(dn||(dn={}));var An={pageX:0,pageY:0};function bn(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||An;return{x:n[e+"X"],y:n[e+"Y"]}}function yn(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function Cn(t,e){return void 0===e&&(e="page"),{point:vn(t)?bn(t,e):yn(t,e)}}var Sn=function(t,e){void 0===e&&(e=!1);var n,o=function(e){return t(e,Cn(e))};return e?(n=o,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):o},wn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},xn={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function En(t){return zt&&null===window.onpointerdown?t:zt&&null===window.ontouchstart?xn[t]:zt&&null===window.onmousedown?wn[t]:t}function Ln(t,e,n,o){return pn(t,En(e),Sn(n,"pointerdown"===e),o)}function _n(t,e,n,o){return mn(t,En(e),n&&Sn(n,"pointerdown"===e),o)}function On(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var Tn=On("dragHorizontal"),kn=On("dragVertical");function Dn(t){var e=!1;if("y"===t)e=kn();else if("x"===t)e=Tn();else{var n=Tn(),o=kn();n&&o?e=function(){n(),o()}:(n&&n(),o&&o())}return e}function Pn(){var t=Dn(!0);return!t||(t(),!1)}function Bn(t,e,n){return function(o,i){var r;gn(o)&&!Pn()&&(null==n||n(o,i),null===(r=t.animationState)||void 0===r||r.setActive(dn.Hover,e))}}var Fn=function(t,e){return!!e&&(t===e||Fn(t,e.parentElement))};function Rn(t){return Object(W.useEffect)((function(){return function(){return t()}}),[])}var In=function(t,e){return function(n){return e(t(n))}},Wn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(In)};var Mn=function(t){return function(e){return t(e),null}},jn={tap:Mn((function(t){var e=t.onTap,n=t.onTapStart,o=t.onTapCancel,i=t.whileTap,r=t.visualElement,a=e||n||o||i,s=Object(W.useRef)(!1),l=Object(W.useRef)(null);function c(){var t;null===(t=l.current)||void 0===t||t.call(l),l.current=null}function u(){var t;return c(),s.current=!1,null===(t=r.animationState)||void 0===t||t.setActive(dn.Tap,!1),!Pn()}function d(t,n){u()&&(Fn(r.getInstance(),t.target)?null==e||e(t,n):null==o||o(t,n))}function h(t,e){u()&&(null==o||o(t,e))}_n(r,"pointerdown",a?function(t,e){var o;c(),s.current||(s.current=!0,l.current=Wn(Ln(window,"pointerup",d),Ln(window,"pointercancel",h)),null==n||n(t,e),null===(o=r.animationState)||void 0===o||o.setActive(dn.Tap,!0))}:void 0),Rn(c)})),focus:Mn((function(t){var e=t.whileFocus,n=t.visualElement;mn(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(dn.Focus,!0)}:void 0),mn(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(dn.Focus,!1)}:void 0)})),hover:Mn((function(t){var e=t.onHoverStart,n=t.onHoverEnd,o=t.whileHover,i=t.visualElement;_n(i,"pointerenter",e||o?Bn(i,!0,e):void 0),_n(i,"pointerleave",n||o?Bn(i,!1,n):void 0)}))};function zn(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}var Nn=function(t,e,n){return Math.min(Math.max(n,t),e)},Vn=.001;function Un(t){var e,n,o=t.duration,i=void 0===o?800:o,r=t.bounce,a=void 0===r?.25:r,s=t.velocity,l=void 0===s?0:s,c=t.mass,u=void 0===c?1:c,d=1-a;d=Nn(.05,1,d),i=Nn(.01,10,i/1e3),d<1?(e=function(t){var e=t*d,n=e*i,o=e-l,r=Hn(t,d),a=Math.exp(-n);return Vn-o/r*a},n=function(t){var n=t*d*i,o=n*l+l,r=Math.pow(d,2)*Math.pow(t,2)*i,a=Math.exp(-n),s=Hn(Math.pow(t,2),d);return(-e(t)+Vn>0?-1:1)*((o-r)*a)/s}):(e=function(t){return Math.exp(-t*i)*((t-l)*i+1)-.001},n=function(t){return Math.exp(-t*i)*(i*i*(l-t))});var h=function(t,e,n){for(var o=n,i=1;i<12;i++)o-=t(o)/e(o);return o}(e,n,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var f=Math.pow(h,2)*u;return{stiffness:f,damping:2*d*Math.sqrt(u*f),duration:i}}function Hn(t,e){return t*Math.sqrt(1-e*e)}var Gn=["duration","bounce"],Qn=["stiffness","damping","mass"];function Yn(t,e){return e.some((function(e){return void 0!==t[e]}))}function Zn(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.restSpeed,a=void 0===r?2:r,s=t.restDelta,l=Object(xt.d)(t,["from","to","restSpeed","restDelta"]),c={done:!1,value:n},u=function(t){var e=Object(xt.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Yn(t,Qn)&&Yn(t,Gn)){var n=Un(t);(e=Object(xt.a)(Object(xt.a)(Object(xt.a)({},e),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return e}(l),d=u.stiffness,h=u.damping,f=u.mass,p=u.velocity,m=u.duration,g=u.isResolvedFromDuration,v=qn,A=qn;function b(){var t=p?-p/1e3:0,e=i-n,o=h/(2*Math.sqrt(d*f)),r=Math.sqrt(d/f)/1e3;if(null!=s||(s=Math.abs(i-n)<=1?.01:.4),o<1){var a=Hn(r,o);v=function(n){var s=Math.exp(-o*r*n);return i-s*((t+o*r*e)/a*Math.sin(a*n)+e*Math.cos(a*n))},A=function(n){var i=Math.exp(-o*r*n);return o*r*i*(Math.sin(a*n)*(t+o*r*e)/a+e*Math.cos(a*n))-i*(Math.cos(a*n)*(t+o*r*e)-a*e*Math.sin(a*n))}}else if(1===o)v=function(n){return i-Math.exp(-r*n)*(e+(t+r*e)*n)};else{var l=r*Math.sqrt(o*o-1);v=function(n){var a=Math.exp(-o*r*n),s=Math.min(l*n,300);return i-a*((t+o*r*e)*Math.sinh(s)+l*e*Math.cosh(s))/l}}}return b(),{next:function(t){var e=v(t);if(g)c.done=t>=m;else{var n=1e3*A(t),o=Math.abs(n)<=a,r=Math.abs(i-e)<=s;c.done=o&&r}return c.value=c.done?i:e,c},flipTarget:function(){var t;p=-p,n=(t=[i,n])[0],i=t[1],b()}}}Zn.needsInterpolation=function(t,e){return"string"==typeof t||"string"==typeof e};var qn=function(t){return 0},Xn=function(t,e,n){var o=e-t;return 0===o?1:(n-t)/o},$n=function(t,e,n){return-n*t+n*e+t},Kn=function(t,e){return function(n){return Boolean(ye(n)&&be.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e))}},Jn=function(t,e,n){return function(o){var i;if(!ye(o))return o;var r=o.match(ve),a=r[0],s=r[1],l=r[2],c=r[3];return(i={})[t]=parseFloat(a),i[e]=parseFloat(s),i[n]=parseFloat(l),i.alpha=void 0!==c?parseFloat(c):1,i}},to=me(0,255),eo=Object(xt.a)(Object(xt.a)({},Oe),{transform:function(t){return Math.round(to(t))}}),no={test:Kn("rgb","red"),parse:Jn("red","green","blue"),transform:function(t){var e=t.red,n=t.green,o=t.blue,i=t.alpha,r=void 0===i?1:i;return"rgba("+eo.transform(e)+", "+eo.transform(n)+", "+eo.transform(o)+", "+ge(Te.transform(r))+")"}};var oo={test:Kn("#"),parse:function(t){var e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:no.transform},io={test:Kn("hsl","hue"),parse:Jn("hue","saturation","lightness"),transform:function(t){var e=t.hue,n=t.saturation,o=t.lightness,i=t.alpha,r=void 0===i?1:i;return"hsla("+Math.round(e)+", "+we.transform(ge(n))+", "+we.transform(ge(o))+", "+ge(Te.transform(r))+")"}},ro=function(t,e,n){var o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},ao=[oo,no,io],so=function(t){return ao.find((function(e){return e.test(t)}))},lo=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},co=function(t,e){var n=so(t),o=so(e);lo(t),lo(e),n.transform,o.transform;var i=n.parse(t),r=o.parse(e),a=Object(xt.a)({},i),s=n===io?$n:ro;return function(t){for(var e in a)"alpha"!==e&&(a[e]=s(i[e],r[e],t));return a.alpha=$n(i.alpha,r.alpha,t),n.transform(a)}},uo={test:function(t){return no.test(t)||oo.test(t)||io.test(t)},parse:function(t){return no.test(t)?no.parse(t):io.test(t)?io.parse(t):oo.parse(t)},transform:function(t){return ye(t)?t:t.hasOwnProperty("red")?no.transform(t):io.transform(t)}},ho="${c}",fo="${n}";function po(t){var e=[],n=0,o=t.match(Ae);o&&(n=o.length,t=t.replace(Ae,ho),e.push.apply(e,o.map(uo.parse)));var i=t.match(ve);return i&&(t=t.replace(ve,fo),e.push.apply(e,i.map(Oe.parse))),{values:e,numColors:n,tokenised:t}}function mo(t){return po(t).values}function go(t){var e=po(t),n=e.values,o=e.numColors,i=e.tokenised,r=n.length;return function(t){for(var e=i,n=0;n<r;n++)e=e.replace(n<o?ho:fo,n<o?uo.transform(t[n]):ge(t[n]));return e}}var vo=function(t){return"number"==typeof t?0:t};var Ao={test:function(t){var e,n,o,i;return isNaN(t)&&ye(t)&&(null!==(n=null===(e=t.match(ve))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(Ae))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:mo,createTransformer:go,getAnimatableNone:function(t){var e=mo(t);return go(t)(e.map(vo))}},bo=function(t){return"number"==typeof t};function yo(t,e){return bo(t)?function(n){return $n(t,e,n)}:uo.test(t)?co(t,e):xo(t,e)}var Co=function(t,e){var n=Object(xt.e)([],t),o=n.length,i=t.map((function(t,n){return yo(t,e[n])}));return function(t){for(var e=0;e<o;e++)n[e]=i[e](t);return n}},So=function(t,e){var n=Object(xt.a)(Object(xt.a)({},t),e),o={};for(var i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=yo(t[i],e[i]));return function(t){for(var e in o)n[e]=o[e](t);return n}};function wo(t){for(var e=Ao.parse(t),n=e.length,o=0,i=0,r=0,a=0;a<n;a++)o||"number"==typeof e[a]?o++:void 0!==e[a].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}var xo=function(t,e){var n=Ao.createTransformer(e),o=wo(t),i=wo(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&(o.numNumbers,i.numNumbers),Wn(Co(o.parsed,i.parsed),n)},Eo=function(t,e){return function(n){return $n(t,e,n)}};function Lo(t,e,n){for(var o,i=[],r=n||("number"==typeof(o=t[0])?Eo:"string"==typeof o?uo.test(o)?co:xo:Array.isArray(o)?Co:"object"==typeof o?So:void 0),a=t.length-1,s=0;s<a;s++){var l=r(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;l=Wn(c,l)}i.push(l)}return i}function _o(t,e,n){var o=void 0===n?{}:n,i=o.clamp,r=void 0===i||i,a=o.ease,s=o.mixer,l=t.length;e.length,!a||!Array.isArray(a)||a.length,t[0]>t[l-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=Lo(e,a,s),u=2===l?function(t,e){var n=t[0],o=t[1],i=e[0];return function(t){return i(Xn(n,o,t))}}(t,c):function(t,e){var n=t.length,o=n-1;return function(i){var r=0,a=!1;if(i<=t[0]?a=!0:i>=t[o]&&(r=o-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>i||s===o);s++);r=s-1}var l=Xn(t[r],t[r+1],i);return e[r](l)}}(t,c);return r?function(e){return u(Nn(t[0],t[l-1],e))}:u}var Oo,To=function(t){return function(e){return 1-t(1-e)}},ko=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},Do=function(t){return function(e){return e*e*((t+1)*e-t)}},Po=function(t){return t},Bo=(Oo=2,function(t){return Math.pow(t,Oo)}),Fo=To(Bo),Ro=ko(Bo),Io=function(t){return 1-Math.sin(Math.acos(t))},Wo=To(Io),Mo=ko(Wo),jo=Do(1.525),zo=To(jo),No=ko(jo),Vo=function(t){var e=Do(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),Uo=function(t){if(1===t||0===t)return t;var e=t*t;return t<.36363636363636365?7.5625*e:t<.7272727272727273?9.075*e-9.9*t+3.4:t<.9?12.066481994459833*e-19.63545706371191*t+8.898060941828255:10.8*t*t-20.52*t+10.72},Ho=To(Uo);function Go(t,e){return t.map((function(){return e||Ro})).splice(0,t.length-1)}function Qo(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.ease,a=t.offset,s=t.duration,l=void 0===s?300:s,c={done:!1,value:n},u=Array.isArray(i)?i:[n,i],d=function(t,e){return t.map((function(t){return t*e}))}(a&&a.length===u.length?a:function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(u),l);function h(){return _o(d,u,{ease:Array.isArray(r)?r:Go(u,r)})}var f=h();return{next:function(t){return c.value=f(t),c.done=t>=l,c},flipTarget:function(){u.reverse(),f=h()}}}var Yo={keyframes:Qo,spring:Zn,decay:function(t){var e=t.velocity,n=void 0===e?0:e,o=t.from,i=void 0===o?0:o,r=t.power,a=void 0===r?.8:r,s=t.timeConstant,l=void 0===s?350:s,c=t.restDelta,u=void 0===c?.5:c,d=t.modifyTarget,h={done:!1,value:i},f=a*n,p=i+f,m=void 0===d?p:d(p);return m!==p&&(f=m-i),{next:function(t){var e=-f*Math.exp(-t/l);return h.done=!(e>u||e<-u),h.value=h.done?m:m+e,h},flipTarget:function(){}}}};var Zo=1/60*1e3,qo="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Xo="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(qo())}),Zo)};var $o=!0,Ko=!1,Jo=!1,ti={delta:0,timestamp:0},ei=["read","update","preRender","render","postRender"],ni=ei.reduce((function(t,e){return t[e]=function(t){var e=[],n=[],o=0,i=!1,r=new WeakSet,a={schedule:function(t,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&i,c=l?e:n;return a&&r.add(t),-1===c.indexOf(t)&&(c.push(t),l&&i&&(o=e.length)),t},cancel:function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:function(s){var l;if(i=!0,e=(l=[n,e])[0],(n=l[1]).length=0,o=e.length)for(var c=0;c<o;c++){var u=e[c];u(s),r.has(u)&&(a.schedule(u),t())}i=!1}};return a}((function(){return Ko=!0})),t}),{}),oi=ei.reduce((function(t,e){var n=ni[e];return t[e]=function(t,e,o){return void 0===e&&(e=!1),void 0===o&&(o=!1),Ko||li(),n.schedule(t,e,o)},t}),{}),ii=ei.reduce((function(t,e){return t[e]=ni[e].cancel,t}),{}),ri=ei.reduce((function(t,e){return t[e]=function(){return ni[e].process(ti)},t}),{}),ai=function(t){return ni[t].process(ti)},si=function(t){Ko=!1,ti.delta=$o?Zo:Math.max(Math.min(t-ti.timestamp,40),1),ti.timestamp=t,Jo=!0,ei.forEach(ai),Jo=!1,Ko&&($o=!1,Xo(si))},li=function(){Ko=!0,$o=!0,Jo||Xo(si)},ci=function(){return ti},ui=oi;function di(t,e,n){return void 0===n&&(n=0),t-e-n}var hi=function(t){var e=function(e){var n=e.delta;return t(n)};return{start:function(){return ui.update(e,!0)},stop:function(){return ii.update(e)}}};function fi(t){var e,n,o,i,r,a=t.from,s=t.autoplay,l=void 0===s||s,c=t.driver,u=void 0===c?hi:c,d=t.elapsed,h=void 0===d?0:d,f=t.repeat,p=void 0===f?0:f,m=t.repeatType,g=void 0===m?"loop":m,v=t.repeatDelay,A=void 0===v?0:v,b=t.onPlay,y=t.onStop,C=t.onComplete,S=t.onRepeat,w=t.onUpdate,x=Object(xt.d)(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),E=x.to,L=0,_=x.duration,O=!1,T=!0,k=function(t){if(Array.isArray(t.to))return Qo;if(Yo[t.type])return Yo[t.type];var e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Qo:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Zn:Qo}(x);(null===(n=(e=k).needsInterpolation)||void 0===n?void 0:n.call(e,a,E))&&(r=_o([0,100],[a,E],{clamp:!1}),a=0,E=100);var D=k(Object(xt.a)(Object(xt.a)({},x),{from:a,to:E}));function P(){L++,"reverse"===g?h=function(t,e,n,o){return void 0===n&&(n=0),void 0===o&&(o=!0),o?di(e+-t,e,n):e-(t-e)+n}(h,_,A,T=L%2==0):(h=di(h,_,A),"mirror"===g&&D.flipTarget()),O=!1,S&&S()}function B(t){if(T||(t=-t),h+=t,!O){var e=D.next(Math.max(0,h));i=e.value,r&&(i=r(i)),O=T?e.done:h<=0}null==w||w(i),O&&(0===L&&(null!=_||(_=h)),L<p?function(t,e,n,o){return o?t>=e+n:t<=-n}(h,_,A,T)&&P():(o.stop(),C&&C()))}return l&&(null==b||b(),(o=u(B)).start()),{stop:function(){null==y||y(),o.stop()}}}function pi(t,e){return e?t*(1e3/e):0}var mi=function(t){return 1e3*t},gi=function(t,e){return 1-3*e+3*t},vi=function(t,e){return 3*e-6*t},Ai=function(t){return 3*t},bi=function(t,e,n){return((gi(e,n)*t+vi(e,n))*t+Ai(e))*t},yi=function(t,e,n){return 3*gi(e,n)*t*t+2*vi(e,n)*t+Ai(e)};var Ci=.1;function Si(t,e,n,o){if(t===e&&n===o)return Po;for(var i=new Float32Array(11),r=0;r<11;++r)i[r]=bi(r*Ci,t,n);function a(e){for(var o=0,r=1;10!==r&&i[r]<=e;++r)o+=Ci;--r;var a=o+(e-i[r])/(i[r+1]-i[r])*Ci,s=yi(a,t,n);return s>=.001?function(t,e,n,o){for(var i=0;i<8;++i){var r=yi(e,n,o);if(0===r)return e;e-=(bi(e,n,o)-t)/r}return e}(e,a,t,n):0===s?a:function(t,e,n,o,i){var r,a,s=0;do{(r=bi(a=e+(n-e)/2,o,i)-t)>0?n=a:e=a}while(Math.abs(r)>1e-7&&++s<10);return a}(e,o,o+Ci,t,n)}return function(t){return 0===t||1===t?t:bi(a(t),e,o)}}var wi={linear:Po,easeIn:Bo,easeInOut:Ro,easeOut:Fo,circIn:Io,circInOut:Mo,circOut:Wo,backIn:jo,backInOut:No,backOut:zo,anticipate:Vo,bounceIn:Ho,bounceInOut:function(t){return t<.5?.5*(1-Uo(1-2*t)):.5*Uo(2*t-1)+.5},bounceOut:Uo},xi=function(t){if(Array.isArray(t)){t.length;var e=Object(xt.c)(t,4);return Si(e[0],e[1],e[2],e[3])}return"string"==typeof t?wi[t]:t},Ei=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ao.test(e)||e.startsWith("url(")))},Li=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},_i=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},Oi=function(){return{type:"keyframes",ease:"linear",duration:.3}},Ti=function(t){return{type:"keyframes",duration:.8,values:t}},ki={x:Li,y:Li,z:Li,rotate:Li,rotateX:Li,rotateY:Li,rotateZ:Li,scaleX:_i,scaleY:_i,scale:_i,opacity:Oi,backgroundColor:Oi,color:Oi,default:_i},Di=new Set(["brightness","contrast","saturate","opacity"]);function Pi(t){var e=t.slice(0,-1).split("("),n=e[0],o=e[1];if("drop-shadow"===n)return t;var i=(o.match(ve)||[])[0];if(!i)return t;var r=o.replace(i,""),a=Di.has(n)?1:0;return i!==o&&(a*=100),n+"("+a+r+")"}var Bi=/([a-z-]*)\(.*?\)/g,Fi=Object(xt.a)(Object(xt.a)({},Ao),{getAnimatableNone:function(t){var e=t.match(Bi);return e?e.map(Pi).join(" "):t}}),Ri=Object(xt.a)(Object(xt.a)({},Pe),{color:uo,backgroundColor:uo,outlineColor:uo,fill:uo,stroke:uo,borderColor:uo,borderTopColor:uo,borderRightColor:uo,borderBottomColor:uo,borderLeftColor:uo,filter:Fi,WebkitFilter:Fi}),Ii=function(t){return Ri[t]};function Wi(t,e){var n,o=Ii(t);return o!==Fi&&(o=Ao),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}function Mi(t){var e=t.ease,n=t.times,o=t.yoyo,i=t.flip,r=t.loop,a=Object(xt.d)(t,["ease","times","yoyo","flip","loop"]),s=Object(xt.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=mi(a.duration)),a.repeatDelay&&(s.repeatDelay=mi(a.repeatDelay)),e&&(s.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(e)?e.map(xi):xi(e)),"tween"===a.type&&(s.type="keyframes"),(o||r||i)&&(!0,o?s.repeatType="reverse":r?s.repeatType="loop":i&&(s.repeatType="mirror"),s.repeat=r||o||i||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function ji(t,e,n){var o,i,r,a;return Array.isArray(e.to)&&(null!==(o=t.duration)&&void 0!==o||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=Object(xt.e)([],Object(xt.c)(t.to)),t.to[0]=t.from)}(e),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var e=Object(xt.d)(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object(xt.a)(Object(xt.a)({},t),(i=n,r=e.to,a=rn(r)?Ti:ki[i]||ki.default,Object(xt.a)({to:r},a(r))))),Object(xt.a)(Object(xt.a)({},e),Mi(t))}function zi(t,e,n,o,i){var r,a=Ui(o,t),s=null!==(r=a.from)&&void 0!==r?r:e.get(),l=Ei(t,n);"none"===s&&l&&"string"==typeof n?s=Wi(t,n):Ni(s)&&"string"==typeof n?s=Vi(n):!Array.isArray(n)&&Ni(n)&&"string"==typeof s&&(n=Vi(s));var c=Ei(t,s);return c&&l&&!1!==a.type?function(){var o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:function(t){return e.set(t)}};return"inertia"===a.type||"decay"===a.type?function(t){var e,n=t.from,o=void 0===n?0:n,i=t.velocity,r=void 0===i?0:i,a=t.min,s=t.max,l=t.power,c=void 0===l?.8:l,u=t.timeConstant,d=void 0===u?750:u,h=t.bounceStiffness,f=void 0===h?500:h,p=t.bounceDamping,m=void 0===p?10:p,g=t.restDelta,v=void 0===g?1:g,A=t.modifyTarget,b=t.driver,y=t.onUpdate,C=t.onComplete;function S(t){return void 0!==a&&t<a||void 0!==s&&t>s}function w(t){return void 0===a?s:void 0===s||Math.abs(a-t)<Math.abs(s-t)?a:s}function x(t){null==e||e.stop(),e=fi(Object(xt.a)(Object(xt.a)({},t),{driver:b,onUpdate:function(e){var n;null==y||y(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:C}))}function E(t){x(Object(xt.a)({type:"spring",stiffness:f,damping:m,restDelta:v},t))}if(S(o))E({from:o,velocity:r,to:w(o)});else{var L=c*r+o;"undefined"!=typeof A&&(L=A(L));var _,O,T=w(L),k=T===a?-1:1;x({type:"decay",from:o,velocity:r,timeConstant:d,power:c,restDelta:v,modifyTarget:A,onUpdate:S(L)?function(t){_=O,O=t,r=pi(t-_,ci().delta),(1===k&&t>T||-1===k&&t<T)&&E({from:t,to:T,velocity:r})}:void 0})}return{stop:function(){return null==e?void 0:e.stop()}}}(Object(xt.a)(Object(xt.a)({},o),a)):fi(Object(xt.a)(Object(xt.a)({},ji(a,o,t)),{onUpdate:function(t){var e;o.onUpdate(t),null===(e=a.onUpdate)||void 0===e||e.call(a,t)},onComplete:function(){var t;o.onComplete(),null===(t=a.onComplete)||void 0===t||t.call(a)}}))}:function(){var t;return e.set(n),i(),null===(t=null==a?void 0:a.onComplete)||void 0===t||t.call(a),{stop:function(){}}}}function Ni(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Vi(t){return"number"==typeof t?0:Wi("",t)}function Ui(t,e){return t[e]||t.default||t}function Hi(t,e,n,o){return void 0===o&&(o={}),e.start((function(i){var r,a,s=zi(t,e,n,o,i),l=function(t,e){var n;return null!==(n=(Ui(t,e)||{}).delay)&&void 0!==n?n:0}(o,t),c=function(){return a=s()};return l?r=setTimeout(c,mi(l)):c(),function(){clearTimeout(r),null==a||a.stop()}}))}function Gi(t,e){-1===t.indexOf(e)&&t.push(e)}function Qi(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Yi=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e=this;return Gi(this.subscriptions,t),function(){return Qi(e.subscriptions,t)}},t.prototype.notify=function(t,e,n){var o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(var i=0;i<o;i++){var r=this.subscriptions[i];r&&r(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Zi=function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Yi,this.velocityUpdateSubscribers=new Yi,this.renderSubscribers=new Yi,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var o=ci(),i=o.delta,r=o.timestamp;n.lastUpdated!==r&&(n.timeDelta=i,n.lastUpdated=r,ui.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),e&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return ui.postRender(n.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,e){void 0===e&&(e=!0),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?pi(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var e=this;return this.stop(),new Promise((function(n){e.hasAnimated=!0,e.stopAnimation=t(n)})).then((function(){return e.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function qi(t){return new Zi(t)}var Xi=function(t){return function(e){return e.test(t)}},$i=[Oe,xe,we,Se,Le,Ee,{test:function(t){return"auto"===t},parse:function(t){return t}}],Ki=function(t){return $i.find(Xi(t))},Ji=Object(xt.e)(Object(xt.e)([],Object(xt.c)($i)),[uo,Ao]),tr=function(t){return Ji.find(Xi(t))};function er(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,qi(n))}function nr(t,e){var n=Yt(t,e),o=n?t.makeTargetAnimatable(n,!1):{},i=o.transitionEnd,r=void 0===i?{}:i;o.transition;var a,s=Object(xt.d)(o,["transitionEnd","transition"]);for(var l in s=Object(xt.a)(Object(xt.a)({},s),r)){er(t,l,(a=s[l],rn(a)?a[a.length-1]||0:a))}}function or(t,e){if(e)return(e[t]||e.default||e).from}function ir(t,e,n){var o;void 0===n&&(n={});var i=Yt(t,e,n.custom),r=(i||{}).transition,a=void 0===r?t.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=i?function(){return rr(t,i,n)}:function(){return Promise.resolve()},l=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?function(o){void 0===o&&(o=0);var i=a.delayChildren,r=void 0===i?0:i,s=a.staggerChildren,l=a.staggerDirection;return function(t,e,n,o,i,r){void 0===n&&(n=0);void 0===o&&(o=0);void 0===i&&(i=1);var a=[],s=(t.variantChildren.size-1)*o,l=1===i?function(t){return void 0===t&&(t=0),t*o}:function(t){return void 0===t&&(t=0),s-t*o};return Array.from(t.variantChildren).sort(ar).forEach((function(t,o){a.push(ir(t,e,Object(xt.a)(Object(xt.a)({},r),{delay:n+l(o)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(a)}(t,e,r+o,s,l,n)}:function(){return Promise.resolve()},c=a.when;if(c){var u=Object(xt.c)("beforeChildren"===c?[s,l]:[l,s],2),d=u[0],h=u[1];return d().then(h)}return Promise.all([s(),l(n.delay)])}function rr(t,e,n){var o,i=void 0===n?{}:n,r=i.delay,a=void 0===r?0:r,s=i.transitionOverride,l=i.type,c=t.makeTargetAnimatable(e),u=c.transition,d=void 0===u?t.getDefaultTransition():u,h=c.transitionEnd,f=Object(xt.d)(c,["transition","transitionEnd"]);s&&(d=s);var p=[],m=l&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[l]);for(var g in f){var v=t.getValue(g),A=f[g];if(!(!v||void 0===A||m&&sr(m,g))){var b=Hi(g,v,A,Object(xt.a)({delay:a},d));p.push(b)}}return Promise.all(p).then((function(){h&&nr(t,h)}))}function ar(t,e){return t.sortNodePosition(e)}function sr(t,e){var n=t.protectedKeys,o=t.needsAnimating,i=n.hasOwnProperty(e)&&!0!==o[e];return o[e]=!1,i}var lr=[dn.Animate,dn.Hover,dn.Tap,dn.Drag,dn.Focus,dn.Exit],cr=Object(xt.e)([],Object(xt.c)(lr)).reverse(),ur=lr.length;function dr(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,o=e.options;return function(t,e,n){var o;if(void 0===n&&(n={}),t.notifyAnimationStart(),Array.isArray(e)){var i=e.map((function(e){return ir(t,e,n)}));o=Promise.all(i)}else if("string"==typeof e)o=ir(t,e,n);else{var r="function"==typeof e?Yt(t,e,n.custom):e;o=rr(t,r,n)}return o.then((function(){return t.notifyAnimationComplete(e)}))}(t,n,o)})))}}function hr(t){var e,n=dr(t),o=((e={})[dn.Animate]=fr(!0),e[dn.Hover]=fr(),e[dn.Tap]=fr(),e[dn.Drag]=fr(),e[dn.Focus]=fr(),e[dn.Exit]=fr(),e),i={},r=!0,a=function(e,n){var o=Yt(t,n);if(o){o.transition;var i=o.transitionEnd,r=Object(xt.d)(o,["transition","transitionEnd"]);e=Object(xt.a)(Object(xt.a)(Object(xt.a)({},e),r),i)}return e};function s(e,s){for(var l,c=t.getProps(),u=t.getVariantContext(!0)||{},d=[],h=new Set,f={},p=1/0,m=function(n){var i=cr[n],m=o[i],g=null!==(l=c[i])&&void 0!==l?l:u[i],v=Gt(g),A=i===s?m.isActive:null;!1===A&&(p=n);var b=g===u[i]&&g!==c[i]&&v;if(b&&r&&t.manuallyAnimateOnMount&&(b=!1),m.protectedKeys=Object(xt.a)({},f),!m.isActive&&null===A||!g&&!m.prevProp||on(g)||"boolean"==typeof g)return"continue";var y=function(t,e){if("string"==typeof e)return e!==t;if(Ht(e))return!zn(e,t);return!1}(m.prevProp,g)||i===s&&m.isActive&&!b&&v||n>p&&v,C=Array.isArray(g)?g:[g],S=C.reduce(a,{});!1===A&&(S={});var w=m.prevResolvedValues,x=void 0===w?{}:w,E=Object(xt.a)(Object(xt.a)({},x),S),L=function(t){y=!0,h.delete(t),m.needsAnimating[t]=!0};for(var _ in E){var O=S[_],T=x[_];f.hasOwnProperty(_)||(O!==T?rn(O)&&rn(T)?zn(O,T)?m.protectedKeys[_]=!0:L(_):void 0!==O?L(_):h.add(_):void 0!==O&&h.has(_)?L(_):m.protectedKeys[_]=!0)}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(f=Object(xt.a)(Object(xt.a)({},f),S)),r&&t.blockInitialAnimation&&(y=!1),y&&!b&&d.push.apply(d,Object(xt.e)([],Object(xt.c)(C.map((function(t){return{animation:t,options:Object(xt.a)({type:i},e)}})))))},g=0;g<ur;g++)m(g);if(i=Object(xt.a)({},f),h.size){var v={};h.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(v[e]=n)})),d.push({animation:v})}var A=Boolean(d.length);return r&&!1===c.initial&&!t.manuallyAnimateOnMount&&(A=!1),r=!1,A?n(d):Promise.resolve()}return{isAnimated:function(t){return void 0!==i[t]},animateChanges:s,setActive:function(e,n,i){var r;return o[e].isActive===n?Promise.resolve():(null===(r=t.variantChildren)||void 0===r||r.forEach((function(t){var o;return null===(o=t.animationState)||void 0===o?void 0:o.setActive(e,n)})),o[e].isActive=n,s(i,e))},setAnimateFunction:function(e){n=e(t)},getState:function(){return o}}}function fr(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var pr={animation:Mn((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=hr(e)),on(n)&&Object(W.useEffect)((function(){return n.subscribe(e)}),[n])})),exit:Mn((function(t){var e=t.custom,n=t.visualElement,o=Object(xt.c)(Ft(),2),i=o[0],r=o[1],a=Object(W.useContext)(Pt);Object(W.useEffect)((function(){var t,o,s=null===(t=n.animationState)||void 0===t?void 0:t.setActive(dn.Exit,!i,{custom:null!==(o=null==a?void 0:a.custom)&&void 0!==o?o:e});!i&&(null==s||s.then(r))}),[i])}))},mr=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},gr=function(t){return mr(t)&&t.hasOwnProperty("z")},vr=function(t,e){return Math.abs(t-e)};function Ar(t,e){if(bo(t)&&bo(e))return vr(t,e);if(mr(t)&&mr(e)){var n=vr(t.x,e.x),o=vr(t.y,e.y),i=gr(t)&&gr(e)?vr(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}var br=function(){function t(t,e,n){var o=this,i=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(o.lastMoveEvent&&o.lastMoveEventInfo){var t=Sr(o.lastMoveEventInfo,o.history),e=null!==o.startEvent,n=Ar(t.offset,{x:0,y:0})>=3;if(e||n){var i=t.point,r=ci().timestamp;o.history.push(Object(xt.a)(Object(xt.a)({},i),{timestamp:r}));var a=o.handlers,s=a.onStart,l=a.onMove;e||(s&&s(o.lastMoveEvent,t),o.startEvent=o.lastMoveEvent),l&&l(o.lastMoveEvent,t)}}},this.handlePointerMove=function(t,e){o.lastMoveEvent=t,o.lastMoveEventInfo=yr(e,o.transformPagePoint),gn(t)&&0===t.buttons?o.handlePointerUp(t,e):ui.update(o.updatePoint,!0)},this.handlePointerUp=function(t,e){o.end();var n=o.handlers,i=n.onEnd,r=n.onSessionEnd,a=Sr(yr(e,o.transformPagePoint),o.history);o.startEvent&&i&&i(t,a),r&&r(t,a)},!(vn(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=i;var r=yr(Cn(t),this.transformPagePoint),a=r.point,s=ci().timestamp;this.history=[Object(xt.a)(Object(xt.a)({},a),{timestamp:s})];var l=e.onSessionStart;l&&l(t,Sr(r,this.history)),this.removeListeners=Wn(Ln(window,"pointermove",this.handlePointerMove),Ln(window,"pointerup",this.handlePointerUp),Ln(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),ii.update(this.updatePoint)},t}();function yr(t,e){return e?{point:e(t.point)}:t}function Cr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Sr(t,e){var n=t.point;return{point:n,delta:Cr(n,xr(e)),offset:Cr(n,wr(e)),velocity:Er(e,.1)}}function wr(t){return t[0]}function xr(t){return t[t.length-1]}function Er(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,o=null,i=xr(t);n>=0&&(o=t[n],!(i.timestamp-o.timestamp>mi(e)));)n--;if(!o)return{x:0,y:0};var r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Lr(t){return t}function _r(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}var Or={translate:0,scale:1,origin:0,originPoint:0};function Tr(){return{x:Object(xt.a)({},Or),y:Object(xt.a)({},Or)}}function kr(t){return[t("x"),t("y")]}function Dr(t,e,n){var o=e.min,i=e.max;return void 0!==o&&t<o?t=n?$n(o,t,n.min):Math.max(t,o):void 0!==i&&t>i&&(t=n?$n(i,t,n.max):Math.min(t,i)),t}function Pr(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Br(t,e){var n,o=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&(o=(n=Object(xt.c)([i,o],2))[0],i=n[1]),{min:t.min+o,max:t.min+i}}function Fr(t,e,n){return{min:Rr(t,e),max:Rr(t,n)}}function Rr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function Ir(t,e){return _r(function(t,e){var n=t.top,o=t.left,i=t.bottom,r=t.right;void 0===e&&(e=Lr);var a=e({x:o,y:n}),s=e({x:r,y:i});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}function Wr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),Ar(t,e)<n}function Mr(t){return t.max-t.min}function jr(t,e){var n=.5,o=Mr(t),i=Mr(e);return i>o?n=Xn(e.min,e.max-o,t.min):o>i&&(n=Xn(t.min,t.max-i,e.min)),Nn(0,1,n)}function zr(t,e,n,o){void 0===o&&(o=.5),t.origin=o,t.originPoint=$n(e.min,e.max,t.origin),t.scale=Mr(n)/Mr(e),Wr(t.scale,1,1e-4)&&(t.scale=1),t.translate=$n(n.min,n.max,t.origin)-t.originPoint,Wr(t.translate)&&(t.translate=0)}function Nr(t,e,n,o){zr(t.x,e.x,n.x,Vr(o.originX)),zr(t.y,e.y,n.y,Vr(o.originY))}function Vr(t){return"number"==typeof t?t:.5}function Ur(t,e,n){t.min=n.min+e.min,t.max=t.min+Mr(e)}var Hr=function(t,e){return t.depth-e.depth};function Gr(t){return t.projection.isEnabled||t.shouldResetTransform()}function Qr(t,e){void 0===e&&(e=[]);var n=t.parent;return n&&Qr(n,e),Gr(t)&&e.push(t),e}function Yr(t){if(!t.shouldResetTransform()){var e,n=t.getLayoutState();t.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=t.measureViewportBox(),n.layoutCorrected=(e=n.layout,{x:Object(xt.a)({},e.x),y:Object(xt.a)({},e.y)}),t.notifyLayoutMeasure(n.layout,t.prevViewportBox||n.layout),ui.update((function(){return t.rebaseProjectionTarget()}))}}function Zr(t,e){return{min:e.min-t.min,max:e.max-t.min}}function qr(t,e){return{x:Zr(t.x,e.x),y:Zr(t.y,e.y)}}function Xr(t,e){var n=t.getLayoutId(),o=e.getLayoutId();return n!==o||void 0===o&&t!==e}function $r(t){var e=t.getProps(),n=e.drag,o=e._dragX;return n&&!o}function Kr(t,e){t.min=e.min,t.max=e.max}function Jr(t,e,n){return n+e*(t-n)}function ta(t,e,n,o,i){return void 0!==i&&(t=Jr(t,i,o)),Jr(t,n,o)+e}function ea(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),t.min=ta(t.min,e,n,o,i),t.max=ta(t.max,e,n,o,i)}function na(t,e){var n=e.x,o=e.y;ea(t.x,n.translate,n.scale,n.originPoint),ea(t.y,o.translate,o.scale,o.originPoint)}function oa(t,e,n,o){var i=Object(xt.c)(o,3),r=i[0],a=i[1],s=i[2];t.min=e.min,t.max=e.max;var l=void 0!==n[s]?n[s]:.5,c=$n(e.min,e.max,l);ea(t,n[r],n[a],c,n.scale)}var ia=["x","scaleX","originX"],ra=["y","scaleY","originY"];function aa(t,e,n){oa(t.x,e.x,n,ia),oa(t.y,e.y,n,ra)}function sa(t,e,n,o,i){return t=Jr(t-=e,1/n,o),void 0!==i&&(t=Jr(t,1/i,o)),t}function la(t,e,n){var o=Object(xt.c)(n,3),i=o[0],r=o[1],a=o[2];!function(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),void 0===o&&(o=.5);var r=$n(t.min,t.max,o)-e;t.min=sa(t.min,e,n,r,i),t.max=sa(t.max,e,n,r,i)}(t,e[i],e[r],e[a],e.scale)}function ca(t,e){la(t.x,e,ia),la(t.y,e,ra)}var ua=new Set;function da(t,e,n){t[n]||(t[n]=[]),t[n].push(e)}function ha(t){return ua.add(t),function(){return ua.delete(t)}}function fa(){if(ua.size){var t=0,e=[[]],n=[],o=function(n){return da(e,n,t)},i=function(e){da(n,e,t),t++};ua.forEach((function(e){e(o,i),t=0})),ua.clear();for(var r=n.length,a=0;a<=r;a++)e[a]&&e[a].forEach(ma),n[a]&&n[a].forEach(ma)}}var pa,ma=function(t){return t()},ga=new WeakMap,va=function(){function t(t){var e=t.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=e,this.visualElement.enableLayoutProjection(),ga.set(e,this)}return t.prototype.start=function(t,e){var n=this,o=void 0===e?{}:e,i=o.snapToCursor,r=void 0!==i&&i,a=o.cursorProgress,s=this.props.transformPagePoint;this.panSession=new br(t,{onSessionStart:function(t){var e;n.stopMotion();var o=function(t){return Cn(t,"client")}(t).point;null===(e=n.cancelLayout)||void 0===e||e.call(n),n.cancelLayout=ha((function(t,e){var i=Qr(n.visualElement),s=function(t){var e=[],n=function(t){Gr(t)&&e.push(t),t.children.forEach(n)};return t.children.forEach(n),e.sort(Hr)}(n.visualElement),l=Object(xt.e)(Object(xt.e)([],Object(xt.c)(i)),Object(xt.c)(s)),c=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),e((function(){l.forEach((function(t){return t.resetTransform()}))})),t((function(){Yr(n.visualElement),s.forEach(Yr)})),e((function(){l.forEach((function(t){return t.restoreTransform()})),r&&(c=n.snapToCursor(o))})),t((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var t=n.visualElement.projection;kr((function(e){if(!c){var i=t.target[e],r=i.min,s=i.max;n.cursorProgress[e]=a?a[e]:Xn(r,s,o[e])}var l=n.getAxisMotionValue(e);l&&(n.originPoint[e]=l.get())}))})),e((function(){ri.update(),ri.preRender(),ri.render(),ri.postRender()})),t((function(){return n.resolveDragConstraints()}))}))},onStart:function(t,e){var o,i,r,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Dn(s),n.openGlobalLock))&&(fa(),n.isDragging=!0,n.currentDirection=null,null===(i=(o=n.props).onDragStart)||void 0===i||i.call(o,t,e),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(dn.Drag,!0))},onMove:function(t,e){var o,i,r,a,s=n.props,l=s.dragPropagation,c=s.dragDirectionLock;if(l||n.openGlobalLock){var u=e.offset;if(c&&null===n.currentDirection)return n.currentDirection=function(t,e){void 0===e&&(e=10);var n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(u),void(null!==n.currentDirection&&(null===(i=(o=n.props).onDirectionLock)||void 0===i||i.call(o,n.currentDirection)));n.updateAxis("x",e.point,u),n.updateAxis("y",e.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,t,e),pa=t}},onSessionEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:s})},t.prototype.resolveDragConstraints=function(){var t=this,e=this.props,n=e.dragConstraints,o=e.dragElastic,i=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Ut(n)?this.resolveRefConstraints(i,n):function(t,e){var n=e.top,o=e.left,i=e.bottom,r=e.right;return{x:Pr(t.x,o,r),y:Pr(t.y,n,i)}}(i,n)),this.elastic=function(t){return!1===t?t=0:!0===t&&(t=.35),{x:Fr(t,"left","right"),y:Fr(t,"top","bottom")}}(o),this.constraints&&!this.hasMutatedConstraints&&kr((function(e){t.getAxisMotionValue(e)&&(t.constraints[e]=function(t,e){var n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i[e],t.constraints[e]))}))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,o=n.onMeasureDragConstraints,i=n.transformPagePoint,r=e.current;this.constraintsBox=Ir(r,i);var a=function(t,e){return{x:Br(t.x,e.x),y:Br(t.y,e.y)}}(t,this.constraintsBox);if(o){var s=o(function(t){var e=t.x,n=t.y;return{top:n.min,bottom:n.max,left:e.min,right:e.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=_r(s))}return a},t.prototype.cancelDrag=function(){var t,e;this.visualElement.unlockProjectionTarget(),null===(t=this.cancelLayout)||void 0===t||t.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(dn.Drag,!1)},t.prototype.stop=function(t,e){var n,o,i;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=e.velocity;this.animateDragEnd(a),null===(i=(o=this.props).onDragEnd)||void 0===i||i.call(o,t,e)}},t.prototype.snapToCursor=function(t){var e=this;return kr((function(n){if(Aa(n,e.props.drag,e.currentDirection)){var o=e.getAxisMotionValue(n);if(!o)return e.cursorProgress[n]=.5,!0;var i=e.visualElement.getLayoutState().layout,r=i[n].max-i[n].min,a=i[n].min+r/2,s=t[n]-a;e.originPoint[n]=t[n],o.set(s)}})).includes(!0)},t.prototype.updateAxis=function(t,e,n){if(Aa(t,this.props.drag,this.currentDirection))return this.getAxisMotionValue(t)?this.updateAxisMotionValue(t,n):this.updateVisualElementAxis(t,e)},t.prototype.updateAxisMotionValue=function(t,e){var n=this.getAxisMotionValue(t);if(e&&n){var o=this.originPoint[t]+e[t],i=this.constraints?Dr(o,this.constraints[t],this.elastic[t]):o;n.set(i)}},t.prototype.updateVisualElementAxis=function(t,e){var n,o=this.visualElement.getLayoutState().layout[t],i=o.max-o.min,r=this.cursorProgress[t],a=function(t,e,n,o,i){var r=t-e*n;return o?Dr(r,o,i):r}(e[t],i,r,null===(n=this.constraints)||void 0===n?void 0:n[t],this.elastic[t]);this.visualElement.setProjectionTargetAxis(t,a,a+i)},t.prototype.setProps=function(t){var e=t.drag,n=void 0!==e&&e,o=t.dragDirectionLock,i=void 0!==o&&o,r=t.dragPropagation,a=void 0!==r&&r,s=t.dragConstraints,l=void 0!==s&&s,c=t.dragElastic,u=void 0===c?.35:c,d=t.dragMomentum,h=void 0===d||d,f=Object(xt.d)(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(xt.a)({drag:n,dragDirectionLock:i,dragPropagation:a,dragConstraints:l,dragElastic:u,dragMomentum:h},f)},t.prototype.getAxisMotionValue=function(t){var e=this.props,n=e.layout,o=e.layoutId,i="_drag"+t.toUpperCase();return this.props[i]?this.props[i]:n||void 0!==o?void 0:this.visualElement.getValue(t,0)},t.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},t.prototype.isExternalDrag=function(){var t=this.props,e=t._dragX,n=t._dragY;return e||n},t.prototype.animateDragEnd=function(t){var e=this,n=this.props,o=n.drag,i=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(t,e){void 0===e&&(e=!0);var n,o=t.getProjectionParent();return!!o&&(e?ca(n=qr(o.projection.target,t.projection.target),o.getLatestValues()):n=qr(o.getLayoutState().layout,t.getLayoutState().layout),kr((function(e){return t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var c=this.visualElement.getProjectionParent();if(c){var u=qr(c.projection.targetFinal,l);kr((function(t){var e=u[t],n=e.min,o=e.max;l[t]={min:isNaN(n)?void 0:n,max:isNaN(o)?void 0:o}}))}}var d=kr((function(n){var c;if(Aa(n,o,e.currentDirection)){var u=null!==(c=null==l?void 0:l[n])&&void 0!==c?c:{},d=r?200:1e6,h=r?40:1e7,f=Object(xt.a)(Object(xt.a)({type:"inertia",velocity:i?t[n]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},a),u);return e.getAxisMotionValue(n)?e.startAxisValueAnimation(n,f):e.visualElement.startLayoutAnimation(n,f,s)}}));return Promise.all(d).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){var t=this;kr((function(e){var n=t.getAxisMotionValue(e);n?n.stop():t.visualElement.stopLayoutAnimation()}))},t.prototype.startAxisValueAnimation=function(t,e){var n=this.getAxisMotionValue(t);if(n){var o=n.get();return n.set(o),n.set(o),Hi(t,n,0,e)}},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag;if(Ut(e.dragConstraints)&&this.constraintsBox){this.stopMotion();var o={x:0,y:0};kr((function(e){o[e]=jr(t.visualElement.projection.target[e],t.constraintsBox[e])})),this.updateConstraints((function(){kr((function(e){if(Aa(e,n,null)){var i=function(t,e,n){var o=t.max-t.min,i=$n(e.min,e.max-o,n);return{min:i,max:i+o}}(t.visualElement.projection.target[e],t.constraintsBox[e],o[e]),r=i.min,a=i.max;t.visualElement.setProjectionTargetAxis(e,r,a)}}))})),setTimeout(fa,1)}},t.prototype.updateConstraints=function(t){var e=this;this.cancelLayout=ha((function(n,o){var i=Qr(e.visualElement);o((function(){return i.forEach((function(t){return t.resetTransform()}))})),n((function(){return Yr(e.visualElement)})),o((function(){return i.forEach((function(t){return t.restoreTransform()}))})),n((function(){e.resolveDragConstraints()})),t&&o(t)}))},t.prototype.mount=function(t){var e=this,n=Ln(t.getInstance(),"pointerdown",(function(t){var n=e.props,o=n.drag,i=n.dragListener;o&&(void 0===i||i)&&e.start(t)})),o=pn(window,"resize",(function(){e.scalePoint()})),i=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),r=t.prevDragCursor;return r&&this.start(pa,{cursorProgress:r}),function(){null==n||n(),null==o||o(),null==i||i(),e.cancelDrag()}},t}();function Aa(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var ba,ya,Ca={pan:Mn((function(t){var e=t.onPan,n=t.onPanStart,o=t.onPanEnd,i=t.onPanSessionStart,r=t.visualElement,a=e||n||o||i,s=Object(W.useRef)(null),l=Object(W.useContext)(kt).transformPagePoint,c={onSessionStart:i,onStart:n,onMove:e,onEnd:function(t,e){s.current=null,o&&o(t,e)}};Object(W.useEffect)((function(){null!==s.current&&s.current.updateHandlers(c)})),_n(r,"pointerdown",a&&function(t){s.current=new br(t,c,{transformPagePoint:l})}),Rn((function(){return s.current&&s.current.end()}))})),drag:Mn((function(t){var e=t.dragControls,n=t.visualElement,o=Object(W.useContext)(kt).transformPagePoint,i=Bt((function(){return new va({visualElement:n})}));i.setProps(Object(xt.a)(Object(xt.a)({},t),{transformPagePoint:o})),Object(W.useEffect)((function(){return e&&e.subscribe(i)}),[i]),Object(W.useEffect)((function(){return i.mount(n)}),[])}))};function Sa(t){return"string"==typeof t&&t.startsWith("var(--")}!function(t){t[t.Entering=0]="Entering",t[t.Present=1]="Present",t[t.Exiting=2]="Exiting"}(ba||(ba={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(ya||(ya={}));var wa=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function xa(t,e,n){void 0===n&&(n=1);var o=Object(xt.c)(function(t){var e=wa.exec(t);if(!e)return[,];var n=Object(xt.c)(e,3);return[n[1],n[2]]}(t),2),i=o[0],r=o[1];if(i){var a=window.getComputedStyle(e).getPropertyValue(i);return a?a.trim():Sa(r)?xa(r,e,n+1):r}}function Ea(t,e){return t/(e.max-e.min)*100}var La="_$css";var _a={process:function(t,e,n){var o=n.target;if("string"==typeof t){if(!xe.test(t))return t;t=parseFloat(t)}return Ea(t,o.x)+"% "+Ea(t,o.y)+"%"}},Oa={borderRadius:Object(xt.a)(Object(xt.a)({},_a),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:_a,borderTopRightRadius:_a,borderBottomLeftRadius:_a,borderBottomRightRadius:_a,boxShadow:{process:function(t,e){var n=e.delta,o=e.treeScale,i=t,r=t.includes("var("),a=[];r&&(t=t.replace(wa,(function(t){return a.push(t),La})));var s=Ao.parse(t);if(s.length>5)return i;var l=Ao.createTransformer(t),c="number"!=typeof s[0]?1:0,u=n.x.scale*o.x,d=n.y.scale*o.y;s[0+c]/=u,s[1+c]/=d;var h=$n(u,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=h),"number"==typeof s[3+c]&&(s[3+c]/=h);var f=l(s);if(r){var p=0;f=f.replace(La,(function(){var t=a[p];return p++,t}))}return f}}},Ta=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},e.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},e.isAnimating={x:!1,y:!1},e.stopAxisAnimation={x:void 0,y:void 0},e.isAnimatingTree=!1,e.animate=function(t,n,o){void 0===o&&(o={});var i=o.originBox,r=o.targetBox,a=o.visibilityAction,s=o.shouldStackAnimate,l=o.onComplete,c=o.prevParent,u=Object(xt.d)(o,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=e.props,h=d.visualElement,f=d.layout;if(!1===s)return e.isAnimatingTree=!1,e.safeToRemove();if(!e.isAnimatingTree||!0===s){s&&(e.isAnimatingTree=!0),n=i||n,t=r||t;var p=!1,m=h.getProjectionParent();if(m){var g=m.prevViewportBox,v=m.getLayoutState().layout;c&&(r&&(v=c.getLayoutState().layout),i&&!Xr(c,m)&&c.prevViewportBox&&(g=c.prevViewportBox)),g&&Ra(c,i,r)&&(p=!0,n=qr(g,n),t=qr(v,t))}var A=ka(n,t),b=kr((function(o){var i,r;if("position"===f){var s=t[o].max-t[o].min;n[o].max=n[o].min+s}if(!h.projection.isTargetLocked)return void 0===a?A?e.animateAxis(o,t[o],n[o],Object(xt.a)(Object(xt.a)({},u),{isRelative:p})):(null===(r=(i=e.stopAxisAnimation)[o])||void 0===r||r.call(i),h.setProjectionTargetAxis(o,t[o].min,t[o].max,p)):void h.setVisibility(a===ya.Show)}));return h.syncRender(),Promise.all(b).then((function(){e.isAnimatingTree=!1,l&&l(),h.notifyLayoutAnimationComplete()}))}},e}return Object(xt.b)(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.visualElement;e.animateMotionValue=Hi,e.enableLayoutProjection(),this.unsubLayoutReady=e.onLayoutUpdate(this.animate),e.layoutSafeToRemove=function(){return t.safeToRemove()},function(t){for(var e in t)ne[e]=t[e]}(Oa)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),kr((function(e){var n,o;return null===(o=(n=t.stopAxisAnimation)[e])||void 0===o?void 0:o.call(n)}))},e.prototype.animateAxis=function(t,e,n,o){var i,r,a=this,s=void 0===o?{}:o,l=s.transition,c=s.isRelative;if(!this.isAnimating[t]||!Ba(e,this.currentAnimationTarget[t])){null===(r=(i=this.stopAxisAnimation)[t])||void 0===r||r.call(i),this.isAnimating[t]=!0;var u=this.props.visualElement,d=this.frameTarget[t],h=u.getProjectionAnimationProgress()[t];h.clearListeners(),h.set(0),h.set(0);var f=function(){var o=h.get()/1e3;!function(t,e,n,o){t.min=$n(e.min,n.min,o),t.max=$n(e.max,n.max,o)}(d,n,e,o),u.setProjectionTargetAxis(t,d.min,d.max,c)};f();var p=h.onChange(f);this.stopAxisAnimation[t]=function(){a.isAnimating[t]=!1,h.stop(),p()},this.currentAnimationTarget[t]=e;var m=l||u.getDefaultTransition()||Fa;return Hi("x"===t?"layoutX":"layoutY",h,1e3,m&&Ui(m,"layout")).then(this.stopAxisAnimation[t])}},e.prototype.safeToRemove=function(){var t,e;null===(e=(t=this.props).safeToRemove)||void 0===e||e.call(t)},e.prototype.render=function(){return null},e}(W.Component);function ka(t,e){return!(Pa(t)||Pa(e)||Ba(t.x,e.x)&&Ba(t.y,e.y))}var Da={min:0,max:0};function Pa(t){return Ba(t.x,Da)&&Ba(t.y,Da)}function Ba(t,e){return t.min===e.min&&t.max===e.max}var Fa={duration:.45,ease:[.4,0,.1,1]};function Ra(t,e,n){return t||!t&&!(e||n)}var Ia={layoutReady:function(t){return t.notifyLayoutReady()}};function Wa(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?Ia:e,o=n.layoutReady,i=n.parent;ha((function(e,n){var r=Array.from(t).sort(Hr),a=i?Qr(i):[];n((function(){Object(xt.e)(Object(xt.e)([],Object(xt.c)(a)),Object(xt.c)(r)).forEach((function(t){return t.resetTransform()}))})),e((function(){r.forEach(Yr)})),n((function(){a.forEach((function(t){return t.restoreTransform()})),r.forEach(o)})),e((function(){r.forEach((function(t){t.isPresent&&(t.presence=ba.Present)}))})),n((function(){ri.preRender(),ri.render()})),e((function(){ui.postRender((function(){return r.forEach(Ma)})),t.clear()}))})),fa()}}}function Ma(t){t.prevViewportBox=t.projection.target}var ja=Object(W.createContext)(Wa()),za=Object(W.createContext)(Wa());function Na(t){return!!t.forceUpdate}var Va=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(xt.b)(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.framerSyncLayout,o=t.visualElement;Na(e)&&e.register(o),Na(n)&&n.register(o),o.onUnmount((function(){Na(e)&&e.remove(o),Na(n)&&n.remove(o)}))},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Na(e)?e.syncUpdate():(!function(t){t.shouldResetTransform()||(t.prevViewportBox=t.measureViewportBox(!1),t.rebaseProjectionTarget(!1,t.prevViewportBox))}(n),e.add(n)),null},e.prototype.componentDidUpdate=function(){var t=this.props.syncLayout;Na(t)||t.flush()},e.prototype.render=function(){return null},e}(W.default.Component);var Ua={measureLayout:function(t){var e=Object(W.useContext)(ja),n=Object(W.useContext)(za);return W.default.createElement(Va,Object(xt.a)({},t,{syncLayout:e,framerSyncLayout:n}))},layoutAnimation:function(t){var e=Object(xt.c)(Ft(),2)[1];return W.createElement(Ta,Object(xt.a)({},t,{safeToRemove:e}))}};function Ha(){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:Tr(),deltaFinal:Tr(),deltaTransform:""}}var Ga=Ha();function Qa(t,e,n){var o=t.x,i=t.y,r="translate3d("+o.translate/e.x+"px, "+i.translate/e.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),l&&(r+="rotateY("+l+") ")}return r+="scale("+o.scale+", "+i.scale+")",n||r!==Za?r:""}function Ya(t){var e=t.deltaFinal;return 100*e.x.origin+"% "+100*e.y.origin+"% 0"}var Za=Qa(Ga.delta,Ga.treeScale,{x:1,y:1}),qa=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Xa(t,e,n,o){var i,r,a=t.delta,s=t.layout,l=t.layoutCorrected,c=t.treeScale,u=e.target;r=s,Kr((i=l).x,r.x),Kr(i.y,r.y),function(t,e,n){var o=n.length;if(o){var i,r;e.x=e.y=1;for(var a=0;a<o;a++)r=(i=n[a]).getLayoutState().delta,e.x*=r.x.scale,e.y*=r.y.scale,na(t,r),$r(i)&&aa(t,t,i.getLatestValues())}}(l,c,n),Nr(a,l,u,o)}var $a=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(t){Gi(this.children,t),this.isDirty=!0},t.prototype.remove=function(t){Qi(this.children,t),this.isDirty=!0},t.prototype.forEach=function(t){this.isDirty&&this.children.sort(Hr),this.isDirty=!1,this.children.forEach(t)},t}();var Ka=function(t){var e=t.treeType,n=void 0===e?"":e,o=t.build,i=t.getBaseTarget,r=t.makeTargetAnimatable,a=t.measureViewportBox,s=t.render,l=t.readValueFromInstance,c=t.resetTransform,u=t.restoreTransform,d=t.removeValueFromRenderState,h=t.sortNodePosition,f=t.scrapeMotionValuesFromProps;return function(t,e){var p=t.parent,m=t.props,g=t.presenceId,v=t.blockInitialAnimation,A=t.visualState;void 0===e&&(e={});var b,y,C,S,w,x,E=A.latestValues,L=A.renderState,_=function(){var t=qa.map((function(){return new Yi})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){return qa.forEach((function(o){var i;null===(i=e[o])||void 0===i||i.call(e);var r="on"+o,a=t[r];a&&(e[o]=n[r](a))}))}};return t.forEach((function(t,e){n["on"+qa[e]]=function(e){return t.add(e)},n["notify"+qa[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,Object(xt.e)([],Object(xt.c)(e)))}})),n}(),O={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},T=O,k=E,D=Ha(),P=!1,B=new Map,F=new Map,R={},I=Object(xt.a)({},E);function W(){b&&(Q.isProjectionReady()&&(aa(T.targetFinal,T.target,k),Nr(D.deltaFinal,D.layoutCorrected,T.targetFinal,E)),M(),s(b,L))}function M(){var t=E;if(S&&S.isActive()){var n=S.getCrossfadeState(Q);n&&(t=n)}o(Q,L,t,T,D,e,m)}function j(){_.notifyUpdate(E)}function z(){Q.layoutTree.forEach(ts)}var N=f(m);for(var V in N){var U=N[V];void 0!==E[V]&&de(U)&&U.set(E[V],!1)}var H=Zt(m),G=qt(m),Q=Object(xt.a)(Object(xt.a)({treeType:n,current:null,depth:p?p.depth+1:0,parent:p,children:new Set,path:p?Object(xt.e)(Object(xt.e)([],Object(xt.c)(p.path)),[p]):[],layoutTree:p?p.layoutTree:new $a,presenceId:g,projection:O,variantChildren:G?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==p?void 0:p.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(b)},mount:function(t){b=Q.current=t,Q.pointTo(Q),G&&p&&!H&&(x=null==p?void 0:p.addVariantChild(Q)),null==p||p.children.add(Q)},unmount:function(){ii.update(j),ii.render(W),ii.preRender(Q.updateLayoutProjection),F.forEach((function(t){return t()})),Q.stopLayoutAnimation(),Q.layoutTree.remove(Q),null==x||x(),null==p||p.children.delete(Q),null==C||C(),_.clearAllListeners()},addVariantChild:function(t){var e,n=Q.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return h&&n===t.treeType?h(Q.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return G?Q:null==p?void 0:p.getClosestVariantNode()},scheduleUpdateLayoutProjection:p?p.scheduleUpdateLayoutProjection:function(){return ui.preRender(Q.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return m.layoutId},getInstance:function(){return b},getStaticValue:function(t){return E[t]},setStaticValue:function(t,e){return E[t]=e},getLatestValues:function(){return E},setVisibility:function(t){Q.isVisible!==t&&(Q.isVisible=t,Q.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),r(Q,t,m,e)},addValue:function(t,e){Q.hasValue(t)&&Q.removeValue(t),B.set(t,e),E[t]=e.get(),function(t,e){var n=e.onChange((function(e){E[t]=e,m.onUpdate&&ui.update(j,!1,!0)})),o=e.onRenderRequest(Q.scheduleRender);F.set(t,(function(){n(),o()}))}(t,e)},removeValue:function(t){var e;B.delete(t),null===(e=F.get(t))||void 0===e||e(),F.delete(t),delete E[t],d(t,L)},hasValue:function(t){return B.has(t)},getValue:function(t,e){var n=B.get(t);return void 0===n&&void 0!==e&&(n=qi(e),Q.addValue(t,n)),n},forEachValue:function(t){return B.forEach(t)},readValue:function(t){var n;return null!==(n=E[t])&&void 0!==n?n:l(b,t,e)},setBaseTarget:function(t,e){I[t]=e},getBaseTarget:function(t){if(i){var e=i(m,t);if(void 0!==e&&!de(e))return e}return I[t]}},_),{build:function(){return M(),L},scheduleRender:function(){ui.render(W,!1,!0)},syncRender:W,setProps:function(t){m=t,_.updatePropListeners(t),R=function(t,e,n){var o;for(var i in e){var r=e[i],a=n[i];if(de(r))t.addValue(i,r);else if(de(a))t.addValue(i,qi(r));else if(a!==r)if(t.hasValue(i)){var s=t.getValue(i);!s.hasAnimated&&s.set(r)}else t.addValue(i,qi(null!==(o=t.getStaticValue(i))&&void 0!==o?o:r))}for(var i in n)void 0===e[i]&&t.removeValue(i);return e}(Q,f(m),R)},getProps:function(){return m},getVariant:function(t){var e;return null===(e=m.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return m.transition},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==p?void 0:p.getVariantContext();if(!H){var e=(null==p?void 0:p.getVariantContext())||{};return void 0!==m.initial&&(e.initial=m.initial),e}for(var n={},o=0;o<os;o++){var i=ns[o],r=m[i];(Gt(r)||!1===r)&&(n[i]=r)}return n},enableLayoutProjection:function(){O.isEnabled=!0,Q.layoutTree.add(Q)},lockProjectionTarget:function(){O.isTargetLocked=!0},unlockProjectionTarget:function(){Q.stopLayoutAnimation(),O.isTargetLocked=!1},getLayoutState:function(){return D},setCrossfader:function(t){S=t},isProjectionReady:function(){return O.isEnabled&&O.isHydrated&&D.isHydrated},startLayoutAnimation:function(t,e,n){void 0===n&&(n=!1);var o=Q.getProjectionAnimationProgress()[t],i=n?O.relativeTarget[t]:O.target[t],r=i.min,a=i.max-r;return o.clearListeners(),o.set(r),o.set(r),o.onChange((function(e){Q.setProjectionTargetAxis(t,e,e+a,n)})),Q.animateMotionValue(t,o,0,e)},stopLayoutAnimation:function(){kr((function(t){return Q.getProjectionAnimationProgress()[t].stop()}))},measureViewportBox:function(t){void 0===t&&(t=!0);var n=a(b,e);return t||ca(n,E),n},getProjectionAnimationProgress:function(){return w||(w={x:qi(0),y:qi(0)}),w},setProjectionTargetAxis:function(t,e,n,o){var i;void 0===o&&(o=!1),o?(O.relativeTarget||(O.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),i=O.relativeTarget[t]):(O.relativeTarget=void 0,i=O.target[t]),O.isHydrated=!0,i.min=e,i.max=n,P=!0,_.notifySetAxisTarget()},rebaseProjectionTarget:function(t,e){void 0===e&&(e=D.layout);var n=Q.getProjectionAnimationProgress(),o=n.x,i=n.y,r=!(O.relativeTarget||O.isTargetLocked||o.isAnimating()||i.isAnimating());(t||r)&&kr((function(t){var n=e[t],o=n.min,i=n.max;Q.setProjectionTargetAxis(t,o,i)}))},notifyLayoutReady:function(t){!function(t){var e=t.getProjectionParent();if(e){var n=qr(e.getLayoutState().layout,t.getLayoutState().layout);kr((function(e){t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)}))}else t.rebaseProjectionTarget()}(Q),Q.notifyLayoutUpdate(D.layout,Q.prevViewportBox||D.layout,t)},resetTransform:function(){return c(Q,b,m)},restoreTransform:function(){return u(b,L)},updateLayoutProjection:function(){if(Q.isProjectionReady()){var t=D.delta,e=D.treeScale,n=e.x,o=e.y,i=D.deltaTransform;Xa(D,T,Q.path,E),P&&Q.notifyViewportBoxUpdate(T.target,t),P=!1;var r=Qa(t,e);r===i&&n===e.x&&o===e.y||Q.scheduleRender(),D.deltaTransform=r}},updateTreeLayoutProjection:function(){Q.layoutTree.forEach(Ja),ui.preRender(z,!1,!0)},getProjectionParent:function(){if(void 0===y){for(var t=!1,e=Q.path.length-1;e>=0;e--){var n=Q.path[e];if(n.projection.isEnabled){t=n;break}}y=t}return y},resolveRelativeTargetBox:function(){var t=Q.getProjectionParent();if(O.relativeTarget&&t&&(function(t,e){Ur(t.target.x,t.relativeTarget.x,e.target.x),Ur(t.target.y,t.relativeTarget.y,e.target.y)}(O,t.projection),$r(t))){var e=O.target;aa(e,e,t.getLatestValues())}},shouldResetTransform:function(){return Boolean(m._layoutResetTransform)},pointTo:function(t){T=t.projection,k=t.getLatestValues(),null==C||C(),C=Wn(t.onSetAxisTarget(Q.scheduleUpdateLayoutProjection),t.onLayoutAnimationComplete((function(){var t;Q.isPresent?Q.presence=ba.Present:null===(t=Q.layoutSafeToRemove)||void 0===t||t.call(Q)})))},isPresent:!0,presence:ba.Entering});return Q}};function Ja(t){t.resolveRelativeTargetBox()}function ts(t){t.updateLayoutProjection()}var es,ns=Object(xt.e)(["initial"],Object(xt.c)(lr)),os=ns.length,is=new Set(["width","height","top","left","right","bottom","x","y"]),rs=function(t){return is.has(t)},as=function(t,e){t.set(e,!1),t.set(e)},ss=function(t){return t===Oe||t===xe};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(es||(es={}));var ls=function(t,e){return parseFloat(t.split(", ")[e])},cs=function(t,e){return function(n,o){var i=o.transform;if("none"===i||!i)return 0;var r=i.match(/^matrix3d\((.+)\)$/);if(r)return ls(r[1],e);var a=i.match(/^matrix\((.+)\)$/);return a?ls(a[1],t):0}},us=new Set(["x","y","z"]),ds=ie.filter((function(t){return!us.has(t)}));var hs={width:function(t){var e=t.x;return e.max-e.min},height:function(t){var e=t.y;return e.max-e.min},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.y,o=e.top;return parseFloat(o)+(n.max-n.min)},right:function(t,e){var n=t.x,o=e.left;return parseFloat(o)+(n.max-n.min)},x:cs(4,13),y:cs(5,14)},fs=function(t,e,n,o){void 0===n&&(n={}),void 0===o&&(o={}),e=Object(xt.a)({},e),o=Object(xt.a)({},o);var i=Object.keys(e).filter(rs),r=[],a=!1,s=[];if(i.forEach((function(i){var l=t.getValue(i);if(t.hasValue(i)){var c,u=n[i],d=e[i],h=Ki(u);if(rn(d))for(var f=d.length,p=null===d[0]?1:0;p<f;p++)c?Ki(d[p]):(c=Ki(d[p]))===h||ss(h)&&ss(c);else c=Ki(d);if(h!==c)if(ss(h)&&ss(c)){var m=l.get();"string"==typeof m&&l.set(parseFloat(m)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&c===xe&&(e[i]=d.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==c?void 0:c.transform)&&(0===u||0===d)?0===u?l.set(c.transform(u)):e[i]=h.transform(d):(a||(r=function(t){var e=[];return ds.forEach((function(n){var o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),a=!0),s.push(i),o[i]=void 0!==o[i]?o[i]:e[i],as(l,d))}})),s.length){var l=function(t,e,n){var o=e.measureViewportBox(),i=e.getInstance(),r=getComputedStyle(i),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&e.setStaticValue("display",t.display||"block"),e.syncRender();var l=e.measureViewportBox();return n.forEach((function(n){var i=e.getValue(n);as(i,hs[n](o,s)),t[n]=hs[n](l,r)})),t}(e,t,s);return r.length&&r.forEach((function(e){var n=Object(xt.c)(e,2),o=n[0],i=n[1];t.getValue(o).set(i)})),t.syncRender(),{target:l,transitionEnd:o}}return{target:e,transitionEnd:o}};function ps(t,e,n,o){return function(t){return Object.keys(t).some(rs)}(e)?fs(t,e,n,o):{target:e,transitionEnd:o}}var ms=function(t,e,n,o){var i=function(t,e,n){var o,i=Object(xt.d)(e,[]),r=t.getInstance();if(!(r instanceof HTMLElement))return{target:i,transitionEnd:n};for(var a in n&&(n=Object(xt.a)({},n)),t.forEachValue((function(t){var e=t.get();if(Sa(e)){var n=xa(e,r);n&&t.set(n)}})),i){var s=i[a];if(Sa(s)){var l=xa(s,r);l&&(i[a]=l,n&&(null!==(o=n[a])&&void 0!==o||(n[a]=s)))}}return{target:i,transitionEnd:n}}(t,e,o);return ps(t,e=i.target,n,o=i.transitionEnd)};var gs={treeType:"dom",readValueFromInstance:function(t,e){if(se(e)){var n=Ii(e);return n&&n.default||0}var o,i=(o=t,window.getComputedStyle(o));return(fe(e)?i.getPropertyValue(e):i[e])||0},sortNodePosition:function(t,e){return 2&t.compareDocumentPosition(e)?1:-1},getBaseTarget:function(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:function(t,e){return Ir(t,e.transformPagePoint)},resetTransform:function(t,e,n){var o=n.transformTemplate;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,o=e.style;delete n[t],delete o[t]},makeTargetAnimatable:function(t,e,n,o){var i=n.transformValues;void 0===o&&(o=!0);var r=e.transition,a=e.transitionEnd,s=Object(xt.d)(e,["transition","transitionEnd"]),l=function(t,e,n){var o,i,r={};for(var a in t)r[a]=null!==(o=or(a,e))&&void 0!==o?o:null===(i=n.getValue(a))||void 0===i?void 0:i.get();return r}(s,r||{},t);if(i&&(a&&(a=i(a)),s&&(s=i(s)),l&&(l=i(l))),o){!function(t,e,n){var o,i,r,a,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),l=s.length;if(l)for(var c=0;c<l;c++){var u=s[c],d=e[u],h=null;Array.isArray(d)&&(h=d[0]),null===h&&(h=null!==(i=null!==(o=n[u])&&void 0!==o?o:t.readValue(u))&&void 0!==i?i:e[u]),null!=h&&("string"==typeof h&&/^\-?\d*\.?\d+$/.test(h)?h=parseFloat(h):!tr(h)&&Ao.test(d)&&(h=Wi(u,d)),t.addValue(u,qi(h)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=h),t.setBaseTarget(u,h))}}(t,s,l);var c=ms(t,s,l,a);a=c.transitionEnd,s=c.target}return Object(xt.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:en,build:function(t,e,n,o,i,r,a){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden");var s=o.isEnabled&&i.isHydrated;Be(e,n,o,i,r,a.transformTemplate,s?Qa:void 0,s?Ya:void 0)},render:Ke},vs=Ka(gs),As=Ka(Object(xt.a)(Object(xt.a)({},gs),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return se(e)?(null===(n=Ii(e))||void 0===n?void 0:n.default)||0:(e=Je.has(e)?e:$e(e),t.getAttribute(e))},scrapeMotionValuesFromProps:nn,build:function(t,e,n,o,i,r,a){var s=o.isEnabled&&i.isHydrated;Qe(e,n,o,i,r,a.transformTemplate,s?Qa:void 0,s?Ya:void 0)},render:tn})),bs=function(t,e){return ee(t)?As(e,{enableHardwareAcceleration:!1}):vs(e,{enableHardwareAcceleration:!0})},ys=Object(xt.a)(Object(xt.a)(Object(xt.a)(Object(xt.a)({},pr),jn),Ca),Ua),Cs=Jt((function(t,e){return fn(t,e,ys,bs)}));class Ss{constructor(t){this.highlighted=!1,this.code=t,this.points=[]}}var ws=n(6);class xs{static now(){return Date.now()}}function Es(t){var e=Bt((function(){return qi(t)}));if(Object(W.useContext)(kt).isStatic){var n=Object(xt.c)(Object(W.useState)(t),2)[1];Object(W.useEffect)((function(){return e.onChange(n)}),[])}return e}var Ls=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function _s(t,e){var n=Es(e()),o=function(){return n.set(e())};return o(),function(t,e){Object(W.useEffect)((function(){var n=t.map((function(t){return t.onChange(e)}));return function(){return n.forEach((function(t){return t()}))}}))}(t,(function(){return ui.update(o,!1,!0)})),n}function Os(t,e,n,o){var i="function"==typeof e?e:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),o=n?0:-1,i=t[0+o],r=t[1+o],a=t[2+o],s=t[3+o],l=_o(r,a,Object(xt.a)({mixer:Ls(a[0])},s));return n?l(i):l}(e,n,o);return Array.isArray(t)?Ts(t,i):Ts([t],(function(t){var e=Object(xt.c)(t,1)[0];return i(e)}))}function Ts(t,e){var n=Bt((function(){return[]}));return _s(t,(function(){n.length=0;for(var o=t.length,i=0;i<o;i++)n[i]=t[i].get();return e(n)}))}function ks(t,e,n){void 0===n&&(n={});var o=de(t)?t:qi(t);return Hi("",o,e,n),{stop:function(){return o.stop()}}}var Ds=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class Ps extends W.default.Component{constructor(t){super(t),this.state={element:t.element}}update(t){this.setState({element:t})}style(t){this.customStyle=t,this.forceUpdate()}render(){var t,e,n,o,i,r,a,s,l;const c=this.state.element,u=this.props.configuration.style;!c.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(c);const d=null!==(e=null===(t=this.customStyle)||void 0===t?void 0:t.fillColor)&&void 0!==e?e:c.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,h=null!==(o=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==o?o:c.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,f=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.strokeWidth)&&void 0!==r?r:c.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,p=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:c.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,m=null!==(l=this.props.animateToPoints)&&void 0!==l?l:c.points;return W.default.createElement(Bs,{points:m,onClick:()=>{this.props.onClick&&this.props.onClick(c)},fill:d,stroke:h,strokeWidth:f,cornerRadius:p})}}function Bs(t){var{points:e,cornerRadius:n}=t,o=Ds(t,["points","cornerRadius"]);const i=[e[0].x,e[0].y,e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y],r=i.map(Es),a=Os(r,(([t,e,o,i,r,a,s,l])=>{const c=[{x:t,y:e},{x:o,y:i},{x:r,y:a},{x:s,y:l}];return ws.a.toSvgPathStringWithRoundedCorners(c,n)}));return Object(W.useEffect)((()=>{const t=[];for(let e=0;e<i.length;e++)t.push(ks(r[e],i[e]));return()=>{t.forEach((t=>t.stop()))}}),[e]),W.default.createElement(Cs.path,Object.assign({d:a},o))}class Fs extends W.default.Component{constructor(t){super(t),this.state={polygonElements:[]}}update(t,e,n,o){const i=[];(class{static keepOnlyCenterMostDuplicate(t,e){const n=new Map;t.forEach((t=>{const e=At(t),o=n.get(e);o?o.push(t):n.set(e,[t])})),n.forEach(((e,o)=>{e.length<2?n.delete(o):e.forEach(((e,n)=>{t.splice(t.indexOf(e),1)}))})),n.forEach(((n,o)=>{const i=t=>{let e={x:0,y:0};return t.forEach((t=>{e.x+=t.x,e.y+=t.y})),e.x/=t.length,e.y/=t.length,e},r=e.width/2,a=n.reduce(((t,e)=>{const n=i(t.quad),o=i(e.quad);return Math.abs(r-n.x)<Math.abs(r-o.x)?t:e}));t.push(a)}))}}).keepOnlyCenterMostDuplicate(o,n),o.forEach((o=>{const r=new Ss(o);r.points=void 0===t?ws.a.scaleListToHtmlElement(o.quad,n,e.video):o.quad.map((e=>{const o=new ws.a(e.x,e.y);return o.x*=t.width/n.width,o.y*=t.height/n.height,o.y+=t.y,o.x+=t.x,o})),r.points.forEach((t=>{e.state.mirrored&&this.container&&(t.x=this.container.clientWidth-t.x)})),i.push(r)}));const r=[];this.state.polygonElements.forEach((t=>{const e=i.find((e=>vt(e.code,t.element.code)));let n=!1;void 0===e?t.updatedAt+1e3<xs.now()&&(n=!0):(t.element=e,t.polygon=W.default.createElement(Ps,{key:At(t.element.code),ref:e=>t.polygonRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)}),t.label=W.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:At(t.element.code),ref:e=>t.labelRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)})),t.updatedAt=xs.now()),n||r.push(t)})),i.forEach((t=>{if(void 0===this.state.polygonElements.find((e=>vt(e.element.code,t.code)))){let e,n;const o=W.default.createElement(Ps,{key:At(t.code),ref:o=>{e=o,void 0!==n&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),i=W.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:At(t.code),ref:o=>{n=o,void 0!==e&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)})),a={element:t,polygon:o,label:i,polygonRef:e,labelRef:n,updatedAt:xs.now()};r.push(a)}})),this.setState({polygonElements:r})}onPolygonClick(t){var e,n,o,i;t.highlighted=!t.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((e=>{var n;const o=e.labelRef,i=e.label.props.element;o&&vt(i.code,t.code)&&(o.update(t),null===(n=e.polygonRef)||void 0===n||n.update(t))})),t.highlighted&&(null===(n=(e=this.props).onPolygonSelected)||void 0===n||n.call(e,t.code)),null===(i=(o=this.props).onPolygonClick)||void 0===i||i.call(o,t.code)}render(){var t,e;return W.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:t=>this.container=t},W.default.createElement(Cs.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((t=>t.polygon))),null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((t=>t.label)))}}var Rs=n(37),Is=n.n(Rs),Ws=n(40),Ms={insert:"head",singleton:!1},js=(Is()(Ws.a,Ms),Ws.a.locals,n(27)),zs=n.n(js);class Ns{constructor(t){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=t}setDuration(t){const e=Date.now()/1e3,n=e-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const o=-t*this.t;this.element&&(this.element.style.animationDuration=`${t}s`,this.element.style.animationDelay=`${o}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=e,this.lastDuration=t}}class Vs extends W.default.Component{constructor(){super(...arguments),this.inner1=new Ns("scanbot-shutter-rotate"),this.inner2=new Ns("scanbot-shutter-rotate")}render(){return W.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(t){"searching"==t?(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,W.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:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==t||"manual"==t,"scanbot-shutter-fade-out":"searching"==t||"capturing"==t,"scanbot-shutter-pulse-fast":"processing"==t},W.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},W.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},W.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")),(t=>{this.inner1.element=t}))}captureSearchingInner2(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},W.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")),(t=>{this.inner2.element=t}))}path(t){return W.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n){return W.default.createElement("div",{className:zs()(t),ref:n},W.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}class Us extends W.default.Component{render(){return W.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},W.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_919_23088)"},W.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 Hs extends W.default.Component{render(){return W.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},W.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_919_23102)"},W.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 Gs extends W.default.Component{constructor(t){super(t),this.state={barcodes:void 0}}update(t){this.setState({barcodes:t})}didScan(){return void 0!==this.state.barcodes}render(){var t,e;return W.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:St.ScanbotPrimary}},W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},W.default.createElement(Us,null),W.default.createElement("div",{style:{backgroundColor:St.Orange,color:St.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(e=null===(t=this.state.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)),W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},W.default.createElement(Vs,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},W.default.createElement("div",{style:{fontSize:13,color:St.White,marginRight:10}},"Scan More"),W.default.createElement(Hs,null)))}}class Qs extends W.default.Component{render(){const t=ws.a.centerOf(this.props.points),e=ws.a.smallerSizeOfQuad(this.props.points)/40;return W.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:t.x-20,top:t.y-20,transform:`scale(${e})`}},W.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},W.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_910_20901)"},W.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),W.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 Ys=n(10);class Zs extends W.default.Component{constructor(t){super(t),this.state={elements:[],imageSize:Ys.a.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const o=new Ss(n);o.points=ws.a.scaleListToHtmlElement(n.quad,t.originalImageSize,this.image),e.push(o)})),this.setState({imageSize:Ys.a.fromHtmlElement(this.image),elements:e})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:W.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}},W.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),W.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>W.default.createElement(Qs,{key:e,points:t.points})))))}}class qs extends W.default.Component{render(){if(!this.props.visible)return null;const t=mt.a.svg`
31
+ `;var a=e=>o.default.createElement(r,{viewBox:"0 0 50 50"},o.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:e.color||"black"})),s=n(27),l=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class c{}class u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d extends o.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:i.a.instance).bridge}dispose(){const{container:e}=this.props;e&&Object(o.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 l(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:o.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},o.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 i}));var o=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class i extends Error{constructor(e,t,n){super(t),this.name="",this.name=e,this.message=t,this.webApiError=n}static mediaDevicesUndefined(){return new i(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 i(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 i(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 i(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",e)}static unknown(e){return new i(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 o(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?i.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===e.name?i.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:i.unknown(null==e?void 0:e.message)}}i.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},i.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 i}));var o=n(40);class i extends o.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)}}i.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},i.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},i.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,i.DEFAULT_ACCEPTED_ANGLE_SCORE=75,i.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(e,t,n){"use strict";n.r(t),n.d(t,"SingleScanningMode",(function(){return v})),n.d(t,"Resolution",(function(){return C})),n.d(t,"CameraConfiguration",(function(){return b})),n.d(t,"TopBarConfiguration",(function(){return A.a})),n.d(t,"ActionBarConfiguration",(function(){return S})),n.d(t,"BarcodeUseCase",(function(){return y})),n.d(t,"Palette",(function(){return h.f})),n.d(t,"StyledText",(function(){return h.j})),n.d(t,"IconStyle",(function(){return h.e})),n.d(t,"PolygonStyle",(function(){return h.g})),n.d(t,"BackgroundStyle",(function(){return h.a})),n.d(t,"ForegroundStyle",(function(){return h.d})),n.d(t,"RoundButton",(function(){return h.h})),n.d(t,"BadgedButton",(function(){return h.b})),n.d(t,"ButtonConfiguration",(function(){return h.c})),n.d(t,"Sound",(function(){return h.i})),n.d(t,"Vibration",(function(){return h.l})),n.d(t,"Timeouts",(function(){return h.k})),n.d(t,"ViewFinderConfiguration",(function(){return P})),n.d(t,"FinderStyle",(function(){return D})),n.d(t,"FinderCorneredStyle",(function(){return _})),n.d(t,"FinderStrokedStyle",(function(){return R})),n.d(t,"UserGuidanceConfiguration",(function(){return F.a})),n.d(t,"BarcodeItemErrorState",(function(){return f})),n.d(t,"BarcodeMappedData",(function(){return p})),n.d(t,"BarcodeInfoMapping",(function(){return g})),n.d(t,"ExpectedBarcode",(function(){return k})),n.d(t,"FindAndPickScanningMode",(function(){return O})),n.d(t,"BarcodeTextLocalization",(function(){return M})),n.d(t,"BarcodeRecognizerConfiguration",(function(){return W})),n.d(t,"ArOverlayPolygonConfiguration",(function(){return d.c})),n.d(t,"BarcodeItemConfiguration",(function(){return d.e})),n.d(t,"BadgeStyle",(function(){return d.d})),n.d(t,"ArOverlayGeneralConfiguration",(function(){return d.b})),n.d(t,"FindAndPickArOverlayPolygonConfiguration",(function(){return d.f})),n.d(t,"FindAndPickBadgeConfiguration",(function(){return d.g})),n.d(t,"ArOverlayFindAndPickConfiguration",(function(){return d.a})),n.d(t,"BarcodeScannerConfiguration",(function(){return V})),n.d(t,"BarcodeScannerUIItem",(function(){return j})),n.d(t,"BarcodeScannerUIResult",(function(){return H})),n.d(t,"OcrResult",(function(){return U.OcrResult})),n.d(t,"FieldValidationStatusValues",(function(){return U.FieldValidationStatusValues})),n.d(t,"FieldDataFormatValues",(function(){return U.FieldDataFormatValues})),n.d(t,"FieldParsedData",(function(){return U.FieldParsedData})),n.d(t,"FieldType",(function(){return U.FieldType})),n.d(t,"Field",(function(){return U.Field})),n.d(t,"GenericDocumentType",(function(){return U.GenericDocumentType})),n.d(t,"GenericDocument",(function(){return U.GenericDocument})),n.d(t,"Sheet",(function(){return w})),n.d(t,"SwipeToDelete",(function(){return E})),n.d(t,"ManualCountEditDialog",(function(){return x})),n.d(t,"SheetContent",(function(){return B})),n.d(t,"MultipleScanningMode",(function(){return I})),n.d(t,"ScanbotAlertDialog",(function(){return T})),n.d(t,"CameraPermissionScreen",(function(){return N})),n.d(t,"BarcodeItem",(function(){return z.BarcodeItem})),n.d(t,"AcknowledgementBottomBar",(function(){return Y})),n.d(t,"AcknowledgementScreenConfiguration",(function(){return X})),n.d(t,"ShutterButton",(function(){return le})),n.d(t,"PreviewButton",(function(){return te})),n.d(t,"ScanAssistanceOverlay",(function(){return ce})),n.d(t,"PagePreviewMode",(function(){return ue})),n.d(t,"TextButtonMode",(function(){return de})),n.d(t,"NoButtonMode",(function(){return he})),n.d(t,"CameraBottomBar",(function(){return me})),n.d(t,"PageSnapFeedbackMode",(function(){return ne})),n.d(t,"PageSnapFunnelAnimation",(function(){return fe})),n.d(t,"PageSnapCheckMarkAnimation",(function(){return pe})),n.d(t,"PageSnapFeedbackNone",(function(){return ge})),n.d(t,"CaptureFeedback",(function(){return ve})),n.d(t,"DocumentPolygonConfiguration",(function(){return Ce})),n.d(t,"SelectCameraMenu",(function(){return be})),n.d(t,"CameraScreenConfiguration",(function(){return ye})),n.d(t,"CroppingBottomBar",(function(){return Ae})),n.d(t,"CroppingScreenConfiguration",(function(){return Se})),n.d(t,"DocumentScannerCameraConfiguration",(function(){return q})),n.d(t,"DocumentScannerOutputSettings",(function(){return Ee})),n.d(t,"DocumentScannerScreens",(function(){return ke})),n.d(t,"DocumentScannerTextLocalization",(function(){return Oe})),n.d(t,"UserGuidanceStates",(function(){return J})),n.d(t,"DocumentScannerUserGuidance",(function(){return $})),n.d(t,"DocumentFlowAppearanceConfiguration",(function(){return De})),n.d(t,"DocumentScanningFlow",(function(){return Le})),n.d(t,"IntroListEntry",(function(){return oe.g})),n.d(t,"IntroImage",(function(){return oe.f})),n.d(t,"NoIntroImage",(function(){return oe.j})),n.d(t,"ReceiptsIntroImage",(function(){return oe.k})),n.d(t,"MedicalCertificateIntroImage",(function(){return oe.i})),n.d(t,"DocumentIntroImage",(function(){return oe.d})),n.d(t,"CheckIntroImage",(function(){return oe.a})),n.d(t,"IdCardIntroImage",(function(){return oe.e})),n.d(t,"CreditCardIntroImage",(function(){return oe.b})),n.d(t,"CustomImage",(function(){return oe.c})),n.d(t,"IntroductionScreenConfiguration",(function(){return oe.h})),n.d(t,"ReviewBottomBarConfiguration",(function(){return xe})),n.d(t,"ReviewMorePopupMenu",(function(){return Be})),n.d(t,"ZoomOverlay",(function(){return Ie})),n.d(t,"ReviewScreenConfiguration",(function(){return Te})),n.d(t,"CommonActionBarConfiguration",(function(){return s})),n.d(t,"CommonCameraConfiguration",(function(){return l})),n.d(t,"CommonCameraPermission",(function(){return i})),n.d(t,"CommonCommon",(function(){return Z})),n.d(t,"CommonNavigationBarConfiguration",(function(){return c})),n.d(t,"CommonScanbotAlertDialog",(function(){return r})),n.d(t,"CommonTopBarConfiguration",(function(){return u})),n.d(t,"CommonUserGuidanceConfiguration",(function(){return o})),n.d(t,"CommonViewFinderConfiguration",(function(){return a}));var o={};n.r(o),n.d(o,"UserGuidanceConfiguration",(function(){return G})),n.d(o,"IconUserGuidanceConfiguration",(function(){return Q}));var i={};n.r(i),n.d(i,"CameraPermissionScreen",(function(){return K}));var r={};n.r(r),n.d(r,"ScanbotAlertDialog",(function(){return ie}));var a={};n.r(a),n.d(a,"ViewFinderConfiguration",(function(){return re})),n.d(a,"FinderStyle",(function(){return ee})),n.d(a,"FinderCorneredStyle",(function(){return ae})),n.d(a,"FinderStrokedStyle",(function(){return se}));var s={};n.r(s),n.d(s,"ActionBarConfiguration",(function(){return Pe}));var l={};n.r(l),n.d(l,"Resolution",(function(){return _e})),n.d(l,"CameraConfiguration",(function(){return Re}));var c={};n.r(c);var u={};n.r(u),n.d(u,"TopBarConfiguration",(function(){return Fe}));var d=n(10),h=n(3),m=n(6);class f extends m.a{constructor(e={}){super(),this.title=new h.j({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new h.j({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 h.c({}),this.cancelButton=new h.c({}),void 0!==e.title&&(this.title=new h.j(e.title)),void 0!==e.subtitle&&(this.subtitle=new h.j(e.subtitle)),void 0!==e.retryButton&&(this.retryButton=new h.c(e.retryButton)),void 0!==e.cancelButton&&(this.cancelButton=new h.c(e.cancelButton))}}class p extends m.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 g extends m.a{constructor(e={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new h.j({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new f({}),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 h.j(e.loadingMessage)),void 0!==e.errorState&&(this.errorState=new f(e.errorState))}}class v extends m.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 h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new h.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new h.c({visible:!0,text:"?sheetSubmitButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new h.c({visible:!0,text:"?singleModeConfirmationCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new h.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new f({title:new h.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new h.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new h.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new h.c({text:"?barcodeInfoMappingErrorStateCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new d.b({visible:!1,counterBadge:new d.d({visible:!0,background:new h.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new d.c({visible:!0,deselected:new h.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new h.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new d.e({imageVisible:!0,titleSelected:new h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new h.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new h.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new h.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new h.g({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 h.j(e.barcodeTitle)),void 0!==e.barcodeSubtitle&&(this.barcodeSubtitle=new h.j(e.barcodeSubtitle)),void 0!==e.submitButton&&(this.submitButton=new h.c(e.submitButton)),void 0!==e.cancelButton&&(this.cancelButton=new h.c(e.cancelButton)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new g(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new d.b(e.arOverlay))}}class C extends m.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}}class b extends m.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new C({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 C(e.idealPreviewResolution))}}var y,A=n(31);class S extends m.a{constructor(e={}){super(),this.flashButton=new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==e.flashButton&&(this.flashButton=new h.h(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new h.h(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new h.h(e.flipCameraButton))}}class w extends m.a{constructor(e={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new h.b({}),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.collapsedVisibleHeight&&(this.collapsedVisibleHeight=e.collapsedVisibleHeight),void 0!==e.listButton&&(this.listButton=new h.b(e.listButton))}}class E extends m.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 x extends m.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new h.j({text:"Update count",color:"?sbColorOnSurface"}),this.info=new h.j({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new h.c({visible:!0,text:"Update",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new h.c({visible:!0,text:"Cancel",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new h.e({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 h.j(e.title)),void 0!==e.info&&(this.info=new h.j(e.info)),void 0!==e.updateButton&&(this.updateButton=new h.c(e.updateButton)),void 0!==e.cancelButton&&(this.cancelButton=new h.c(e.cancelButton)),void 0!==e.clearTextButton&&(this.clearTextButton=new h.e(e.clearTextButton))}}class B extends m.a{constructor(e={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new h.j({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new h.c({visible:!0,text:"Clear all",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new h.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new h.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new h.c({visible:!0,text:"Submit",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new h.c({visible:!0,text:"Start scanning",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new h.j({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new h.j({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 h.e({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new E({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 h.j(e.title)),void 0!==e.clearAllButton&&(this.clearAllButton=new h.c(e.clearAllButton)),void 0!==e.barcodeItemTitle&&(this.barcodeItemTitle=new h.j(e.barcodeItemTitle)),void 0!==e.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new h.j(e.barcodeItemSubtitle)),void 0!==e.barcodeItemImageVisible&&(this.barcodeItemImageVisible=e.barcodeItemImageVisible),void 0!==e.submitButton&&(this.submitButton=new h.c(e.submitButton)),void 0!==e.startScanningButton&&(this.startScanningButton=new h.c(e.startScanningButton)),void 0!==e.placeholderTitle&&(this.placeholderTitle=new h.j(e.placeholderTitle)),void 0!==e.placeholderSubtitle&&(this.placeholderSubtitle=new h.j(e.placeholderSubtitle)),void 0!==e.placeholderIconBackground&&(this.placeholderIconBackground=e.placeholderIconBackground),void 0!==e.placeholderIcon&&(this.placeholderIcon=new h.e(e.placeholderIcon)),void 0!==e.swipeToDelete&&(this.swipeToDelete=new E(e.swipeToDelete))}}class I extends m.a{constructor(e={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new w({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new h.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new B({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new h.j({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new h.c({visible:!0,text:"?sheetClearAllButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new h.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new h.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new h.c({visible:!0,text:"?sheetSubmitButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new h.c({visible:!0,text:"?sheetStartScanningButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new h.j({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new h.j({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new h.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new E({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new x({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new h.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new h.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new h.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new h.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new g({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new h.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new f({title:new h.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new h.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new h.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new d.b({visible:!1,counterBadge:new d.d({visible:!0,background:new h.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new d.c({visible:!0,deselected:new h.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new h.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new d.e({imageVisible:!0,titleSelected:new h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new h.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new h.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new h.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new h.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new h.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.mode&&(this.mode=e.mode),void 0!==e.sheet&&(this.sheet=new w(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new B(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new x(e.manualCountEditDialog)),void 0!==e.barcodeInfoMapping&&(this.barcodeInfoMapping=new g(e.barcodeInfoMapping)),void 0!==e.arOverlay&&(this.arOverlay=new d.b(e.arOverlay))}}class T extends m.a{constructor(e={}){if(super(),this.title=new h.j({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new h.j({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==e.title&&(this.title=new h.j(e.title)),void 0!==e.subtitle&&(this.subtitle=new h.j(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)throw new Error("okButton must be present in constructor argument");if(this.okButton=new h.c(e.okButton),void 0===e.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new h.c(e.cancelButton)}}class k extends m.a{constructor(e={}){if(super(),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 O extends m.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 w({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new h.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new B({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new h.j({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new h.c({visible:!0,text:"?sheetResetButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new h.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new h.j({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new h.c({visible:!0,text:"?sheetSubmitButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new h.c({visible:!0,text:"?sheetStartScanningButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new h.j({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new h.j({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new h.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new E({enabled:!1,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new x({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new h.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new h.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new h.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new h.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new d.a({visible:!1,automaticSelectionEnabled:!0,polygon:new d.f({partiallyScanned:new h.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new h.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new h.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new d.g({partiallyScanned:new d.d({visible:!0,background:new h.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new d.d({visible:!0,background:new h.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new d.d({visible:!0,background:new h.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new T({title:new h.j({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new h.j({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new h.c({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new T({title:new h.j({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new h.j({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new h.c({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new h.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new h.c({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new h.d({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 k(e)))),void 0!==e.countingRepeatDelay&&(this.countingRepeatDelay=e.countingRepeatDelay),void 0!==e.sheet&&(this.sheet=new w(e.sheet)),void 0!==e.sheetContent&&(this.sheetContent=new B(e.sheetContent)),void 0!==e.manualCountEditDialog&&(this.manualCountEditDialog=new x(e.manualCountEditDialog)),void 0!==e.arOverlay&&(this.arOverlay=new d.a(e.arOverlay)),void 0!==e.partialScannedAlertDialogEnabled&&(this.partialScannedAlertDialogEnabled=e.partialScannedAlertDialogEnabled),void 0!==e.partialScannedAlertDialog&&(this.partialScannedAlertDialog=new T(e.partialScannedAlertDialog)),void 0!==e.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=e.confirmationAlertDialogEnabled),void 0!==e.confirmationAlertDialog&&(this.confirmationAlertDialog=new T(e.confirmationAlertDialog))}}(y||(y={})).From=function(e){const t=e._type;switch(t){case"SingleScanningMode":return new v(e);case"MultipleScanningMode":return new I(e);case"FindAndPickScanningMode":return new O(e);default:throw`Unknown child class name: ${t}`}};var D,L=n(21);class P extends m.a{constructor(e={}){super(),this.visible=!0,this.style=new _({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new L.AspectRatio({width:1,height:1}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.style&&(this.style=D.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new L.AspectRatio(e.aspectRatio))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new _(e);case"FinderStrokedStyle":return new R(e);default:throw`Unknown child class name: ${t}`}}}(D||(D={}));class _ extends m.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 R extends m.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 F=n(32);class M extends m.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)}}class W extends m.a{constructor(e={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==e.barcodesRegexFilter&&(this.barcodesRegexFilter=e.barcodesRegexFilter),void 0!==e.barcodeFormats&&(this.barcodeFormats=e.barcodeFormats.map((e=>e))),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 N extends m.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new h.e({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new h.c({text:"Close",background:new h.a({}),foreground:new h.d({})}),this.enableCameraTitle=new h.j({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new h.j({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 h.e(e.icon)),void 0!==e.closeButton&&(this.closeButton=new h.c(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new h.j(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new h.j(e.enableCameraExplanation))}}class V extends m.a{constructor(e={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new h.f({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 M({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new A.a({title:new h.j({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new h.c({visible:!0,text:"?topBarCancelButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new h.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new S({flashButton:new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new h.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new P({visible:!0,style:new _({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new L.AspectRatio({width:1,height:1})}),this.userGuidance=new F.a({visible:!0,title:new h.j({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new h.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new N({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new h.e({visible:!0,color:"?sbColorOnSurface"}),closeButton:new h.c({visible:!0,text:"?cameraPermissionCloseButton",background:new h.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new h.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new h.j({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new h.j({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new b({}),this.recognizerConfiguration=new W({}),this.useCase=new v({}),this.sound=new h.i({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new h.l({enabled:!0}),this.timeouts=new h.k({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 h.f(e.palette)),void 0!==e.localization&&(this.localization=new M(e.localization)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.topBar&&(this.topBar=new A.a(e.topBar)),void 0!==e.actionBar&&(this.actionBar=new S(e.actionBar)),void 0!==e.viewFinder&&(this.viewFinder=new P(e.viewFinder)),void 0!==e.userGuidance&&(this.userGuidance=new F.a(e.userGuidance)),void 0!==e.cameraPermission&&(this.cameraPermission=new N(e.cameraPermission)),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new b(e.cameraConfiguration)),void 0!==e.recognizerConfiguration&&(this.recognizerConfiguration=new W(e.recognizerConfiguration)),void 0!==e.useCase&&(this.useCase=y.From(e.useCase)),void 0!==e.sound&&(this.sound=new h.i(e.sound)),void 0!==e.vibration&&(this.vibration=new h.l(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new h.k(e.timeouts))}}var z=n(38);class j extends m.a{constructor(e={}){if(super(),void 0===e.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new z.BarcodeItem(e.barcode),void 0===e.count)throw new Error("count must be present in constructor argument");this.count=e.count}}class H extends m.a{constructor(e={}){super(),this.items=[],void 0!==e.items&&(this.items=e.items.map((e=>new j(e))))}}var U=n(20),Z=n(2);class G extends m.a{constructor(e={}){super(),this.visible=!0,this.title=new Z.StyledText({color:"?sbColorOnPrimary"}),this.background=new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.background&&(this.background=new Z.BackgroundStyle(e.background))}}class Q extends m.a{constructor(e={}){super(),this.visible=!0,this.icon=new Z.IconStyle({color:"?sbColorOnPrimary"}),this.title=new Z.StyledText({color:"?sbColorOnPrimary"}),this.background=new Z.BackgroundStyle({fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.icon&&(this.icon=new Z.IconStyle(e.icon)),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.background&&(this.background=new Z.BackgroundStyle(e.background))}}class Y extends m.a{constructor(e={}){super(),this.retakeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?acknowledgementRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementRetakeButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.acceptWhenOkButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.acceptWhenNotOkButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?acknowledgementAcceptButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionAcknowledgementAcceptButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),void 0!==e.retakeButton&&(this.retakeButton=new Z.BarButtonConfiguration(e.retakeButton)),void 0!==e.acceptWhenOkButton&&(this.acceptWhenOkButton=new Z.BarButtonConfiguration(e.acceptWhenOkButton)),void 0!==e.acceptWhenNotOkButton&&(this.acceptWhenNotOkButton=new Z.BarButtonConfiguration(e.acceptWhenNotOkButton))}}class X extends m.a{constructor(e={}){super(),this.minimumQuality="POOR",this.acknowledgementMode="ALWAYS",this.badImageHint=new Q({visible:!0,icon:new Z.IconStyle({color:"?sbColorOnPrimary"}),title:new Z.StyledText({text:"?acknowledgementScreenBadDocumentHint",color:"?sbColorOnPrimary"}),background:new Z.BackgroundStyle({strokeColor:"?sbColorNegative",fillColor:"?sbColorNegative",strokeWidth:0})}),this.backgroundColor="?sbColorOutline",this.bottomBar=new Y({}),void 0!==e.minimumQuality&&(this.minimumQuality=e.minimumQuality),void 0!==e.acknowledgementMode&&(this.acknowledgementMode=e.acknowledgementMode),void 0!==e.badImageHint&&(this.badImageHint=new Q(e.badImageHint)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new Y(e.bottomBar))}}class K extends m.a{constructor(e={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new Z.IconStyle({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new Z.ButtonConfiguration({text:"Close",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.enableCameraTitle=new Z.StyledText({text:"Camera permission denied!",color:"?sbColorOnSurface"}),this.enableCameraExplanation=new Z.StyledText({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 Z.IconStyle(e.icon)),void 0!==e.closeButton&&(this.closeButton=new Z.ButtonConfiguration(e.closeButton)),void 0!==e.enableCameraTitle&&(this.enableCameraTitle=new Z.StyledText(e.enableCameraTitle)),void 0!==e.enableCameraExplanation&&(this.enableCameraExplanation=new Z.StyledText(e.enableCameraExplanation))}}class q extends m.a{constructor(e={}){super(),this.cameraModule="BACK",this.flashEnabled=!1,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.flashEnabled&&(this.flashEnabled=e.flashEnabled),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 L.AspectRatio(e)))),void 0!==e.ignoreBadAspectRatio&&(this.ignoreBadAspectRatio=e.ignoreBadAspectRatio)}}class J extends m.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 $ extends m.a{constructor(e={}){super(),this.visibility="ENABLED",this.title=new Z.StyledText({text:"?cameraUserGuidanceStart",color:"?sbColorOnPrimary"}),this.background=new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"?sbColorSurfaceHigh"}),this.statesTitles=new J({}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.background&&(this.background=new Z.BackgroundStyle(e.background)),void 0!==e.statesTitles&&(this.statesTitles=new J(e.statesTitles))}}var ee,te,ne,oe=n(16);class ie extends m.a{constructor(e={}){super(),this.title=new Z.StyledText({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new Z.StyledText({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",this.okButton=new Z.ButtonConfiguration({background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary"})}),this.actionButton=new Z.ButtonConfiguration({visible:!1,background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),this.cancelButton=new Z.ButtonConfiguration({visible:!0,background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0})}),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.subtitle&&(this.subtitle=new Z.StyledText(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 Z.ButtonConfiguration(e.okButton)),void 0!==e.actionButton&&(this.actionButton=new Z.ButtonConfiguration(e.actionButton)),void 0!==e.cancelButton&&(this.cancelButton=new Z.ButtonConfiguration(e.cancelButton))}}class re extends m.a{constructor(e={}){super(),this.visible=!0,this.style=new ae({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new L.AspectRatio({width:1,height:1}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.style&&(this.style=ee.From(e.style)),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.aspectRatio&&(this.aspectRatio=new L.AspectRatio(e.aspectRatio))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"FinderCorneredStyle":return new ae(e);case"FinderStrokedStyle":return new se(e);default:throw`Unknown child class name: ${t}`}}}(ee||(ee={}));class ae extends m.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 se extends m.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)}}class le extends m.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 ue(e);case"TextButtonMode":return new de(e);case"NoButtonMode":return new he(e);default:throw`Unknown child class name: ${t}`}}}(te||(te={}));class ce extends m.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 ue extends m.a{constructor(e={}){super(),this._type="PagePreviewMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.imagePlaceholderColor="?sbColorOnSurfaceVariant",this.pageCounter=new Z.BadgeStyle({visible:!0,background:new Z.BackgroundStyle({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 Z.BadgeStyle(e.pageCounter))}}class de extends m.a{constructor(e={}){super(),this._type="TextButtonMode",this.accessibilityDescription="?accessibilityDescriptionCameraPreviewButton",this.style=new Z.StyledText({text:"?cameraPreviewButtonTitle",color:"?sbColorOnPrimary"}),void 0!==e.accessibilityDescription&&(this.accessibilityDescription=e.accessibilityDescription),void 0!==e.style&&(this.style=new Z.StyledText(e.style))}}class he extends m.a{constructor(e={}){super(),this._type="NoButtonMode",this.visible=!1,void 0!==e.visible&&(this.visible=e.visible)}}class me extends m.a{constructor(e={}){super(),this.importButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraImportButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraImportButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.autoSnappingModeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraAutoSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraAutoSnapButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.manualSnappingModeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraManualSnapButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraManualSnapButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.shutterButton=new le({accessibilityDescription:"?accessibilityDescriptionCameraShutterButton"}),this.torchOnButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraTorchOnButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOnButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.torchOffButton=new Z.BarButtonConfiguration({title:new Z.StyledText({visible:!1,text:"?cameraTorchOffButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraTorchOffButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.previewButton=new ue({}),void 0!==e.importButton&&(this.importButton=new Z.BarButtonConfiguration(e.importButton)),void 0!==e.autoSnappingModeButton&&(this.autoSnappingModeButton=new Z.BarButtonConfiguration(e.autoSnappingModeButton)),void 0!==e.manualSnappingModeButton&&(this.manualSnappingModeButton=new Z.BarButtonConfiguration(e.manualSnappingModeButton)),void 0!==e.shutterButton&&(this.shutterButton=new le(e.shutterButton)),void 0!==e.torchOnButton&&(this.torchOnButton=new Z.BarButtonConfiguration(e.torchOnButton)),void 0!==e.torchOffButton&&(this.torchOffButton=new Z.BarButtonConfiguration(e.torchOffButton)),void 0!==e.previewButton&&(this.previewButton=te.From(e.previewButton))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"PageSnapFunnelAnimation":return new fe(e);case"PageSnapCheckMarkAnimation":return new pe(e);case"PageSnapFeedbackNone":return new ge(e);default:throw`Unknown child class name: ${t}`}}}(ne||(ne={}));class fe extends m.a{constructor(e={}){super(),this._type="PageSnapFunnelAnimation",this.overlayColor="?sbColorModalOverlay",void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor)}}class pe extends m.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 ge extends m.a{constructor(e={}){super(),this._type="PageSnapFeedbackNone"}}class ve extends m.a{constructor(e={}){super(),this.cameraBlinkEnabled=!0,this.snapFeedbackMode=new fe({}),void 0!==e.cameraBlinkEnabled&&(this.cameraBlinkEnabled=e.cameraBlinkEnabled),void 0!==e.snapFeedbackMode&&(this.snapFeedbackMode=ne.From(e.snapFeedbackMode))}}class Ce extends m.a{constructor(e={}){super(),this.visibility="ENABLED",this.documentOk=new Z.PolygonStyle({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:2}),this.documentNotOk=new Z.PolygonStyle({strokeColor:"?sbColorNegative",fillColor:"#00000000",strokeWidth:2}),this.autoSnapProgress=new Z.PolygonStyle({strokeColor:"#40A9FF",fillColor:"#00000000",strokeWidth:2}),void 0!==e.visibility&&(this.visibility=e.visibility),void 0!==e.documentOk&&(this.documentOk=new Z.PolygonStyle(e.documentOk)),void 0!==e.documentNotOk&&(this.documentNotOk=new Z.PolygonStyle(e.documentNotOk)),void 0!==e.autoSnapProgress&&(this.autoSnapProgress=new Z.PolygonStyle(e.autoSnapProgress))}}class be extends m.a{constructor(e={}){super(),this.button=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraSelectButton"}),this.backgroundColor="?sbColorSurface",this.title=new Z.StyledText({text:"?cameraSelectCameraMenuTitle",color:"?sbColorOnSurfaceVariant"}),this.dividerColor="?sbColorOutline",this.menuEntry=new Z.PopupMenuItem({title:new Z.StyledText({color:"?sbColorOnSurface"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new Z.IconStyle({color:"?sbColorOnSurface"})}),this.menuEntryActive=new Z.PopupMenuItem({title:new Z.StyledText({color:"?sbColorPrimary"}),accessibilityDescription:"?accessibilityDescriptionCameraSelectMenuItem",icon:new Z.IconStyle({color:"?sbColorPrimary"})}),void 0!==e.button&&(this.button=new Z.IconButton(e.button)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.title&&(this.title=new Z.StyledText(e.title)),void 0!==e.dividerColor&&(this.dividerColor=e.dividerColor),void 0!==e.menuEntry&&(this.menuEntry=new Z.PopupMenuItem(e.menuEntry)),void 0!==e.menuEntryActive&&(this.menuEntryActive=new Z.PopupMenuItem(e.menuEntryActive))}}class ye extends m.a{constructor(e={}){super(),this.acknowledgement=new X({}),this.introduction=new oe.h({}),this.scanAssistanceOverlay=new ce({}),this.cameraPermission=new K({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new Z.IconStyle({visible:!0,color:"?sbColorOnSurface"}),closeButton:new Z.ButtonConfiguration({visible:!0,text:"?cameraPermissionCloseButton",accessibilityDescription:"?accessibilityDescriptionCameraPermissionCloseButton",background:new Z.BackgroundStyle({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),enableCameraTitle:new Z.StyledText({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new Z.StyledText({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.topBarTitle=new Z.StyledText({text:"?cameraTopBarTitle",color:"?sbColorOnPrimary"}),this.topBarIntroButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionCameraTopBarIntroButton"}),this.topBarBackButton=new Z.ButtonConfiguration({visible:!0,text:"?cameraTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraTopBarCancelButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarCameraSelect=new be({}),this.topUserGuidance=new G({title:new Z.StyledText({text:"?cameraTopGuidance",color:"?sbColorOnPrimary"})}),this.userGuidance=new $({}),this.backgroundColor="#000000FF",this.cameraConfiguration=new q({}),this.polygon=new Ce({}),this.bottomBar=new me({}),this.viewFinder=new re({visible:!1,aspectRatio:new L.AspectRatio({width:21,height:29})}),this.captureFeedback=new ve({}),this.vibration=new Z.Vibration({enabled:!0}),this.timeouts=new Z.Timeouts({autoCancelTimeout:0,initialScanDelay:0}),this.limitReachedAlertDialog=new ie({title:new Z.StyledText({text:"?cameraLimitReachedAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?cameraLimitReachedAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?cameraLimitReachedOkButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraLimitReachedOkButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),cancelButton:new Z.ButtonConfiguration({visible:!1})}),this.cancelAlertDialog=new ie({title:new Z.StyledText({text:"?cameraCancelAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?cameraCancelAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?cameraCancelYesButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelYesButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),cancelButton:new Z.ButtonConfiguration({text:"?cameraCancelNoButtonTitle",accessibilityDescription:"?accessibilityDescriptionCameraCancelNoButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})})}),void 0!==e.acknowledgement&&(this.acknowledgement=new X(e.acknowledgement)),void 0!==e.introduction&&(this.introduction=new oe.h(e.introduction)),void 0!==e.scanAssistanceOverlay&&(this.scanAssistanceOverlay=new ce(e.scanAssistanceOverlay)),void 0!==e.cameraPermission&&(this.cameraPermission=new K(e.cameraPermission)),void 0!==e.topBarTitle&&(this.topBarTitle=new Z.StyledText(e.topBarTitle)),void 0!==e.topBarIntroButton&&(this.topBarIntroButton=new Z.IconButton(e.topBarIntroButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new Z.ButtonConfiguration(e.topBarBackButton)),void 0!==e.topBarCameraSelect&&(this.topBarCameraSelect=new be(e.topBarCameraSelect)),void 0!==e.topUserGuidance&&(this.topUserGuidance=new G(e.topUserGuidance)),void 0!==e.userGuidance&&(this.userGuidance=new $(e.userGuidance)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.cameraConfiguration&&(this.cameraConfiguration=new q(e.cameraConfiguration)),void 0!==e.polygon&&(this.polygon=new Ce(e.polygon)),void 0!==e.bottomBar&&(this.bottomBar=new me(e.bottomBar)),void 0!==e.viewFinder&&(this.viewFinder=new re(e.viewFinder)),void 0!==e.captureFeedback&&(this.captureFeedback=new ve(e.captureFeedback)),void 0!==e.vibration&&(this.vibration=new Z.Vibration(e.vibration)),void 0!==e.timeouts&&(this.timeouts=new Z.Timeouts(e.timeouts)),void 0!==e.limitReachedAlertDialog&&(this.limitReachedAlertDialog=new ie(e.limitReachedAlertDialog)),void 0!==e.cancelAlertDialog&&(this.cancelAlertDialog=new ie(e.cancelAlertDialog))}}class Ae extends m.a{constructor(e={}){super(),this.detectButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?croppingDetectButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingDetectButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.rotateButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?croppingRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingRotateButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.resetButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?croppingResetButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionCroppingResetButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),void 0!==e.detectButton&&(this.detectButton=new Z.BarButtonConfiguration(e.detectButton)),void 0!==e.rotateButton&&(this.rotateButton=new Z.BarButtonConfiguration(e.rotateButton)),void 0!==e.resetButton&&(this.resetButton=new Z.BarButtonConfiguration(e.resetButton))}}class Se extends m.a{constructor(e={}){super(),this.topBarBackButton=new Z.ButtonConfiguration({visible:!0,text:"?croppingTopBarCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarCancelButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.topBarTitle=new Z.StyledText({text:"?croppingScreenTitle",color:"?sbColorOnPrimary"}),this.topBarConfirmButton=new Z.ButtonConfiguration({visible:!0,text:"?croppingTopBarConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionCroppingTopBarConfirmButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.backgroundColor="?sbColorOutline",this.croppingHandlerColor="?sbColorSurface",this.croppingPolygonColor="?sbColorSurface",this.bottomBar=new Ae({}),void 0!==e.topBarBackButton&&(this.topBarBackButton=new Z.ButtonConfiguration(e.topBarBackButton)),void 0!==e.topBarTitle&&(this.topBarTitle=new Z.StyledText(e.topBarTitle)),void 0!==e.topBarConfirmButton&&(this.topBarConfirmButton=new Z.ButtonConfiguration(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.bottomBar&&(this.bottomBar=new Ae(e.bottomBar))}}var we=n(41);class Ee extends m.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?we.a.From(e.defaultFilter):null)}}class xe extends m.a{constructor(e={}){super(),this.addButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenAddButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewAddButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.retakeButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenRetakeButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRetakeButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.cropButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenCropButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewCropButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.rotateButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenRotateButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewRotateButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.deleteButton=new Z.BarButtonConfiguration({title:new Z.StyledText({text:"?reviewScreenDeleteButtonTitle",color:"?sbColorOnPrimary"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),icon:new Z.IconStyle({color:"?sbColorOnPrimary"})}),this.submitButton=new Z.ButtonConfiguration({text:"?reviewScreenSubmitButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewSubmitButton",background:new Z.BackgroundStyle({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnSurface"})}),void 0!==e.addButton&&(this.addButton=new Z.BarButtonConfiguration(e.addButton)),void 0!==e.retakeButton&&(this.retakeButton=new Z.BarButtonConfiguration(e.retakeButton)),void 0!==e.cropButton&&(this.cropButton=new Z.BarButtonConfiguration(e.cropButton)),void 0!==e.rotateButton&&(this.rotateButton=new Z.BarButtonConfiguration(e.rotateButton)),void 0!==e.deleteButton&&(this.deleteButton=new Z.BarButtonConfiguration(e.deleteButton)),void 0!==e.submitButton&&(this.submitButton=new Z.ButtonConfiguration(e.submitButton))}}class Be extends m.a{constructor(e={}){super(),this.backgroundColor="?sbColorSurface",this.deleteAll=new Z.PopupMenuItem({title:new Z.StyledText({text:"?reviewScreenDeleteAllButtonTitle",color:"?sbColorNegative"}),accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllButton",icon:new Z.IconStyle({color:"?sbColorNegative"})}),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.deleteAll&&(this.deleteAll=new Z.PopupMenuItem(e.deleteAll))}}class Ie extends m.a{constructor(e={}){super(),this.overlayColor="?sbColorModalOverlay",this.closeButton=new Z.ButtonConfiguration({text:"?zoomOverlayCancelButtonText",accessibilityDescription:"?accessibilityDescriptionZoomOverlayCancelButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),void 0!==e.overlayColor&&(this.overlayColor=e.overlayColor),void 0!==e.closeButton&&(this.closeButton=new Z.ButtonConfiguration(e.closeButton))}}class Te extends m.a{constructor(e={}){super(),this.enabled=!0,this.topBarTitle=new Z.StyledText({text:"?reviewScreenTitle",color:"?sbColorOnPrimary"}),this.topBarMoreButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewMoreButton"}),this.topBarBackButton=new Z.ButtonConfiguration({visible:!0,text:"?reviewTopBarBackButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewTopBarBackButton",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.morePopup=new Be({}),this.zoomButton=new Z.RoundButton({accessibilityDescription:"?accessibilityDescriptionReviewZoomButton",backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary"}),this.zoomOverlay=new Ie({}),this.backgroundColor="?sbColorOnSurfaceVariant",this.bottomBar=new xe({}),this.switchNextPageButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewNextPageButton"}),this.switchPreviousPageButton=new Z.IconButton({color:"?sbColorOnPrimary",accessibilityDescription:"?accessibilityDescriptionReviewPreviousPageButton"}),this.pageCounter=new G({title:new Z.StyledText({text:"?reviewScreenPageCount",color:"?sbColorOnPrimary"}),background:new Z.BackgroundStyle({fillColor:"?sbColorSurfaceHigh",strokeWidth:0})}),this.deleteAllPagesAlertDialog=new ie({title:new Z.StyledText({text:"?reviewDeleteAllPagesAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?reviewDeleteAllPagesAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?reviewDeleteAllPagesAlertDeleteButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),actionButton:new Z.ButtonConfiguration({visible:!1}),cancelButton:new Z.ButtonConfiguration({text:"?reviewDeleteAllPagesAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})})}),this.deletePageAlertDialog=new ie({title:new Z.StyledText({text:"?reviewDeletePageAlertTitle",color:"?sbColorOnSurface"}),subtitle:new Z.StyledText({text:"?reviewDeletePageAlertSubTitle",color:"?sbColorOnSurfaceVariant"}),okButton:new Z.ButtonConfiguration({text:"?reviewDeletePageAlertConfirmButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertConfirmButton",background:new Z.BackgroundStyle({fillColor:"?sbColorPrimary",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),actionButton:new Z.ButtonConfiguration({text:"?reviewDeletePageAlertDeleteRetakeButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})}),cancelButton:new Z.ButtonConfiguration({text:"?reviewDeletePageAlertCancelButtonTitle",accessibilityDescription:"?accessibilityDescriptionReviewDeletePageAlertCancelButton",background:new Z.BackgroundStyle({fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorPrimary"})})}),void 0!==e.enabled&&(this.enabled=e.enabled),void 0!==e.topBarTitle&&(this.topBarTitle=new Z.StyledText(e.topBarTitle)),void 0!==e.topBarMoreButton&&(this.topBarMoreButton=new Z.IconButton(e.topBarMoreButton)),void 0!==e.topBarBackButton&&(this.topBarBackButton=new Z.ButtonConfiguration(e.topBarBackButton)),void 0!==e.morePopup&&(this.morePopup=new Be(e.morePopup)),void 0!==e.zoomButton&&(this.zoomButton=new Z.RoundButton(e.zoomButton)),void 0!==e.zoomOverlay&&(this.zoomOverlay=new Ie(e.zoomOverlay)),void 0!==e.backgroundColor&&(this.backgroundColor=e.backgroundColor),void 0!==e.bottomBar&&(this.bottomBar=new xe(e.bottomBar)),void 0!==e.switchNextPageButton&&(this.switchNextPageButton=new Z.IconButton(e.switchNextPageButton)),void 0!==e.switchPreviousPageButton&&(this.switchPreviousPageButton=new Z.IconButton(e.switchPreviousPageButton)),void 0!==e.pageCounter&&(this.pageCounter=new G(e.pageCounter)),void 0!==e.deleteAllPagesAlertDialog&&(this.deleteAllPagesAlertDialog=new ie(e.deleteAllPagesAlertDialog)),void 0!==e.deletePageAlertDialog&&(this.deletePageAlertDialog=new ie(e.deletePageAlertDialog))}}class ke extends m.a{constructor(e={}){super(),this.camera=new ye({}),this.review=new Te({}),this.cropping=new Se({}),void 0!==e.camera&&(this.camera=new ye(e.camera)),void 0!==e.review&&(this.review=new Te(e.review)),void 0!==e.cropping&&(this.cropping=new Se(e.cropping))}}class Oe extends m.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.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.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 De extends m.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 Le extends m.a{constructor(e={}){super(),this.version="1.0",this.screen="DocumentScanner",this.palette=new Z.Palette({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 Oe({}),this.appearance=new De({}),this.outputSettings=new Ee({}),this.screens=new ke({}),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 Z.Palette(e.palette)),void 0!==e.localization&&(this.localization=new Oe(e.localization)),void 0!==e.appearance&&(this.appearance=new De(e.appearance)),void 0!==e.outputSettings&&(this.outputSettings=new Ee(e.outputSettings)),void 0!==e.screens&&(this.screens=new ke(e.screens)),void 0!==e.documentUuid&&(this.documentUuid=null!=e.documentUuid?e.documentUuid:null),void 0!==e.cleanScanningSession&&(this.cleanScanningSession=e.cleanScanningSession)}}class Pe extends m.a{constructor(e={}){super(),this.flashButton=new Z.RoundButton({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new Z.RoundButton({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new Z.RoundButton({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==e.flashButton&&(this.flashButton=new Z.RoundButton(e.flashButton)),void 0!==e.zoomButton&&(this.zoomButton=new Z.RoundButton(e.zoomButton)),void 0!==e.flipCameraButton&&(this.flipCameraButton=new Z.RoundButton(e.flipCameraButton))}}class _e extends m.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}}class Re extends m.a{constructor(e={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new _e({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 _e(e.idealPreviewResolution))}}class Fe extends m.a{constructor(e={}){super(),this.title=new Z.StyledText({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new Z.ButtonConfiguration({text:"Cancel",background:new Z.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new Z.ForegroundStyle({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new Z.StyledText(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 Z.ButtonConfiguration(e.cancelButton))}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return a})),n.d(t,"f",(function(){return o})),n.d(t,"j",(function(){return s})),n.d(t,"k",(function(){return l})),n.d(t,"i",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"e",(function(){return h})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return f})),n.d(t,"h",(function(){return p}));var o,i=n(2),r=n(6);class a extends r.a{constructor(e={}){super(),this.image=new s({}),this.text=new i.StyledText({text:"?cameraIntroDescription",color:"?sbColorOnSurface"}),void 0!==e.image&&(this.image=o.From(e.image)),void 0!==e.text&&(this.text=new i.StyledText(e.text))}}!function(e){e.From=function(e){const t=e._type;switch(t){case"NoIntroImage":return new s(e);case"ReceiptsIntroImage":return new l(e);case"MedicalCertificateIntroImage":return new c(e);case"DocumentIntroImage":return new u(e);case"CheckIntroImage":return new d(e);case"IdCardIntroImage":return new h(e);case"CreditCardIntroImage":return new m(e);case"CustomImage":return new f(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={}));class s extends r.a{constructor(e={}){super(),this._type="NoIntroImage"}}class l extends r.a{constructor(e={}){super(),this._type="ReceiptsIntroImage"}}class c 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 h extends r.a{constructor(e={}){super(),this._type="IdCardIntroImage"}}class m 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 i.ButtonConfiguration({visible:!0,text:"?cameraIntroDoneButton",accessibilityDescription:"?accessibilityDescriptionCameraIntroDoneButton",background:new i.BackgroundStyle({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.ForegroundStyle({iconVisible:!0,color:"?sbColorPrimary",useShadow:!1})}),this.title=new i.StyledText({text:"?cameraIntroTitle",color:"?sbColorOnSurface"}),this.subtitle=new i.StyledText({text:"?cameraIntroSubtitle",color:"?sbColorOnSurface"}),this.items=[new a({image:new u({}),text:new i.StyledText({text:"?cameraIntroItem1",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new i.StyledText({text:"?cameraIntroItem2",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new i.StyledText({text:"?cameraIntroItem3",color:"?sbColorOnSurface"})}),new a({image:new s({}),text:new i.StyledText({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 i.ButtonConfiguration(e.topBarDoneButton)),void 0!==e.title&&(this.title=new i.StyledText(e.title)),void 0!==e.subtitle&&(this.subtitle=new i.StyledText(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 o}));class o{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.r(t),n.d(t,"OcrResult",(function(){return r})),n.d(t,"FieldValidationStatusValues",(function(){return a})),n.d(t,"FieldDataFormatValues",(function(){return s})),n.d(t,"FieldParsedData",(function(){return l})),n.d(t,"FieldType",(function(){return c})),n.d(t,"Field",(function(){return u})),n.d(t,"GenericDocumentType",(function(){return d})),n.d(t,"GenericDocument",(function(){return h}));var o=n(39),i=n(7);class r extends i.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 l extends i.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 c extends i.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&&o.CommonFieldTypeValues.includes(e.commonType)?e.commonType:null,void 0!==e.listIndex&&(this.listIndex=null!=e.listIndex?e.listIndex:null)}}class u extends i.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 c(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 l(e))))}}class d extends i.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 h extends i.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 h(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.r(t),n.d(t,"LineSegmentInt",(function(){return i})),n.d(t,"LineSegmentFloat",(function(){return r})),n.d(t,"AspectRatio",(function(){return a}));var o=n(7);class i extends o.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 o.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 o.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 o=n(14),i=n(15),r=n(5);function a(){const e=new i.BarcodeScannerConfiguration;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 o.a{constructor(e){super(e),this.finder=a(),this.userGuidance=function(){const e=new i.BarcodeScannerConfiguration;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,i;o.a.mapValuesDeep(null!==(n=t.finder)&&void 0!==n?n:{},e.finder),o.a.mapValuesDeep(null!==(i=t.userGuidance)&&void 0!==i?i:{},e.userGuidance)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(11);class i{constructor(e,t,n,o){this.x=e,this.y=t,this.width=n,this.height=o}scaleDown(e){return new i(this.x/e,this.y/e,this.width/e,this.height/e)}bottom(){return this.y+this.height}size(){return new o.a(this.width,this.height)}static withSize(e,t){return new i(0,0,e,t)}static empty(){return new i(0,0,0,0)}static fromRect(e){return e?new i(e.x,e.y,e.width,e.height):i.empty()}static fromPoint(e,t){return new i(e.x-t/2,e.y-t/2,t,t)}static fromDOMRect(e){return new i(e.x,e.y,e.width,e.height)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(0),i=n(23),r=n(5),a=n(9);class s extends o.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(e){super(e),this.holePosition=i.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=e=>{var t,n,o,i;(null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)===(null===(n=e.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)===(null===(i=e.padding)||void 0===i?void 0:i.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,o,i;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,l=Math.max(20,(r-s)/2),c=Math.min(s,r-2*l),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=c,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-c/2;const d=(null===(e=this.guidanceText)||void 0===e?void 0:e.clientHeight)+this.guidanceTextTopPadding||0,h=Math.max(10,null!==(n=null===(t=this.props.padding)||void 0===t?void 0:t.minTopPadding)&&void 0!==n?n:0),m=a-h-Math.max(10,null!==(i=null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)&&void 0!==i?i:0)-d;this.holePosition.height>m?(this.holePosition.height=m,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=h):this.holePosition.y=h+(m-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,o=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height;e.beginPath(),e.fillStyle="black",e.moveTo(n+t,o),e.arcTo(n+i,o,n+i,o+r,t),e.arcTo(n+i,o+r,n,o+r,t),e.arcTo(n,o+r,n,o,t),e.arcTo(n,o,n+i,o,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,o=this.holePosition.width,i=this.holePosition.height,a=15,s=this.style.strokeWidth,l=this.cornerRadius();e.beginPath(),e.moveTo(t,n+a),e.arcTo(t,n,t+o,n,l),e.lineTo(t+a,n),e.moveTo(t+o-a,n),e.arcTo(t+o,n,t+o,n+i,l),e.lineTo(t+o,n+a),e.moveTo(t+o,n+i-a),e.arcTo(t+o,n+i,t,n+i,l),e.lineTo(t+o-a,n+i),e.moveTo(t,n+i-a),e.arcTo(t,n+i,t+o,n+i,l),e.lineTo(t+a,n+i),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,o=this.holePosition.width,i=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;e.beginPath(),e.moveTo(t+a,n),e.arcTo(t+o,n,t+o,n+i,a),e.moveTo(t+o,n+a),e.arcTo(t+o,n+i,t,n+i,a),e.moveTo(t+o-a,n+i),e.arcTo(t,n+i,t,n,a),e.moveTo(t,n+i-a),e.arcTo(t,n,t+o,n,a),e.strokeStyle=r.b.getColorValue(this.style.strokeColor),e.lineWidth=s,e.stroke()},this.guidanceTextTopPadding=20,this.render=()=>o.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")}},o.default.createElement("canvas",{ref:e=>{this.holeCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),o.default.createElement("canvas",{ref:e=>{this.crosshairCanvas=e},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&o.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"}},o.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 o=n(0),i=n(13),r=n(27),a=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class s extends o.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 o=this.props.preferredCamera;if(o)try{const t=(yield navigator.mediaDevices.enumerateDevices()).find((e=>e.deviceId===o||e.label===o));if(t)return Object.assign(Object.assign({},e),{deviceId:t.deviceId})}catch(e){throw i.a.enumerateDevicesFailed()}else{const o={user:"front",environment:"back"},i=(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 i&&i in o){yield r.a.INSTANCE.load();const t=r.a.INSTANCE.getMainCamera(o[i]);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,o,r,s,l,c;return a(this,void 0,void 0,(function*(){if(console.log("refreshStream",this),i.a.hasCheckedPermission()||(yield i.a.tryCheckPermission()),i.a.hasDeniedPermission())null===(t=(e=this.props).onError)||void 0===t||t.call(e,i.a.permissionDenied());else try{const e={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};if(!navigator.mediaDevices){const e=i.a.unknown();return null===(o=(n=this.props).onError)||void 0===o||o.call(n,e),void console.log(e)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(e);this.setState({stream:t},(()=>{var e,n,o,i;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(i=(o=this.props).onReady)||void 0===i||i.call(o)}))}catch(e){const t=i.a.mediaDeviceNotFound();return null===(s=(r=this.props).onError)||void 0===s||s.call(r,t),void console.error(t)}}catch(e){const t=i.a.createFromDOMException(e);return null===(c=(l=this.props).onError)||void 0===c||c.call(l,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 l=n(11),c=n(23),u=n(17),d=n(37);class h{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 o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,"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(o);const i=this.program=e.createProgram();e.attachShader(i,n),e.attachShader(i,o),e.linkProgram(i),e.useProgram(i),e.uniform1i(e.getUniformLocation(i,"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,o,i,r,a,s){let l,c;if(r=Math.floor(r),a=Math.floor(a),t=Math.floor(t),n=Math.floor(n),o=Math.floor(o),i=Math.floor(i),e instanceof HTMLVideoElement)[c,l]=[e.videoWidth,e.videoHeight];else{if(!(e instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[c,l]=[e.width,e.height]}(c<t+o||l<n+i)&&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 h=this.gl;this.canvas.width=r,this.canvas.height=a,h.viewport(0,0,r,a);const m=[o/(r*c),i/(a*l)],f=[t/c,n/l];return h.uniform2fv(h.getUniformLocation(this.program,"scale"),m),h.uniform2fv(h.getUniformLocation(this.program,"offset"),f),h.texImage2D(h.TEXTURE_2D,0,h.RGB,h.RGB,h.UNSIGNED_BYTE,e),h.drawArrays(h.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)),h.readPixels(0,0,r,a,h.RGBA,h.UNSIGNED_BYTE,s),new ImageData(s,r,a)}}class m{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,o,i,r,a,s){return this.canvas.width=r,this.canvas.height=a,this.ctx.drawImage(e,t,n,o,i,0,0,r,a),this.ctx.getImageData(0,0,r,a)}}var f=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class p extends o.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 l.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 o=this.windowSize(),i=t.height/(o.height+o.y),r=o.width*i,a=o.height*i,s=t.width/2-r/2,l=o.y*i,d=new c.a(s,l,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:o,videoHeight:i}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const l=this.finderFrame||new c.a(0,0,r,a);if(l.width<=0||l.height<=0)return;const d=this.zoom(),h=(o-r/d)/2,m=(i-a/d)/2,f=l.x/s+h,p=l.y/s+m,g=this.finderFrame?s:d,v=l.width/g,C=l.height/g,b=this.calculateFrameSize(e,v,C);return n.getImageData(this.video,f,p,v,C,b.width,b.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 c.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:e,videoHeight:t}=this.video,n=this.video.getBoundingClientRect(),o=e,i=t,r=1;return n.width/n.height<=e/t?(r=n.height/t,r>0&&(o=n.width/r)):(r=n.width/e,r>0&&(i=n.height/r)),{clientVideoWidth:o,clientVideoHeight:i,coef:r}}calculateFrameSize(e,t,n){let o=t,i=n;if(e>0&&0!=t&&0!=n){const r=t/n;t>n?(o=t>e?e:t,i=o/r):(i=n>e?e:n,o=i*r)}return new l.a(o,i)}getCanvasRenderingContext(){return this.video?0===this.video.videoWidth?null:(this.canvas&&!this.reloadCanvas||(this.canvas&&this.releaseCanvas(),this.canvas=h.isSupported()?new h:new m,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 o.default.createElement(s,{videoConstraints:e,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:t,onStreamChanged:this.onStreamChanged,onError:n,ref:e=>{this.videoStream=e}},o.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 Qe}));var o=n(4),i=(n(51),n(0)),r=n(49),a=n.n(r),s=n(29),l=n(50),c="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",h="6.1.8",m="/*!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 b=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"]),y=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,A=/(^-|-$)/g;function S(e){return e.replace(y,"-").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 B,I=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},T=function(e){return I(5381,e)};function k(e){return x(T(e)>>>0)}function O(e){return e.displayName||e.name||"Component"}function D(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},M={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},W=((B={})[_]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},B[P]=M,B);function N(e){return("type"in(t=e)&&t.type.$$typeof)===P?M:"$$typeof"in e?W[e.$$typeof]:R;var t}var V=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 o=U(t);o&&o!==Z&&G(e,o,n)}var i=z(t);j&&(i=i.concat(j(t)));for(var r=N(e),a=N(t),s=0;s<i.length;++s){var l=i[s];if(!(l in F||n&&n[l]||a&&l in a||r&&l in r)){var c=H(t,l);try{V(e,l,c)}catch(e){}}}}return e}function Q(e){return"function"==typeof e}function Y(e){return"object"==typeof e&&"styledComponentId"in e}function X(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function K(e,t){if(0===e.length)return"";for(var n=e[0],o=1;o<e.length;o++)n+=t?t+e[o]:e[o];return n}function q(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&&!q(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var o=0;o<t.length;o++)e[o]=J(e[o],t[o]);else if(q(t))for(var o in t)e[o]=J(e[o],t[o]);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,o=n.length,i=o;e>=i;)if((i<<=1)<0)throw ee(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;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),o=n+t;this.groupSizes[e]=0;for(var i=n;i<o;i++)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],o=this.indexOfGroup(e),i=o+n,r=o;r<i;r++)t+="".concat(this.tag.getRule(r)).concat(m);return t},e}(),ne=new Map,oe=new Map,ie=1,re=function(e){if(ne.has(e))return ne.get(e);for(;oe.has(ie);)ie++;var t=ie++;return ne.set(e,t),oe.set(t,e),t},ae=function(e,t){ie=t+1,ne.set(e,t),oe.set(t,e)},se="style[".concat(c,"][").concat(d,'="').concat(h,'"]'),le=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ce=function(e,t,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&e.registerName(t,o)},ue=function(e,t){for(var n,o=(null!==(n=t.textContent)&&void 0!==n?n:"").split(m),i=[],r=0,a=o.length;r<a;r++){var s=o[r].trim();if(s){var l=s.match(le);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(ae(u,c),ce(e,u,l[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function de(){return n.nc}var he=function(e){var t=document.head,n=e||t,o=document.createElement("style"),i=function(e){var t=Array.from(e.querySelectorAll("style[".concat(c,"]")));return t[t.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(c,u),o.setAttribute(d,h);var a=de();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},me=function(){function e(e){this.element=he(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,o=t.length;n<o;n++){var i=t[n];if(i.ownerNode===e)return i}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=he(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 i=this;this.options=Object(o.a)(Object(o.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,o=t.length;n<o;n++){var i=t[n];i&&i.getAttribute(c)!==u&&(ue(e,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),$(this,(function(){return function(e){for(var t=e.getTag(),n=t.length,o="",i=function(n){var i=function(e){return oe.get(e)}(n);if(void 0===i)return"continue";var r=e.names.get(i),a=t.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(c,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==r&&r.forEach((function(e){e.length>0&&(l+="".concat(e,","))})),o+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(m)},r=0;r<n;r++)i(r);return o}(i)}))}return e.registerId=function(e){return re(e)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(Object(o.a)(Object(o.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 me(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}(),be=/&/g,ye=/^\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,o,i=void 0===e?v:e,r=i.options,a=void 0===r?v:r,l=i.plugins,c=void 0===l?g:l,u=function(e,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(t):e},d=c.slice();d.push((function(e){e.type===s.a&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(be,n).replace(o,u))})),a.prefix&&d.push(s.d),d.push(s.g);var h=function(e,i,r,l){void 0===i&&(i=""),void 0===r&&(r=""),void 0===l&&(l="&"),t=l,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var c=e.replace(ye,""),u=s.b(r||i?"".concat(r," ").concat(i," { ").concat(c," }"):c);a.namespace&&(u=Ae(u,a.namespace));var h=[];return s.f(u,s.c(d.concat(s.e((function(e){return h.push(e)}))))),h};return h.hash=c.length?c.reduce((function(e,t){return t.name||ee(15),I(e,t.name)}),5381).toString():"",h}var we=new Ce,Ee=Se(),xe=i.default.createContext({shouldForwardProp:void 0,styleSheet:we,stylis:Ee}),Be=(xe.Consumer,i.default.createContext(void 0));function Ie(){return Object(i.useContext)(xe)}function Te(e){var t=Object(i.useState)(e.stylisPlugins),n=t[0],o=t[1],r=Ie().styleSheet,s=Object(i.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]),l=Object(i.useMemo)((function(){return Se({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:n})}),[e.enableVendorPrefixes,e.namespace,n]);Object(i.useEffect)((function(){a()(n,e.stylisPlugins)||o(e.stylisPlugins)}),[e.stylisPlugins]);var c=Object(i.useMemo)((function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:s,stylis:l}}),[e.shouldForwardProp,s,l]);return i.default.createElement(xe.Provider,{value:c},i.default.createElement(Be.Provider,{value:l},e.children))}var ke=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ee);var o=n.name+t.hash;e.hasNameForId(n.id,o)||e.insertRules(n.id,o,t(n.rules,o,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,$(this,(function(){throw ee(12,String(n.name))}))}return e.prototype.getName=function(e){return void 0===e&&(e=Ee),this.name+e.hash},e}(),Oe=function(e){return e>="A"&&e<="Z"};function De(e){for(var t="",n=0;n<e.length;n++){var o=e[n];if(1===n&&"-"===o&&"-"===e[0])return e;Oe(o)?t+="-"+o.toLowerCase():t+=o}return t.startsWith("ms-")?"-"+t:t}var Le=function(e){return null==e||!1===e||""===e},Pe=function(e){var t,n,i=[];for(var r in e){var a=e[r];e.hasOwnProperty(r)&&!Le(a)&&(Array.isArray(a)&&a.isCss||Q(a)?i.push("".concat(De(r),":"),a,";"):q(a)?i.push.apply(i,Object(o.e)(Object(o.e)(["".concat(r," {")],Pe(a),!1),["}"],!1)):i.push("".concat(De(r),": ").concat((t=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in l.a||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function _e(e,t,n,o){return Le(e)?[]:Y(e)?[".".concat(e.styledComponentId)]:Q(e)?!Q(i=e)||i.prototype&&i.prototype.isReactComponent||!t?[e]:_e(e(t),t,n,o):e instanceof ke?n?(e.inject(n,o),[e.getName(o)]):[e]:q(e)?Pe(e):Array.isArray(e)?Array.prototype.concat.apply(g,e.map((function(e){return _e(e,t,n,o)}))):[e.toString()];var i}function Re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Q(n)&&!Y(n))return!1}return!0}var Fe=T(h),Me=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=I(Fe,t),this.baseStyle=n,Ce.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))o=X(o,this.staticRulesId);else{var i=K(_e(this.rules,e,t,n)),r=x(I(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);t.insertRules(this.componentId,r,a)}o=X(o,r),this.staticRulesId=r}else{for(var s=I(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=K(_e(u,e,t,n));s=I(s,d+c),l+=d}}if(l){var h=x(s>>>0);t.hasNameForId(this.componentId,h)||t.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),o=X(o,h)}}return o},e}(),We=i.default.createContext(void 0);We.Consumer;var Ne={};new Set;function Ve(e,t,n){var r=Y(e),a=e,s=!D(e),l=t.attrs,c=void 0===l?g:l,u=t.componentId,d=void 0===u?function(e,t){var n="string"!=typeof e?"sc":S(e);Ne[n]=(Ne[n]||0)+1;var o="".concat(n,"-").concat(k(h+n+Ne[n]));return t?"".concat(t,"-").concat(o):o}(t.displayName,t.parentComponentId):u,m=t.displayName,f=void 0===m?function(e){return D(e)?"styled.".concat(e):"Styled(".concat(O(e),")")}(e):m,p=t.displayName&&t.componentId?"".concat(S(t.displayName),"-").concat(t.componentId):t.componentId||d,y=r&&a.attrs?a.attrs.concat(c).filter(Boolean):c,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 Me(n,p,r?a.componentStyle:void 0);function B(e,t){return function(e,t,n){var r=e.attrs,a=e.componentStyle,s=e.defaultProps,l=e.foldedComponentIds,c=e.styledComponentId,u=e.target,d=i.default.useContext(We),h=Ie(),m=e.shouldForwardProp||h.shouldForwardProp,f=C(t,d,s)||v,p=function(e,t,n){for(var i,r=Object(o.a)(Object(o.a)({},t),{className:void 0,theme:n}),a=0;a<e.length;a+=1){var s=Q(i=e[a])?i(r):i;for(var l in s)r[l]="className"===l?X(r[l],s[l]):"style"===l?Object(o.a)(Object(o.a)({},r[l]),s[l]):s[l]}return t.className&&(r.className=X(r.className,t.className)),r}(r,t,f),g=p.as||u,y={};for(var A in p)void 0===p[A]||"$"===A[0]||"as"===A||"theme"===A&&p.theme===f||("forwardedAs"===A?y.as=p.forwardedAs:m&&!m(A,g)||(y[A]=p[A]));var S=function(e,t){var n=Ie();return e.generateAndInjectStyles(t,n.styleSheet,n.stylis)}(a,p),w=X(l,c);return S&&(w+=" "+S),p.className&&(w+=" "+p.className),y[D(g)&&!b.has(g)?"class":"className"]=w,y.ref=n,Object(i.createElement)(g,y)}(I,e,t)}B.displayName=f;var I=i.default.forwardRef(B);return I.attrs=y,I.componentStyle=x,I.displayName=f,I.shouldForwardProp=A,I.foldedComponentIds=r?X(a.foldedComponentIds,a.styledComponentId):"",I.styledComponentId=p,I.target=r?a.target:e,Object.defineProperty(I,"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 o=0,i=t;o<i.length;o++)J(e,i[o],!0);return e}({},a.defaultProps,e):e}}),$(I,(function(){return".".concat(I.styledComponentId)})),s&&G(I,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),I}function ze(e,t){for(var n=[e[0]],o=0,i=t.length;o<i;o+=1)n.push(t[o],e[o+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(Q(e)||q(e))return je(_e(ze(g,Object(o.e)([e],t,!0))));var i=e;return 0===t.length&&1===i.length&&"string"==typeof i[0]?_e(i):je(_e(ze(i,t)))}function Ue(e,t,n){if(void 0===n&&(n=v),!t)throw ee(1,t);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return e(t,n,He.apply(void 0,Object(o.e)([i],r,!1)))};return i.attrs=function(i){return Ue(e,t,Object(o.a)(Object(o.a)({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ue(e,t,Object(o.a)(Object(o.a)({},n),i))},i}var Ze=function(e){return Ue(Ve,e)},Ge=Ze;b.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,o){var i=o(K(_e(this.rules,t,n,o)),""),r=this.componentId+e;n.insertRules(r,r,i)},e.prototype.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.prototype.renderStyles=function(e,t,n,o){e>2&&Ce.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,o)}}();function Qe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=K(He.apply(void 0,Object(o.e)([e],t,!1))),r=k(i);return new ke(r,i)}(function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=de(),o=K([n&&'nonce="'.concat(n,'"'),"".concat(c,'="true"'),"".concat(d,'="').concat(h,'"')].filter(Boolean)," ");return"<style ".concat(o,">").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={})[c]="",t[d]=h,t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=de();return r&&(n.nonce=r),[i.default.createElement("style",Object(o.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 i.default.createElement(Te,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){throw ee(3)}})(),"__sc-".concat(c,"__")}).call(this,n(47))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(13),i=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.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 i(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,o.a.createFromDOMException(e)}}))}loadSlow(){return this.loadSlowResult=this.loadSlowResult||(()=>i(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||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const e=[];for(const t of yield this.getVideoDevices()){const n=r.guessparseCameraLabelFacingMode(t.label),o=r.guessparseCameraLabelMaxNumPixels(t.label);e.push({maxNumPixels:o,facingMode:n,supportsTorchControl:void 0,deviceId:t.deviceId,label:t.label})}return e})))(),this.loadFastResult}getMainCamera(e){var t,n,o,i,r,a;return null!==(a=null===(r=null===(i=null===(o=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===o?void 0:o.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===i?void 0:i[0])||void 0===r?void 0:r.camera)&&void 0!==a?a:null}getVideoDevices(){return i(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 i(this,void 0,void 0,(function*(){if(o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())throw o.a.permissionDenied();if(!navigator.mediaDevices)throw o.a.unknown()}))}static getCameraInfoFromStream(e){var t;return null===(t=e.getVideoTracks().map((e=>{var t,n,o,i,r,a;const s=null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e),l=null===(n=e.getSettings)||void 0===n?void 0:n.call(e),c=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!==(i=null===(o=null==s?void 0:s.facingMode)||void 0===o?void 0:o[0])&&void 0!==i?i:l.facingMode);"unknown"===u&&(u=this.guessparseCameraLabelFacingMode(c));let d=function(e){var t,n;let o=(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(!o||Number.isNaN(o))return;return o}(s);Number.isNaN(d)&&(d=this.guessparseCameraLabelMaxNumPixels(c));return{facingMode:u,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(r=null==s?void 0:s.torch)&&void 0!==r?r:"torch"in l)&&void 0!==a&&a,label:c,deviceId:l.deviceId}})).sort(((e,t)=>t.maxNumPixels-e.maxNumPixels)))||void 0===t?void 0:t[0]}getUserMedia(e){return i(this,void 0,void 0,(function*(){try{return yield navigator.mediaDevices.getUserMedia(e)}catch(e){throw o.a.mediaDeviceNotFound()}}))}}},function(e,t,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var r=typeof o;if("string"===r||"number"===r)e.push(o);else if(Array.isArray(o)){if(o.length){var a=i.apply(null,o);a&&e.push(a)}}else if("object"===r)if(o.toString===Object.prototype.toString)for(var s in o)n.call(o,s)&&o[s]&&e.push(s);else e.push(o.toString())}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(o=function(){return i}.apply(t,[]))||(e.exports=o)}()},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 o="-ms-",i="-moz-",r="-webkit-",a="comm",s="rule",l="decl",c="@keyframes",u=Math.abs,d=String.fromCharCode,h=Object.assign;function m(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 b(e){return e.length}function y(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,B=0,I=0,T=0,k="";function O(e,t,n,o,i,r,a,s){return{value:e,root:t,parent:n,type:o,props:i,children:r,line:E,column:x,length:a,return:"",siblings:s}}function D(e,t){return h(O("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function L(e){for(;e.root;)e=D(e.root,{children:[e]});A(e,e.siblings)}function P(){return T=I<B?v(k,I++):0,x++,10===T&&(x=1,E++),T}function _(){return v(k,I)}function R(){return I}function F(e,t){return C(k,e,t)}function M(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 W(e){return E=x=1,B=b(k=e),I=0,[]}function N(e){return k="",e}function V(e){return m(F(I-1,H(91===e?e+2:40===e?e+1:e)))}function z(e){for(;(T=_())&&T<33;)P();return M(e)>2||M(T)>3?"":" "}function j(e,t){for(;--t&&P()&&!(T<48||T>102||T>57&&T<65||T>70&&T<97););return F(e,R()+(t<6&&32==_()&&32==P()))}function H(e){for(;P();)switch(T){case e:return I;case 34:case 39:34!==e&&39!==e&&H(T);break;case 40:41===e&&H(e);break;case 92:P()}return I}function U(e,t){for(;P()&&e+T!==57&&(e+T!==84||47!==_()););return"/*"+F(t,I-1)+"*"+d(47===e?e:P())}function Z(e){for(;!M(_());)P();return F(e,I)}function G(e){return N(Q("",null,null,null,[""],e=W(e),0,[0],e))}function Q(e,t,n,o,i,r,a,s,l){for(var c=0,h=0,m=a,f=0,C=0,y=0,S=1,w=1,B=1,O=0,D="",L=i,F=r,M=o,W=D;w;)switch(y=O,O=P()){case 40:if(108!=y&&58==v(W,m-1)){-1!=g(W+=p(V(O),"&","&\f"),"&\f",u(c?s[c-1]:0))&&(B=-1);break}case 34:case 39:case 91:W+=V(O);break;case 9:case 10:case 13:case 32:W+=z(y);break;case 92:W+=j(R()-1,7);continue;case 47:switch(_()){case 42:case 47:A(X(U(P(),R()),t,n,l),l);break;default:W+="/"}break;case 123*S:s[c++]=b(W)*B;case 125*S:case 59:case 0:switch(O){case 0:case 125:w=0;case 59+h:-1==B&&(W=p(W,/\f/g,"")),C>0&&b(W)-m&&A(C>32?K(W+";",o,n,m-1,l):K(p(W," ","")+";",o,n,m-2,l),l);break;case 59:W+=";";default:if(A(M=Y(W,t,n,c,h,i,s,D,L=[],F=[],m,r),r),123===O)if(0===h)Q(W,t,M,M,L,r,m,s,F);else switch(99===f&&110===v(W,3)?100:f){case 100:case 108:case 109:case 115:Q(e,M,M,o&&A(Y(e,M,M,0,0,i,s,D,i,L=[],m,F),F),i,F,m,s,o?L:F);break;default:Q(W,M,M,M,[""],F,0,s,F)}}c=h=C=0,S=B=1,D=W="",m=a;break;case 58:m=1+b(W),C=y;default:if(S<1)if(123==O)--S;else if(125==O&&0==S++&&125==(T=I>0?v(k,--I):0,x--,10===T&&(x=1,E--),T))continue;switch(W+=d(O),O*S){case 38:B=h>0?1:(W+="\f",-1);break;case 44:s[c++]=(b(W)-1)*B,B=1;break;case 64:45===_()&&(W+=V(P())),f=_(),h=m=b(D=W+=Z(R())),O++;break;case 45:45===y&&2==b(W)&&(S=0)}}return r}function Y(e,t,n,o,i,r,a,l,c,d,h,f){for(var g=i-1,v=0===i?r:[""],b=y(v),A=0,S=0,w=0;A<o;++A)for(var E=0,x=C(e,g+1,g=u(S=a[A])),B=e;E<b;++E)(B=m(S>0?v[E]+" "+x:p(x,/&\f/g,v[E])))&&(c[w++]=B);return O(e,t,n,0===i?s:l,c,d,h,f)}function X(e,t,n,o){return O(e,t,n,a,d(T),C(e,2,-2),0,o)}function K(e,t,n,o,i){return O(e,t,n,l,C(e,0,o),C(e,o+1,-1),o,i)}function q(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 i+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return r+e+i+e+o+e+e;case 5936:switch(v(e,t+11)){case 114:return r+e+o+p(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return r+e+o+p(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return r+e+o+p(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return r+e+o+e+e;case 6165:return r+e+o+"flex-"+e+e;case 5187:return r+e+p(e,/(\w+).+(:[^]+)/,r+"box-$1$2"+o+"flex-$1$2")+e;case 5443:return r+e+o+"flex-item-"+p(e,/flex-|-self/g,"")+(f(e,/flex-|baseline/)?"":o+"grid-row-"+p(e,/flex-|-self/g,""))+e;case 4675:return r+e+o+"flex-line-pack"+p(e,/align-content|flex-|-self/g,"")+e;case 5548:return r+e+o+p(e,"shrink","negative")+e;case 5292:return r+e+o+p(e,"basis","preferred-size")+e;case 6060:return r+"box-"+p(e,"-grow","")+r+e+o+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"+o+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+e+e;case 4200:if(!f(e,/flex-|baseline/))return o+"grid-column-align"+C(e,t)+e;break;case 2592:case 3360:return o+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:o+p(e,"-start","")+e+o+"grid-row-span:"+(~g(n,"span",0)?f(n,/\d+/):+f(n,/\d+/)-+f(e,/\d+/))+";":o+p(e,"-start","")+e;case 4896:case 4128:return n&&n.some((function(e){return f(e.props,/grid-\w+-start/)}))?e:o+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(b(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"+i+(108==v(e,t+3)?"$3":"$2-$3"))+e;case 115:return~g(e,"stretch",0)?q(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,i,r,a,s,l){return o+n+":"+i+l+(r?o+n+"-span:"+(a?s:+s-+i)+l:"")+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"+o+"$2box$3")+e;case 100:return p(e,":",":"+o)+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="",o=0;o<e.length;o++)n+=t(e[o],o,e,t)||"";return n}function $(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case l:return e.return=e.return||e.value;case a:return"";case c:return e.return=e.value+"{"+J(e.children,o)+"}";case s:if(!b(e.value=e.props.join(",")))return""}return b(n=J(e.children,o))?e.return=e.value+"{"+n+"}":""}function ee(e){var t=y(e);return function(n,o,i,r){for(var a="",s=0;s<t;s++)a+=e[s](n,o,i,r)||"";return a}}function te(e){return function(t){t.root||(t=t.return)&&e(t)}}function ne(e,t,n,i){if(e.length>-1&&!e.return)switch(e.type){case l:return void(e.return=q(e.value,e.length,n));case c:return J([D(e,{value:p(e.value,"@","@"+r)})],i);case s:if(e.length)return S(n=e.props,(function(t){switch(f(t,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":L(D(e,{props:[p(t,/:(read-\w+)/,":-moz-$1")]})),L(D(e,{props:[t]})),h(e,{props:w(n,i)});break;case"::placeholder":L(D(e,{props:[p(t,/:(plac\w+)/,":"+r+"input-$1")]})),L(D(e,{props:[p(t,/:(plac\w+)/,":-moz-$1")]})),L(D(e,{props:[p(t,/:(plac\w+)/,o+"input-$1")]})),L(D(e,{props:[t]})),h(e,{props:w(n,i)})}return""}))}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(3),i=n(6);class r extends i.a{constructor(e={}){super(),this.title=new o.j({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new o.c({text:"Cancel",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.d({color:"?sbColorOnPrimary"})}),void 0!==e.title&&(this.title=new o.j(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 o.c(e.cancelButton))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(3),i=n(6);class r extends i.a{constructor(e={}){super(),this.visible=!0,this.title=new o.j({color:"?sbColorOnPrimary"}),this.background=new o.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.title&&(this.title=new o.j(e.title)),void 0!==e.background&&(this.background=new o.a(e.background))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));var o=n(8);function i(e,t,n){return Math.min(Math.max(e,t),n)}function r(e,t,n){return new o.a(i(e.x,-t/2,n.width-t/2),i(e.y,-t/2,n.height-t/2))}},function(e,t,n){"use strict";n.r(t),n.d(t,"OutputModeValues",(function(){return i})),n.d(t,"BinarizationFilterPresetValues",(function(){return r})),n.d(t,"ParametricFilter",(function(){return a})),n.d(t,"ScanbotBinarizationFilter",(function(){return s})),n.d(t,"CustomBinarizationFilter",(function(){return l})),n.d(t,"ColorDocumentFilter",(function(){return c})),n.d(t,"BrightnessFilter",(function(){return u})),n.d(t,"ContrastFilter",(function(){return d})),n.d(t,"GrayscaleFilter",(function(){return h})),n.d(t,"LegacyFilter",(function(){return m})),n.d(t,"WhiteBlackPointFilter",(function(){return f}));var o=n(7);const i=["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 l(e);case"ColorDocumentFilter":return new c(e);case"BrightnessFilter":return new u(e);case"ContrastFilter":return new d(e);case"GrayscaleFilter":return new h(e);case"LegacyFilter":return new m(e);case"WhiteBlackPointFilter":return new f(e);default:throw`Unknown child class name: ${t}`}}}(a||(a={}));class s extends o.a{constructor(e={}){super(),this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class l extends o.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 c extends o.a{constructor(e={}){super(),this._type="ColorDocumentFilter"}}class u extends o.a{constructor(e={}){super(),this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class d extends o.a{constructor(e={}){super(),this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class h extends o.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 m extends o.a{constructor(e={}){super(),this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class f extends o.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.r(t),n.d(t,"BarcodeFormatConfigurationBase",(function(){return o})),n.d(t,"BarcodeFormatOneDConfigurationBase",(function(){return i})),n.d(t,"BarcodeFormatCodabarConfiguration",(function(){return a})),n.d(t,"BarcodeFormatCode11Configuration",(function(){return s})),n.d(t,"BarcodeFormatCode39Configuration",(function(){return l})),n.d(t,"BarcodeFormatCode93Configuration",(function(){return c})),n.d(t,"BarcodeFormatCode128Configuration",(function(){return u})),n.d(t,"BarcodeFormatCode2Of5Configuration",(function(){return d})),n.d(t,"BarcodeFormatDataBarConfiguration",(function(){return h})),n.d(t,"BarcodeFormatDataBarExpandedConfiguration",(function(){return m})),n.d(t,"BarcodeFormatDataBarLimitedConfiguration",(function(){return f})),n.d(t,"BarcodeFormatItfConfiguration",(function(){return p})),n.d(t,"MsiPlesseyChecksumAlgorithmValues",(function(){return g})),n.d(t,"BarcodeFormatMsiPlesseyConfiguration",(function(){return v})),n.d(t,"BarcodeFormatUpcEanConfiguration",(function(){return C})),n.d(t,"BarcodeFormatPharmaCodeConfiguration",(function(){return b})),n.d(t,"BarcodeFormatTwoDConfigurationBase",(function(){return y})),n.d(t,"BarcodeFormatAztecConfiguration",(function(){return S})),n.d(t,"BarcodeFormatQrCodeConfiguration",(function(){return w})),n.d(t,"BarcodeFormatPdf417Configuration",(function(){return E})),n.d(t,"BarcodeFormatMicroPdf417Configuration",(function(){return x})),n.d(t,"BarcodeFormatDataMatrixConfiguration",(function(){return B})),n.d(t,"BarcodeFormatMaxiCodeConfiguration",(function(){return I})),n.d(t,"BarcodeFormatFourStateConfigurationBase",(function(){return A})),n.d(t,"AustraliaPostCustomerFormatValues",(function(){return T})),n.d(t,"BarcodeFormatAustraliaPostConfiguration",(function(){return k})),n.d(t,"BarcodeFormatJapanPostConfiguration",(function(){return O})),n.d(t,"BarcodeFormatRoyalMailConfiguration",(function(){return D})),n.d(t,"BarcodeFormatRoyalTntPostConfiguration",(function(){return L})),n.d(t,"BarcodeFormatUspsIntelligentMailConfiguration",(function(){return P})),n.d(t,"BarcodeFormatPharmaCodeTwoTrackConfiguration",(function(){return _})),n.d(t,"BarcodeFormatGs1CompositeConfiguration",(function(){return R})),n.d(t,"BarcodeFormatCommonOneDConfiguration",(function(){return F})),n.d(t,"BarcodeFormatCommonTwoDConfiguration",(function(){return M})),n.d(t,"BarcodeFormatCommonFourStateConfiguration",(function(){return W})),n.d(t,"BarcodeFormatCommonConfiguration",(function(){return N}));var o,i,r=n(7);!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 l(e);case"BarcodeFormatCode93Configuration":return new c(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new h(e);case"BarcodeFormatDataBarExpandedConfiguration":return new m(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 b(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 B(e);case"BarcodeFormatMaxiCodeConfiguration":return new I(e);case"BarcodeFormatAustraliaPostConfiguration":return new k(e);case"BarcodeFormatJapanPostConfiguration":return new O(e);case"BarcodeFormatRoyalMailConfiguration":return new D(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 M(e);case"BarcodeFormatCommonFourStateConfiguration":return new W(e);case"BarcodeFormatCommonConfiguration":return new N(e);default:throw`Unknown child class name: ${t}`}}}(o||(o={})),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 l(e);case"BarcodeFormatCode93Configuration":return new c(e);case"BarcodeFormatCode128Configuration":return new u(e);case"BarcodeFormatCode2Of5Configuration":return new d(e);case"BarcodeFormatDataBarConfiguration":return new h(e);case"BarcodeFormatDataBarExpandedConfiguration":return new m(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 b(e);default:throw`Unknown child class name: ${t}`}}}(i||(i={}));class a extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCodabarConfiguration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,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=0,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 l 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=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!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.pzn&&(this.pzn=e.pzn),void 0!==e.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=e.tryCode39ExtendedMode),void 0!==e.useCode39CheckDigit&&(this.useCode39CheckDigit=e.useCode39CheckDigit)}}class c extends r.a{constructor(e={}){super(),this._type="BarcodeFormatCode93Configuration",this.regexFilter="",this.minimumSizeScore=0,this.addAdditionalQuietZone=!1,this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,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=0,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=0,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 h 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 m 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=0,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=0,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 b 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 y,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 B(e);case"BarcodeFormatMaxiCodeConfiguration":return new I(e);default:throw`Unknown child class name: ${t}`}}}(y||(y={}));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 B 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 I 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 k(e);case"BarcodeFormatJapanPostConfiguration":return new O(e);case"BarcodeFormatRoyalMailConfiguration":return new D(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 T=["NUMERIC","ALPHA_NUMERIC"];class k 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 O 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 D 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=0,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","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 M 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 W 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 N 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=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==e.regexFilter&&(this.regexFilter=e.regexFilter),void 0!==e.minimumSizeScore&&(this.minimumSizeScore=e.minimumSizeScore),void 0!==e.addAdditionalQuietZone&&(this.addAdditionalQuietZone=e.addAdditionalQuietZone),void 0!==e.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=e.minimum1DQuietZoneSize),void 0!==e.stripCheckDigits&&(this.stripCheckDigits=e.stripCheckDigits),void 0!==e.minimumTextLength&&(this.minimumTextLength=e.minimumTextLength),void 0!==e.maximumTextLength&&(this.maximumTextLength=e.maximumTextLength),void 0!==e.gs1Handling&&(this.gs1Handling=e.gs1Handling),void 0!==e.strictMode&&(this.strictMode=e.strictMode),void 0!==e.formats&&(this.formats=e.formats.map((e=>e)))}}},function(e,t,n){"use strict";(function(e){function o(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 i(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 o="";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}}()){o+="-simd";n&&r()&&(o+="-threads")}return o}n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return a}))}).call(this,n(47))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{constructor(){this.values=new Map}}o.INSTANCE=new o},function(e,t,n){"use strict";n.r(t),n.d(t,"BarcodeItem",(function(){return a})),n.d(t,"BarcodeScannerEngineModeValues",(function(){return s})),n.d(t,"BarcodeScannerConfiguration",(function(){return l})),n.d(t,"BarcodeScannerResult",(function(){return c}));var o=n(35),i=n(7),r=n(20);class a extends i.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.GenericDocument(e.extractedDocument):null}}const s=["LEGACY","NEXT_GEN_LOW_POWER","NEXT_GEN","NEXT_GEN_LOW_POWER_AR","NEXT_GEN_AR"];class l extends i.a{constructor(e={}){super(),this.barcodeFormatConfigurations=[new o.BarcodeFormatCommonConfiguration({})],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=>o.BarcodeFormatConfigurationBase.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 c extends i.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.r(t),n.d(t,"CommonFieldTypeValues",(function(){return o}));const o=["ID","SURNAME","MAIDEN_NAME","GIVEN_NAMES","BIRTH_DATE","NATIONALITY","BIRTHPLACE","EXPIRY_DATE","EYE_COLOR","HEIGHT","ISSUE_DATE","ISSUING_AUTHORITY","ADDRESS","PSEUDONYM","MRZ","COUNTRY_CODE","GENDER","SIGNATURE","PHOTO","VALID_FROM_DATE","ROUTING_NUMBER","ACCOUNT_NUMBER","PLACE_OF_ISSUE","TITLE_TYPE","REMARKS","NAME","CARD_ACCESS_NUMBER"]},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(e,t,n){Object.keys(e).forEach((o=>{(null==n?void 0:n.includes(o))||(t[o]=e[o])}))}static mapValuesDeep(e,t){const n=e=>e&&"object"==typeof e&&!Array.isArray(e);Object.keys(e).forEach((i=>{i in t&&n(e[i])&&n(t[i])?o.mapValuesDeep(e[i],t[i]):t[i]=e[i]}))}static _fromJson(e,t){return this.mapValuesDeep(t,e),e}}},function(e,t,n){"use strict";var o=n(34);n.d(t,"a",(function(){return o.ParametricFilter}))},function(e,t,n){"use strict";var o,i=function(){return"undefined"==typeof o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},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 l(e,t){for(var n={},o=[],i=0;i<e.length;i++){var r=e[i],l=t.base?r[0]+t.base:r[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var d=s(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(h)):a.push({identifier:u,updater:g(h,t),references:1}),o.push(u)}return o}function c(e){var t=document.createElement("style"),o=e.attributes||{};if("undefined"==typeof o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[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 h(e,t,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var r=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function m(e,t,n){var o=n.css,i=n.media,r=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var f=null,p=0;function g(e,t){var n,o,i;if(t.singleton){var r=p++;n=f||(f=c(t)),o=h.bind(null,n,r,!1),i=h.bind(null,n,r,!0)}else n=c(t),o=m.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<n.length;o++){var i=s(n[o]);a[i].references--}for(var r=l(e,t),c=0;c<n.length;c++){var u=s(n[c]);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,o){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(i[a]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);o&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},function(e,t,n){"use strict";var o={};n.r(o),n.d(o,"BarcodeFormatValues",(function(){return X})),n.d(o,"BarcodeFormats",(function(){return K})),n.d(o,"Gs1HandlingValues",(function(){return J})),n.d(o,"UpcEanExtensionBehaviorValues",(function(){return $}));var i={};n.r(i),n.d(i,"BarcodeDocumentFormatValues",(function(){return ee})),n.d(i,"BarcodeDocumentFormats",(function(){return te}));var r={};n.r(r),n.d(r,"DocumentScannerEngineModeValues",(function(){return ie})),n.d(r,"DocumentScannerParameters",(function(){return re})),n.d(r,"DocumentScannerConfiguration",(function(){return ae})),n.d(r,"DocumentDetectionStatusValues",(function(){return se})),n.d(r,"DocumentDetectionScores",(function(){return le})),n.d(r,"DocumentDetectionResult",(function(){return ce}));var a={};n.r(a),n.d(a,"CheckDocumentDetectionModeValues",(function(){return de})),n.d(a,"CheckRecognitionStatusValues",(function(){return he})),n.d(a,"CheckScanningResult",(function(){return me})),n.d(a,"CheckScannerConfiguration",(function(){return fe}));var s={};n.r(s),n.d(s,"DocumentQualityValues",(function(){return ge})),n.d(s,"DocumentQualityThreshold",(function(){return ve})),n.d(s,"DocumentQualityAnalyzerConfiguration",(function(){return Ce})),n.d(s,"DocumentQualityAnalyzerResult",(function(){return be}));var l={};n.r(l),n.d(l,"EuropeanHealthInsuranceCardRecognitionResult",(function(){return ye})),n.d(l,"EuropeanHealthInsuranceCardRecognizerConfiguration",(function(){return Ae}));var c={};n.r(c),n.d(c,"DocumentDataExtractorConfigurationElement",(function(){return Se})),n.d(c,"DateValidationConfiguration",(function(){return we})),n.d(c,"EuropeanHealthInsuranceCardIssuingCountryValues",(function(){return Ee})),n.d(c,"EuropeanHealthInsuranceCardConfiguration",(function(){return xe})),n.d(c,"MrzFallbackConfiguration",(function(){return Be})),n.d(c,"DocumentDataExtractorCommonConfiguration",(function(){return Ie}));var u={};n.r(u),n.d(u,"ConfirmationMethodValues",(function(){return Te})),n.d(u,"ResultAccumulationConfiguration",(function(){return ke})),n.d(u,"AccumulatedResultsVerifierConfiguration",(function(){return Oe}));var d={};n.r(d),n.d(d,"DocumentDataExtractionStatusValues",(function(){return De})),n.d(d,"DocumentDataExtractionResult",(function(){return Le})),n.d(d,"DocumentDataExtractionModeValues",(function(){return Pe})),n.d(d,"DocumentDataFrameExtractionParameters",(function(){return _e})),n.d(d,"DocumentDataExtractorConfiguration",(function(){return Re}));var h={};n.r(h),n.d(h,"WordBox",(function(){return Fe})),n.d(h,"SymbolBox",(function(){return Me})),n.d(h,"TextPatternScannerResult",(function(){return We})),n.d(h,"ValidatorPresetValues",(function(){return Ne})),n.d(h,"ContentValidator",(function(){return Ve})),n.d(h,"DefaultContentValidator",(function(){return ze})),n.d(h,"PresetContentValidator",(function(){return je})),n.d(h,"PatternContentValidator",(function(){return He})),n.d(h,"TextPatternScannerConfiguration",(function(){return Ue}));var m={};n.r(m),n.d(m,"LicensePlateScannerStrategyValues",(function(){return Ze})),n.d(m,"LicensePlateScannerConfiguration",(function(){return Ge})),n.d(m,"LicensePlateScannerResult",(function(){return Qe}));var f={};n.r(f),n.d(f,"MedicalCertificateScanningParameters",(function(){return Ye})),n.d(f,"MedicalCertificateCheckBoxTypeValues",(function(){return Xe})),n.d(f,"MedicalCertificateCheckBox",(function(){return Ke})),n.d(f,"MedicalCertificateDateRecordTypeValues",(function(){return qe})),n.d(f,"MedicalCertificateDateRecord",(function(){return Je})),n.d(f,"MedicalCertificatePatientInfoFieldTypeValues",(function(){return $e})),n.d(f,"MedicalCertificatePatientInfoField",(function(){return et})),n.d(f,"MedicalCertificatePatientInfoBox",(function(){return tt})),n.d(f,"MedicalCertificateFormTypeValues",(function(){return nt})),n.d(f,"MedicalCertificateScanningResult",(function(){return ot}));var p={};n.r(p),n.d(p,"MrzDocumentTypeValues",(function(){return it})),n.d(p,"MrzScannerResult",(function(){return rt})),n.d(p,"MrzIncompleteResultHandlingValues",(function(){return at})),n.d(p,"MrzScannerConfiguration",(function(){return st}));var g={};n.r(g),n.d(g,"OcrElement",(function(){return lt})),n.d(g,"Glyph",(function(){return ct})),n.d(g,"Word",(function(){return ut})),n.d(g,"Line",(function(){return dt})),n.d(g,"Block",(function(){return ht})),n.d(g,"Page",(function(){return mt}));var v={};n.r(v),n.d(v,"PdfAttributes",(function(){return pt})),n.d(v,"PageSizeValues",(function(){return gt})),n.d(v,"PageDirectionValues",(function(){return vt})),n.d(v,"PageFitValues",(function(){return Ct})),n.d(v,"ResamplingMethodValues",(function(){return bt})),n.d(v,"PdfConfiguration",(function(){return yt}));var C={};n.r(C),n.d(C,"CompressionModeValues",(function(){return At})),n.d(C,"BinarizationValues",(function(){return St})),n.d(C,"UserFieldValue",(function(){return wt})),n.d(C,"UserFieldDoubleValue",(function(){return xt})),n.d(C,"UserFieldStringValue",(function(){return Bt})),n.d(C,"UserFieldIntValue",(function(){return It})),n.d(C,"UserField",(function(){return Tt})),n.d(C,"TiffWriterParameters",(function(){return kt}));var b={};n.r(b),n.d(b,"ImageRotationValues",(function(){return Ot}));var y={};n.r(y),n.d(y,"BarcodeConfigurationTypes",(function(){return G})),n.d(y,"BarcodeScannerTypes",(function(){return Q})),n.d(y,"BarcodeTypes",(function(){return o})),n.d(y,"BarcodeDocumentTypes",(function(){return i})),n.d(y,"CheckScannerTypes",(function(){return a})),n.d(y,"CommonFieldType",(function(){return pe})),n.d(y,"DocumentScannerTypes",(function(){return r})),n.d(y,"DocumentQualityAnalyzerTypes",(function(){return s})),n.d(y,"EuropeanHealthInsuranceCardTypes",(function(){return l})),n.d(y,"GenericDocument",(function(){return ue})),n.d(y,"DocumentDataExtractorConfigurationTypes",(function(){return c})),n.d(y,"DocumentDataExtractorTypes",(function(){return d})),n.d(y,"TextPatternScannerTypes",(function(){return h})),n.d(y,"Geometry",(function(){return oe})),n.d(y,"LicensePlateScannerTypes",(function(){return m})),n.d(y,"MedicalCertificateTypes",(function(){return f})),n.d(y,"MrzTypes",(function(){return p})),n.d(y,"OcrTypes",(function(){return g})),n.d(y,"ParametricFilters",(function(){return ft})),n.d(y,"PdfConfigurationTypes",(function(){return v})),n.d(y,"TiffTypes",(function(){return C})),n.d(y,"FrameAccumulationTypes",(function(){return u})),n.d(y,"ImageTypes",(function(){return b})),n.d(y,"PartiallyConstructible",(function(){return Y.a}));class A{}A.VERSION="7.0.0-dev.1",A.BUILD_WITH_UI=!1;var S=n(36);class w{constructor(e,t){this.errorInWorker=null,this.createProxy=e=>new Proxy({},{get:(t,n,o)=>(...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||{},o=Object(S.c)(t),i=`${e}${e.endsWith("/")?"":"/"}ScanbotSDK.Core${o}.js${n}`;if(Object(S.d)(i)){const e=new Blob([`importScripts("${i}")`]);this.instance=new Worker(URL.createObjectURL(e))}else this.instance=new Worker(i);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:o,result:i,recoverableError:r,unrecoverableError:a}=e.data,s=this.continuations[o];if(!s)return;const{resolve:l,reject:c}=s;delete this.continuations[o],a?(c(a),this.handleUnrecoverableError(a)):r?c(r):l(i)},this.instance.onerror=e=>{this.handleUnrecoverableError(e.error)}}post(e,t,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((o,i)=>{const r=Object(S.b)(t,"copy"==n),a=this.nextTicketId++;this.continuations[a]={resolve:o,reject:i},this.instance.postMessage({command:e,args:t,ticket:a},r)}))}destroy(){this.instance.terminate()}}var E=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class x extends Error{}class B extends Error{}class I{constructor(e,t,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),this.core=new w(e,t),this.coreInitializationSuccessful=(()=>E(this,void 0,void 0,(function*(){if(yield this.core.copyArgs.initialize(...n)){let t;try{t=yield this.core.copyArgs.version()}catch(e){t="Error"}const n=A.VERSION;return t!==n?new B(`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 x("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 E(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(e){return new Proxy({},{get:(t,n,o)=>(...t)=>E(this,void 0,void 0,(function*(){const o=yield this.getCoreForCommand(n),i="copy"===e?o.copyArgs:o.transferArgs;return yield i[n](...t)}))})}getCoreForCommand(e=""){return E(this,void 0,void 0,(function*(){const t=yield this.coreInitializationSuccessful;if("OK"===t||"getLicenseInfo"===e&&t instanceof x)return this.core;throw t}))}destroy(){this.core.destroy(),this.core=void 0}}class T{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(e){const t=new T;return t.status=e.licenseStatus,t.description=e.description,t}}var k=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class O{constructor(e,t){this._sdk=e,this._pdfOperation=t}addPage(e,t={}){return k(this,void 0,void 0,(function*(){const{consumeImage:n="COPY_IMAGE"}=t,o=this._sdk.getBridge(n);yield o.addPageToPdf(this._pdfOperation,e)}))}addPages(e){return k(this,void 0,void 0,(function*(){for(const t of e.pages){const e=yield t.finalRawImage();yield this.addPage(e)}}))}complete(){return k(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var D=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class L{constructor(e,t){this._sdk=e,this._tiffOperation=t}addPage(e,t={}){return D(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:o="COPY_IMAGE"}=t,i=this._sdk.getBridge(o);yield i.addPageToTiff(this._tiffOperation,e,n)}))}addPages(e,t={}){return D(this,void 0,void 0,(function*(){for(const n of e.pages){const e=yield n.finalRawImage();yield this.addPage(e,t)}}))}complete(){return D(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var P=n(23);class _{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 o=0;o<5;o++)e+=t.charAt(Math.floor(Math.random()*n));return e}}var R=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class F{static toDataUrl(e){return new Promise(((t,n)=>{const o=new Blob([e],{type:"image/jpeg"}),i=new FileReader;i.onload=()=>t(i.result),i.onerror=()=>n(i.error),i.readAsDataURL(o)}))}static getObjectFitSize(e,t,n=!0){const o=t.width/t.height,i=e.width/e.height;let r=0,a=0;(n?o>i:o<i)?(r=e.width,a=r/o):(a=e.height,r=a*o);const s=(e.width-r)/2,l=(e.height-a)/2;return new P.a(s,l,r,a)}static loadFromUrl(e){return new Promise(((t,n)=>{const o=document.createElement("img");o.src=e,o.onload=()=>R(this,void 0,void 0,(function*(){const e=document.createElement("canvas");e.width=o.width,e.height=o.height;const n=e.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);t(i)})),o.onerror=n}))}static saveImageData(e){const t=this.createImageDataCanvas(e),n=" ("+e.width+"x"+e.height+")";t.toBlob((e=>this.saveBlob(e,_.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 o=URL.createObjectURL(e);n.setAttribute("href",o),n.click()}static convertImageDataWrapperToImageData(e){if(e)return new ImageData(e.data,e.width,e.height)}static wrapperToBase64(e){return F.createImageDataCanvas(F.convertImageDataWrapperToImageData(e)).toDataURL("image/png")}static toBase64(e,t=!0){return R(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}))}}class M{saveImageAsJpeg(e,t){if(!e||0===e.length)return void console.log("Data cannot be null or empty");t||(t=_.uuid()+".jpeg");let n=new Blob([e],{type:"image/jpeg"});F.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 W=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class N{constructor(e,t){this._sdk=e,this._mrzRecognizerToken=t}recognize(e,t="COPY_IMAGE"){return W(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanMRZ(yield this._mrzRecognizerToken,e)}))}recognizeURL(e){return W(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=e,o.onload=()=>W(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const e=n.getContext("2d");e.drawImage(o,0,0);const i=e.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);t(r||void 0)}))}))}))}release(){return W(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var V=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class z{constructor(e,t){this._sdk=e,this._OcrEngineToken=t}performOcr(e,t="COPY_IMAGE"){return V(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.performOcr(this._OcrEngineToken,e)}))}recognizeURL(e){return V(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=e,o.onload=()=>V(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const e=n.getContext("2d");e.drawImage(o,0,0);const i=e.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);t(r)}))}))}))}release(){return V(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var j=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class H{constructor(e,t){this._sdk=e,this._textPatternScannerToken=t}recognize(e,t="COPY_IMAGE"){return j(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(t);return yield n.scanTextLine(yield this._textPatternScannerToken,e)}))}cleanRecognitionQueue(){return j(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanTextLineScanningQueue(yield this._textPatternScannerToken)}))}recognizeURL(e){return j(this,void 0,void 0,(function*(){return new Promise((t=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=e,o.onload=()=>j(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const e=n.getContext("2d");e.drawImage(o,0,0);const i=e.getImageData(0,0,o.width,o.height),r=yield this.recognize(i,"CONSUME_IMAGE");r&&t(r)}))}))}))}release(){return j(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textPatternScannerToken)}))}}var U=n(14),Z=n(22),G=n(35),Q=n(38),Y=n(7);const X=["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"];class K extends Y.a{constructor(e={}){super()}}var q;(q=K||(K={})).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","UPC_A","UPC_E"],q.twod=["AZTEC","DATA_MATRIX","MAXI_CODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],q.postal=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],q.pharma=["CODE_32","PHARMA_CODE","PHARMA_CODE_TWO_TRACK","PZN"],q.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"],q.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","QR_CODE","RMQR_CODE","ROYAL_MAIL","ROYAL_TNT_POST","UPC_A","UPC_E","USPS_INTELLIGENT_MAIL"];const J=["PARSE","VALIDATE_STRUCTURE","DECODE_STRUCTURE","VALIDATE_FULL","DECODE_FULL"],$=["REQUIRE_2","REQUIRE_5","REQUIRE_ANY","IGNORE","ALLOW_2","ALLOW_5","ALLOW_ANY"],ee=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"];class te extends Y.a{constructor(e={}){super()}}var ne;(ne=te||(te={})).all=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],ne.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 oe=n(21);const ie=["ML","LEGACY"];class re extends Y.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 oe.AspectRatio(e)))),void 0!==e.ignoreOrientationMismatch&&(this.ignoreOrientationMismatch=e.ignoreOrientationMismatch)}}class ae extends Y.a{constructor(e={}){super(),this.engineMode="ML",this.parameters=new re({}),void 0!==e.engineMode&&(this.engineMode=e.engineMode),void 0!==e.parameters&&(this.parameters=new re(e.parameters))}}const se=["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 le extends Y.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 ce extends Y.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 le(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 oe.LineSegmentInt(e))),void 0===e.verticalLines)throw new Error("verticalLines must be present in constructor argument");if(this.verticalLines=e.verticalLines.map((e=>new oe.LineSegmentInt(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 oe.LineSegmentFloat(e))),void 0===e.verticalLinesNormalized)throw new Error("verticalLinesNormalized must be present in constructor argument");if(this.verticalLinesNormalized=e.verticalLinesNormalized.map((e=>new oe.LineSegmentFloat(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 ue=n(20);const de=["DISABLED","DETECT_DOCUMENT","DETECT_AND_CROP_DOCUMENT"],he=["SUCCESS","VALIDATION_FAILED","FAIL"];class me extends Y.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 ue.GenericDocument(e.check):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=null!=e.documentDetectionResult?new ce(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 fe extends Y.a{constructor(e={}){super(),this.documentDetectionMode="DISABLED",void 0!==e.documentDetectionMode&&(this.documentDetectionMode=e.documentDetectionMode)}}var pe=n(39);const ge=["VERY_POOR","POOR","REASONABLE","GOOD","EXCELLENT"];class ve extends Y.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 Ce extends Y.a{constructor(e={}){super(),this.qualityThresholds=[new ve({symbolQuality:.5,symbolRatio:.5}),new ve({symbolQuality:.7,symbolRatio:.3}),new ve({symbolQuality:.85,symbolRatio:.3}),new ve({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 ve(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 be extends Y.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&&ge.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 ye extends Y.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 ye.Field(e))),void 0!==e.status&&(this.status=e.status)}}!function(e){e.RecognitionStatusValues=["SUCCESS","FAILED_DETECTION","INCOMPLETE_VALIDATION"];class t extends Y.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={}))}(ye||(ye={}));class Ae extends Y.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 Se;!function(e){e.From=function(e){const t=e._type;switch(t){case"DateValidationConfiguration":return new we(e);case"EuropeanHealthInsuranceCardConfiguration":return new xe(e);case"MRZFallbackConfiguration":return new Be(e);case"DocumentDataExtractorCommonConfiguration":return new Ie(e);default:throw`Unknown child class name: ${t}`}}}(Se||(Se={}));class we extends Y.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 Ee=["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 xe extends Y.a{constructor(e={}){super(),this._type="EuropeanHealthInsuranceCardConfiguration",this.expectedCountry=null,void 0!==e.expectedCountry&&(this.expectedCountry=null!=e.expectedCountry&&Ee.includes(e.expectedCountry)?e.expectedCountry:null)}}class Be extends Y.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 Ie extends Y.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 Te=["EXACT","INTERPOLATE"];class ke extends Y.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 Oe extends Y.a{constructor(e={}){super(),this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult)}}const De=["SUCCESS","ERROR_NOTHING_FOUND","ERROR_BAD_CROP","ERROR_UNKNOWN_DOCUMENT","ERROR_UNACCEPTABLE_DOCUMENT","INCOMPLETE_VALIDATION"];class Le extends Y.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 ue.GenericDocument(e.document):null,void 0===e.documentDetectionResult)throw new Error("documentDetectionResult must be present in constructor argument");if(this.documentDetectionResult=new ce(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 Pe=["LIVE","SINGLE_SHOT"];class _e extends Y.a{constructor(e={}){super(),this.mode="LIVE",void 0!==e.mode&&(this.mode=e.mode)}}class Re extends Y.a{constructor(e={}){if(super(),this.resultAccumulationConfig=new ke({}),this.fieldExcludeList=[],void 0!==e.resultAccumulationConfig&&(this.resultAccumulationConfig=new ke(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=>Se.From(e)))}}class Fe extends Y.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 Me extends Y.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 We extends Y.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 Fe(e))),void 0===e.symbolBoxes)throw new Error("symbolBoxes must be present in constructor argument");this.symbolBoxes=e.symbolBoxes.map((e=>new Me(e))),void 0!==e.confidence&&(this.confidence=e.confidence),void 0!==e.validationSuccessful&&(this.validationSuccessful=e.validationSuccessful)}}const Ne=["VEHICLE_IDENTIFICATION_NUMBER"];var Ve;!function(e){e.From=function(e){const t=e._type;switch(t){case"DefaultContentValidator":return new ze(e);case"PresetContentValidator":return new je(e);case"PatternContentValidator":return new He(e);default:throw`Unknown child class name: ${t}`}}}(Ve||(Ve={}));class ze extends Y.a{constructor(e={}){super(),this._type="DefaultContentValidator",this.allowedCharacters="",void 0!==e.allowedCharacters&&(this.allowedCharacters=e.allowedCharacters)}}class je extends Y.a{constructor(e={}){if(super(),this._type="PresetContentValidator",void 0===e.preset)throw new Error("preset must be present in constructor argument");this.preset=e.preset}}class He extends Y.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 Ue extends Y.a{constructor(e={}){super(),this.ocrResolutionLimit=0,this.maximumNumberOfAccumulatedFrames=3,this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=2,this.validator=new ze({}),void 0!==e.ocrResolutionLimit&&(this.ocrResolutionLimit=e.ocrResolutionLimit),void 0!==e.maximumNumberOfAccumulatedFrames&&(this.maximumNumberOfAccumulatedFrames=e.maximumNumberOfAccumulatedFrames),void 0!==e.minimumNumberOfRequiredFramesWithEqualRecognitionResult&&(this.minimumNumberOfRequiredFramesWithEqualRecognitionResult=e.minimumNumberOfRequiredFramesWithEqualRecognitionResult),void 0!==e.validator&&(this.validator=Ve.From(e.validator))}}const Ze=["CLASSIC","ML"];class Ge extends Y.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 Qe extends Y.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 Ye extends Y.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 Xe=["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 Ke extends Y.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 qe=["INCAPABLE_OF_WORK_SINCE","INCAPABLE_OF_WORK_UNTIL","DIAGNOSED_ON","DOCUMENT_DATE","BIRTH_DATE","CHILD_NEEDS_CARE_FROM","CHILD_NEEDS_CARE_UNTIL","UNDEFINED"];class Je extends Y.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 $e=["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 et extends Y.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 tt extends Y.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 et(e))),void 0!==e.hasContents&&(this.hasContents=e.hasContents)}}const nt=["UNKNOWN","FORM_1A","FORM_1B","FORM_1C","FORM_1D","FORM_21A","FORM_21A_BACK","FORM_1B_CUSTOM"];class ot extends Y.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 tt(e.patientInfoBox),void 0===e.checkBoxes)throw new Error("checkBoxes must be present in constructor argument");if(this.checkBoxes=e.checkBoxes.map((e=>new Ke(e))),void 0===e.dates)throw new Error("dates must be present in constructor argument");if(this.dates=e.dates.map((e=>new Je(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 ce(e.documentDetectionResult):null}}const it=["UNKNOWN","CREW_MEMBER_CERTIFICATE","ID_CARD","PASSPORT","VISA","CH_DRIVING_LICENSE"];class rt extends Y.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 ue.GenericDocument(e.document):null}}const at=["ACCEPT","REJECT"];class st extends Y.a{constructor(e={}){super(),this.frameAccumulationConfiguration=new Oe({}),this.enableDetection=!0,this.incompleteResultHandling="ACCEPT",void 0!==e.frameAccumulationConfiguration&&(this.frameAccumulationConfiguration=new Oe(e.frameAccumulationConfiguration)),void 0!==e.enableDetection&&(this.enableDetection=e.enableDetection),void 0!==e.incompleteResultHandling&&(this.incompleteResultHandling=e.incompleteResultHandling)}}var lt;!function(e){e.From=function(e){const t=e._type;switch(t){case"Glyph":return new ct(e);case"Word":return new ut(e);case"Line":return new dt(e);case"Block":return new ht(e);case"Page":return new mt(e);default:throw`Unknown child class name: ${t}`}}}(lt||(lt={}));class ct extends Y.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 ut extends Y.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 ct(e)))}}class dt extends Y.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 ut(e)))}}class ht extends Y.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 dt(e)))}}class mt extends Y.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 ht(e)))}}var ft=n(34);class pt extends Y.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 gt=["LETTER","LEGAL","A3","A4","A5","B4","B5","EXECUTIVE","US4x6","US4x8","US5x7","COMM10","CUSTOM"],vt=["PORTRAIT","LANDSCAPE","AUTO"],Ct=["FIT_IN","FILL_IN","STRETCH","NONE"],bt=["NONE","NEAREST","LINEAR","CUBIC","LANCZOS4","AREA"];class yt extends Y.a{constructor(e={}){super(),this.attributes=new pt({}),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 pt(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 At=["NONE","CCITTRLE","CCITT_T4","CCITT_T6","LZW","OJPEG","JPEG","T85","T43","NEXT","CCITTRLEW","PACKBITS","THUNDERSCAN","IT8CTPAD","IT8LW","IT8MP","IT8BL","PIXARFILM","PIXARLOG","DEFLATE","ADOBE_DEFLATE"],St=["DISABLED","ENABLED","ENABLED_IF_BINARIZATION_FILTER_SET"];var wt,Et;!function(e){e.From=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new xt(e);case"UserFieldStringValue":return new Bt(e);case"UserFieldIntValue":return new It(e);default:throw`Unknown child class name: ${t}`}}}(wt||(wt={}));class xt extends Y.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 Bt extends Y.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 It extends Y.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 Tt extends Y.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=wt.From(e.value)}}class kt extends Y.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 Tt(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?ft.ParametricFilter.From(e.binarizationFilter):null)}}(Et=kt||(kt={})).defaultCompression="LZW",Et.binaryDocumentOptimizedCompression="CCITT_T6";const Ot=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"];class Dt extends Z.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new h.TextPatternScannerConfiguration,this.onTextDetected=function(e){},this.finder.aspectRatio=new oe.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(e){const t=new Dt;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class Lt extends Z.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new h.TextPatternScannerConfiguration,this.onTextDetected=function(e){},this.finder.aspectRatio=new oe.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(e){const t=new Lt;return this.mapFinderConfiguration(t,e),this._fromJson(t,e)}}class Pt extends Error{constructor(e){super(e.description),this.name="LicenseError"}}class _t{static throwIfMissingBuffer(e){_t.throwIfMissing(e,"ImageBuffer may not be null")}static throwIfMissing(e,t){if(!e)throw new Error(t)}}var Rt=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Ft{constructor(e,t){this._sdk=e,this._token=t}analyze(e,t="COPY_IMAGE"){return Rt(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const n=this._sdk.getBridge(t);return yield n.documentQualityAnalyzerAnalyze(this._token,e)}))}release(){return Rt(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var Mt=n(17),Wt=n(0),Nt=n(48),Vt=n(15),zt=n(1),jt=n.n(zt),Ht=n(5);const Ut="var(--1-sb-dvh, 1vh)";function Zt(){const e=Object(Wt.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(Wt.useEffect)((()=>{if(t(),!e)return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}})),null}var Gt=n(31),Qt=n(9),Yt=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};function Xt(e){const{styleConfig:t}=e,n=Yt(e,["styleConfig"]),o=Object.assign(Object.assign({},e.style),{backgroundColor:Ht.b.getColorValue(t.fillColor),borderColor:Ht.b.getColorValue(t.strokeColor),borderWidth:t.strokeWidth,borderRadius:t.cornerRadius,borderStyle:"solid"});return Wt.default.createElement(zt.Box,Object.assign({},n,{style:o}))}function Kt(e){return e=Ht.b.getColorValue(e),Object.assign(Object.assign({},function(e){return{color:e=Ht.b.getColorValue(e),"&:hover":{textDecoration:"underline !important",backgroundColor:"transparent !important"}}}(e)),qt(e))}function qt(e){return{"&:focus-visible":{outlineColor:`${e=Ht.b.getColorValue(e)} !important`,outlineWidth:"2px !important",outlineStyle:"solid !important"}}}function Jt(e){var t;const n=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{};return Wt.default.createElement(Wt.default.Fragment,null,e.config.visible&&Wt.default.createElement(zt.IconButton,Object.assign({disabled:!e.enabled,component:null!==(t=e.iconButtonComponent)&&void 0!==t?t:"button","aria-label":Ht.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign({opacity:e.enabled?1:.5,backgroundColor:Ht.b.getColorValue(e.config.background.fillColor),borderWidth:e.config.background.strokeWidth,borderColor:Ht.b.getColorValue(e.config.background.strokeColor),borderStyle:"solid",borderRadius:"4px",visibility:e.config.visible?"visible":"hidden",flexDirection:"column"},Kt(e.config.title.color)),onClick:e.onClick},n),e.config.icon.visible&&Wt.default.createElement(e.icon,{color:Ht.b.getColorValue(e.config.icon.color)}),e.children,Wt.default.createElement(Qt.a,{config:e.config.title,style:{fontSize:12,marginTop:8}})))}const $t=new Map;function en(e){const t=function(e){if(!$t.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 o=n.fillStyle;if(n.fillStyle="#fff",n.fillStyle=e,o!==n.fillStyle)return $t.set(e,null),null;n.fillRect(0,0,1,1);const i=[...n.getImageData(0,0,1,1).data];$t.set(e,{r:i[0],g:i[1],b:i[2],a:i[3]})}return $t.get(e)}(e);return 0===(null==t?void 0:t.a)}function tn(e){var t,n;if(!e.visible)return Wt.default.createElement("div",{style:{display:"flex",flex:1}});const o=e.debugName?{[`data-sb-button-${e.debugName}`]:1}:{},i="right"===(null!==(t=e.iconPosition)&&void 0!==t?t:"left");let r={};return en(Ht.b.getColorValue(e.background.fillColor))&&(r={textDecoration:"underline"}),Wt.default.createElement(zt.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(Qt.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:Ht.b.getColorValue(e.foreground.color),outlineWidth:2,outlineStyle:"solid"},px:0},e.buttonWidth?{width:`${e.buttonWidth}px`,minWidth:0}:{}),disableRipple:!0},o),Wt.default.createElement(Xt,{styleConfig: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&&!i&&e.icon,Ht.b.getLocalizedText(e.text),e.foreground.iconVisible&&i&&e.icon))}Gt.a;const nn=Wt.default.createContext(null);function on(e){const t=e.mode,n="HIDDEN"===t?0:48;Object(Wt.useEffect)((()=>{if("HIDDEN"===t)return;const n=document.createElement("meta");return n.name="theme-color",n.content=Ht.b.getColorValue(e.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[t]);const o="SOLID"===t?0:n,i={height:n,remainingVisibleBodyHeight:"SOLID"===t?`calc(100 * ${Ut} - ${n}px)`:`calc(100 * ${Ut})`,minTopPaddingForContent:o,minTopPaddingForViewFinder:10+o},r="SOLID"===t?{backgroundColor:Ht.b.getColorValue(e.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${Ht.b.getColorValue(e.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return Wt.default.createElement(Wt.default.Fragment,null,"HIDDEN"!==t&&Wt.default.createElement(zt.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},Wt.default.createElement(zt.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},Wt.default.createElement(zt.Box,{sx:{flex:1}},e.cancelButton.visible&&Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(tn,Object.assign({onClick:e.onBackPress,icon:e.cancelButton.foreground.iconVisible&&Wt.default.createElement(jt.a,{sx:{fontSize:12,mr:"5px"}})},e.cancelButton)))),Wt.default.createElement(zt.Box,null,Wt.default.createElement(zt.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},Wt.default.createElement(Qt.a,{config:e.title}))),Wt.default.createElement(zt.Box,{sx:{flex:1}}))),Wt.default.createElement(nn.Provider,{value:i},e.children))}function rn(e){return{textOverflow:"ellipsis",WebkitBoxOrient:"vertical",WebkitLineClamp:`${e}`,overflow:"hidden",whiteSpace:e>1?"normal":"nowrap",display:e>1?"-webkit-box":"block"}}function an(e){if(e.loading)return Wt.default.createElement(zt.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 Wt.default.createElement(zt.Box,{sx:t})}const t={width:e.imageSize,height:e.imageSize,borderRadius:8};return Wt.default.createElement("img",{src:e.data.barcodeImage,alt:e.data.title,style:t})}function sn(e){var t,n;const o=(null===(t=e.barcodeMappedData)||void 0===t?void 0:t.state)||"LOADING",i=(null===(n=e.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!e||"LOADED"!==o,a=e.imageSize,s=e.barcodeTitle.visible||e.barcodeSubtitle.visible||e.counterForm,l=e.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:Ht.b.getColorValue(e.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return Wt.default.createElement(zt.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},e.barcodeImageVisible&&Wt.default.createElement(zt.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},Wt.default.createElement(an,{data:i,imageSize:a,loading:r})),s&&Wt.default.createElement(zt.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},e.barcodeTitle.visible&&Wt.default.createElement(zt.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},Wt.default.createElement(zt.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},rn(e.maxNumberOfTitleLines)),Object(Qt.b)(e.barcodeTitle))},r?Wt.default.createElement(zt.Skeleton,{variant:"text"}):i.title),e.displayRightArrow&&!r&&Wt.default.createElement(jt.a,{sx:{fontSize:16,fontWeight:"bold",color:Ht.b.getColorValue(e.barcodeTitle.color)}})),e.barcodeSubtitle.visible&&Wt.default.createElement(zt.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},rn(e.maxNumberOfSubtitleLines)),Object(Qt.b)(e.barcodeSubtitle))},r?Wt.default.createElement(zt.Skeleton,{variant:"text"}):i.subtitle),e.counterForm&&Wt.default.createElement(zt.ButtonGroup,{variant:"outlined"},Wt.default.createElement(zt.Button,{disabled:!e.counterForm.removeButtonEnabled,sx:l,style:{opacity:e.counterForm.removeButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter-1),disableRipple:!0},Wt.default.createElement(jt.a,{sx:{color:Ht.b.getColorValue(e.counterForm.manualCountChangeColor)}})),Wt.default.createElement(zt.Button,{sx:Object.assign(Object.assign({},l),{color:Ht.b.getColorValue(e.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:e.counterForm.onNumberClick,disableRipple:!0},e.counterForm.counter),Wt.default.createElement(zt.Button,{disabled:!e.counterForm.addButtonEnabled,sx:l,style:{opacity:e.counterForm.addButtonEnabled?1:.3},onClick:()=>e.counterForm.setCounter(e.counterForm.counter+1),disableRipple:!0},Wt.default.createElement(jt.a,{sx:{color:Ht.b.getColorValue(e.counterForm.manualCountChangeColor)}})))))}Vt.ButtonConfiguration;function ln(e){var t;if(!e.visible)return null;const n={["data-sb-button-"+e.debugName]:!0};return Wt.default.createElement(zt.Button,Object.assign({disabled:null!==(t=e.disabled)&&void 0!==t&&t,onClick:e.onClick,type:e.type,"aria-label":e.ariaLabel,sx:Object.assign(Object.assign({},e.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:Ht.b.getColorValue(e.background.strokeColor),borderWidth:e.background.strokeWidth,backgroundColor:Ht.b.getColorValue(e.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},n),e.foreground.iconVisible&&e.icon&&Wt.default.createElement(e.icon,{sx:{color:Ht.b.getColorValue(e.foreground.color),pr:2}}),Wt.default.createElement(Qt.a,{config:{visible:!0,text:e.text,color:e.foreground.color,useShadow:e.foreground.useShadow}}))}var cn=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};function un(e){var t,{modalOverlayColor:n}=e,o=cn(e,["modalOverlayColor"]);const i={backdrop:{style:{backgroundColor:Ht.b.getColorValue(n)}}},r=Object.assign(Object.assign({},o.PaperProps),{sx:Object.assign(Object.assign({},null===(t=o.PaperProps)||void 0===t?void 0:t.sx),o.width?{width:o.width}:{maxWidth:400})});return Wt.default.createElement(zt.Dialog,Object.assign({},o,{componentsProps:i,PaperProps:r}))}function dn(e){const t=Object(Wt.useContext)(Ht.a).getColorValue,n=!e.barcodeMappedData||"LOADED"!==e.barcodeMappedData.state,o={backgroundColor:t(n?e.sheetColorLoading:e.sheetColorLoaded)},[i,r]=Wt.default.useState(),a=Object(Wt.useRef)((()=>{}));Object(Wt.useEffect)((()=>{e.open&&r(!1)}),[e.open]);const s=()=>{a.current=e.handleCancel,r(!0)};return Wt.default.createElement(un,{modalOverlayColor:e.modalOverlayColor,open:e.open&&!i,fullWidth:!0,TransitionProps:{onExited:()=>{i&&a.current()}},onClose:()=>{n||s()}},Wt.default.createElement(zt.DialogContent,{style:o},Wt.default.createElement(sn,Object.assign({},e,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),Wt.default.createElement(zt.DialogActions,{style:o},Wt.default.createElement(jt.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},Wt.default.createElement(jt.a,{item:!0,xs:12},Wt.default.createElement(jt.a,{color:t(e.dividerColor)})),n?Wt.default.createElement(jt.a,{item:!0,xs:12,sx:{textAlign:"center"}},Wt.default.createElement(zt.Box,null,Wt.default.createElement(zt.CircularProgress,{sx:{color:t(e.loadingMessage.color),verticalAlign:"middle",mr:2}}),Wt.default.createElement(Qt.a,{config:e.loadingMessage}))):Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},onClick:s},e.cancelButton))),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},onClick:()=>{a.current=e.handleSubmit,r(!0)}},e.submitButton)))))))}var hn=n(3);hn.h;function mn(e){if(!1===e.visible)return null;const t={backgroundColor:e.active?Ht.b.getColorValue(e.activeBackgroundColor):Ht.b.getColorValue(e.backgroundColor),color:e.active?Ht.b.getColorValue(e.activeForegroundColor):Ht.b.getColorValue(e.foregroundColor)};return Wt.default.createElement(zt.IconButton,{sx:Object.assign(Object.assign({},t),{"&:hover, &:focus":Object.assign({outline:"none"},t),width:48,height:48}),onClick:e.onClick},e.text&&Wt.default.createElement("span",{style:{fontSize:15}},Ht.b.getLocalizedText(e.text)),e.icon&&Wt.default.createElement(e.icon,{style:{padding:7}}))}var fn=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class pn{constructor(){this.audioFile=new Audio}initialize(e){return fn(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 fn(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(e){}}))}}pn.INSTANCE=new pn;var gn=pn;class vn{constructor(){this.DURATION=200}vibrate(e){e.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}vn.INSTANCE=new vn;var Cn=vn,bn=n(12),yn=n(25),An=n(24),Sn=n(26);class wn extends Wt.default.Component{constructor(e){super(e),this.state={base64Image:void 0}}render(){const e="x"+this.props.barcode.count;return Wt.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},Wt.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},Wt.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},Wt.default.createElement("div",{style:{flex:1}},this.props.barcode.text),Wt.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},e)),Wt.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}function En(e,t){return e.format===t.format&&e.text===t.text}function xn(e){return e.text+e.format}class Bn extends Wt.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=>En(t,e)));-1===n?(e.count=1,t.push(e)):t[n].count++})),t}update(e){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(e)})}render(){return Wt.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((e,t)=>Wt.default.createElement(wn,{key:t,barcode:e,onClick:this.props.onClick}))))}}class In{}In.ScanbotPrimary="#c8193c",In.LightGray="#F5F5F5",In.Gray="#808080",In.DarkGray="#333333",In.Orange="#FF5533",In.White="#FFFFFF",In.TransparentGreen="rgba(0, 255, 0, 0.5)",In.TransparentGray="rgba(50, 50, 50, 0.5)",In.TransparentBlack="rgba(0, 0, 0, 0.3)",In.SBNegative="#FF3737";var Tn,kn=In;!function(e){e[e.None=0]="None",e[e.PushRight=1]="PushRight",e[e.PushBottom=2]="PushBottom",e[e.Pop=3]="Pop"}(Tn||(Tn={}));class On extends Wt.default.Component{constructor(e){super(e),this._isVisible=!1,this.state={animation:{type:Tn.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===Tn.None)return null;const o=this.animation(this.state.animation.type),i=this.to(this.state.animation.type);this.previousDestination=i;const r=this.props.style;return Wt.default.createElement(o,{style:this.containerStyle(`${i}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:e=>{this.reset()}},Wt.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:e=>{e.stopPropagation()}},Wt.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:kn.ScanbotPrimary}},Wt.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},Wt.default.createElement("div",{style:{backgroundColor:kn.White,height:3,width:33,borderRadius:5}})),Wt.default.createElement("div",{style:{display:"flex",height:50}},Wt.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:kn.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),Wt.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:kn.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"),Wt.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:kn.White,justifyContent:"right",alignItems:"center",paddingRight:10}},Wt.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:e=>{e.stopPropagation(),this.reset()}},"×")))),Wt.default.createElement(Bn,{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(Tn.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===Tn.Pop&&this.updateAnimationType(Tn.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 o=Sn.b`from {transform: ${t};} to {transform: ${n};}`;return Sn.a.div`animation: ${o} 0.5s;`}from(e){if(e===Tn.PushRight)return this.translate("X",100);if(e===Tn.PushBottom)return this.translate("Y",100);if(e===Tn.Pop){const e=this.pushType===Tn.PushRight?"X":"Y";return this.translate(e,0)}}to(e){if(e===Tn.PushRight)return this.translate("X",0);if(e===Tn.PushBottom)return this.translate("Y",0);if(e===Tn.Pop){const e=this.pushType===Tn.PushRight?"X":"Y";return this.translate(e,100)}}translate(e,t){return"translate"+e+"("+t+"%)"}componentWillUnmount(){this._isVisible=!1}}var Dn=n(4),Ln=function(e){return{isEnabled:function(t){return e.some((function(e){return!!t[e]}))}}},Pn={measureLayout:Ln(["layout","layoutId","drag","_layoutResetTransform"]),animation:Ln(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:Ln(["exit"]),drag:Ln(["drag","dragControls"]),focus:Ln(["whileFocus"]),hover:Ln(["whileHover","onHoverStart","onHoverEnd"]),tap:Ln(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Ln(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:Ln(["layout","layoutId"])};var _n=Object(Wt.createContext)({strict:!1}),Rn=Object.keys(Pn),Fn=Rn.length;var Mn=Object(Wt.createContext)({transformPagePoint:function(e){return e},isStatic:!1}),Wn=Object(Wt.createContext)({});var Nn=Object(Wt.createContext)(null);function Vn(e){var t=Object(Wt.useRef)(null);return null===t.current&&(t.current=e()),t.current}function zn(){var e=Object(Wt.useContext)(Nn);if(null===e)return[!0,null];var t=e.isPresent,n=e.onExitComplete,o=e.register,i=Zn();Object(Wt.useEffect)((function(){return o(i)}),[]);return!t&&n?[!1,function(){return null==n?void 0:n(i)}]:[!0]}function jn(e){return null===e||e.isPresent}var Hn=0,Un=function(){return Hn++},Zn=function(){return Vn(Un)},Gn=Object(Wt.createContext)(null),Qn="undefined"!=typeof window,Yn=Qn?Wt.useLayoutEffect:Wt.useEffect;function Xn(e,t,n,o){var i=Object(Wt.useContext)(Mn),r=Object(Wt.useContext)(_n),a=Object(Wt.useContext)(Wn).visualElement,s=Object(Wt.useContext)(Nn),l=function(e){var t=e.layoutId,n=Object(Wt.useContext)(Gn);return n&&void 0!==t?n+"-"+t:t}(n),c=Object(Wt.useRef)(void 0);o||(o=r.renderer),!c.current&&o&&(c.current=o(e,{visualState:t,parent:a,props:Object(Dn.a)(Object(Dn.a)({},n),{layoutId:l}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=c.current;return Yn((function(){u&&(u.setProps(Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},i),n),{layoutId:l})),u.isPresent=jn(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(Wt.useEffect)((function(){var e;u&&(null===(e=u.animationState)||void 0===e||e.animateChanges())})),Yn((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function Kn(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function qn(e){return Array.isArray(e)}function Jn(e){return"string"==typeof e||qn(e)}function $n(e,t,n,o,i){var r;return void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof t&&(t=null===(r=e.variants)||void 0===r?void 0:r[t]),"function"==typeof t?t(null!=n?n:e.custom,o,i):t}function eo(e,t,n){var o=e.getProps();return $n(o,t,null!=n?n:o.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 to(e){var t;return"function"==typeof(null===(t=e.animate)||void 0===t?void 0:t.start)||Jn(e.initial)||Jn(e.animate)||Jn(e.whileHover)||Jn(e.whileDrag)||Jn(e.whileTap)||Jn(e.whileFocus)||Jn(e.exit)}function no(e){return Boolean(to(e)||e.variants)}function oo(e,t){var n=function(e,t){if(to(e)){var n=e.initial,o=e.animate;return{initial:!1===n||Jn(n)?n:void 0,animate:Jn(o)?o:void 0}}return!1!==e.inherit?t:{}}(e,Object(Wt.useContext)(Wn)),o=n.initial,i=n.animate;return Object(Wt.useMemo)((function(){return{initial:o,animate:i}}),t?[io(o),io(i)]:[])}function io(e){return Array.isArray(e)?e.join(" "):e}function ro(e){var t=e.preloadedFeatures,n=e.createVisualElement,o=e.useRender,i=e.useVisualState,r=e.Component;return t&&function(e){for(var t in e){var n=e[t];null!==n&&(Pn[t].Component=n)}}(t),Object(Wt.forwardRef)((function(e,t){var a=Object(Wt.useContext)(Mn).isStatic,s=null,l=oo(e,a),c=i(e,a);return!a&&Qn&&(l.visualElement=Xn(r,c,e,n),s=function(e,t,n){var o=[];if(Object(Wt.useContext)(_n),!t)return null;for(var i=0;i<Fn;i++){var r=Rn[i],a=Pn[r],s=a.isEnabled,l=a.Component;s(e)&&l&&o.push(Wt.createElement(l,Object(Dn.a)({key:r},e,{visualElement:t})))}return o}(e,l.visualElement)),Wt.createElement(Wt.Fragment,null,Wt.createElement(Wn.Provider,{value:l},o(r,e,function(e,t,n){return Object(Wt.useCallback)((function(o){var i;o&&(null===(i=e.mount)||void 0===i||i.call(e,o)),t&&(o?t.mount(o):t.unmount()),n&&("function"==typeof n?n(o):Kn(n)&&(n.current=o))}),[t])}(c,l.visualElement,t),c,a)),s)}))}function ao(e){function t(t,n){return void 0===n&&(n={}),ro(e(t,n))}var n=new Map;return new Proxy(t,{get:function(e,o){return n.has(o)||n.set(o,t(o)),n.get(o)}})}var so=["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 lo(e){return"string"==typeof e&&!e.includes("-")&&!!(so.indexOf(e)>-1||/[A-Z]/.test(e))}var co={};var uo=["","X","Y","Z"],ho=["transformPerspective","x","y","z"];function mo(e,t){return ho.indexOf(e)-ho.indexOf(t)}["translate","scale","rotate","skew"].forEach((function(e){return uo.forEach((function(t){return ho.push(e+t)}))}));var fo=new Set(ho);function po(e){return fo.has(e)}var go=new Set(["originX","originY","originZ"]);function vo(e){return go.has(e)}function Co(e,t){var n=t.layout,o=t.layoutId;return po(e)||vo(e)||(n||void 0!==o)&&(!!co[e]||"opacity"===e)}var bo=function(e){return null!==e&&"object"==typeof e&&e.getVelocity},yo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function Ao(e){return e.startsWith("--")}var So=function(e,t){return t&&"number"==typeof e?t.transform(e):e},wo=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},Eo=function(e){return e%1?Number(e.toFixed(5)):e},xo=/(-)?([\d]*\.?[\d])+/g,Bo=/(#[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,Io=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function To(e){return"string"==typeof e}var ko=function(e){return{test:function(t){return To(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},Oo=ko("deg"),Do=ko("%"),Lo=ko("px"),Po=ko("vh"),_o=ko("vw"),Ro=Object(Dn.a)(Object(Dn.a)({},Do),{parse:function(e){return Do.parse(e)/100},transform:function(e){return Do.transform(100*e)}}),Fo={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},Mo=Object(Dn.a)(Object(Dn.a)({},Fo),{transform:wo(0,1)}),Wo=Object(Dn.a)(Object(Dn.a)({},Fo),{default:1}),No=Object(Dn.a)(Object(Dn.a)({},Fo),{transform:Math.round}),Vo={borderWidth:Lo,borderTopWidth:Lo,borderRightWidth:Lo,borderBottomWidth:Lo,borderLeftWidth:Lo,borderRadius:Lo,radius:Lo,borderTopLeftRadius:Lo,borderTopRightRadius:Lo,borderBottomRightRadius:Lo,borderBottomLeftRadius:Lo,width:Lo,maxWidth:Lo,height:Lo,maxHeight:Lo,size:Lo,top:Lo,right:Lo,bottom:Lo,left:Lo,padding:Lo,paddingTop:Lo,paddingRight:Lo,paddingBottom:Lo,paddingLeft:Lo,margin:Lo,marginTop:Lo,marginRight:Lo,marginBottom:Lo,marginLeft:Lo,rotate:Oo,rotateX:Oo,rotateY:Oo,rotateZ:Oo,scale:Wo,scaleX:Wo,scaleY:Wo,scaleZ:Wo,skew:Oo,skewX:Oo,skewY:Oo,distance:Lo,translateX:Lo,translateY:Lo,translateZ:Lo,x:Lo,y:Lo,z:Lo,perspective:Lo,transformPerspective:Lo,opacity:Mo,originX:Ro,originY:Ro,originZ:Lo,zIndex:No,fillOpacity:Mo,strokeOpacity:Mo,numOctaves:No};function zo(e,t,n,o,i,r,a,s){var l,c=e.style,u=e.vars,d=e.transform,h=e.transformKeys,m=e.transformOrigin;h.length=0;var f=!1,p=!1,g=!0;for(var v in t){var C=t[v];if(Ao(v))u[v]=C;else{var b=Vo[v],y=So(C,b);if(po(v)){if(f=!0,d[v]=y,h.push(v),!g)continue;C!==(null!==(l=b.default)&&void 0!==l?l:0)&&(g=!1)}else if(vo(v))m[v]=y,p=!0;else if((null==n?void 0:n.isHydrated)&&(null==o?void 0:o.isHydrated)&&co[v]){var A=co[v].process(C,o,n),S=co[v].applyTo;if(S)for(var w=S.length,E=0;E<w;E++)c[S[E]]=A;else c[v]=A}else c[v]=y}}o&&n&&a&&s?(c.transform=a(o.deltaFinal,o.treeScale,f?d:void 0),r&&(c.transform=r(d,c.transform)),c.transformOrigin=s(o)):(f&&(c.transform=function(e,t,n,o){var i=e.transform,r=e.transformKeys,a=t.enableHardwareAcceleration,s=void 0===a||a,l=t.allowTransformNone,c=void 0===l||l,u="";r.sort(mo);for(var d=!1,h=r.length,m=0;m<h;m++){var f=r[m];u+=(yo[f]||f)+"("+i[f]+") ","z"===f&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),o?u=o(i,n?"":u):c&&n&&(u="none"),u}(e,i,g,r)),p&&(c.transformOrigin=function(e){var t=e.originX,n=void 0===t?"50%":t,o=e.originY,i=void 0===o?"50%":o,r=e.originZ;return n+" "+i+" "+(void 0===r?0:r)}(m)))}var jo=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Ho(e,t,n){for(var o in t)bo(t[o])||Co(o,n)||(e[o]=t[o])}function Uo(e,t,n){var o={};return Ho(o,e.style||{},e),Object.assign(o,function(e,t,n){var o=e.transformTemplate;return Object(Wt.useMemo)((function(){var e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};zo(e,t,void 0,void 0,{enableHardwareAcceleration:!n},o);var i=e.vars,r=e.style;return Object(Dn.a)(Object(Dn.a)({},i),r)}),[t])}(e,t,n)),e.transformValues&&(o=e.transformValues(o)),o}function Zo(e,t,n){var o={},i=Uo(e,t,n);return Boolean(e.drag)&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),o.style=i,o}var Go=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 Qo(e){return Go.has(e)}var Yo=function(e){return!Qo(e)};try{var Xo=n(55).default;Yo=function(e){return e.startsWith("on")?!Qo(e):Xo(e)}}catch(e){}function Ko(e,t,n){return"string"==typeof e?e:Lo.transform(t+n*e)}var qo=function(e,t){return Lo.transform(e*t)},Jo={offset:"stroke-dashoffset",array:"stroke-dasharray"},$o={offset:"strokeDashoffset",array:"strokeDasharray"};function ei(e,t,n,o,i,r,a,s){var l=t.attrX,c=t.attrY,u=t.originX,d=t.originY,h=t.pathLength,m=t.pathSpacing,f=void 0===m?1:m,p=t.pathOffset,g=void 0===p?0:p;zo(e,Object(Dn.d)(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o,i,r,a,s),e.attrs=e.style,e.style={};var v=e.attrs,C=e.style,b=e.dimensions,y=e.totalPathLength;v.transform&&(b&&(C.transform=v.transform),delete v.transform),b&&(void 0!==u||void 0!==d||C.transform)&&(C.transformOrigin=function(e,t,n){return Ko(t,e.x,e.width)+" "+Ko(n,e.y,e.height)}(b,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==l&&(v.x=l),void 0!==c&&(v.y=c),void 0!==y&&void 0!==h&&function(e,t,n,o,i,r){void 0===o&&(o=1),void 0===i&&(i=0),void 0===r&&(r=!0);var a=r?Jo:$o;e[a.offset]=qo(-i,t);var s=qo(n,t),l=qo(o,t);e[a.array]=s+" "+l}(v,y,h,f,g,!1)}var ti=function(){return Object(Dn.a)(Object(Dn.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function ni(e,t){var n=Object(Wt.useMemo)((function(){var n=ti();return ei(n,t,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),Object(Dn.a)(Object(Dn.a)({},n.attrs),{style:Object(Dn.a)({},n.style)})}),[t]);if(e.style){var o={};Ho(o,e.style,e),n.style=Object(Dn.a)(Object(Dn.a)({},o),n.style)}return n}function oi(e){void 0===e&&(e=!1);return function(t,n,o,i,r){var a=i.latestValues,s=(lo(t)?ni:Zo)(n,a,r),l=function(e,t,n){var o={};for(var i in e)(Yo(i)||!0===n&&Qo(i)||!t&&!Qo(i))&&(o[i]=e[i]);return o}(n,"string"==typeof t,e),c=Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},l),s),{ref:o});return Object(Wt.createElement)(t,c)}}var ii=/([a-z])([A-Z])/g,ri=function(e){return e.replace(ii,"$1-$2").toLowerCase()};function ai(e,t){var n=t.style,o=t.vars;for(var i in Object.assign(e.style,n),o)e.style.setProperty(i,o[i])}var si=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function li(e,t){for(var n in ai(e,t),t.attrs)e.setAttribute(si.has(n)?n:ri(n),t.attrs[n])}function ci(e){var t=e.style,n={};for(var o in t)(bo(t[o])||Co(o,e))&&(n[o]=t[o]);return n}function ui(e){var t=ci(e);for(var n in e){if(bo(e[n]))t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function di(e){return"object"==typeof e&&"function"==typeof e.start}var hi=function(e){return Array.isArray(e)};function mi(e){var t,n=bo(e)?e.get():e;return t=n,Boolean(t&&"object"==typeof t&&t.mix&&t.toValue)?n.toValue():n}function fi(e,t,n,o){var i=e.scrapeMotionValuesFromProps,r=e.createRenderState,a=e.onMount,s={latestValues:gi(t,n,o,i),renderState:r()};return a&&(s.mount=function(e){return a(t,e,s)}),s}var pi=function(e){return function(t,n){var o=Object(Wt.useContext)(Wn),i=Object(Wt.useContext)(Nn);return n?fi(e,t,o,i):Vn((function(){return fi(e,t,o,i)}))}};function gi(e,t,n,o){var i={},r=!1===(null==n?void 0:n.initial),a=o(e);for(var s in a)i[s]=mi(a[s]);var l=e.initial,c=e.animate,u=to(e),d=no(e);t&&d&&!u&&!1!==e.inherit&&(null!=l||(l=t.initial),null!=c||(c=t.animate));var h=r||!1===l?c:l;h&&"boolean"!=typeof h&&!di(h)&&(Array.isArray(h)?h:[h]).forEach((function(t){var n=$n(e,t);if(n){var o=n.transitionEnd;n.transition;var r=Object(Dn.d)(n,["transitionEnd","transition"]);for(var a in r)i[a]=r[a];for(var a in o)i[a]=o[a]}}));return i}var vi={useVisualState:pi({scrapeMotionValuesFromProps:ui,createRenderState:ti,onMount:function(e,t,n){var o=n.renderState,i=n.latestValues;try{o.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){o.dimensions={x:0,y:0,width:0,height:0}}"path"===t.tagName&&(o.totalPathLength=t.getTotalLength()),ei(o,i,void 0,void 0,{enableHardwareAcceleration:!1},e.transformTemplate),li(t,o)}})};var Ci,bi={useVisualState:pi({scrapeMotionValuesFromProps:ci,createRenderState:jo})};function yi(e,t,n,o){var i=t.forwardMotionProps,r=void 0!==i&&i,a=lo(e)?vi:bi;return Object(Dn.a)(Object(Dn.a)({},a),{preloadedFeatures:n,useRender:oi(r),createVisualElement:o,Component:e})}function Ai(e,t,n,o){return e.addEventListener(t,n,o),function(){return e.removeEventListener(t,n,o)}}function Si(e,t,n,o){Object(Wt.useEffect)((function(){var i=e.current;if(n&&i)return Ai(i,t,n,o)}),[e,t,n,o])}function wi(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function Ei(e){return!!e.touches}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.Exit="exit"}(Ci||(Ci={}));var xi={pageX:0,pageY:0};function Bi(e,t){void 0===t&&(t="page");var n=e.touches[0]||e.changedTouches[0]||xi;return{x:n[t+"X"],y:n[t+"Y"]}}function Ii(e,t){return void 0===t&&(t="page"),{x:e[t+"X"],y:e[t+"Y"]}}function Ti(e,t){return void 0===t&&(t="page"),{point:Ei(e)?Bi(e,t):Ii(e,t)}}var ki=function(e,t){void 0===t&&(t=!1);var n,o=function(t){return e(t,Ti(t))};return t?(n=o,function(e){var t=e instanceof MouseEvent;(!t||t&&0===e.button)&&n(e)}):o},Oi={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Di={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Li(e){return Qn&&null===window.onpointerdown?e:Qn&&null===window.ontouchstart?Di[e]:Qn&&null===window.onmousedown?Oi[e]:e}function Pi(e,t,n,o){return Ai(e,Li(t),ki(n,"pointerdown"===t),o)}function _i(e,t,n,o){return Si(e,Li(t),n&&ki(n,"pointerdown"===t),o)}function Ri(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var Fi=Ri("dragHorizontal"),Mi=Ri("dragVertical");function Wi(e){var t=!1;if("y"===e)t=Mi();else if("x"===e)t=Fi();else{var n=Fi(),o=Mi();n&&o?t=function(){n(),o()}:(n&&n(),o&&o())}return t}function Ni(){var e=Wi(!0);return!e||(e(),!1)}function Vi(e,t,n){return function(o,i){var r;wi(o)&&!Ni()&&(null==n||n(o,i),null===(r=e.animationState)||void 0===r||r.setActive(Ci.Hover,t))}}var zi=function(e,t){return!!t&&(e===t||zi(e,t.parentElement))};function ji(e){return Object(Wt.useEffect)((function(){return function(){return e()}}),[])}var Hi=function(e,t){return function(n){return t(e(n))}},Ui=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(Hi)};var Zi=function(e){return function(t){return e(t),null}},Gi={tap:Zi((function(e){var t=e.onTap,n=e.onTapStart,o=e.onTapCancel,i=e.whileTap,r=e.visualElement,a=t||n||o||i,s=Object(Wt.useRef)(!1),l=Object(Wt.useRef)(null);function c(){var e;null===(e=l.current)||void 0===e||e.call(l),l.current=null}function u(){var e;return c(),s.current=!1,null===(e=r.animationState)||void 0===e||e.setActive(Ci.Tap,!1),!Ni()}function d(e,n){u()&&(zi(r.getInstance(),e.target)?null==t||t(e,n):null==o||o(e,n))}function h(e,t){u()&&(null==o||o(e,t))}_i(r,"pointerdown",a?function(e,t){var o;c(),s.current||(s.current=!0,l.current=Ui(Pi(window,"pointerup",d),Pi(window,"pointercancel",h)),null==n||n(e,t),null===(o=r.animationState)||void 0===o||o.setActive(Ci.Tap,!0))}:void 0),ji(c)})),focus:Zi((function(e){var t=e.whileFocus,n=e.visualElement;Si(n,"focus",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Ci.Focus,!0)}:void 0),Si(n,"blur",t?function(){var e;null===(e=n.animationState)||void 0===e||e.setActive(Ci.Focus,!1)}:void 0)})),hover:Zi((function(e){var t=e.onHoverStart,n=e.onHoverEnd,o=e.whileHover,i=e.visualElement;_i(i,"pointerenter",t||o?Vi(i,!0,t):void 0),_i(i,"pointerleave",n||o?Vi(i,!1,n):void 0)}))};function Qi(e,t){if(!Array.isArray(t))return!1;var n=t.length;if(n!==e.length)return!1;for(var o=0;o<n;o++)if(t[o]!==e[o])return!1;return!0}var Yi=function(e,t,n){return Math.min(Math.max(n,e),t)},Xi=.001;function Ki(e){var t,n,o=e.duration,i=void 0===o?800:o,r=e.bounce,a=void 0===r?.25:r,s=e.velocity,l=void 0===s?0:s,c=e.mass,u=void 0===c?1:c,d=1-a;d=Yi(.05,1,d),i=Yi(.01,10,i/1e3),d<1?(t=function(e){var t=e*d,n=t*i,o=t-l,r=qi(e,d),a=Math.exp(-n);return Xi-o/r*a},n=function(e){var n=e*d*i,o=n*l+l,r=Math.pow(d,2)*Math.pow(e,2)*i,a=Math.exp(-n),s=qi(Math.pow(e,2),d);return(-t(e)+Xi>0?-1:1)*((o-r)*a)/s}):(t=function(e){return Math.exp(-e*i)*((e-l)*i+1)-.001},n=function(e){return Math.exp(-e*i)*(i*i*(l-e))});var h=function(e,t,n){for(var o=n,i=1;i<12;i++)o-=e(o)/t(o);return o}(t,n,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var m=Math.pow(h,2)*u;return{stiffness:m,damping:2*d*Math.sqrt(u*m),duration:i}}function qi(e,t){return e*Math.sqrt(1-t*t)}var Ji=["duration","bounce"],$i=["stiffness","damping","mass"];function er(e,t){return t.some((function(t){return void 0!==e[t]}))}function tr(e){var t=e.from,n=void 0===t?0:t,o=e.to,i=void 0===o?1:o,r=e.restSpeed,a=void 0===r?2:r,s=e.restDelta,l=Object(Dn.d)(e,["from","to","restSpeed","restDelta"]),c={done:!1,value:n},u=function(e){var t=Object(Dn.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!er(e,$i)&&er(e,Ji)){var n=Ki(e);(t=Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(l),d=u.stiffness,h=u.damping,m=u.mass,f=u.velocity,p=u.duration,g=u.isResolvedFromDuration,v=nr,C=nr;function b(){var e=f?-f/1e3:0,t=i-n,o=h/(2*Math.sqrt(d*m)),r=Math.sqrt(d/m)/1e3;if(null!=s||(s=Math.abs(i-n)<=1?.01:.4),o<1){var a=qi(r,o);v=function(n){var s=Math.exp(-o*r*n);return i-s*((e+o*r*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},C=function(n){var i=Math.exp(-o*r*n);return o*r*i*(Math.sin(a*n)*(e+o*r*t)/a+t*Math.cos(a*n))-i*(Math.cos(a*n)*(e+o*r*t)-a*t*Math.sin(a*n))}}else if(1===o)v=function(n){return i-Math.exp(-r*n)*(t+(e+r*t)*n)};else{var l=r*Math.sqrt(o*o-1);v=function(n){var a=Math.exp(-o*r*n),s=Math.min(l*n,300);return i-a*((e+o*r*t)*Math.sinh(s)+l*t*Math.cosh(s))/l}}}return b(),{next:function(e){var t=v(e);if(g)c.done=e>=p;else{var n=1e3*C(e),o=Math.abs(n)<=a,r=Math.abs(i-t)<=s;c.done=o&&r}return c.value=c.done?i:t,c},flipTarget:function(){var e;f=-f,n=(e=[i,n])[0],i=e[1],b()}}}tr.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var nr=function(e){return 0},or=function(e,t,n){var o=t-e;return 0===o?1:(n-e)/o},ir=function(e,t,n){return-n*e+n*t+e},rr=function(e,t){return function(n){return Boolean(To(n)&&Io.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},ar=function(e,t,n){return function(o){var i;if(!To(o))return o;var r=o.match(xo),a=r[0],s=r[1],l=r[2],c=r[3];return(i={})[e]=parseFloat(a),i[t]=parseFloat(s),i[n]=parseFloat(l),i.alpha=void 0!==c?parseFloat(c):1,i}},sr=wo(0,255),lr=Object(Dn.a)(Object(Dn.a)({},Fo),{transform:function(e){return Math.round(sr(e))}}),cr={test:rr("rgb","red"),parse:ar("red","green","blue"),transform:function(e){var t=e.red,n=e.green,o=e.blue,i=e.alpha,r=void 0===i?1:i;return"rgba("+lr.transform(t)+", "+lr.transform(n)+", "+lr.transform(o)+", "+Eo(Mo.transform(r))+")"}};var ur={test:rr("#"),parse:function(e){var t="",n="",o="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),o=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),o=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,o+=o,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:cr.transform},dr={test:rr("hsl","hue"),parse:ar("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,o=e.lightness,i=e.alpha,r=void 0===i?1:i;return"hsla("+Math.round(t)+", "+Do.transform(Eo(n))+", "+Do.transform(Eo(o))+", "+Eo(Mo.transform(r))+")"}},hr=function(e,t,n){var o=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-o)+o))},mr=[ur,cr,dr],fr=function(e){return mr.find((function(t){return t.test(e)}))},pr=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},gr=function(e,t){var n=fr(e),o=fr(t);pr(e),pr(t),n.transform,o.transform;var i=n.parse(e),r=o.parse(t),a=Object(Dn.a)({},i),s=n===dr?ir:hr;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(i[t],r[t],e));return a.alpha=ir(i.alpha,r.alpha,e),n.transform(a)}},vr={test:function(e){return cr.test(e)||ur.test(e)||dr.test(e)},parse:function(e){return cr.test(e)?cr.parse(e):dr.test(e)?dr.parse(e):ur.parse(e)},transform:function(e){return To(e)?e:e.hasOwnProperty("red")?cr.transform(e):dr.transform(e)}},Cr="${c}",br="${n}";function yr(e){var t=[],n=0,o=e.match(Bo);o&&(n=o.length,e=e.replace(Bo,Cr),t.push.apply(t,o.map(vr.parse)));var i=e.match(xo);return i&&(e=e.replace(xo,br),t.push.apply(t,i.map(Fo.parse))),{values:t,numColors:n,tokenised:e}}function Ar(e){return yr(e).values}function Sr(e){var t=yr(e),n=t.values,o=t.numColors,i=t.tokenised,r=n.length;return function(e){for(var t=i,n=0;n<r;n++)t=t.replace(n<o?Cr:br,n<o?vr.transform(e[n]):Eo(e[n]));return t}}var wr=function(e){return"number"==typeof e?0:e};var Er={test:function(e){var t,n,o,i;return isNaN(e)&&To(e)&&(null!==(n=null===(t=e.match(xo))||void 0===t?void 0:t.length)&&void 0!==n?n:0)+(null!==(i=null===(o=e.match(Bo))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:Ar,createTransformer:Sr,getAnimatableNone:function(e){var t=Ar(e);return Sr(e)(t.map(wr))}},xr=function(e){return"number"==typeof e};function Br(e,t){return xr(e)?function(n){return ir(e,t,n)}:vr.test(e)?gr(e,t):Or(e,t)}var Ir=function(e,t){var n=Object(Dn.e)([],e),o=n.length,i=e.map((function(e,n){return Br(e,t[n])}));return function(e){for(var t=0;t<o;t++)n[t]=i[t](e);return n}},Tr=function(e,t){var n=Object(Dn.a)(Object(Dn.a)({},e),t),o={};for(var i in n)void 0!==e[i]&&void 0!==t[i]&&(o[i]=Br(e[i],t[i]));return function(e){for(var t in o)n[t]=o[t](e);return n}};function kr(e){for(var t=Er.parse(e),n=t.length,o=0,i=0,r=0,a=0;a<n;a++)o||"number"==typeof t[a]?o++:void 0!==t[a].hue?r++:i++;return{parsed:t,numNumbers:o,numRGB:i,numHSL:r}}var Or=function(e,t){var n=Er.createTransformer(t),o=kr(e),i=kr(t);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&(o.numNumbers,i.numNumbers),Ui(Ir(o.parsed,i.parsed),n)},Dr=function(e,t){return function(n){return ir(e,t,n)}};function Lr(e,t,n){for(var o,i=[],r=n||("number"==typeof(o=e[0])?Dr:"string"==typeof o?vr.test(o)?gr:Or:Array.isArray(o)?Ir:"object"==typeof o?Tr:void 0),a=e.length-1,s=0;s<a;s++){var l=r(e[s],e[s+1]);if(t){var c=Array.isArray(t)?t[s]:t;l=Ui(c,l)}i.push(l)}return i}function Pr(e,t,n){var o=void 0===n?{}:n,i=o.clamp,r=void 0===i||i,a=o.ease,s=o.mixer,l=e.length;t.length,!a||!Array.isArray(a)||a.length,e[0]>e[l-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var c=Lr(t,a,s),u=2===l?function(e,t){var n=e[0],o=e[1],i=t[0];return function(e){return i(or(n,o,e))}}(e,c):function(e,t){var n=e.length,o=n-1;return function(i){var r=0,a=!1;if(i<=e[0]?a=!0:i>=e[o]&&(r=o-1,a=!0),!a){for(var s=1;s<n&&!(e[s]>i||s===o);s++);r=s-1}var l=or(e[r],e[r+1],i);return t[r](l)}}(e,c);return r?function(t){return u(Yi(e[0],e[l-1],t))}:u}var _r,Rr=function(e){return function(t){return 1-e(1-t)}},Fr=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},Mr=function(e){return function(t){return t*t*((e+1)*t-e)}},Wr=function(e){return e},Nr=(_r=2,function(e){return Math.pow(e,_r)}),Vr=Rr(Nr),zr=Fr(Nr),jr=function(e){return 1-Math.sin(Math.acos(e))},Hr=Rr(jr),Ur=Fr(Hr),Zr=Mr(1.525),Gr=Rr(Zr),Qr=Fr(Zr),Yr=function(e){var t=Mr(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),Xr=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},Kr=Rr(Xr);function qr(e,t){return e.map((function(){return t||zr})).splice(0,e.length-1)}function Jr(e){var t=e.from,n=void 0===t?0:t,o=e.to,i=void 0===o?1:o,r=e.ease,a=e.offset,s=e.duration,l=void 0===s?300:s,c={done:!1,value:n},u=Array.isArray(i)?i:[n,i],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),l);function h(){return Pr(d,u,{ease:Array.isArray(r)?r:qr(u,r)})}var m=h();return{next:function(e){return c.value=m(e),c.done=e>=l,c},flipTarget:function(){u.reverse(),m=h()}}}var $r={keyframes:Jr,spring:tr,decay:function(e){var t=e.velocity,n=void 0===t?0:t,o=e.from,i=void 0===o?0:o,r=e.power,a=void 0===r?.8:r,s=e.timeConstant,l=void 0===s?350:s,c=e.restDelta,u=void 0===c?.5:c,d=e.modifyTarget,h={done:!1,value:i},m=a*n,f=i+m,p=void 0===d?f:d(f);return p!==f&&(m=p-i),{next:function(e){var t=-m*Math.exp(-e/l);return h.done=!(t>u||t<-u),h.value=h.done?p:p+t,h},flipTarget:function(){}}}};var ea=1/60*1e3,ta="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},na="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(ta())}),ea)};var oa=!0,ia=!1,ra=!1,aa={delta:0,timestamp:0},sa=["read","update","preRender","render","postRender"],la=sa.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],o=0,i=!1,r=new WeakSet,a={schedule:function(e,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&i,c=l?t:n;return a&&r.add(e),-1===c.indexOf(e)&&(c.push(e),l&&i&&(o=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),r.delete(e)},process:function(s){var l;if(i=!0,t=(l=[n,t])[0],(n=l[1]).length=0,o=t.length)for(var c=0;c<o;c++){var u=t[c];u(s),r.has(u)&&(a.schedule(u),e())}i=!1}};return a}((function(){return ia=!0})),e}),{}),ca=sa.reduce((function(e,t){var n=la[t];return e[t]=function(e,t,o){return void 0===t&&(t=!1),void 0===o&&(o=!1),ia||fa(),n.schedule(e,t,o)},e}),{}),ua=sa.reduce((function(e,t){return e[t]=la[t].cancel,e}),{}),da=sa.reduce((function(e,t){return e[t]=function(){return la[t].process(aa)},e}),{}),ha=function(e){return la[e].process(aa)},ma=function(e){ia=!1,aa.delta=oa?ea:Math.max(Math.min(e-aa.timestamp,40),1),aa.timestamp=e,ra=!0,sa.forEach(ha),ra=!1,ia&&(oa=!1,na(ma))},fa=function(){ia=!0,oa=!0,ra||na(ma)},pa=function(){return aa},ga=ca;function va(e,t,n){return void 0===n&&(n=0),e-t-n}var Ca=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return ga.update(t,!0)},stop:function(){return ua.update(t)}}};function ba(e){var t,n,o,i,r,a=e.from,s=e.autoplay,l=void 0===s||s,c=e.driver,u=void 0===c?Ca:c,d=e.elapsed,h=void 0===d?0:d,m=e.repeat,f=void 0===m?0:m,p=e.repeatType,g=void 0===p?"loop":p,v=e.repeatDelay,C=void 0===v?0:v,b=e.onPlay,y=e.onStop,A=e.onComplete,S=e.onRepeat,w=e.onUpdate,E=Object(Dn.d)(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),x=E.to,B=0,I=E.duration,T=!1,k=!0,O=function(e){if(Array.isArray(e.to))return Jr;if($r[e.type])return $r[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?Jr:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?tr:Jr}(E);(null===(n=(t=O).needsInterpolation)||void 0===n?void 0:n.call(t,a,x))&&(r=Pr([0,100],[a,x],{clamp:!1}),a=0,x=100);var D=O(Object(Dn.a)(Object(Dn.a)({},E),{from:a,to:x}));function L(){B++,"reverse"===g?h=function(e,t,n,o){return void 0===n&&(n=0),void 0===o&&(o=!0),o?va(t+-e,t,n):t-(e-t)+n}(h,I,C,k=B%2==0):(h=va(h,I,C),"mirror"===g&&D.flipTarget()),T=!1,S&&S()}function P(e){if(k||(e=-e),h+=e,!T){var t=D.next(Math.max(0,h));i=t.value,r&&(i=r(i)),T=k?t.done:h<=0}null==w||w(i),T&&(0===B&&(null!=I||(I=h)),B<f?function(e,t,n,o){return o?e>=t+n:e<=-n}(h,I,C,k)&&L():(o.stop(),A&&A()))}return l&&(null==b||b(),(o=u(P)).start()),{stop:function(){null==y||y(),o.stop()}}}function ya(e,t){return t?e*(1e3/t):0}var Aa=function(e){return 1e3*e},Sa=function(e,t){return 1-3*t+3*e},wa=function(e,t){return 3*t-6*e},Ea=function(e){return 3*e},xa=function(e,t,n){return((Sa(t,n)*e+wa(t,n))*e+Ea(t))*e},Ba=function(e,t,n){return 3*Sa(t,n)*e*e+2*wa(t,n)*e+Ea(t)};var Ia=.1;function Ta(e,t,n,o){if(e===t&&n===o)return Wr;for(var i=new Float32Array(11),r=0;r<11;++r)i[r]=xa(r*Ia,e,n);function a(t){for(var o=0,r=1;10!==r&&i[r]<=t;++r)o+=Ia;--r;var a=o+(t-i[r])/(i[r+1]-i[r])*Ia,s=Ba(a,e,n);return s>=.001?function(e,t,n,o){for(var i=0;i<8;++i){var r=Ba(t,n,o);if(0===r)return t;t-=(xa(t,n,o)-e)/r}return t}(t,a,e,n):0===s?a:function(e,t,n,o,i){var r,a,s=0;do{(r=xa(a=t+(n-t)/2,o,i)-e)>0?n=a:t=a}while(Math.abs(r)>1e-7&&++s<10);return a}(t,o,o+Ia,e,n)}return function(e){return 0===e||1===e?e:xa(a(e),t,o)}}var ka={linear:Wr,easeIn:Nr,easeInOut:zr,easeOut:Vr,circIn:jr,circInOut:Ur,circOut:Hr,backIn:Zr,backInOut:Qr,backOut:Gr,anticipate:Yr,bounceIn:Kr,bounceInOut:function(e){return e<.5?.5*(1-Xr(1-2*e)):.5*Xr(2*e-1)+.5},bounceOut:Xr},Oa=function(e){if(Array.isArray(e)){e.length;var t=Object(Dn.c)(e,4);return Ta(t[0],t[1],t[2],t[3])}return"string"==typeof e?ka[e]:e},Da=function(e,t){return"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Er.test(t)||t.startsWith("url(")))},La=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Pa=function(e){return{type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},_a=function(){return{type:"keyframes",ease:"linear",duration:.3}},Ra=function(e){return{type:"keyframes",duration:.8,values:e}},Fa={x:La,y:La,z:La,rotate:La,rotateX:La,rotateY:La,rotateZ:La,scaleX:Pa,scaleY:Pa,scale:Pa,opacity:_a,backgroundColor:_a,color:_a,default:Pa},Ma=new Set(["brightness","contrast","saturate","opacity"]);function Wa(e){var t=e.slice(0,-1).split("("),n=t[0],o=t[1];if("drop-shadow"===n)return e;var i=(o.match(xo)||[])[0];if(!i)return e;var r=o.replace(i,""),a=Ma.has(n)?1:0;return i!==o&&(a*=100),n+"("+a+r+")"}var Na=/([a-z-]*)\(.*?\)/g,Va=Object(Dn.a)(Object(Dn.a)({},Er),{getAnimatableNone:function(e){var t=e.match(Na);return t?t.map(Wa).join(" "):e}}),za=Object(Dn.a)(Object(Dn.a)({},Vo),{color:vr,backgroundColor:vr,outlineColor:vr,fill:vr,stroke:vr,borderColor:vr,borderTopColor:vr,borderRightColor:vr,borderBottomColor:vr,borderLeftColor:vr,filter:Va,WebkitFilter:Va}),ja=function(e){return za[e]};function Ha(e,t){var n,o=ja(e);return o!==Va&&(o=Er),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,t)}function Ua(e){var t=e.ease,n=e.times,o=e.yoyo,i=e.flip,r=e.loop,a=Object(Dn.d)(e,["ease","times","yoyo","flip","loop"]),s=Object(Dn.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=Aa(a.duration)),a.repeatDelay&&(s.repeatDelay=Aa(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!=typeof e[0]}(t)?t.map(Oa):Oa(t)),"tween"===a.type&&(s.type="keyframes"),(o||r||i)&&(!0,o?s.repeatType="reverse":r?s.repeatType="loop":i&&(s.repeatType="mirror"),s.repeat=r||o||i||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function Za(e,t,n){var o,i,r,a;return Array.isArray(t.to)&&(null!==(o=e.duration)&&void 0!==o||(e.duration=.8)),function(e){Array.isArray(e.to)&&null===e.to[0]&&(e.to=Object(Dn.e)([],Object(Dn.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(Dn.d)(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}(e)||(e=Object(Dn.a)(Object(Dn.a)({},e),(i=n,r=t.to,a=hi(r)?Ra:Fa[i]||Fa.default,Object(Dn.a)({to:r},a(r))))),Object(Dn.a)(Object(Dn.a)({},t),Ua(e))}function Ga(e,t,n,o,i){var r,a=Xa(o,e),s=null!==(r=a.from)&&void 0!==r?r:t.get(),l=Da(e,n);"none"===s&&l&&"string"==typeof n?s=Ha(e,n):Qa(s)&&"string"==typeof n?s=Ya(n):!Array.isArray(n)&&Qa(n)&&"string"==typeof s&&(n=Ya(s));var c=Da(e,s);return c&&l&&!1!==a.type?function(){var o={from:s,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:function(e){return t.set(e)}};return"inertia"===a.type||"decay"===a.type?function(e){var t,n=e.from,o=void 0===n?0:n,i=e.velocity,r=void 0===i?0:i,a=e.min,s=e.max,l=e.power,c=void 0===l?.8:l,u=e.timeConstant,d=void 0===u?750:u,h=e.bounceStiffness,m=void 0===h?500:h,f=e.bounceDamping,p=void 0===f?10:f,g=e.restDelta,v=void 0===g?1:g,C=e.modifyTarget,b=e.driver,y=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=ba(Object(Dn.a)(Object(Dn.a)({},e),{driver:b,onUpdate:function(t){var n;null==y||y(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:A}))}function x(e){E(Object(Dn.a)({type:"spring",stiffness:m,damping:p,restDelta:v},e))}if(S(o))x({from:o,velocity:r,to:w(o)});else{var B=c*r+o;"undefined"!=typeof C&&(B=C(B));var I,T,k=w(B),O=k===a?-1:1;E({type:"decay",from:o,velocity:r,timeConstant:d,power:c,restDelta:v,modifyTarget:C,onUpdate:S(B)?function(e){I=T,T=e,r=ya(e-I,pa().delta),(1===O&&e>k||-1===O&&e<k)&&x({from:e,to:k,velocity:r})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}}(Object(Dn.a)(Object(Dn.a)({},o),a)):ba(Object(Dn.a)(Object(Dn.a)({},Za(a,o,e)),{onUpdate:function(e){var t;o.onUpdate(e),null===(t=a.onUpdate)||void 0===t||t.call(a,e)},onComplete:function(){var e;o.onComplete(),null===(e=a.onComplete)||void 0===e||e.call(a)}}))}:function(){var e;return t.set(n),i(),null===(e=null==a?void 0:a.onComplete)||void 0===e||e.call(a),{stop:function(){}}}}function Qa(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function Ya(e){return"number"==typeof e?0:Ha("",e)}function Xa(e,t){return e[t]||e.default||e}function Ka(e,t,n,o){return void 0===o&&(o={}),t.start((function(i){var r,a,s=Ga(e,t,n,o,i),l=function(e,t){var n;return null!==(n=(Xa(e,t)||{}).delay)&&void 0!==n?n:0}(o,e),c=function(){return a=s()};return l?r=setTimeout(c,Aa(l)):c(),function(){clearTimeout(r),null==a||a.stop()}}))}function qa(e,t){-1===e.indexOf(t)&&e.push(t)}function Ja(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var $a=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return qa(this.subscriptions,e),function(){return Ja(t.subscriptions,e)}},e.prototype.notify=function(e,t,n){var o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](e,t,n);else for(var i=0;i<o;i++){var r=this.subscriptions[i];r&&r(e,t,n)}},e.prototype.getSize=function(){return this.subscriptions.length},e.prototype.clear=function(){this.subscriptions.length=0},e}(),es=function(){function e(e){var t,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new $a,this.velocityUpdateSubscribers=new $a,this.renderSubscribers=new $a,this.canTrackVelocity=!1,this.updateAndNotify=function(e,t){void 0===t&&(t=!0),n.prev=n.current,n.current=e;var o=pa(),i=o.delta,r=o.timestamp;n.lastUpdated!==r&&(n.timeDelta=i,n.lastUpdated=r,ga.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 ga.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?ya(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 ts(e){return new es(e)}var ns=function(e){return function(t){return t.test(e)}},os=[Fo,Lo,Do,Oo,_o,Po,{test:function(e){return"auto"===e},parse:function(e){return e}}],is=function(e){return os.find(ns(e))},rs=Object(Dn.e)(Object(Dn.e)([],Object(Dn.c)(os)),[vr,Er]),as=function(e){return rs.find(ns(e))};function ss(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ts(n))}function ls(e,t){var n=eo(e,t),o=n?e.makeTargetAnimatable(n,!1):{},i=o.transitionEnd,r=void 0===i?{}:i;o.transition;var a,s=Object(Dn.d)(o,["transitionEnd","transition"]);for(var l in s=Object(Dn.a)(Object(Dn.a)({},s),r)){ss(e,l,(a=s[l],hi(a)?a[a.length-1]||0:a))}}function cs(e,t){if(t)return(t[e]||t.default||t).from}function us(e,t,n){var o;void 0===n&&(n={});var i=eo(e,t,n.custom),r=(i||{}).transition,a=void 0===r?e.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=i?function(){return ds(e,i,n)}:function(){return Promise.resolve()},l=(null===(o=e.variantChildren)||void 0===o?void 0:o.size)?function(o){void 0===o&&(o=0);var i=a.delayChildren,r=void 0===i?0:i,s=a.staggerChildren,l=a.staggerDirection;return function(e,t,n,o,i,r){void 0===n&&(n=0);void 0===o&&(o=0);void 0===i&&(i=1);var a=[],s=(e.variantChildren.size-1)*o,l=1===i?function(e){return void 0===e&&(e=0),e*o}:function(e){return void 0===e&&(e=0),s-e*o};return Array.from(e.variantChildren).sort(hs).forEach((function(e,o){a.push(us(e,t,Object(Dn.a)(Object(Dn.a)({},r),{delay:n+l(o)})).then((function(){return e.notifyAnimationComplete(t)})))})),Promise.all(a)}(e,t,r+o,s,l,n)}:function(){return Promise.resolve()},c=a.when;if(c){var u=Object(Dn.c)("beforeChildren"===c?[s,l]:[l,s],2),d=u[0],h=u[1];return d().then(h)}return Promise.all([s(),l(n.delay)])}function ds(e,t,n){var o,i=void 0===n?{}:n,r=i.delay,a=void 0===r?0:r,s=i.transitionOverride,l=i.type,c=e.makeTargetAnimatable(t),u=c.transition,d=void 0===u?e.getDefaultTransition():u,h=c.transitionEnd,m=Object(Dn.d)(c,["transition","transitionEnd"]);s&&(d=s);var f=[],p=l&&(null===(o=e.animationState)||void 0===o?void 0:o.getState()[l]);for(var g in m){var v=e.getValue(g),C=m[g];if(!(!v||void 0===C||p&&ms(p,g))){var b=Ka(g,v,C,Object(Dn.a)({delay:a},d));f.push(b)}}return Promise.all(f).then((function(){h&&ls(e,h)}))}function hs(e,t){return e.sortNodePosition(t)}function ms(e,t){var n=e.protectedKeys,o=e.needsAnimating,i=n.hasOwnProperty(t)&&!0!==o[t];return o[t]=!1,i}var fs=[Ci.Animate,Ci.Hover,Ci.Tap,Ci.Drag,Ci.Focus,Ci.Exit],ps=Object(Dn.e)([],Object(Dn.c)(fs)).reverse(),gs=fs.length;function vs(e){return function(t){return Promise.all(t.map((function(t){var n=t.animation,o=t.options;return function(e,t,n){var o;if(void 0===n&&(n={}),e.notifyAnimationStart(),Array.isArray(t)){var i=t.map((function(t){return us(e,t,n)}));o=Promise.all(i)}else if("string"==typeof t)o=us(e,t,n);else{var r="function"==typeof t?eo(e,t,n.custom):t;o=ds(e,r,n)}return o.then((function(){return e.notifyAnimationComplete(t)}))}(e,n,o)})))}}function Cs(e){var t,n=vs(e),o=((t={})[Ci.Animate]=bs(!0),t[Ci.Hover]=bs(),t[Ci.Tap]=bs(),t[Ci.Drag]=bs(),t[Ci.Focus]=bs(),t[Ci.Exit]=bs(),t),i={},r=!0,a=function(t,n){var o=eo(e,n);if(o){o.transition;var i=o.transitionEnd,r=Object(Dn.d)(o,["transition","transitionEnd"]);t=Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},t),r),i)}return t};function s(t,s){for(var l,c=e.getProps(),u=e.getVariantContext(!0)||{},d=[],h=new Set,m={},f=1/0,p=function(n){var i=ps[n],p=o[i],g=null!==(l=c[i])&&void 0!==l?l:u[i],v=Jn(g),C=i===s?p.isActive:null;!1===C&&(f=n);var b=g===u[i]&&g!==c[i]&&v;if(b&&r&&e.manuallyAnimateOnMount&&(b=!1),p.protectedKeys=Object(Dn.a)({},m),!p.isActive&&null===C||!g&&!p.prevProp||di(g)||"boolean"==typeof g)return"continue";var y=function(e,t){if("string"==typeof t)return t!==e;if(qn(t))return!Qi(t,e);return!1}(p.prevProp,g)||i===s&&p.isActive&&!b&&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(Dn.a)(Object(Dn.a)({},E),S),B=function(e){y=!0,h.delete(e),p.needsAnimating[e]=!0};for(var I in x){var T=S[I],k=E[I];m.hasOwnProperty(I)||(T!==k?hi(T)&&hi(k)?Qi(T,k)?p.protectedKeys[I]=!0:B(I):void 0!==T?B(I):h.add(I):void 0!==T&&h.has(I)?B(I):p.protectedKeys[I]=!0)}p.prevProp=g,p.prevResolvedValues=S,p.isActive&&(m=Object(Dn.a)(Object(Dn.a)({},m),S)),r&&e.blockInitialAnimation&&(y=!1),y&&!b&&d.push.apply(d,Object(Dn.e)([],Object(Dn.c)(A.map((function(e){return{animation:e,options:Object(Dn.a)({type:i},t)}})))))},g=0;g<gs;g++)p(g);if(i=Object(Dn.a)({},m),h.size){var v={};h.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===c.initial&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,C?n(d):Promise.resolve()}return{isAnimated:function(e){return void 0!==i[e]},animateChanges:s,setActive:function(t,n,i){var r;return o[t].isActive===n?Promise.resolve():(null===(r=e.variantChildren)||void 0===r||r.forEach((function(e){var o;return null===(o=e.animationState)||void 0===o?void 0:o.setActive(t,n)})),o[t].isActive=n,s(i,t))},setAnimateFunction:function(t){n=t(e)},getState:function(){return o}}}function bs(e){return void 0===e&&(e=!1),{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var ys={animation:Zi((function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=Cs(t)),di(n)&&Object(Wt.useEffect)((function(){return n.subscribe(t)}),[n])})),exit:Zi((function(e){var t=e.custom,n=e.visualElement,o=Object(Dn.c)(zn(),2),i=o[0],r=o[1],a=Object(Wt.useContext)(Nn);Object(Wt.useEffect)((function(){var e,o,s=null===(e=n.animationState)||void 0===e?void 0:e.setActive(Ci.Exit,!i,{custom:null!==(o=null==a?void 0:a.custom)&&void 0!==o?o:t});!i&&(null==s||s.then(r))}),[i])}))},As=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},Ss=function(e){return As(e)&&e.hasOwnProperty("z")},ws=function(e,t){return Math.abs(e-t)};function Es(e,t){if(xr(e)&&xr(t))return ws(e,t);if(As(e)&&As(t)){var n=ws(e.x,t.x),o=ws(e.y,t.y),i=Ss(e)&&Ss(t)?ws(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}var xs=function(){function e(e,t,n){var o=this,i=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(o.lastMoveEvent&&o.lastMoveEventInfo){var e=Ts(o.lastMoveEventInfo,o.history),t=null!==o.startEvent,n=Es(e.offset,{x:0,y:0})>=3;if(t||n){var i=e.point,r=pa().timestamp;o.history.push(Object(Dn.a)(Object(Dn.a)({},i),{timestamp:r}));var a=o.handlers,s=a.onStart,l=a.onMove;t||(s&&s(o.lastMoveEvent,e),o.startEvent=o.lastMoveEvent),l&&l(o.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){o.lastMoveEvent=e,o.lastMoveEventInfo=Bs(t,o.transformPagePoint),wi(e)&&0===e.buttons?o.handlePointerUp(e,t):ga.update(o.updatePoint,!0)},this.handlePointerUp=function(e,t){o.end();var n=o.handlers,i=n.onEnd,r=n.onSessionEnd,a=Ts(Bs(t,o.transformPagePoint),o.history);o.startEvent&&i&&i(e,a),r&&r(e,a)},!(Ei(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=i;var r=Bs(Ti(e),this.transformPagePoint),a=r.point,s=pa().timestamp;this.history=[Object(Dn.a)(Object(Dn.a)({},a),{timestamp:s})];var l=t.onSessionStart;l&&l(e,Ts(r,this.history)),this.removeListeners=Ui(Pi(window,"pointermove",this.handlePointerMove),Pi(window,"pointerup",this.handlePointerUp),Pi(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),ua.update(this.updatePoint)},e}();function Bs(e,t){return t?{point:t(e.point)}:e}function Is(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ts(e,t){var n=e.point;return{point:n,delta:Is(n,Os(t)),offset:Is(n,ks(t)),velocity:Ds(t,.1)}}function ks(e){return e[0]}function Os(e){return e[e.length-1]}function Ds(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,o=null,i=Os(e);n>=0&&(o=e[n],!(i.timestamp-o.timestamp>Aa(t)));)n--;if(!o)return{x:0,y:0};var r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Ls(e){return e}function Ps(e){var t=e.top;return{x:{min:e.left,max:e.right},y:{min:t,max:e.bottom}}}var _s={translate:0,scale:1,origin:0,originPoint:0};function Rs(){return{x:Object(Dn.a)({},_s),y:Object(Dn.a)({},_s)}}function Fs(e){return[e("x"),e("y")]}function Ms(e,t,n){var o=t.min,i=t.max;return void 0!==o&&e<o?e=n?ir(o,e,n.min):Math.max(e,o):void 0!==i&&e>i&&(e=n?ir(i,e,n.max):Math.min(e,i)),e}function Ws(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 Ns(e,t){var n,o=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&(o=(n=Object(Dn.c)([i,o],2))[0],i=n[1]),{min:e.min+o,max:e.min+i}}function Vs(e,t,n){return{min:zs(e,t),max:zs(e,n)}}function zs(e,t){var n;return"number"==typeof e?e:null!==(n=e[t])&&void 0!==n?n:0}function js(e,t){return Ps(function(e,t){var n=e.top,o=e.left,i=e.bottom,r=e.right;void 0===t&&(t=Ls);var a=t({x:o,y:n}),s=t({x:r,y:i});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(e.getBoundingClientRect(),t))}function Hs(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=.01),Es(e,t)<n}function Us(e){return e.max-e.min}function Zs(e,t){var n=.5,o=Us(e),i=Us(t);return i>o?n=or(t.min,t.max-o,e.min):o>i&&(n=or(e.min,e.max-i,t.min)),Yi(0,1,n)}function Gs(e,t,n,o){void 0===o&&(o=.5),e.origin=o,e.originPoint=ir(t.min,t.max,e.origin),e.scale=Us(n)/Us(t),Hs(e.scale,1,1e-4)&&(e.scale=1),e.translate=ir(n.min,n.max,e.origin)-e.originPoint,Hs(e.translate)&&(e.translate=0)}function Qs(e,t,n,o){Gs(e.x,t.x,n.x,Ys(o.originX)),Gs(e.y,t.y,n.y,Ys(o.originY))}function Ys(e){return"number"==typeof e?e:.5}function Xs(e,t,n){e.min=n.min+t.min,e.max=e.min+Us(t)}var Ks=function(e,t){return e.depth-t.depth};function qs(e){return e.projection.isEnabled||e.shouldResetTransform()}function Js(e,t){void 0===t&&(t=[]);var n=e.parent;return n&&Js(n,t),qs(e)&&t.push(e),t}function $s(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(Dn.a)({},t.x),y:Object(Dn.a)({},t.y)}),e.notifyLayoutMeasure(n.layout,e.prevViewportBox||n.layout),ga.update((function(){return e.rebaseProjectionTarget()}))}}function el(e,t){return{min:t.min-e.min,max:t.max-e.min}}function tl(e,t){return{x:el(e.x,t.x),y:el(e.y,t.y)}}function nl(e,t){var n=e.getLayoutId(),o=t.getLayoutId();return n!==o||void 0===o&&e!==t}function ol(e){var t=e.getProps(),n=t.drag,o=t._dragX;return n&&!o}function il(e,t){e.min=t.min,e.max=t.max}function rl(e,t,n){return n+t*(e-n)}function al(e,t,n,o,i){return void 0!==i&&(e=rl(e,i,o)),rl(e,n,o)+t}function sl(e,t,n,o,i){void 0===t&&(t=0),void 0===n&&(n=1),e.min=al(e.min,t,n,o,i),e.max=al(e.max,t,n,o,i)}function ll(e,t){var n=t.x,o=t.y;sl(e.x,n.translate,n.scale,n.originPoint),sl(e.y,o.translate,o.scale,o.originPoint)}function cl(e,t,n,o){var i=Object(Dn.c)(o,3),r=i[0],a=i[1],s=i[2];e.min=t.min,e.max=t.max;var l=void 0!==n[s]?n[s]:.5,c=ir(t.min,t.max,l);sl(e,n[r],n[a],c,n.scale)}var ul=["x","scaleX","originX"],dl=["y","scaleY","originY"];function hl(e,t,n){cl(e.x,t.x,n,ul),cl(e.y,t.y,n,dl)}function ml(e,t,n,o,i){return e=rl(e-=t,1/n,o),void 0!==i&&(e=rl(e,1/i,o)),e}function fl(e,t,n){var o=Object(Dn.c)(n,3),i=o[0],r=o[1],a=o[2];!function(e,t,n,o,i){void 0===t&&(t=0),void 0===n&&(n=1),void 0===o&&(o=.5);var r=ir(e.min,e.max,o)-t;e.min=ml(e.min,t,n,r,i),e.max=ml(e.max,t,n,r,i)}(e,t[i],t[r],t[a],t.scale)}function pl(e,t){fl(e.x,t,ul),fl(e.y,t,dl)}var gl=new Set;function vl(e,t,n){e[n]||(e[n]=[]),e[n].push(t)}function Cl(e){return gl.add(e),function(){return gl.delete(e)}}function bl(){if(gl.size){var e=0,t=[[]],n=[],o=function(n){return vl(t,n,e)},i=function(t){vl(n,t,e),e++};gl.forEach((function(t){t(o,i),e=0})),gl.clear();for(var r=n.length,a=0;a<=r;a++)t[a]&&t[a].forEach(Al),n[a]&&n[a].forEach(Al)}}var yl,Al=function(e){return e()},Sl=new WeakMap,wl=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(),Sl.set(t,this)}return e.prototype.start=function(e,t){var n=this,o=void 0===t?{}:t,i=o.snapToCursor,r=void 0!==i&&i,a=o.cursorProgress,s=this.props.transformPagePoint;this.panSession=new xs(e,{onSessionStart:function(e){var t;n.stopMotion();var o=function(e){return Ti(e,"client")}(e).point;null===(t=n.cancelLayout)||void 0===t||t.call(n),n.cancelLayout=Cl((function(e,t){var i=Js(n.visualElement),s=function(e){var t=[],n=function(e){qs(e)&&t.push(e),e.children.forEach(n)};return e.children.forEach(n),t.sort(Ks)}(n.visualElement),l=Object(Dn.e)(Object(Dn.e)([],Object(Dn.c)(i)),Object(Dn.c)(s)),c=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),t((function(){l.forEach((function(e){return e.resetTransform()}))})),e((function(){$s(n.visualElement),s.forEach($s)})),t((function(){l.forEach((function(e){return e.restoreTransform()})),r&&(c=n.snapToCursor(o))})),e((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var e=n.visualElement.projection;Fs((function(t){if(!c){var i=e.target[t],r=i.min,s=i.max;n.cursorProgress[t]=a?a[t]:or(r,s,o[t])}var l=n.getAxisMotionValue(t);l&&(n.originPoint[t]=l.get())}))})),t((function(){da.update(),da.preRender(),da.render(),da.postRender()})),e((function(){return n.resolveDragConstraints()}))}))},onStart:function(e,t){var o,i,r,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Wi(s),n.openGlobalLock))&&(bl(),n.isDragging=!0,n.currentDirection=null,null===(i=(o=n.props).onDragStart)||void 0===i||i.call(o,e,t),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(Ci.Drag,!0))},onMove:function(e,t){var o,i,r,a,s=n.props,l=s.dragPropagation,c=s.dragDirectionLock;if(l||n.openGlobalLock){var u=t.offset;if(c&&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===(i=(o=n.props).onDirectionLock)||void 0===i||i.call(o,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),yl=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,o=t.dragElastic,i=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Kn(n)?this.resolveRefConstraints(i,n):function(e,t){var n=t.top,o=t.left,i=t.bottom,r=t.right;return{x:Ws(e.x,o,r),y:Ws(e.y,n,i)}}(i,n)),this.elastic=function(e){return!1===e?e=0:!0===e&&(e=.35),{x:Vs(e,"left","right"),y:Vs(e,"top","bottom")}}(o),this.constraints&&!this.hasMutatedConstraints&&Fs((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}(i[t],e.constraints[t]))}))},e.prototype.resolveRefConstraints=function(e,t){var n=this.props,o=n.onMeasureDragConstraints,i=n.transformPagePoint,r=t.current;this.constraintsBox=js(r,i);var a=function(e,t){return{x:Ns(e.x,t.x),y:Ns(e.y,t.y)}}(e,this.constraintsBox);if(o){var s=o(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=Ps(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(Ci.Drag,!1)},e.prototype.stop=function(e,t){var n,o,i;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===(i=(o=this.props).onDragEnd)||void 0===i||i.call(o,e,t)}},e.prototype.snapToCursor=function(e){var t=this;return Fs((function(n){if(El(n,t.props.drag,t.currentDirection)){var o=t.getAxisMotionValue(n);if(!o)return t.cursorProgress[n]=.5,!0;var i=t.visualElement.getLayoutState().layout,r=i[n].max-i[n].min,a=i[n].min+r/2,s=e[n]-a;t.originPoint[n]=e[n],o.set(s)}})).includes(!0)},e.prototype.updateAxis=function(e,t,n){if(El(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 o=this.originPoint[e]+t[e],i=this.constraints?Ms(o,this.constraints[e],this.elastic[e]):o;n.set(i)}},e.prototype.updateVisualElementAxis=function(e,t){var n,o=this.visualElement.getLayoutState().layout[e],i=o.max-o.min,r=this.cursorProgress[e],a=function(e,t,n,o,i){var r=e-t*n;return o?Ms(r,o,i):r}(t[e],i,r,null===(n=this.constraints)||void 0===n?void 0:n[e],this.elastic[e]);this.visualElement.setProjectionTargetAxis(e,a,a+i)},e.prototype.setProps=function(e){var t=e.drag,n=void 0!==t&&t,o=e.dragDirectionLock,i=void 0!==o&&o,r=e.dragPropagation,a=void 0!==r&&r,s=e.dragConstraints,l=void 0!==s&&s,c=e.dragElastic,u=void 0===c?.35:c,d=e.dragMomentum,h=void 0===d||d,m=Object(Dn.d)(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(Dn.a)({drag:n,dragDirectionLock:i,dragPropagation:a,dragConstraints:l,dragElastic:u,dragMomentum:h},m)},e.prototype.getAxisMotionValue=function(e){var t=this.props,n=t.layout,o=t.layoutId,i="_drag"+e.toUpperCase();return this.props[i]?this.props[i]:n||void 0!==o?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,o=n.drag,i=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(e,t){void 0===t&&(t=!0);var n,o=e.getProjectionParent();return!!o&&(t?pl(n=tl(o.projection.target,e.projection.target),o.getLatestValues()):n=tl(o.getLayoutState().layout,e.getLayoutState().layout),Fs((function(t){return e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var c=this.visualElement.getProjectionParent();if(c){var u=tl(c.projection.targetFinal,l);Fs((function(e){var t=u[e],n=t.min,o=t.max;l[e]={min:isNaN(n)?void 0:n,max:isNaN(o)?void 0:o}}))}}var d=Fs((function(n){var c;if(El(n,o,t.currentDirection)){var u=null!==(c=null==l?void 0:l[n])&&void 0!==c?c:{},d=r?200:1e6,h=r?40:1e7,m=Object(Dn.a)(Object(Dn.a)({type:"inertia",velocity:i?e[n]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},a),u);return t.getAxisMotionValue(n)?t.startAxisValueAnimation(n,m):t.visualElement.startLayoutAnimation(n,m,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;Fs((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 o=n.get();return n.set(o),n.set(o),Ka(e,n,0,t)}},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.drag;if(Kn(t.dragConstraints)&&this.constraintsBox){this.stopMotion();var o={x:0,y:0};Fs((function(t){o[t]=Zs(e.visualElement.projection.target[t],e.constraintsBox[t])})),this.updateConstraints((function(){Fs((function(t){if(El(t,n,null)){var i=function(e,t,n){var o=e.max-e.min,i=ir(t.min,t.max-o,n);return{min:i,max:i+o}}(e.visualElement.projection.target[t],e.constraintsBox[t],o[t]),r=i.min,a=i.max;e.visualElement.setProjectionTargetAxis(t,r,a)}}))})),setTimeout(bl,1)}},e.prototype.updateConstraints=function(e){var t=this;this.cancelLayout=Cl((function(n,o){var i=Js(t.visualElement);o((function(){return i.forEach((function(e){return e.resetTransform()}))})),n((function(){return $s(t.visualElement)})),o((function(){return i.forEach((function(e){return e.restoreTransform()}))})),n((function(){t.resolveDragConstraints()})),e&&o(e)}))},e.prototype.mount=function(e){var t=this,n=Pi(e.getInstance(),"pointerdown",(function(e){var n=t.props,o=n.drag,i=n.dragListener;o&&(void 0===i||i)&&t.start(e)})),o=Ai(window,"resize",(function(){t.scalePoint()})),i=e.onLayoutUpdate((function(){t.isDragging&&t.resolveDragConstraints()})),r=e.prevDragCursor;return r&&this.start(yl,{cursorProgress:r}),function(){null==n||n(),null==o||o(),null==i||i(),t.cancelDrag()}},e}();function El(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}var xl,Bl,Il={pan:Zi((function(e){var t=e.onPan,n=e.onPanStart,o=e.onPanEnd,i=e.onPanSessionStart,r=e.visualElement,a=t||n||o||i,s=Object(Wt.useRef)(null),l=Object(Wt.useContext)(Mn).transformPagePoint,c={onSessionStart:i,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,o&&o(e,t)}};Object(Wt.useEffect)((function(){null!==s.current&&s.current.updateHandlers(c)})),_i(r,"pointerdown",a&&function(e){s.current=new xs(e,c,{transformPagePoint:l})}),ji((function(){return s.current&&s.current.end()}))})),drag:Zi((function(e){var t=e.dragControls,n=e.visualElement,o=Object(Wt.useContext)(Mn).transformPagePoint,i=Vn((function(){return new wl({visualElement:n})}));i.setProps(Object(Dn.a)(Object(Dn.a)({},e),{transformPagePoint:o})),Object(Wt.useEffect)((function(){return t&&t.subscribe(i)}),[i]),Object(Wt.useEffect)((function(){return i.mount(n)}),[])}))};function Tl(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"}(xl||(xl={})),function(e){e[e.Hide=0]="Hide",e[e.Show=1]="Show"}(Bl||(Bl={}));var kl=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ol(e,t,n){void 0===n&&(n=1);var o=Object(Dn.c)(function(e){var t=kl.exec(e);if(!t)return[,];var n=Object(Dn.c)(t,3);return[n[1],n[2]]}(e),2),i=o[0],r=o[1];if(i){var a=window.getComputedStyle(t).getPropertyValue(i);return a?a.trim():Tl(r)?Ol(r,t,n+1):r}}function Dl(e,t){return e/(t.max-t.min)*100}var Ll="_$css";var Pl={process:function(e,t,n){var o=n.target;if("string"==typeof e){if(!Lo.test(e))return e;e=parseFloat(e)}return Dl(e,o.x)+"% "+Dl(e,o.y)+"%"}},_l={borderRadius:Object(Dn.a)(Object(Dn.a)({},Pl),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Pl,borderTopRightRadius:Pl,borderBottomLeftRadius:Pl,borderBottomRightRadius:Pl,boxShadow:{process:function(e,t){var n=t.delta,o=t.treeScale,i=e,r=e.includes("var("),a=[];r&&(e=e.replace(kl,(function(e){return a.push(e),Ll})));var s=Er.parse(e);if(s.length>5)return i;var l=Er.createTransformer(e),c="number"!=typeof s[0]?1:0,u=n.x.scale*o.x,d=n.y.scale*o.y;s[0+c]/=u,s[1+c]/=d;var h=ir(u,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=h),"number"==typeof s[3+c]&&(s[3+c]/=h);var m=l(s);if(r){var f=0;m=m.replace(Ll,(function(){var e=a[f];return f++,e}))}return m}}},Rl=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,o){void 0===o&&(o={});var i=o.originBox,r=o.targetBox,a=o.visibilityAction,s=o.shouldStackAnimate,l=o.onComplete,c=o.prevParent,u=Object(Dn.d)(o,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=t.props,h=d.visualElement,m=d.layout;if(!1===s)return t.isAnimatingTree=!1,t.safeToRemove();if(!t.isAnimatingTree||!0===s){s&&(t.isAnimatingTree=!0),n=i||n,e=r||e;var f=!1,p=h.getProjectionParent();if(p){var g=p.prevViewportBox,v=p.getLayoutState().layout;c&&(r&&(v=c.getLayoutState().layout),i&&!nl(c,p)&&c.prevViewportBox&&(g=c.prevViewportBox)),g&&zl(c,i,r)&&(f=!0,n=tl(g,n),e=tl(v,e))}var C=Fl(n,e),b=Fs((function(o){var i,r;if("position"===m){var s=e[o].max-e[o].min;n[o].max=n[o].min+s}if(!h.projection.isTargetLocked)return void 0===a?C?t.animateAxis(o,e[o],n[o],Object(Dn.a)(Object(Dn.a)({},u),{isRelative:f})):(null===(r=(i=t.stopAxisAnimation)[o])||void 0===r||r.call(i),h.setProjectionTargetAxis(o,e[o].min,e[o].max,f)):void h.setVisibility(a===Bl.Show)}));return h.syncRender(),Promise.all(b).then((function(){t.isAnimatingTree=!1,l&&l(),h.notifyLayoutAnimationComplete()}))}},t}return Object(Dn.b)(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.visualElement;t.animateMotionValue=Ka,t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate),t.layoutSafeToRemove=function(){return e.safeToRemove()},function(e){for(var t in e)co[t]=e[t]}(_l)},t.prototype.componentWillUnmount=function(){var e=this;this.unsubLayoutReady(),Fs((function(t){var n,o;return null===(o=(n=e.stopAxisAnimation)[t])||void 0===o?void 0:o.call(n)}))},t.prototype.animateAxis=function(e,t,n,o){var i,r,a=this,s=void 0===o?{}:o,l=s.transition,c=s.isRelative;if(!this.isAnimating[e]||!Nl(t,this.currentAnimationTarget[e])){null===(r=(i=this.stopAxisAnimation)[e])||void 0===r||r.call(i),this.isAnimating[e]=!0;var u=this.props.visualElement,d=this.frameTarget[e],h=u.getProjectionAnimationProgress()[e];h.clearListeners(),h.set(0),h.set(0);var m=function(){var o=h.get()/1e3;!function(e,t,n,o){e.min=ir(t.min,n.min,o),e.max=ir(t.max,n.max,o)}(d,n,t,o),u.setProjectionTargetAxis(e,d.min,d.max,c)};m();var f=h.onChange(m);this.stopAxisAnimation[e]=function(){a.isAnimating[e]=!1,h.stop(),f()},this.currentAnimationTarget[e]=t;var p=l||u.getDefaultTransition()||Vl;return Ka("x"===e?"layoutX":"layoutY",h,1e3,p&&Xa(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}(Wt.Component);function Fl(e,t){return!(Wl(e)||Wl(t)||Nl(e.x,t.x)&&Nl(e.y,t.y))}var Ml={min:0,max:0};function Wl(e){return Nl(e.x,Ml)&&Nl(e.y,Ml)}function Nl(e,t){return e.min===t.min&&e.max===t.max}var Vl={duration:.45,ease:[.4,0,.1,1]};function zl(e,t,n){return e||!e&&!(t||n)}var jl={layoutReady:function(e){return e.notifyLayoutReady()}};function Hl(){var e=new Set;return{add:function(t){return e.add(t)},flush:function(t){var n=void 0===t?jl:t,o=n.layoutReady,i=n.parent;Cl((function(t,n){var r=Array.from(e).sort(Ks),a=i?Js(i):[];n((function(){Object(Dn.e)(Object(Dn.e)([],Object(Dn.c)(a)),Object(Dn.c)(r)).forEach((function(e){return e.resetTransform()}))})),t((function(){r.forEach($s)})),n((function(){a.forEach((function(e){return e.restoreTransform()})),r.forEach(o)})),t((function(){r.forEach((function(e){e.isPresent&&(e.presence=xl.Present)}))})),n((function(){da.preRender(),da.render()})),t((function(){ga.postRender((function(){return r.forEach(Ul)})),e.clear()}))})),bl()}}}function Ul(e){e.prevViewportBox=e.projection.target}var Zl=Object(Wt.createContext)(Hl()),Gl=Object(Wt.createContext)(Hl());function Ql(e){return!!e.forceUpdate}var Yl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(Dn.b)(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.syncLayout,n=e.framerSyncLayout,o=e.visualElement;Ql(t)&&t.register(o),Ql(n)&&n.register(o),o.onUnmount((function(){Ql(t)&&t.remove(o),Ql(n)&&n.remove(o)}))},t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.syncLayout,n=e.visualElement;return Ql(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;Ql(e)||e.flush()},t.prototype.render=function(){return null},t}(Wt.default.Component);var Xl={measureLayout:function(e){var t=Object(Wt.useContext)(Zl),n=Object(Wt.useContext)(Gl);return Wt.default.createElement(Yl,Object(Dn.a)({},e,{syncLayout:t,framerSyncLayout:n}))},layoutAnimation:function(e){var t=Object(Dn.c)(zn(),2)[1];return Wt.createElement(Rl,Object(Dn.a)({},e,{safeToRemove:t}))}};function Kl(){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:Rs(),deltaFinal:Rs(),deltaTransform:""}}var ql=Kl();function Jl(e,t,n){var o=e.x,i=e.y,r="translate3d("+o.translate/t.x+"px, "+i.translate/t.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),l&&(r+="rotateY("+l+") ")}return r+="scale("+o.scale+", "+i.scale+")",n||r!==ec?r:""}function $l(e){var t=e.deltaFinal;return 100*t.x.origin+"% "+100*t.y.origin+"% 0"}var ec=Jl(ql.delta,ql.treeScale,{x:1,y:1}),tc=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function nc(e,t,n,o){var i,r,a=e.delta,s=e.layout,l=e.layoutCorrected,c=e.treeScale,u=t.target;r=s,il((i=l).x,r.x),il(i.y,r.y),function(e,t,n){var o=n.length;if(o){var i,r;t.x=t.y=1;for(var a=0;a<o;a++)r=(i=n[a]).getLayoutState().delta,t.x*=r.x.scale,t.y*=r.y.scale,ll(e,r),ol(i)&&hl(e,e,i.getLatestValues())}}(l,c,n),Qs(a,l,u,o)}var oc=function(){function e(){this.children=[],this.isDirty=!1}return e.prototype.add=function(e){qa(this.children,e),this.isDirty=!0},e.prototype.remove=function(e){Ja(this.children,e),this.isDirty=!0},e.prototype.forEach=function(e){this.isDirty&&this.children.sort(Ks),this.isDirty=!1,this.children.forEach(e)},e}();var ic=function(e){var t=e.treeType,n=void 0===t?"":t,o=e.build,i=e.getBaseTarget,r=e.makeTargetAnimatable,a=e.measureViewportBox,s=e.render,l=e.readValueFromInstance,c=e.resetTransform,u=e.restoreTransform,d=e.removeValueFromRenderState,h=e.sortNodePosition,m=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 b,y,A,S,w,E,x=C.latestValues,B=C.renderState,I=function(){var e=tc.map((function(){return new $a})),t={},n={clearAllListeners:function(){return e.forEach((function(e){return e.clear()}))},updatePropListeners:function(e){return tc.forEach((function(o){var i;null===(i=t[o])||void 0===i||i.call(t);var r="on"+o,a=e[r];a&&(t[o]=n[r](a))}))}};return e.forEach((function(e,t){n["on"+tc[t]]=function(t){return e.add(t)},n["notify"+tc[t]]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.notify.apply(e,Object(Dn.e)([],Object(Dn.c)(t)))}})),n}(),T={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}}},k=T,O=x,D=Kl(),L=!1,P=new Map,_=new Map,R={},F=Object(Dn.a)({},x);function M(){b&&(G.isProjectionReady()&&(hl(k.targetFinal,k.target,O),Qs(D.deltaFinal,D.layoutCorrected,k.targetFinal,x)),W(),s(b,B))}function W(){var e=x;if(S&&S.isActive()){var n=S.getCrossfadeState(G);n&&(e=n)}o(G,B,e,k,D,t,p)}function N(){I.notifyUpdate(x)}function V(){G.layoutTree.forEach(ac)}var z=m(p);for(var j in z){var H=z[j];void 0!==x[j]&&bo(H)&&H.set(x[j],!1)}var U=to(p),Z=no(p),G=Object(Dn.a)(Object(Dn.a)({treeType:n,current:null,depth:f?f.depth+1:0,parent:f,children:new Set,path:f?Object(Dn.e)(Object(Dn.e)([],Object(Dn.c)(f.path)),[f]):[],layoutTree:f?f.layoutTree:new oc,presenceId:g,projection:T,variantChildren:Z?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==f?void 0:f.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(b)},mount:function(e){b=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(){ua.update(N),ua.render(M),ua.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(),I.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 h&&n===e.treeType?h(G.getInstance(),e.getInstance()):0},getClosestVariantNode:function(){return Z?G:null==f?void 0:f.getClosestVariantNode()},scheduleUpdateLayoutProjection:f?f.scheduleUpdateLayoutProjection:function(){return ga.preRender(G.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return p.layoutId},getInstance:function(){return b},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&&ga.update(N,!1,!0)})),o=t.onRenderRequest(G.scheduleRender);_.set(e,(function(){n(),o()}))}(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,B)},hasValue:function(e){return P.has(e)},getValue:function(e,t){var n=P.get(e);return void 0===n&&void 0!==t&&(n=ts(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:l(b,e,t)},setBaseTarget:function(e,t){F[e]=t},getBaseTarget:function(e){if(i){var t=i(p,e);if(void 0!==t&&!bo(t))return t}return F[e]}},I),{build:function(){return W(),B},scheduleRender:function(){ga.render(M,!1,!0)},syncRender:M,setProps:function(e){p=e,I.updatePropListeners(e),R=function(e,t,n){var o;for(var i in t){var r=t[i],a=n[i];if(bo(r))e.addValue(i,r);else if(bo(a))e.addValue(i,ts(r));else if(a!==r)if(e.hasValue(i)){var s=e.getValue(i);!s.hasAnimated&&s.set(r)}else e.addValue(i,ts(null!==(o=e.getStaticValue(i))&&void 0!==o?o:r))}for(var i in n)void 0===t[i]&&e.removeValue(i);return t}(G,m(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={},o=0;o<cc;o++){var i=lc[o],r=p[i];(Jn(r)||!1===r)&&(n[i]=r)}return n},enableLayoutProjection:function(){T.isEnabled=!0,G.layoutTree.add(G)},lockProjectionTarget:function(){T.isTargetLocked=!0},unlockProjectionTarget:function(){G.stopLayoutAnimation(),T.isTargetLocked=!1},getLayoutState:function(){return D},setCrossfader:function(e){S=e},isProjectionReady:function(){return T.isEnabled&&T.isHydrated&&D.isHydrated},startLayoutAnimation:function(e,t,n){void 0===n&&(n=!1);var o=G.getProjectionAnimationProgress()[e],i=n?T.relativeTarget[e]:T.target[e],r=i.min,a=i.max-r;return o.clearListeners(),o.set(r),o.set(r),o.onChange((function(t){G.setProjectionTargetAxis(e,t,t+a,n)})),G.animateMotionValue(e,o,0,t)},stopLayoutAnimation:function(){Fs((function(e){return G.getProjectionAnimationProgress()[e].stop()}))},measureViewportBox:function(e){void 0===e&&(e=!0);var n=a(b,t);return e||pl(n,x),n},getProjectionAnimationProgress:function(){return w||(w={x:ts(0),y:ts(0)}),w},setProjectionTargetAxis:function(e,t,n,o){var i;void 0===o&&(o=!1),o?(T.relativeTarget||(T.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),i=T.relativeTarget[e]):(T.relativeTarget=void 0,i=T.target[e]),T.isHydrated=!0,i.min=t,i.max=n,L=!0,I.notifySetAxisTarget()},rebaseProjectionTarget:function(e,t){void 0===t&&(t=D.layout);var n=G.getProjectionAnimationProgress(),o=n.x,i=n.y,r=!(T.relativeTarget||T.isTargetLocked||o.isAnimating()||i.isAnimating());(e||r)&&Fs((function(e){var n=t[e],o=n.min,i=n.max;G.setProjectionTargetAxis(e,o,i)}))},notifyLayoutReady:function(e){!function(e){var t=e.getProjectionParent();if(t){var n=tl(t.getLayoutState().layout,e.getLayoutState().layout);Fs((function(t){e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)}))}else e.rebaseProjectionTarget()}(G),G.notifyLayoutUpdate(D.layout,G.prevViewportBox||D.layout,e)},resetTransform:function(){return c(G,b,p)},restoreTransform:function(){return u(b,B)},updateLayoutProjection:function(){if(G.isProjectionReady()){var e=D.delta,t=D.treeScale,n=t.x,o=t.y,i=D.deltaTransform;nc(D,k,G.path,x),L&&G.notifyViewportBoxUpdate(k.target,e),L=!1;var r=Jl(e,t);r===i&&n===t.x&&o===t.y||G.scheduleRender(),D.deltaTransform=r}},updateTreeLayoutProjection:function(){G.layoutTree.forEach(rc),ga.preRender(V,!1,!0)},getProjectionParent:function(){if(void 0===y){for(var e=!1,t=G.path.length-1;t>=0;t--){var n=G.path[t];if(n.projection.isEnabled){e=n;break}}y=e}return y},resolveRelativeTargetBox:function(){var e=G.getProjectionParent();if(T.relativeTarget&&e&&(function(e,t){Xs(e.target.x,e.relativeTarget.x,t.target.x),Xs(e.target.y,e.relativeTarget.y,t.target.y)}(T,e.projection),ol(e))){var t=T.target;hl(t,t,e.getLatestValues())}},shouldResetTransform:function(){return Boolean(p._layoutResetTransform)},pointTo:function(e){k=e.projection,O=e.getLatestValues(),null==A||A(),A=Ui(e.onSetAxisTarget(G.scheduleUpdateLayoutProjection),e.onLayoutAnimationComplete((function(){var e;G.isPresent?G.presence=xl.Present:null===(e=G.layoutSafeToRemove)||void 0===e||e.call(G)})))},isPresent:!0,presence:xl.Entering});return G}};function rc(e){e.resolveRelativeTargetBox()}function ac(e){e.updateLayoutProjection()}var sc,lc=Object(Dn.e)(["initial"],Object(Dn.c)(fs)),cc=lc.length,uc=new Set(["width","height","top","left","right","bottom","x","y"]),dc=function(e){return uc.has(e)},hc=function(e,t){e.set(t,!1),e.set(t)},mc=function(e){return e===Fo||e===Lo};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(sc||(sc={}));var fc=function(e,t){return parseFloat(e.split(", ")[t])},pc=function(e,t){return function(n,o){var i=o.transform;if("none"===i||!i)return 0;var r=i.match(/^matrix3d\((.+)\)$/);if(r)return fc(r[1],t);var a=i.match(/^matrix\((.+)\)$/);return a?fc(a[1],e):0}},gc=new Set(["x","y","z"]),vc=ho.filter((function(e){return!gc.has(e)}));var Cc={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,o=t.top;return parseFloat(o)+(n.max-n.min)},right:function(e,t){var n=e.x,o=t.left;return parseFloat(o)+(n.max-n.min)},x:pc(4,13),y:pc(5,14)},bc=function(e,t,n,o){void 0===n&&(n={}),void 0===o&&(o={}),t=Object(Dn.a)({},t),o=Object(Dn.a)({},o);var i=Object.keys(t).filter(dc),r=[],a=!1,s=[];if(i.forEach((function(i){var l=e.getValue(i);if(e.hasValue(i)){var c,u=n[i],d=t[i],h=is(u);if(hi(d))for(var m=d.length,f=null===d[0]?1:0;f<m;f++)c?is(d[f]):(c=is(d[f]))===h||mc(h)&&mc(c);else c=is(d);if(h!==c)if(mc(h)&&mc(c)){var p=l.get();"string"==typeof p&&l.set(parseFloat(p)),"string"==typeof d?t[i]=parseFloat(d):Array.isArray(d)&&c===Lo&&(t[i]=d.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==c?void 0:c.transform)&&(0===u||0===d)?0===u?l.set(c.transform(u)):t[i]=h.transform(d):(a||(r=function(e){var t=[];return vc.forEach((function(n){var o=e.getValue(n);void 0!==o&&(t.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))})),t.length&&e.syncRender(),t}(e),a=!0),s.push(i),o[i]=void 0!==o[i]?o[i]:t[i],hc(l,d))}})),s.length){var l=function(e,t,n){var o=t.measureViewportBox(),i=t.getInstance(),r=getComputedStyle(i),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 l=t.measureViewportBox();return n.forEach((function(n){var i=t.getValue(n);hc(i,Cc[n](o,s)),e[n]=Cc[n](l,r)})),e}(t,e,s);return r.length&&r.forEach((function(t){var n=Object(Dn.c)(t,2),o=n[0],i=n[1];e.getValue(o).set(i)})),e.syncRender(),{target:l,transitionEnd:o}}return{target:t,transitionEnd:o}};function yc(e,t,n,o){return function(e){return Object.keys(e).some(dc)}(t)?bc(e,t,n,o):{target:t,transitionEnd:o}}var Ac=function(e,t,n,o){var i=function(e,t,n){var o,i=Object(Dn.d)(t,[]),r=e.getInstance();if(!(r instanceof HTMLElement))return{target:i,transitionEnd:n};for(var a in n&&(n=Object(Dn.a)({},n)),e.forEachValue((function(e){var t=e.get();if(Tl(t)){var n=Ol(t,r);n&&e.set(n)}})),i){var s=i[a];if(Tl(s)){var l=Ol(s,r);l&&(i[a]=l,n&&(null!==(o=n[a])&&void 0!==o||(n[a]=s)))}}return{target:i,transitionEnd:n}}(e,t,o);return yc(e,t=i.target,n,o=i.transitionEnd)};var Sc={treeType:"dom",readValueFromInstance:function(e,t){if(po(t)){var n=ja(t);return n&&n.default||0}var o,i=(o=e,window.getComputedStyle(o));return(Ao(t)?i.getPropertyValue(t):i[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 js(e,t.transformPagePoint)},resetTransform:function(e,t,n){var o=n.transformTemplate;t.style.transform=o?o({},""):"none",e.scheduleRender()},restoreTransform:function(e,t){e.style.transform=t.style.transform},removeValueFromRenderState:function(e,t){var n=t.vars,o=t.style;delete n[e],delete o[e]},makeTargetAnimatable:function(e,t,n,o){var i=n.transformValues;void 0===o&&(o=!0);var r=t.transition,a=t.transitionEnd,s=Object(Dn.d)(t,["transition","transitionEnd"]),l=function(e,t,n){var o,i,r={};for(var a in e)r[a]=null!==(o=cs(a,t))&&void 0!==o?o:null===(i=n.getValue(a))||void 0===i?void 0:i.get();return r}(s,r||{},e);if(i&&(a&&(a=i(a)),s&&(s=i(s)),l&&(l=i(l))),o){!function(e,t,n){var o,i,r,a,s=Object.keys(t).filter((function(t){return!e.hasValue(t)})),l=s.length;if(l)for(var c=0;c<l;c++){var u=s[c],d=t[u],h=null;Array.isArray(d)&&(h=d[0]),null===h&&(h=null!==(i=null!==(o=n[u])&&void 0!==o?o:e.readValue(u))&&void 0!==i?i:t[u]),null!=h&&("string"==typeof h&&/^\-?\d*\.?\d+$/.test(h)?h=parseFloat(h):!as(h)&&Er.test(d)&&(h=Ha(u,d)),e.addValue(u,ts(h)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=h),e.setBaseTarget(u,h))}}(e,s,l);var c=Ac(e,s,l,a);a=c.transitionEnd,s=c.target}return Object(Dn.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:ci,build:function(e,t,n,o,i,r,a){void 0!==e.isVisible&&(t.style.visibility=e.isVisible?"visible":"hidden");var s=o.isEnabled&&i.isHydrated;zo(t,n,o,i,r,a.transformTemplate,s?Jl:void 0,s?$l:void 0)},render:ai},wc=ic(Sc),Ec=ic(Object(Dn.a)(Object(Dn.a)({},Sc),{getBaseTarget:function(e,t){return e[t]},readValueFromInstance:function(e,t){var n;return po(t)?(null===(n=ja(t))||void 0===n?void 0:n.default)||0:(t=si.has(t)?t:ri(t),e.getAttribute(t))},scrapeMotionValuesFromProps:ui,build:function(e,t,n,o,i,r,a){var s=o.isEnabled&&i.isHydrated;ei(t,n,o,i,r,a.transformTemplate,s?Jl:void 0,s?$l:void 0)},render:li})),xc=function(e,t){return lo(e)?Ec(t,{enableHardwareAcceleration:!1}):wc(t,{enableHardwareAcceleration:!0})},Bc=Object(Dn.a)(Object(Dn.a)(Object(Dn.a)(Object(Dn.a)({},ys),Gi),Il),Xl),Ic=ao((function(e,t){return yi(e,t,Bc,xc)}));class Tc{constructor(e){this.highlighted=!1,this.code=e,this.points=[]}}var kc=n(8);class Oc{static now(){return Date.now()}}function Dc(e){var t=Vn((function(){return ts(e)}));if(Object(Wt.useContext)(Mn).isStatic){var n=Object(Dn.c)(Object(Wt.useState)(e),2)[1];Object(Wt.useEffect)((function(){return t.onChange(n)}),[])}return t}var Lc=function(e){return function(e){return"object"==typeof e&&e.mix}(e)?e.mix:void 0};function Pc(e,t){var n=Dc(t()),o=function(){return n.set(t())};return o(),function(e,t){Object(Wt.useEffect)((function(){var n=e.map((function(e){return e.onChange(t)}));return function(){return n.forEach((function(e){return e()}))}}))}(e,(function(){return ga.update(o,!1,!0)})),n}function _c(e,t,n,o){var i="function"==typeof t?t:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!Array.isArray(e[0]),o=n?0:-1,i=e[0+o],r=e[1+o],a=e[2+o],s=e[3+o],l=Pr(r,a,Object(Dn.a)({mixer:Lc(a[0])},s));return n?l(i):l}(t,n,o);return Array.isArray(e)?Rc(e,i):Rc([e],(function(e){var t=Object(Dn.c)(e,1)[0];return i(t)}))}function Rc(e,t){var n=Vn((function(){return[]}));return Pc(e,(function(){n.length=0;for(var o=e.length,i=0;i<o;i++)n[i]=e[i].get();return t(n)}))}function Fc(e,t,n){void 0===n&&(n={});var o=bo(e)?e:ts(e);return Ka("",o,t,n),{stop:function(){return o.stop()}}}var Mc=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};class Wc extends Wt.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,o,i,r,a,s,l;const c=this.state.element,u=this.props.configuration.style;!c.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(c);const d=null!==(t=null===(e=this.customStyle)||void 0===e?void 0:e.fillColor)&&void 0!==t?t:c.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,h=null!==(o=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==o?o:c.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,m=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.strokeWidth)&&void 0!==r?r:c.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,f=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:c.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,p=null!==(l=this.props.animateToPoints)&&void 0!==l?l:c.points;return Wt.default.createElement(Nc,{points:p,onClick:()=>{this.props.onClick&&this.props.onClick(c)},fill:d,stroke:h,strokeWidth:m,cornerRadius:f})}}function Nc(e){var{points:t,cornerRadius:n}=e,o=Mc(e,["points","cornerRadius"]);const i=[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=i.map(Dc),a=_c(r,(([e,t,o,i,r,a,s,l])=>{const c=[{x:e,y:t},{x:o,y:i},{x:r,y:a},{x:s,y:l}];return kc.a.toSvgPathStringWithRoundedCorners(c,n)}));return Object(Wt.useEffect)((()=>{const e=[];for(let t=0;t<i.length;t++)e.push(Fc(r[t],i[t]));return()=>{e.forEach((e=>e.stop()))}}),[t]),Wt.default.createElement(Ic.path,Object.assign({d:a},o))}class Vc{constructor(){this.detectedAt=0}update(e,t,n,o,i,r){this.polygon=e,this.polygonRef=t,this.label=n,this.labelRef=o,this.element=i,this.updatedAt=r}}class zc extends Wt.default.Component{constructor(e){super(e),this.state={polygonElements:[]}}update(e,t,n,o){const i=[];(class{static keepOnlyCenterMostDuplicate(e,t){const n=new Map;e.forEach((e=>{const t=xn(e),o=n.get(t);o?o.push(e):n.set(t,[e])})),n.forEach(((t,o)=>{t.length<2?n.delete(o):t.forEach(((t,n)=>{e.splice(e.indexOf(t),1)}))})),n.forEach(((n,o)=>{const i=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=i(e.quad),o=i(t.quad);return Math.abs(r-n.x)<Math.abs(r-o.x)?e:t}));e.push(a)}))}}).keepOnlyCenterMostDuplicate(o,n),o.forEach((o=>{const r=new Tc(o);r.points=void 0===e?kc.a.scaleListToHtmlElement(o.quad,n,t.video):o.quad.map((t=>{const o=new kc.a(t.x,t.y);return o.x*=e.width/n.width,o.y*=e.height/n.height,o.y+=e.y,o.x+=e.x,o})),r.points.forEach((e=>{t.state.mirrored&&this.container&&(e.x=this.container.clientWidth-e.x)})),i.push(r)}));const r=[];this.state.polygonElements.forEach((e=>{const t=i.find((t=>En(t.code,e.element.code)));let n=!1;const o=Oc.now();void 0===t?e.updatedAt+1e3<o&&(n=!0):(e.element=t,e.polygon=Wt.default.createElement(Wc,{key:xn(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=Wt.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:xn(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&&o>this.props.configuration.countingRepeatDelay+e.detectedAt&&(this.props.onPolygonSelected(t.code),e.detectedAt=o),e.updatedAt=o),n||r.push(e)})),i.forEach((e=>{if(void 0===this.state.polygonElements.find((t=>En(t.element.code,e.code)))){let t,n;const o=new Vc,i=Wt.default.createElement(Wc,{key:xn(e.code),ref:o=>{t=o,void 0!==n&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}),a=Wt.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:xn(e.code),ref:o=>{n=o,void 0!==t&&this.props.onBarcodeFound(e.code,t,n)},configuration:this.props.configuration,element:e,onClick:this.onPolygonClick.bind(this)}));o.update(i,t,a,n,e,Oc.now()),r.push(o)}})),this.setState({polygonElements:r})}onPolygonClick(e){var t,n,o,i;let r;e.highlighted=!e.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((t=>{var n;const o=t.labelRef,i=t.label.props.element;En(i.code,e.code)&&(r=t),o&&En(i.code,e.code)&&(o.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=Oc.now())),null===(i=(o=this.props).onPolygonClick)||void 0===i||i.call(o,e.code)}render(){var e,t;return Wt.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:e=>this.container=e},Wt.default.createElement(Ic.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 jc=n(42),Hc=n.n(jc),Uc=n(45),Zc={insert:"head",singleton:!1},Gc=(Hc()(Uc.a,Zc),Uc.a.locals,n(28)),Qc=n.n(Gc);class Yc{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 o=-e*this.t;this.element&&(this.element.style.animationDuration=`${e}s`,this.element.style.animationDelay=`${o}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=t,this.lastDuration=e}}class Xc extends Wt.default.Component{constructor(){super(...arguments),this.inner1=new Yc("scanbot-shutter-rotate"),this.inner2=new Yc("scanbot-shutter-rotate")}render(){return Wt.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,Wt.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},Wt.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},Wt.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},Wt.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},Wt.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 Wt.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:e})}svgBase(e,t,n){return Wt.default.createElement("div",{className:Qc()(e),ref:n},Wt.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},t))}}class Kc extends Wt.default.Component{render(){return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_919_23088)"},Wt.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 qc extends Wt.default.Component{render(){return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_919_23102)"},Wt.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 Jc extends Wt.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 Wt.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:kn.ScanbotPrimary}},Wt.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},Wt.default.createElement(Kc,null),Wt.default.createElement("div",{style:{backgroundColor:kn.Orange,color:kn.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)),Wt.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},Wt.default.createElement(Xc,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),Wt.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},Wt.default.createElement("div",{style:{fontSize:13,color:kn.White,marginRight:10}},"Scan More"),Wt.default.createElement(qc,null)))}}class $c extends Wt.default.Component{render(){const e=kc.a.centerOf(this.props.points),t=kc.a.smallerSizeOfQuad(this.props.points)/40;return Wt.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})`}},Wt.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},Wt.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_910_20901)"},Wt.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),Wt.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 eu=n(11);class tu extends Wt.default.Component{constructor(e){super(e),this.state={elements:[],imageSize:eu.a.empty()}}update(e){const t=[];e.barcodes.forEach((n=>{const o=new Tc(n);o.points=kc.a.scaleListToHtmlElement(n.quad,e.originalImageSize,this.image),t.push(o)})),this.setState({imageSize:eu.a.fromHtmlElement(this.image),elements:t})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:Wt.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}},Wt.default.createElement("img",{style:{maxWidth:"100%"},ref:e=>this.image=e,src:`${this.props.image}`}),Wt.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((e,t)=>Wt.default.createElement($c,{key:t,points:e.points})))))}}class nu extends Wt.default.Component{render(){if(!this.props.visible)return null;const e=Sn.a.svg`
32
32
  animation: rotate 2s linear infinite;
33
33
  @keyframes rotate { 100% { transform: rotate(360deg); } }
34
- `;return W.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},W.default.createElement(t,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),W.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"}),W.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"}),W.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 Xs extends W.default.Component{render(){return this.props.text?W.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},W.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:St.TransparentGray,color:St.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class $s extends W.default.Component{constructor(t){super(t),this.state={element:t.element}}style(t){this.customStyle=t,this.forceUpdate()}update(t){this.setState({element:t})}formatText(t,e){if("None"!==e)return"Text"===e?t.text:t.format+" ("+t.text+")"}render(){var t,e,n,o,i;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),l=ws.a.width(null!==(t=this.props.animateToPoints)&&void 0!==t?t:r.points);if(!s)return null;if(!r.points)return null;const c=null!==(n=null===(e=this.customStyle)||void 0===e?void 0:e.backgroundColor)&&void 0!==n?n:r.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,u=null!==(i=null===(o=this.customStyle)||void 0===o?void 0:o.textColor)&&void 0!==i?i:r.highlighted?a.highlightedTextColor:a.textColor;return W.default.createElement(Cs.div,{ref:t=>this.label=t,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:ws.a.lowestX(r.points),y:ws.a.highestY(r.points)+3,backgroundColor:c,fontSize:12,width:l,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:ws.a.lowestX(this.props.animateToPoints),y:ws.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class Ks{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 Js{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.style=new Ks}}class tl{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class el{constructor(){this.enabled=!1,this.style=new tl}}class nl extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new Js,this.detectionParameters=new T.BarcodeScannerTypes.BarcodeScannerConfiguration,this.scanAndCount=new el,this.onBarcodesDetected=function(t){}}static fromJson(t){const e=new nl;return this.mapValues(t,e,["style","videoConstraints","overlay","scanAndCount","finder","userGuidance"]),this.mapFinderConfiguration(e,t),t.overlay&&(this.mapValues(t.overlay,e.overlay,["style"]),t.overlay.style&&this.mapValues(t.overlay.style,e.overlay.style)),t.scanAndCount&&(this.mapValues(t.scanAndCount,e.scanAndCount,["style"]),t.scanAndCount.style&&this.mapValues(t.scanAndCount.style,e.scanAndCount.style)),this.mapVideoConstraints(t,e),e}}class ol{constructor(t){this.coreResult=t,this.barcodes=[],this.originalImageSize=null,this.barcodes=t.barcodes,t.originalImage&&(this.originalImageSize=new Ys.a(t.originalImage.width,t.originalImage.height))}isEmpty(){return 0===this.barcodes.length}}class il{static warn(t){console.warn("[ScanbotSDK]",t)}}class rl{static convertLinesToViewportLines(t,e){if(e&&t)return e.map((e=>({start:new ws.a(e.start.x*t.width,e.start.y*t.height),end:new ws.a(e.end.x*t.width,e.end.y*t.height)})))}static convertToViewportPointsFromParentSize(t,e){return e?Ys.a.isEmpty(t)?void 0:e.map((e=>ws.a.scaleUpTo(e,t))):Ys.a.toPolygon(t)}static calculateScale(t){let e,n=0,o=0;return 1>t.width/t.height?(e=t.height/1,n=(1-t.width/e)/2):(e=t.width/1,o=(1-t.height/e)/2),{x:n,y:o,containerScale:e}}static findScale(t,e){let n,o=0,i=0;return e.ratio(!0)>t.ratio(!0)?(n=t.width/e.width,i=(e.height-t.height/n)/2):(n=t.height/e.height,o=(e.width-t.width/n)/2),{x:o,y:i,scale:n}}static preventDefaultCallback(t){t.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",rl.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",rl.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(t){var e;const n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.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 al=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.a;ht.b;class sl extends ht.c{constructor(t){var e;super(t),this.shouldComputeSize=!0,this.paused=!1,this.barcodeRecognizerHandle=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===(e=this.configuration.finder.visible)||void 0===e||e,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0})}get configuration(){return this._configuration||(this._configuration=nl.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t){return al(this,void 0,void 0,(function*(){const e=rl.findContainerOrThrow(t);return new Promise(((n,o)=>{Object(W.render)(W.default.createElement(sl,{container:e,configuration:t,onSuccess:n,onFailure:o}),e)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return al(this,void 0,void 0,(function*(){il.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){il.warn("Barcode detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return al(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeRecognizerHandle&&this.bridge.copyArgs.releaseObject(this.barcodeRecognizerHandle).catch((t=>{var e,n;return null===(n=(e=this.props.configuration).onError)||void 0===n?void 0:n.call(e,t)}))}updateDimensions(){return al(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return al(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var t,e,n,o,i;return al(this,void 0,void 0,(function*(){if(!this.enabled)return;if(this.paused)return;if(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)return;if(this.detectionRunning)return;let r=!1;try{this.detectionRunning=!0;const t=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!t)return;const a=new ol(t);a.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(t.originalImage)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(null===(o=this.finder)||void 0===o?void 0:o.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(t){console.log(t)}finally{this.detectionRunning=!1;const t=()=>requestAnimationFrame((()=>this.detect())),e=(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)?0:this.configuration.captureDelay;r&&0!=e?setTimeout(t,e):t()}}))}setUseBackendService(t){console.log("Now using backend service for recognition: ",t),this.backendurl=t}recognizeBarcodes(t,e){var n,o,i,r,a,s,l,c;return al(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(t=!1);const l=t?ht.c.DEFAULT_DETECTION_RESOLUTION:ht.c.DETECTION_RESULTION_4K,c=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:l;this.camera.finderFrame=null===(o=this.finder)||void 0===o?void 0:o.holeRect;const u=yield null===(i=this.camera)||void 0===i?void 0:i.createImageData(c,!1);if(!u)return;e&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:b.wrapperToBase64(u)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",ht.c.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));new Ys.a(u.width,u.height);this.barcodeRecognizerHandle||(this.barcodeRecognizerHandle=yield this.bridge.copyArgs.createBarcodeRecognizer(new T.BarcodeScannerTypes.BarcodeScannerConfiguration(Object.assign(Object.assign({},this.configuration.detectionParameters),{live:t}))));const d=yield this.bridge.transferArgs.recognizeBarcodes(this.barcodeRecognizerHandle,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(t){return void(null===(c=(l=this.props.configuration).onError)||void 0===c||c.call(l,t))}}))}setRecognitionResolution(t){this.desiredRecognitionResolution=t}getResolution(){return al(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?t(Ys.a.fromJson(n)):this.camera.didLoadVideo=()=>{const e=this.camera.videoSize();t(Ys.a.fromJson(e))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}setZoom(t){this.setState({zoom:t})}setCameraDirection(t){this.camera.setDirection(t)}updateTorch(t){this.camera.videoStream.updateTorch(t)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var t,e,n,o,i,r,a;const s=(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)?"Tap the shutter button to scan":void 0;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),W.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},W.default.createElement(ft.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:t=>{this.camera=t}})),W.default.createElement(Xs,{top:null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.style.topLabelTop,text:s}),W.default.createElement(Zs,{ref:t=>this.scannedImage=t,image:this.state.image}),this.state.isFinderVisible&&W.default.createElement(pt.a,{ref:t=>{this.finder=t},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),W.default.createElement(Xs,{bottom:100,text:this.state.bottomHintText}),W.default.createElement(qs,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&W.default.createElement(Fs,{ref:t=>{t&&(this.overlay=t)},configuration:this.configuration.overlay,onPolygonSelected:t=>{const e=new ol({barcodes:[t]});this.configuration.onBarcodesDetected(e)},onBarcodeFound:(t,e,n)=>{var o;(null===(o=this.configuration.overlay)||void 0===o?void 0:o.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(t,e,n)},LabelComponent:$s,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&W.default.createElement(Gs,{ref:t=>this.bottomActionBar=t,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(Ct.PushBottom,this.barcodes)},onShutterButtonClick:()=>al(this,void 0,void 0,(function*(){(new y).flash(),this.setState({action:"processing"});const t=(new Date).getTime();let e=yield this.recognizeBarcodes(!1,!1);const n=new ol(null!=e?e:{barcodes:[]});console.log("Recognition took:",((new Date).getTime()-t)/1e3);const o=this.countLabelText(n.barcodes);this.setState({action:"manual",bottomHintText:o}),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()}}),W.default.createElement(wt,{ref:t=>this.popup=t,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(t){return 0==t.length?"No codes scanned. Try again?":1==t.length?"1 Code Scanned":`${t.length} Codes Scanned`}}function ll(t,e){return t&&(t.hasFacingOptions&&e.flipCameraButton.visible||t.isTorchAvailable&&e.flashButton.visible)||e.zoomButton.visible}function cl(t){const e=t.zoomSteps.findIndex((e=>e==t.defaultZoomFactor)),[n,o]=Object(W.useState)(t.torchEnabledInitially),[i,r]=Object(W.useState)(e),a=t.zoomSteps[i],[s,l]=Object(W.useState)("BACK"==t.initialCameraModule?"environment":"user"),c=function(t){var e,n;const o=null===(n=null===(e=null==t?void 0:t.camera)||void 0===e?void 0:e.video)||void 0===n?void 0:n.parentElement,i=()=>o?o.getBoundingClientRect():null,[r,a]=Object(W.useState)(i());return Object(W.useEffect)((()=>{if(o){const t=()=>a(i());t();const e=new ResizeObserver(t);return e.observe(o),()=>{e.disconnect()}}}),[o]),r}(t.scanner),u=!!c;if(Object(W.useEffect)((()=>{var e;(null===(e=t.capabilities)||void 0===e?void 0:e.isTorchAvailable)&&u&&t.scanner.setTorchState(n)}),[t.capabilities,u,n]),Object(W.useEffect)((()=>{var e;u&&(null===(e=t.scanner)||void 0===e||e.setZoom(a))}),[u,a]),!t.capabilities||!c)return null;if(!ll(t.capabilities,t.config))return null;const d=c.height-t.bottomPadding-48;return W.default.createElement(z.Box,{style:{position:"absolute",marginTop:d,marginLeft:c.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},W.default.createElement(at,Object.assign({},t.config.flashButton,{visible:t.capabilities.isTorchAvailable&&t.config.flashButton.visible,icon:n?z.FlashlightOn:z.FlashlightOff,active:n,onClick:()=>o(!n)})),W.default.createElement("div",{style:{width:20}}),W.default.createElement(at,Object.assign({},t.config.zoomButton,{text:`${a.toFixed(1)}x`,active:i!==e,onClick:()=>r((i+1)%t.zoomSteps.length)})),W.default.createElement("div",{style:{width:20}}),W.default.createElement(at,Object.assign({},t.config.flipCameraButton,{visible:t.capabilities.hasFacingOptions&&t.config.flipCameraButton.visible,active:"user"===s,icon:z.FlipCameraIos,onClick:()=>{var e;const n="environment"===s?"user":"environment";l(n),null===(e=t.scanner)||void 0===e||e.setCameraDirection(n)}})))}const ul=Object(W.createContext)(null);class dl{static compute(t,e,n){const o=(ws.a.lowestY(t)+ws.a.highestY(t))/2,i={badgeY:o,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},i),{labelY:Math.max(ws.a.highestY(t)+dl.LABEL_AND_BADGE_PADDING,e?o-dl.AR_BADGE_SIZE/2-dl.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},i),{labelY:Math.min(ws.a.lowestY(t)-dl.LABEL_AND_BADGE_PADDING,e.visible?o+dl.AR_BADGE_SIZE/2+dl.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:o,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${dl.LABEL_AND_BADGE_PADDING/2}px))`},labelY:o,labelStyle:{transform:e.visible?`translateX(-50%) translateY(${dl.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},i),{labelY:0,labelStyle:{display:"none"}}):void 0}}dl.AR_BADGE_SIZE=48,dl.LABEL_AND_BADGE_PADDING=10;var hl=dl;function fl(t){return t.style.visible?""==t.content?null:W.default.createElement(Cs.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},t.positionBadge),animate:t.animateToPoints?t.positionBadge:{},transition:t.transition},W.default.createElement(Z,{styleConfig:Object.assign(Object.assign({},t.style.background),{cornerRadius:hl.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},t.verticalPositions.badgeStyle),{width:hl.AR_BADGE_SIZE,height:hl.AR_BADGE_SIZE,color:V.b.getColorValue(t.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==t?void 0:t.onClick()},W.default.createElement(z.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},t.content))):null}var pl=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class ml extends $s{constructor(){super(...arguments),this.count=0,this.setCount=t=>{this.count=t,this.forceUpdate()}}styleBadge(t,e){this.customBadgeStyle=t,this.customBadgeContent=e,this.forceUpdate()}badgeContent(){return this.customBadgeContent?this.customBadgeContent:0===this.count?"":"x"+this.count}render(){var t,e;let{barcodeItemConfiguration:n,barcodeItemInfoPosition:o,counterBadge:i}=this.props;const r=n,a=this.state.element,s=null!==(t=this.props.animateToPoints)&&void 0!==t?t:a.points,l=a.code,c=a.highlighted,u=(ws.a.lowestX(s)+ws.a.highestX(s))/2;void 0===o&&(o="BELOW");const d=hl.compute(s,i,o),h=void 0===r||!1===r.titleDeselected.visible&&!1===r.subtitleDeselected.visible,f={x:u,y:Math.round(d.labelY)},p={x:u,y:Math.round(d.badgeY)},m={duration:.25,easing:"linear"};return W.default.createElement(W.default.Fragment,null,r&&W.default.createElement(Cs.div,{ref:t=>this.label=t,style:Object.assign(Object.assign({},f),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?f:{},transition:m},W.default.createElement(Z,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:h?"inline-block":"block",zIndex:1500},d.labelStyle),styleConfig:c?r.backgroundSelected:r.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(a)}},W.default.createElement(gl,{barcode:l,barcodeImageVisible:r.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:c?r.titleSelected:r.titleDeselected,barcodeSubtitle:c?r.subtitleSelected:r.subtitleDeselected}))),W.default.createElement(fl,{onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(a)},style:null!==(e=this.customBadgeStyle)&&void 0!==e?e:i,positionBadge:p,content:this.badgeContent(),verticalPositions:d,transition:m,animateToPoints:this.props.animateToPoints}))}}function gl(t){var{barcode:e}=t,n=pl(t,["barcode"]);const o=Object(W.useContext)(ul).useBarcodeMappedData(e);return W.default.createElement(tt,Object.assign({barcodeMappedData:o},n))}var vl=n(8);function Al(t){const e=Object(W.useRef)(),n=Object(W.useRef)(null),[o,i]=(Object(W.useContext)(X),Object(W.useState)(void 0)),[r,a]=Object(W.useState)(!1);Object(W.useEffect)((()=>{var n,o;t.scanningPaused?null===(n=e.current)||void 0===n||n.pause():null===(o=e.current)||void 0===o||o.resume()}),[t.scanningPaused]);const s=function(t){const e=new Js;e.visible=t.visible;const n=t.polygon instanceof vl.c,o=t.polygon,i=t,r=n?o.selected:i.polygon.partiallyScanned,a=n?o.deselected:i.polygon.partiallyScanned;return t.polygon.visible?(e.style.highlightedPolygonFillColor=V.b.getColorValue(r.fillColor),e.style.highlightedPolygonStrokeColor=V.b.getColorValue(r.strokeColor),e.style.highlightedPolygonStrokeWidth=r.strokeWidth,e.style.highlightedPolygonCornerRadius=r.cornerRadius,e.style.polygonFillColor=V.b.getColorValue(a.fillColor),e.style.polygonStrokeColor=V.b.getColorValue(a.strokeColor),e.style.polygonStrokeWidth=a.strokeWidth,e.style.polygonCornerRadius=a.cornerRadius):(e.style.highlightedPolygonFillColor="transparent",e.style.highlightedPolygonStrokeColor="transparent",e.style.polygonFillColor="transparent",e.style.polygonStrokeColor="transparent"),e.automaticSelectionEnabled=!1,e}(t.arOverlay),l=Object.assign(Object.assign({},t.barcodeScannerViewConfig),{onBarcodesDetected:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,o.originalImageSize,o.barcodes),null===(c=(l=t.barcodeScannerViewConfig).onBarcodesDetected)||void 0===c||c.call(l,o)},_onDetectionFailed:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,new Ys.a(o.width,o.height),[]),null===(c=(l=t.barcodeScannerViewConfig)._onDetectionFailed)||void 0===c||c.call(l,o)}});return Object(W.useEffect)((()=>{const e=ll(o,t.actionBarConfig);t.setActionButtonsVisible(e),a(e)}),[o,t.actionBarConfig]),W.default.createElement(W.default.Fragment,null,t.arOverlay.visible&&W.default.createElement(Fs,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:ml,labelComponentConfig:t.arOverlay,onBarcodeFound:t.arOnBarcodeEnter,onPolygonClick:t.arOnBarcodeClick,configuration:s}),W.default.createElement(cl,{config:t.actionBarConfig,scanner:e.current,capabilities:o,bottomPadding:t.actionBarBottomPadding,torchEnabledInitially:t.cameraConfiguration.flashEnabled,zoomSteps:t.cameraConfiguration.zoomSteps,defaultZoomFactor:t.cameraConfiguration.defaultZoomFactor,initialCameraModule:t.cameraConfiguration.cameraModule}),W.default.createElement(sl,{ref:e,viewFinderPadding:t.viewFinderPadding,configuration:l,onSuccess:()=>class{static setFromScanner(t,e){var n;if(!t.current)return;const o=t.current.getCapabilities();e({hasFacingOptions:(null==o?void 0:o.facingMode)&&o.facingMode.length>0,isTorchAvailable:null!==(n=t.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}.setFromScanner(e,i),onFailure:t.onCameraPermissionDenied,onLicenseError:t.onLicenseError}))}function bl(t){return Object(W.useMemo)((()=>{const e=(new nl).videoConstraints;return e.width.ideal=t.cameraConfiguration.idealPreviewResolution.width,e.height.ideal=t.cameraConfiguration.idealPreviewResolution.height,e.facingMode="FRONT"===t.cameraConfiguration.cameraModule?"user":"environment",{videoConstraints:e,backgroundColor:V.b.getColorValue(t.backgroundColor),userGuidance:t.userGuidance,finder:t.viewFinder,detectionParameters:new T.BarcodeScannerTypes.BarcodeScannerConfiguration({live:!0,engineMode:t.recognizerConfiguration.engineMode,barcodeFormatConfigurations:[new T.BarcodeConfigs.BarcodeFormatCommonConfiguration({formats:t.recognizerConfiguration.barcodeFormats.length>0?t.recognizerConfiguration.barcodeFormats:void 0,regexFilter:t.recognizerConfiguration.barcodesRegexFilter,gs1Handling:t.recognizerConfiguration.gs1Handling})]}),desiredRecognitionResolution:t.recognizerConfiguration.maximumRecognizerResolution}}),[t])}var yl=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};function Cl(t){const[e,n]=Object(W.useState)(null),[o,i]=Object(W.useState)(!0),r=Object(W.useMemo)((()=>"__sb_"+Math.random()),[]),a=t.barcodeMapper,s=t.configuration.useCase,l=Object.assign(Object.assign({},bl(t.configuration)),{onBarcodesDetected:e=>{e.barcodes.length>0&&!s.arOverlay.visible&&t.scanningEnabled.current&&n(e.barcodes[0])},onError:t.onError,containerId:r,captureDelay:0}),c=n=>yl(this,void 0,void 0,(function*(){let o;o=null===e?[]:[new j.BarcodeScannerUIItem({count:1,barcode:n})];const i={items:o};t.onSubmit(i)}));Object(W.useEffect)((()=>{e&&(ct.INSTANCE.beep(t.configuration.sound),dt.INSTANCE.vibrate(t.configuration.vibration))}),[e]),Object(W.useEffect)((()=>{null===e||s.confirmationSheetEnabled||c(e)}),[e,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(e);Object(W.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(W.useContext)(X);return W.default.createElement(W.default.Fragment,null,W.default.createElement(ul.Provider,{value:t.barcodeMapper},W.default.createElement(it,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{c(e)},barcodeMappedData:u},{sheetColorLoaded:(h=s).sheetColor,sheetColorLoading:h.barcodeInfoMapping.sheetColor,barcodeImageVisible:h.barcodeImageVisible,barcodeTitle:h.barcodeTitle,barcodeSubtitle:h.barcodeSubtitle,cancelButton:h.cancelButton,submitButton:h.submitButton,dividerColor:h.dividerColor,loadingMessage:h.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),W.default.createElement(z.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},W.default.createElement(Al,{cameraConfiguration:t.configuration.cameraConfiguration,scanningPaused:null!==e,setActionButtonsVisible:i,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:o?80:0},barcodeScannerViewConfig:l,arOnBarcodeClick:t=>n(t),arOnBarcodeEnter:e=>{s.arOverlay.automaticSelectionEnabled&&t.scanningEnabled.current&&n(e)},arOverlay:Object.assign(Object.assign({},s.arOverlay),{counterBadge:Object.assign(Object.assign({},s.arOverlay.counterBadge),{visible:!1})}),containerId:r,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:t.onCameraPermissionDenied,onLicenseError:t.onError}))));var h}function Sl(t){const e=Object.assign(Object.assign({},t.title),{text:V.b.getLocalizedBarcodeText(t.title.text,t.textReplacementArgs)});return W.default.createElement(W.default.Fragment,null,W.default.createElement(q,Object.assign({},t.leftButton)),W.default.createElement(z.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},W.default.createElement(Q.a,{config:e})),W.default.createElement(q,Object.assign({},t.rightButton)))}function wl(){return W.default.createElement("div",{style:{width:30,height:6,backgroundColor:z.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function xl(t){return W.default.createElement(z.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:t.innerRef},t.dragProps),W.default.createElement(wl,null),W.default.createElement(Sl,Object.assign({},t.drawerHeaderContentProps)))}function El(t){return W.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},W.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:t.color}))}function Ll(t){return t.isVisible?W.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},t.style.placeholderIcon.visible&&W.default.createElement(z.Avatar,{style:{backgroundColor:V.b.getColorValue(t.style.placeholderIconBackground),width:100,height:100}},W.default.createElement(El,{color:V.b.getColorValue(t.style.placeholderIcon.color)})),W.default.createElement(z.Typography,{style:{marginTop:20},variant:"h6"},W.default.createElement(Q.a,{config:t.style.placeholderTitle})),W.default.createElement(z.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},W.default.createElement(Q.a,{config:t.style.placeholderSubtitle})),t.onStartClick&&t.style.startScanningButton.visible&&W.default.createElement(et,Object.assign({style:{width:"60%",marginTop:20}},t.style.startScanningButton,{visible:!0,onClick:t.onStartClick}))):null}function _l(t,e,n){const o=Object(W.useRef)(),i=Object(W.useRef)(null),[r,a]=Object(W.useState)(),[s,l]=Object(W.useState)(!1),c=Object(W.useRef)([]),u=t=>{let n="none";if(c.current.length>0){const e=200,o=((t,e)=>{let n=t[0],o=Math.abs(n.time-e);for(let i=1;i<t.length;i++){const r=Math.abs(t[i].time-e);r<o&&(n=t[i],o=r)}return n})(c.current,t.timeStamp-e),i=o.y-t.clientY,r=100;i>r?n="up":i<-r&&(n="down")}c.current.splice(0,c.current.length),e(new ws.a(t.clientX,t.clientY),n)},d={onPointerDown:t=>{t.target.setPointerCapture(t.pointerId),l(!0),i.current=new ws.a(t.clientX,t.clientY),a(ws.a.empty()),t.stopPropagation()},onPointerMove:e=>{if(!s)return;const n=new ws.a(e.clientX,e.clientY);o.current=e,a(n),t(n),c.current.push({x:e.clientX,y:e.clientY,time:e.timeStamp})},onPointerUp:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),u(t)},onPointerCancel:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),n()}};return{startPoint:i,currentPoint:r,props:d,stop:()=>{o.current.stopPropagation()},dragOngoing:s}}var Ol=n(31);function Tl(t){const[e,n]=Object(W.useState)(0),[o,i]=Object(W.useState)(!1),r=Object(W.useRef)(null),a=Object(W.useContext)(X).height,s=t=>{n(t),i(!0),setTimeout((()=>{i(!1)}),500)},l=e=>{const n=e-c.startPoint.current.y;return Object(Ol.a)((t.isOpen?100:0)-100*n/(window.innerHeight-a-t.closedSheetVisibleHeight),0,100)},c=_l((t=>{n(l(t.y))}),((e,n)=>{if(e.y===c.startPoint.current.y)return;let o;o=l(e.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(o="swipe-to-open"),"down"===n&&(o="swipe-to-close"),t.onSwipe(o)}),(()=>{}));return Object(W.useEffect)((()=>{o||c.dragOngoing||!r||(t.isOpen||0===e?t.isOpen&&100!==e&&s(100):s(0))}),[t.isOpen,e,c.dragOngoing]),W.createElement("div",null,W.createElement(N.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${U} - ${a}px - ${t.closedSheetVisibleHeight}px) * ${e} / 100 + ${t.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:o?"height 500ms":void 0,backgroundColor:V.b.getColorValue(t.contentStyle.sheetColor)},elevation:24}},W.createElement(xl,{innerRef:t=>{r.current=t},drawerHeaderContentProps:t.drawerHeaderContentProps,dragProps:c.props}),t.children,W.createElement(Ll,{isVisible:t.isPlaceholderVisible,style:t.contentStyle,onStartClick:()=>t.onSwipe("swipe-to-close")})))}var kl=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function Dl(t){var{inputRef:e}=t,n=kl(t,["inputRef"]);const o=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return W.default.createElement("input",Object.assign({},o,{ref:e}))}function Pl(t){const e=!!t.barcode,[n,o]=W.default.useState(""),i=W.default.useRef(null),r={backgroundColor:V.b.getColorValue(t.dialogStyling.sheetColor)};return Object(W.useEffect)((()=>{e&&o(String(t.barcode.count))}),[e]),W.default.createElement(W.default.Fragment,null,W.default.createElement(ot,{open:e,modalOverlayColor:t.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var t;return null===(t=i.current)||void 0===t?void 0:t.focus()}},onClose:t.onCancel,PaperProps:{component:"form",onSubmit:e=>{e.preventDefault(),t.setCounter(t.barcode.barcode,parseInt(n)||0)}}},W.default.createElement(z.DialogContent,{style:r},W.default.createElement(z.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},W.default.createElement(Q.a,{config:t.dialogStyling.title})),W.default.createElement(z.Typography,{fontSize:14,textAlign:"center"},W.default.createElement(Q.a,{config:t.dialogStyling.info})),W.default.createElement(z.Box,{sx:{display:"flex",border:"2px solid",borderColor:V.b.getColorValue(t.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},W.default.createElement(Dl,{inputRef:i,value:n,onChange:t=>{const e=parseInt(t.target.value.replaceAll(/[^0-9]/g,""));o(e>=0?e.toString():"")},type:"text",pattern:"[0-9]*"}),t.dialogStyling.clearTextButton.visible&&W.default.createElement(N.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>o(""),htmlColor:V.b.getColorValue(t.dialogStyling.clearTextButton.color)}))),W.default.createElement(z.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},W.default.createElement(N.a,{container:!0,spacing:2},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:V.b.getColorValue(t.dialogStyling.dividerColor)})),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:t.onCancel},t.dialogStyling.cancelButton))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({icon:z.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},t.dialogStyling.updateButton)))))))}function Bl(t){return W.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:V.b.getColorValue(t.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},W.default.createElement(N.a,{style:{height:"100%",color:V.b.getColorValue(t.config.iconColor),paddingRight:t.visibleOffset/2,cursor:"pointer"}}))}const Fl=0,Rl=800,Il=1200;function Wl(t){switch(t){case"mobile":return Object(z.useMediaQuery)("(min-width:"+Fl+"px) and (max-width:"+(Rl-1)+"px)");case"tablet":return Object(z.useMediaQuery)("(min-width:"+Rl+"px) and (max-width:"+(Il-1)+"px)");case"desktop":return Object(z.useMediaQuery)("(min-width:"+Il+"px)")}}const Ml=150;function jl(t){const[e,n]=Object(W.useState)(0),[o,i]=Object(W.useState)(!1);let r;const a=_l((t=>{let e=a.startPoint.current.x-t.x;e<0?a.stop():n(-e)}),(e=>{if(e.x===a.startPoint.current.x)return;if(a.startPoint.current.x-e.x>75){const e=t.animateBackAfterDelete?()=>{c(0)}:void 0;c(Ml,e)}else c(0)}),(()=>{c(0)})),s=Object(W.useContext)(ul),l=s.useBarcodeMappedData(t.barcode);Object(W.useEffect)((()=>{const e={barcode:t.barcode,callback:()=>t.onDelete(t.barcode)};return s.addOnEvictionListener(e),()=>{s.removeOnEvictionListener(e)}}),[]);const c=(e,o)=>{const a=e>=Ml,s=-r.getBoundingClientRect().width;n(a?s:0),i(!0),setTimeout((()=>{i(!1),a&&t.onDelete(t.barcode),o&&o()}),200)},u=Wl("desktop")&&t.swipeToDeleteConfig.enabled,d=!u&&t.swipeToDeleteConfig.enabled;return Object(W.useEffect)((()=>{d||c(0)}),[d]),W.default.createElement(z.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:t=>{t&&(r=t)}},W.default.createElement(Bl,{config:t.swipeToDeleteConfig,visibleOffset:Ml}),W.default.createElement(z.Box,Object.assign({sx:{width:"100%",backgroundColor:V.b.getColorValue(t.sheetColor),transform:`translateX(${e}px)`,transition:o?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px",columnGap:"16px"}},d?a.props:{}),W.default.createElement(tt,Object.assign({barcodeMappedData:l},t)),null!==t.readonlyCount&&W.default.createElement(z.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",color:V.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",t.readonlyCount),u&&W.default.createElement(N.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",color:V.b.getColorValue("?sbColorOnSurface")},onClick:()=>t.onDelete(t.barcode)}),W.default.createElement(z.Box,{sx:{width:"0px"}})))}function zl(t){const e=V.b.getColorValue(t.sheetContent.dividerColor),n=t.sheetContent.manualCountChangeEnabled&&"COUNTING"===t.mode,o=(e,n)=>{let o=t.indicatorColor.partial;return n===e.count?o=t.indicatorColor.complete:0===n&&(o=t.indicatorColor.notScanned),V.b.getColorValue(o)};return W.default.createElement(W.default.Fragment,null,W.default.createElement(z.Divider,{style:{borderColor:e}}),t.barcodes.length>0&&W.default.createElement(N.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},W.default.createElement(N.a,{sx:{p:0}},t.barcodes.map((({barcode:i,count:r},a)=>{const s=t.expectedBarcodes.find((t=>t.barcodeValue===i.text));return W.default.createElement(N.a,{key:a,sx:{padding:0,borderBottom:`1px solid ${e}`}},t.indicatorColor&&W.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:o(s,r),position:"absolute"}}),W.default.createElement(jl,{barcode:i,animateBackAfterDelete:t.animateBackAfterDelete,onDelete:()=>t.onBarcodeChange({type:"remove",barcode:i}),counterForm:n&&{counter:r,manualCountChangeColor:t.sheetContent.manualCountChangeColor,manualCountOutlineColor:t.sheetContent.manualCountOutlineColor,addButtonEnabled:void 0===s||s.count>r,removeButtonEnabled:void 0===s||r>0,setCounter:e=>{t.onBarcodeChange({type:"setCount",barcodes:[i],computeNewCount:()=>e})},onNumberClick:()=>t.onNumberClick({barcode:i,count:r})},readonlyCount:"COUNTING"!==t.mode||t.sheetContent.manualCountChangeEnabled?null:r,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,displayRightArrow:!1,imageSize:n?84:40,barcodeImageVisible:t.sheetContent.barcodeItemImageVisible,barcodeTitle:t.sheetContent.barcodeItemTitle,barcodeSubtitle:t.sheetContent.barcodeItemSubtitle,swipeToDeleteConfig:t.sheetContent.swipeToDelete,sheetColor:t.sheetContent.sheetColor}))})))))}function Nl(t){return W.default.createElement(z.Badge,{anchorOrigin:{vertical:"top",horizontal:"left"},badgeContent:t.text,showZero:!0,color:"primary",overlap:"circular",slotProps:{badge:{style:{backgroundColor:t.backgroundColor,color:t.foregroundColor,fontWeight:"bold"}}}},t.children)}function Vl(t){if(!t.buttonStyling.visible)return null;return W.default.createElement(z.Box,{style:t.style},W.default.createElement(Nl,{text:t.text,backgroundColor:V.b.getColorValue(t.buttonStyling.badgeBackgroundColor),foregroundColor:V.b.getColorValue(t.buttonStyling.badgeForegroundColor)},W.default.createElement(z.IconButton,{sx:{backgroundColor:V.b.getColorValue(t.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:V.b.getColorValue(t.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:t.onClick,disableRipple:!0,disableFocusRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:V.b.getColorValue(t.buttonStyling.activeForegroundColor)}}}))))}const Ul=(t,e)=>(null===t.format||null===e.format||t.format===e.format)&&t.text===e.text,Hl=(t,e)=>t.find((t=>((t,e)=>t.barcodeValue===e.text)(t,e)));class Gl{constructor(t,e){this.expectedCount=t,this.foundCount=e}isFulFilled(){return void 0!==this.expectedCount&&void 0!==this.foundCount&&this.expectedCount===this.foundCount}toString(){return`${this.foundCount}/${this.expectedCount}`}}function Ql(t){const e=Object(W.useContext)(V.a).getColorValue,n={backgroundColor:e(t.sheetColor)};return W.default.createElement(ot,{modalOverlayColor:t.modalOverlayColor,open:t.open},W.default.createElement(z.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},W.default.createElement(z.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},W.default.createElement(Q.a,{config:t.title})),W.default.createElement(z.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},W.default.createElement(Q.a,{config:t.subtitle}))),W.default.createElement(z.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},W.default.createElement(N.a,{container:!0,spacing:2},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:e(t.dividerColor)})),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},icon:t.cancelButton.icon,onClick:t.cancelButton.onClick},t.cancelButton.style))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},icon:t.okButton.icon,onClick:t.okButton.onClick},t.okButton.style))))))}function Yl(t){return t.open?W.default.createElement(Ql,{open:t.open,dividerColor:t.style.dividerColor,modalOverlayColor:t.style.modalOverlayColor,sheetColor:t.style.sheetColor,title:t.style.title,subtitle:t.style.subtitle,cancelButton:{style:t.style.cancelButton,onClick:t.onDismiss},okButton:{style:t.style.okButton,onClick:t.onSubmit}}):null}class Zl{constructor(t,e,n){this.barcodeItemSubtitleText=t,this.foundBarcodes=e,this.expectedBarcodes=n}useBarcodeMappedData(t){var e,n,o;const i=null!==(n=null===(e=this.foundBarcodes.find((e=>Ul(e.barcode,t))))||void 0===e?void 0:e.count.toString())&&void 0!==n?n:"0",r=Hl(this.expectedBarcodes,t);return{state:"LOADED",value:{title:`${null!==(o=r.title)&&void 0!==o?o:t.text}`,subtitle:V.b.getLocalizedBarcodeText(this.barcodeItemSubtitleText,[i,null==r?void 0:r.count.toString()]),barcodeImage:r.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function ql(t){const e=Object(W.useContext)(X);return W.default.createElement(N.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:e.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:V.b.getColorValue(t.sheetContent.sheetColor)}},W.default.createElement(N.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},W.default.createElement(Sl,Object.assign({},t.headerProps))),t.barcodeList,W.default.createElement(Ll,{isVisible:t.isEmptyStateVisible,style:t.sheetContent}))}var Xl=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};function $l(t){const e=Object(W.useRef)(),n=Object(W.useRef)(new Date("2001-01-01")),[o,i]=Object(W.useReducer)(function(t,e,n,o){return(i,r)=>{const a=t.useCase,s="FindAndPickScanningMode"===a._type,l=s?"COUNTING":a.mode,c=s?a.expectedBarcodes:[],u=t=>{let e=[...i];const n=r.barcodes||[r.barcode];for(const o of n){const n=e.findIndex((t=>Ul(t.barcode,o)));if(-1===n)e.push({barcode:o,count:t(0)});else{const o=e[n];e[n]=Object.assign(Object.assign({},o),{count:t(o.count,o)})}}return e},d=(t,n)=>{var i;if(e.current=new Date,!n)return t;const r=null===(i=Hl(c,n.barcode))||void 0===i?void 0:i.count;return void 0===r||r===t?t:(o(),t+1)};switch(r.type){case"onBarcodesDetected":{if((new Date).getTime()-e.current.getTime()<a.countingRepeatDelay||!n.current)return[...i];if(s)return a.arOverlay.automaticSelectionEnabled?u(d):[...i];const t=a.arOverlay;if(!t.visible||t.automaticSelectionEnabled){let t=!1;return u((n=>{let i="COUNTING"===l?n+1:1;return i===n||t||(e.current=new Date,o()),i}))}return u((t=>t))}case"onARCodeClick":return u(((t,e)=>{if(s)return d(t,e);const n="UNIQUE"===l?1-t:t+1;return n>0&&o(),n}));case"onCountEditDialogChange":{let t=()=>r.count||0;if(s){const e=Hl(c,r.barcode);r.count>e.count&&(t=()=>e.count)}return u(t)}case"setCount":return u(r.computeNewCount);case"remove":return i.map((t=>Object.assign(Object.assign({},t),{count:Ul(t.barcode,r.barcode)?0:t.count})));case"clear":return i.map((t=>Object.assign(Object.assign({},t),{count:0})));case"setHtmlElements":let t=!1;const h=i.map((e=>Ul(e.barcode,r.barcode)?(t=!0,Object.assign(Object.assign({},e),{polygonElement:r.polygonElement,labelElement:r.labelElement})):e));return t||h.push({barcode:r.barcode,count:0,labelElement:r.labelElement,polygonElement:r.polygonElement}),h}}}(t.configuration,n,t.scanningEnabled,(()=>{ct.INSTANCE.beep(t.configuration.sound),dt.INSTANCE.vibrate(t.configuration.vibration)})),[]),[r,a]=W.default.useState(null),[s,l]=Object(W.useState)(!1),c=Object(W.useMemo)((()=>"__sb_"+Math.random()),[]),[u,d]=Object(W.useState)(!0),h=t.barcodeMapper,[f,p]=Object(W.useState)(null),m="FindAndPickScanningMode"===t.configuration.useCase._type,g=t.configuration.useCase,v=m?"COUNTING":g.mode,A=Object(W.useRef)(Object.assign(Object.assign({},bl(t.configuration)),{onBarcodesDetected:t=>{i({type:"onBarcodesDetected",barcodes:t.barcodes})},_onDetectionFailed(t){},onError:t.onError,captureDelay:1e3/60}));Object(W.useEffect)((()=>{if(m){const e=C();for(const n of e){const e=[(t=n.barcodeValue,new T.BarcodeScannerTypes.BarcodeItem({text:t,format:null,quad:[],sourceImage:null,rawBytes:null,upcEanExtension:null,parsedDocument:null}))];i({type:"setCount",barcodes:e,computeNewCount:()=>0})}}var t}),[]),Object(W.useEffect)((()=>{A.current.container=e.current}),[e]),Object(W.useEffect)((()=>{if(m)for(const t of o){const e=g.arOverlay,n=t.polygonElement,o=t.labelElement;if(w(t.barcode)){const i=R(t.barcode);let r=t.count+"/"+i.expectedCount;g.arOverlay.automaticSelectionEnabled||0!==t.count||(r=W.default.createElement(z.TouchApp,null)),i.isFulFilled()?(null==n||n.style(V.b.getPolygonColorValues(e.polygon.completed,e.polygon.visible)),null==o||o.styleBadge(e.badge.completed,W.default.createElement(z.Check,null))):(null==n||n.style(V.b.getPolygonColorValues(e.polygon.partiallyScanned,e.polygon.visible)),null==o||o.styleBadge(e.badge.partiallyScanned,r))}else null==n||n.style(V.b.getPolygonColorValues(e.polygon.rejected,e.polygon.visible)),null==o||o.styleBadge(e.badge.rejected,W.default.createElement(z.Close,null))}else for(const t of o){if(t.polygonElement){const e=g.arOverlay.polygon,n=t.count>0?e.selected:e.deselected;t.polygonElement.style(V.b.getPolygonColorValues(n,e.visible))}t.labelElement&&(t.labelElement.update(Object.assign(Object.assign({},t.labelElement.state.element),{highlighted:t.count>0})),t.labelElement.setCount(t.count))}}),[o]);const b=o.reduce(((t,e)=>t+e.count),0),y=()=>C().every((t=>o.some((e=>e.barcode.text===t.barcodeValue&&e.count===t.count)))),C=()=>m?g.expectedBarcodes:[],S=t=>Hl(C(),t),w=t=>!!S(t),x=()=>m?o.filter((t=>w(t.barcode))):o.filter((t=>t.count>0)),E=()=>Xl(this,void 0,void 0,(function*(){const e=x().map((t=>new j.BarcodeScannerUIItem({count:"COUNTING"===v?t.count:1,barcode:t.barcode})));t.onSubmit({items:e})})),L=W.default.createElement(zl,{expectedBarcodes:C(),barcodes:x(),animateBackAfterDelete:m,onBarcodeChange:i,sheetContent:g.sheetContent,onNumberClick:t=>a(t),mode:v,indicatorColor:m&&{partial:g.scanningPartiallyColor,complete:g.scanningCompletedColor,notScanned:g.scanningNotScannedColor}}),_={textReplacementArgs:[b.toString()],leftButton:Object.assign(Object.assign({},g.sheetContent.clearAllButton),{onClick:()=>i({type:"clear"})}),rightButton:Object.assign(Object.assign({},g.sheetContent.submitButton),{onClick:()=>Xl(this,void 0,void 0,(function*(){if(m){const t=g;let e=null;t.partialScannedAlertDialogEnabled&&!y()&&(e=t.partialScannedAlertDialog),t.confirmationAlertDialogEnabled&&y()&&(e=t.confirmationAlertDialog),e?p(e):yield E()}else yield E()}))}),title:g.sheetContent.title},O=Wl("mobile"),k="BUTTON"!==g.sheet.mode&&O?"SMALL"===g.sheet.collapsedVisibleHeight?69:128:0,D=O&&"BUTTON"===g.sheet.mode,P=D?76:0,B=(u?80:0)+P,F=Object(W.useContext)(X),R=t=>{const e=o.find((e=>e.barcode.text===t.text)),n=S(t);return new Gl(null==n?void 0:n.count,null==e?void 0:e.count)},I=C().reduce(((t,e)=>t+e.count),0);m&&_.textReplacementArgs.push(I.toString());const M=m?new Zl(g.sheetContent.barcodeItemSubtitle.text,o,C()):h,U=!m&&0===b;return W.default.createElement(W.default.Fragment,null,W.default.createElement(ul.Provider,{value:M},W.default.createElement(N.a,{container:!0,sx:{display:"flex",flexDirection:O?"column":"row",height:`calc(${F.remainingVisibleBodyHeight} - ${k}px)`},alignItems:"stretch"},W.default.createElement(N.a,{id:c,item:!0,ref:e,component:"div",xs:O?12:7,zIndex:100},D&&W.default.createElement(Vl,{style:{position:"absolute",marginTop:`calc(${F.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:m?`${b}/${I}`:b.toString(),onClick:()=>l(!s),buttonStyling:g.sheet.listButton}),W.default.createElement(Al,{viewFinderPadding:{minTopPadding:F.minTopPaddingForContent,minBottomPadding:B},arOverlay:(()=>{if(m){const t=g.arOverlay;return Object.assign(Object.assign({},t),{counterBadge:Object.assign({},t.badge.partiallyScanned)})}const t=g.arOverlay,e=t.counterBadge;return Object.assign(Object.assign({},t),{counterBadge:Object.assign(Object.assign({},e),{visible:e.visible&&"COUNTING"===v})})})(),containerId:c,barcodeScannerViewConfig:A.current,onCameraPermissionDenied:t.onCameraPermissionDenied,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16+P,setActionButtonsVisible:d,arOnBarcodeClick:t=>{i({type:"onARCodeClick",barcode:t})},arOnBarcodeEnter:(t,e,n)=>{if(!n||!e)return;i({type:"setHtmlElements",barcode:t,labelElement:n,polygonElement:e})},scanningPaused:s&&O,cameraConfiguration:t.configuration.cameraConfiguration,onLicenseError:t.onError}),O&&W.default.createElement(Tl,{closedSheetVisibleHeight:k,sheetStyle:g.sheet,contentStyle:g.sheetContent,manualCountEditDialog:g.manualCountEditDialog,isPlaceholderVisible:U,onBarcodeChange:t=>i(t),drawerHeaderContentProps:_,isOpen:s,onSwipe:t=>{l("swipe-to-open"===t)}},L)),function(t){switch(t){case"mobile":return Object(z.useMediaQuery)("(min-width:"+Fl+"px)");case"tablet":return Object(z.useMediaQuery)("(min-width:"+Rl+"px)");case"desktop":return Object(z.useMediaQuery)("(min-width:"+Il+"px)")}}("tablet")&&W.default.createElement(ql,{headerProps:_,sheetContent:g.sheetContent,isEmptyStateVisible:U,barcodeList:L})),W.default.createElement(Pl,{barcode:r,dialogStyling:g.manualCountEditDialog,onCancel:()=>a(null),setCounter:(t,e)=>{i({type:"onCountEditDialogChange",barcode:t,count:e}),a(null)}}),W.default.createElement(Yl,{open:null!==f,style:f,onDismiss:()=>p(null),onSubmit:E})))}const Kl=Object(W.createContext)(null),Jl={didCatch:!1,error:null};class tc extends W.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Jl}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(null!==t){for(var e,n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];null===(e=(n=this.props).onReset)||void 0===e||e.call(n,{args:i,reason:"imperative-api"}),this.setState(Jl)}}componentDidCatch(t,e){var n,o;null===(n=(o=this.props).onError)||void 0===n||n.call(o,t,e)}componentDidUpdate(t,e){const{didCatch:n}=this.state,{resetKeys:o}=this.props;var i,r;n&&null!==e.error&&function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length!==e.length||t.some(((t,n)=>!Object.is(t,e[n])))}(t.resetKeys,o)&&(null===(i=(r=this.props).onReset)||void 0===i||i.call(r,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Jl))}render(){const{children:t,fallbackRender:e,FallbackComponent:n,fallback:o}=this.props,{didCatch:i,error:r}=this.state;let a=t;if(i){const t={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof e)a=e(t);else if(n)a=Object(W.createElement)(n,t);else{if(null!==o&&!Object(W.isValidElement)(o))throw r;a=o}}return Object(W.createElement)(Kl.Provider,{value:{didCatch:i,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}function ec(t){const e=Object(W.useRef)(!0);Object(W.useEffect)((()=>(e.current=!0,()=>{e.current=!1})));const[,n]=Object(W.useReducer)((t=>t+1),0),o=Object(W.useRef)();return Object(W.useMemo)((()=>{o.current={loading:!0,value:void 0,error:null}}),[t]),function(t,e){Object(W.useMemo)((()=>{t&&t.then((t=>{e({loading:!1,error:null,value:t})})).catch((t=>{e({loading:!1,error:{reason:t},value:void 0})}))}),[t])}(t,(t=>{o.current=t,e.current&&n()})),t?o.current:null}var nc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class oc{constructor(t,e){this.barcodeItemMapper=t,this.onError=e,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=t=>At(t),this.onEvictionListeners=new Set}getBarcodeMappedData(t){const e=this.hash(t);if(!this.cache.has(e)){const n=(()=>nc(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const e=new j.BarcodeScannerUIItem({count:1,barcode:t});return this.barcodeItemMapper(e)}{const e=yield b.toDataUrl(yield mu.instance.imageToJpeg(t.sourceImage));return{title:t.text,subtitle:t.format,barcodeImage:e}}})))();this.cache.set(e,n)}return this.cache.get(e)}useBarcodeMappedData(t){const e=Object(W.useRef)(!1),n=ec(t&&this.getBarcodeMappedData(t));if(Object(W.useEffect)((()=>{n&&n.error&&(e.current=!1,this.cacheEntryPendingRetries.push({barcode:t,retry:()=>{this.cache.delete(this.hash(t)),e.current=!0}}),this.onError((()=>{for(const t of this.cacheEntryPendingRetries)t.retry();this.cacheEntryPendingRetries.length=0}),(()=>{e.current=!0;for(const t of this.cacheEntryPendingRetries)for(const e of this.onEvictionListeners)this.hash(e.barcode)==this.hash(t.barcode)&&e.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let o;return o=n.value?"LOADED":n.error&&!e.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:o}}addOnEvictionListener(t){this.onEvictionListeners.add(t)}removeOnEvictionListener(t){this.onEvictionListeners.delete(t)}}j.BarcodeItemErrorState;function ic(t){return W.default.createElement(Ql,{open:t.open,dividerColor:t.dividerColor,modalOverlayColor:t.modalOverlayColor,sheetColor:t.sheetColor,title:t.title,subtitle:t.subtitle,cancelButton:{style:t.cancelButton,onClick:t.handleCancel},okButton:{style:t.retryButton,icon:z.Replay,onClick:t.handleRetry}})}function rc(t){const e=Object(W.useContext)(X);return W.default.createElement(z.Box,{sx:{paddingTop:e.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:V.b.getColorValue(t.config.background)}},W.default.createElement(z.Box,{sx:{height:e.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},t.config.icon.visible&&W.default.createElement(z.Box,null,W.default.createElement(z.Avatar,{sx:{width:100,height:100,backgroundColor:V.b.getColorValue(t.config.iconBackground),margin:"24px"}},W.default.createElement(N.a,{sx:{fontSize:50,color:V.b.getColorValue(t.config.icon.color)}}))),W.default.createElement(z.Typography,{sx:{fontSize:20,textAlign:"center"}},W.default.createElement(Q.a,{config:t.config.enableCameraTitle})),W.default.createElement(z.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},W.default.createElement(Q.a,{config:t.config.enableCameraExplanation})),W.default.createElement(z.Box,{sx:{paddingTop:"16px"}},W.default.createElement(q,Object.assign({},t.config.closeButton,{onClick:t.onAppClose})))))}function ac(t){const e=Object(W.useRef)(Object(z.createTheme)({palette:{primary:{main:St.ScanbotPrimary},secondary:{main:St.DarkGray}}})),[n,o]=Object(W.useState)(!1),[i,r]=Object(W.useState)(!1),[a,s]=Object(W.useState)(t.configuration.timeouts.initialScanDelay<=0),l=Object(W.useRef)(!1),c=Object(W.useRef)(),u=Object(W.useRef)(),d=t.configuration.useCase,h="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,f=Object(W.useMemo)((()=>new oc(null==h?void 0:h.barcodeItemMapper,((t,e)=>{o(!0),c.current=()=>{o(!1),t()},u.current=()=>{o(!1),e()}}))),[]);let p;if(Object(W.useMemo)((()=>{V.b.setPalette(t.configuration.palette),V.b.setBarcodeTextLocalization(t.configuration.localization)}),[t.configuration]),Object(W.useEffect)((()=>{if(t.configuration.timeouts.autoCancelTimeout>0){const e=setTimeout((()=>{t.onClose()}),t.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(e)}}}),[]),Object(W.useEffect)((()=>{if(t.configuration.timeouts.initialScanDelay>0){const e=setTimeout((()=>{s(!0)}),t.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(e)}}}),[]),Object(W.useEffect)((()=>{l.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)p=W.default.createElement(Cl,{configuration:t.configuration,barcodeMapper:f,onClose:t.onClose,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");p=W.default.createElement($l,{configuration:t.configuration,barcodeMapper:f,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l})}return W.default.createElement(W.default.Fragment,null,W.default.createElement(H,null),W.default.createElement(tc,{onError:t.onError,fallback:W.default.createElement("div",null,"Error")},W.default.createElement(V.a.Provider,{value:Object(V.c)(t.configuration.palette)},W.default.createElement(z.ThemeProvider,{theme:e.current},h&&W.default.createElement(ic,Object.assign({open:n,handleCancel:u.current,handleRetry:c.current,modalOverlayColor:h.modalOverlayColor,dividerColor:h.dividerColor,sheetColor:h.sheetColor},h.errorState)),W.default.createElement(N.a,{sx:{height:`100 * ${U}`,width:"100vw",backgroundColor:V.b.getColorValue(t.configuration.backgroundColor)}},W.default.createElement($,Object.assign({onBackPress:t.onClose},t.configuration.topBar),!i&&p,i&&W.default.createElement(rc,{onAppClose:t.onClose,config:t.configuration.cameraPermission})))))))}var sc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class lc{static createBarcodeScanner(t){return new Promise(((e,n)=>{ct.INSTANCE.initialize(t.sound);const o=lc.createContainer("barcode-scanner-controller"),i=Object(M.createRoot)(o),r=()=>sc(this,void 0,void 0,(function*(){return new Promise((t=>{window.setTimeout((()=>{i.unmount(),document.body.removeChild(o),t()}),0)}))})),a=t=>sc(this,void 0,void 0,(function*(){yield r(),n(t)}));i.render(W.default.createElement(ac,{configuration:t,onClose:()=>sc(this,void 0,void 0,(function*(){yield r(),e(null)})),onSubmit:t=>sc(this,void 0,void 0,(function*(){yield r(),e(t)})),onError:a})),(()=>{sc(this,void 0,void 0,(function*(){try{const t=yield mu.instance.getLicenseInfo();t.isValid()||(yield a(new P(t)))}catch(t){yield a(t)}}))})()}))}static createContainer(t){const e=document.createElement("div");return e.id=t,e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.zIndex="1000",e.style.top="0",e.style.backgroundColor="rgba(0, 0, 0, 0.5)",document.body.appendChild(e),e}}lc.Config=j;var cc=lc,uc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class dc{constructor(t,e){this._sdk=t,this._recognizer=e}recognize(t,e,n="COPY_IMAGE"){return uc(this,void 0,void 0,(function*(){const o=this._sdk.getBridge(n);return yield o.genericDocumentRecognizerRecognize(this._recognizer,t,new T.GenericDocumentRecognizerTypes.RecognitionParameters(e))}))}release(){return uc(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._recognizer)}))}}const hc={OK:"Capturing your document... Please do not move the camera.",OK_SMALL_SIZE:"The document is too small. Try moving closer.",OK_BAD_ANGLES:"This is a bad camera angle. Hold the device straight over the document.",OK_BAD_ASPECT_RATIO:"Rotate the device sideways, so that the document fits better into the screen.",OK_OFF_CENTER:"Try holding the device at the center of the document.",OK_TOO_DARK:"A document was detected, but it is too dark. Try turning on a light.",OK_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_NOISE:"Please move the document to a clear surface.",NOT_ACQUIRED:"Scanning failed."};class fc{constructor(t){this.hint=t}}class pc{constructor(){this.outline=new mc,this.captureButton=new bc}}class mc{constructor(){this.polygon=new gc,this.path=new vc,this.label=new Ac}}class gc{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent"}}class vc{constructor(){this.stroke="green",this.strokeWidth=4}}class Ac{}class bc{constructor(){this.color="#FFF"}}class yc extends _.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new T.DocumentDetectorTypes.DocumentDetectorParameters,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new fc(hc),this.style=new pc,this.onDocumentDetected=function(t){}}static fromJson(t){var e;const n=new yc;if(this.mapValues(t,n,["text","style","videoConstraints","detectionParameters"]),n.detectionParameters=new T.DocumentDetectorTypes.DocumentDetectorParameters(null!==(e=t.detectionParameters)&&void 0!==e?e:{}),t.text&&t.text.hint&&this.mapValues(t.text.hint,n.text.hint),t.style){this.mapValues(t.style,n.style,["outline","captureButton"]);const e=t.style.outline;if(e){this.mapValues(e,n.style.outline,["polygon","path","label"]);const t=e.polygon;t&&this.mapValues(t,n.style.outline.polygon);const o=e.path;o&&this.mapValues(o,n.style.outline.path);const i=e.label;i&&this.mapValues(i,n.style.outline.label)}const o=t.style.captureButton;o&&this.mapValues(o,n.style.captureButton)}return this.mapVideoConstraints(t,n),n}}var Cc=n(41),Sc={insert:"head",singleton:!1};Is()(Cc.a,Sc),Cc.a.locals;class wc extends W.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return W.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 t=[];for(let e=0;e<this.LINE_COUNT;e++){const n=this.props.points[e],o=this.props.points[(e+1)%this.LINE_COUNT];t.push(W.default.createElement("line",{key:e,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:o.x,y2:o.y}))}return t}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}wc.CLASSNAME="scanbot-document-outline";class xc extends W.default.Component{constructor(t){super(t),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(t,e,n,o){const i={points:t,animatedPoints:e,isOk:n,isVisible:o};this.setState(i)}pointStringOrLatestValidPoints(t){return t&&t.length>0?ws.a.toSvgString(t):ws.a.toSvgString(this.latestValidPoints)}render(){var t;this.state.points&&(this.latestValidPoints=this.state.points);const e=null!==(t=this.props.style)&&void 0!==t?t:{},n=zs()(wc.CLASSNAME,{[`${wc.CLASSNAME}-ok`]:this.state.isOk},{[`${wc.CLASSNAME}-visible`]:this.state.isVisible},{[`${wc.CLASSNAME}-hidden`]:!this.state.isVisible});return W.default.createElement(Cs.polygon,{ref:t=>this.polygon=t,style:{strokeWidth:e.strokeWidth||2},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?e.strokeCapturing:e.strokeSearching,fill:this.state.isOk?e.fillCapturing:e.fillSearching},onClick:()=>{},fill:"transparent",className:n})}}var Ec=xc;class Lc extends W.default.Component{constructor(t){super(t),this.state={path:void 0}}render(){var t,e;return this.state.path?W.default.createElement(Cs.path,{pathLength:"1",strokeDasharray:"1 1",initial:{strokeDashoffset:1},animate:{strokeDashoffset:0},transition:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:0,repeatType:"loop",repeatDelay:1},stroke:(null===(t=this.props.style)||void 0===t?void 0:t.stroke)||"white",strokeWidth:(null===(e=this.props.style)||void 0===e?void 0:e.strokeWidth)||2,fill:"none",d:this.state.path,className:`${wc.CLASSNAME}-path`}):null}animate(t){const e="M"+ws.a.toSvgString(t)+"z";this.setState({path:e})}clear(){this.setState({path:void 0})}}class _c extends W.default.Component{render(){return W.default.createElement(Cs.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},W.default.createElement(Ec,{ref:t=>this.polygon=t,style:this.props.polygonStyle}),W.default.createElement(Lc,{ref:t=>this.path=t,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(t,e,n){var o;const i="processing"!==n&&!!t,r=null!==(o=this.previous)&&void 0!==o?o:t,a=this.previous?t:void 0;this.polygon.update(r,a,e,i),this.previous=t,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class Oc extends W.default.Component{constructor(){super(...arguments),this.hintLabelClassName="scanbot-document-hint-text",this.state={text:"Initializing...",ok:!1,validPoints:!1}}render(){const{ok:t,text:e,validPoints:n}=this.state,o="searching"===this.props.action||"capturing"===this.props.action,i="processing"!==this.props.action&&n,r=zs()({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:i,[`${this.hintLabelClassName}-hidden`]:!i});return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},W.default.createElement(_c,{ref:t=>{this.polygon=t},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:t,isVisible:i,autoCaptureSensitivity:this.props.autoCaptureSensitivity}),o&&W.default.createElement("label",{ref:t=>this.label=t,style:this.props.style.label,className:r,dangerouslySetInnerHTML:{__html:e}}))}update(t,e,n){this.polygon.update(e,t,this.props.action),this.label&&(this.label.innerHTML=n)}}class Tc{static isConvex(t){if(t.length<4)return!0;let e=!1,n=t.length;for(let o=0;o<n;o++){const i=t[(o+2)%n].x-t[(o+1)%n].x,r=t[(o+2)%n].y-t[(o+1)%n].y,a=t[o].x-t[(o+1)%n].x,s=i*(t[o].y-t[(o+1)%n].y)-r*a;if(0==o)e=s>0;else if(e!=s>0)return!1}return!0}static distanceBetweenPoints(t,e){return Math.pow(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2),.5)}static intersection(t,e){const n=t[0],o=ws.a.subtract(t[1],n),i=e[0],r=ws.a.subtract(e[1],i);if(0===ws.a.cross(o,r))return;const a=ws.a.cross(ws.a.subtract(i,n),o)/ws.a.cross(o,r);return ws.a.add(i,ws.a.multiply(r,a))}}class kc{constructor(t,e=kc.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(t),this.sensitivity=e}check(t){let e=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(t[n],this.lastPolygon[n])){e=!0;break}}else e=!0;return e}reset(){this.lastPolygon=void 0}update(t){this.lastPolygon=t}isPointMoved(t,e){return Tc.distanceBetweenPoints(t,e)/this.maxDistance>this.sensitivity}calculateMaxDistance(t){let e=new ws.a(0,0),n=new ws.a(t.width,t.height);return Tc.distanceBetweenPoints(e,n)}}kc.DEFAULT_SENSITIVITY=.5;var Dc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.b;ht.a;class Pc extends ht.c{constructor(t){if(super(t),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>Dc(this,void 0,void 0,(function*(){const t=yield this.detectAndCrop();this.configuration.onDocumentDetected(t)})),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(!mu.instance)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}get configuration(){return this._configuration||(this._configuration=yc.fromJson(this.props.configuration)),this._configuration}get autoCaptureSensitivity(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}static create(t){return Dc(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,o)=>{Object(W.render)(W.default.createElement(Pc,{container:e,configuration:t,onSuccess:n,onFailure:o}),e)}))}))}detectAndCrop(){var t,e,n;return Dc(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"});const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Pc.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);if(!e)return;return I.a.debug("Detect & Crop document of size: "+e.height*e.width),yield this.bridge.transferArgs.detectAndCropDocument(e)}}catch(t){null===(n=(e=this.configuration).onError)||void 0===n||n.call(e,t)}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(t){this._configuration?this._configuration.autoCaptureEnabled=t:this.props.configuration.autoCaptureEnabled=t,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Dc(this,void 0,void 0,(function*(){t.componentDidMount.call(this),this.detect(),this.recognizer=this.bridge.copyArgs.createDocumentDetector(new T.DocumentDetectorTypes.DocumentDetectorParameters(this.configuration.detectionParameters)),this.recognizer.catch((t=>{var e,n;return null===(n=(e=this.configuration).onError)||void 0===n?void 0:n.call(e,t)}))}))}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return Dc(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield mu.instance.release(yield this.recognizer,"Document Scanner")}))}detect(){var t,e;return Dc(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const t=yield this.detectInWebWorker();if(!t||!this.enabled)return;if(!this.outline)return;this.camera.reusableImageBuffer=t.originalImage.data;const e=this.getStatusString(t),n="OK"===e,o=e.startsWith("OK")?this.scalePolygonPointsToPixels(t.pointsNormalized):void 0;this.outline.update(n,o,v.getProperty(this.configuration.text.hint,e)),yield this.handleAutoCapture(n,o)}catch(n){null===(e=(t=this.configuration).onError)||void 0===e||e.call(t,n)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(t){return this.configuration.ignoreBadAspectRatio&&"OK_BAD_ASPECT_RATIO"===t.status?"OK":t.status}detectInWebWorker(){var t,e,n;return Dc(this,void 0,void 0,(function*(){try{const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(ht.c.DEFAULT_DETECTION_RESOLUTION,!1);return e&&this.enabled?yield this.bridge.transferArgs.documentDetectorDetect(yield this.recognizer,e):null}catch(t){return null===(n=(e=this.configuration).onError)||void 0===n||n.call(e,t),null}}))}handleAutoCapture(t,e){return Dc(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled&&!this.preventAutoCapture)if(t&&!this.autoCaptureToken&&e){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const t=this.getCameraFrameSize();this.polygonMovementPredicate=new kc(t)}if(this.runMovementPredicate(e))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>Dc(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const t=yield this.detectAndCrop();if(null==t?void 0:t.pointsNormalized){const e=this.scalePolygonPointsToPixels(t.pointsNormalized);if(this.runMovementPredicate(e))return}(null==t?void 0:t.status.startsWith("OK"))&&this.configuration.onDocumentDetected&&(this.configuration.onDocumentDetected(t),this.preventAutoCapture=!0,setTimeout((()=>{this.preventAutoCapture=!1}),this.configuration.autoCaptureDelay))}))),this.autoCaptureSensitivity)}else!t&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(t){this.setState({action:t})}render(){var t,e,n;const{action:o}=this.state,{configuration:i}=this,r=null===(t=i.style)||void 0===t?void 0:t.captureButton;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:i.videoConstraints,mirrored:i.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),W.default.createElement(Oc,{ref:t=>{this.outline=t},style:null===(n=i.style)||void 0===n?void 0:n.outline,action:o,autoCaptureSensitivity:this.autoCaptureSensitivity}),W.default.createElement(Vs,{color:(null==r?void 0:r.color)?r.color:"FFF",action:o,onClick:this.enabled?i.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(t){if(t){const e=this.getCameraFrameSize(),n=Ys.a.fromHtmlElement(this.camera.video),o=rl.findScale(n,e);t=(t=rl.convertToViewportPointsFromParentSize(e,t)).map((t=>ws.a.scaleToPoint(t,o.x,o.y,o.scale)))}return t}runMovementPredicate(t){const e=this.polygonMovementPredicate.check(t);return this.polygonMovementPredicate.update(t),e}getCameraFrameSize(){return this.camera.calculateFrameSize(ht.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}Pc.DETECT_AND_CROP_RESOLUTION=0;var Bc=Pc;class Fc extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new T.MRZTypes.RecognizerConfiguration,this.onMrzDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(t){const e=new Fc;return this.mapValues(t,e,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(e,t),this.mapVideoConstraints(t,e),e}}var Rc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.a;ht.b;class Ic extends ht.c{constructor(t){super(t),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=Fc.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t,e){return Rc(this,void 0,void 0,(function*(){const n=document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((o,i)=>{Object(W.render)(W.default.createElement(Ic,{container:n,configuration:t,onSuccess:o,onFailure:i,mrzRecognizer:e}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Rc(this,void 0,void 0,(function*(){il.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){il.warn("Mrz detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Rc(this,void 0,void 0,(function*(){t.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 t,e,n,o,i;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===(t=this.finder)||void 0===t?void 0:t.holeRect;const o=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(Ic.FRAME_RESOLUTION);if(!o)return;r&&this.forceUpdate();const i=yield this.props.mrzRecognizer.recognize(o,"CONSUME_IMAGE");if(!this.enabled)return;if(null===i)return;this.camera.reusableImageBuffer=null==i?void 0:i.originalImage.data,i.recognitionSuccessful?(delete i.originalImage,a=!0,this.configuration.onMrzDetected(i)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(i.originalImage))}catch(t){null===(i=(o=this.configuration).onError)||void 0===i||i.call(o,t)}finally{a?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}render(){var t;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),W.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),this.state.isFinderVisible&&W.default.createElement(pt.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}Ic.FRAME_RESOLUTION=1200;var Wc=Ic,Mc=n(36);class jc{constructor(){this.disabled=!1,this.color="transparent"}}class zc{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20}}class Nc{constructor(){this.color="#1ec31e",this.width=4}}class Vc{constructor(){this.padding=10}}class Uc{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class Hc{constructor(){this.width=2,this.color="white"}}class Gc{constructor(){this.size=20,this.color="white"}}class Qc extends Mc.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new Vc,this.style.magneticLines=new jc,this.style.polygon=new Nc,this.style.polygon.handles=new zc,this.style.magnifier=new Uc,this.style.magnifier.border=new Hc,this.style.magnifier.crosshair=new Gc}static fromJson(t){const e=new Qc;return this.mapValues(t,e,["style"]),t.style&&(this.mapValues(t.style,e.style,["polygon","magneticLines","magnifier"]),t.style.polygon&&(this.mapValues(t.style.polygon,e.style.polygon,["handles"]),t.style.polygon.handles&&this.mapValues(t.style.polygon.handles,e.style.polygon.handles)),t.style.magneticLines&&this.mapValues(t.style.magneticLines,e.style.magneticLines,[]),t.style.magnifier&&(this.mapValues(t.style.magnifier,e.style.magnifier,["border","crosshair"]),t.style.magnifier.border&&this.mapValues(t.style.magnifier.border,e.style.magnifier.border,[]),t.style.magnifier.crosshair&&this.mapValues(t.style.magnifier.crosshair,e.style.magnifier.crosshair,[]))),e}}class Yc extends W.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(t){return W.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},W.default.createElement("line",{x1:t.start.x.toString(),y1:t.start.y.toString(),x2:t.end.x.toString(),y2:t.end.y.toString(),style:{stroke:this.props.style.color,strokeWidth:2}}))}componentDidUpdate(t,e,n){this.props.style.disabled||this.snapToClosestIfAnyAreClose()}render(){var t,e,n,o,i,r;return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},null===(n=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.horizontal)||void 0===e?void 0:e.scaled)||void 0===n?void 0:n.map((t=>this.fromPoint(t))),null===(r=null===(i=null===(o=this.props.lines)||void 0===o?void 0:o.vertical)||void 0===i?void 0:i.scaled)||void 0===r?void 0:r.map((t=>this.fromPoint(t))))}snapToClosestIfAnyAreClose(){var t,e,n,o;const i=this.props.movingLine;let r=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.vertical)||void 0===e?void 0:e.scaled;if(i.isHorizontal&&(r=null===(o=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===o?void 0:o.scaled),!r)return;const a=this.midPoint(i.points[0].coordinates,i.points[1].coordinates),s=r.map((t=>({distance:this.distanceToLine(t,a),mLine:t})));s.sort(((t,e)=>t.distance-e.distance)),s[0].distance<this.BUFFER&&this.props.snapTo({magneticLine:s[0].mLine,polygonLine:i})}distanceToLine(t,e){const n=e.x-t.start.x,o=e.y-t.start.y,i=t.end.x-t.start.x,r=t.end.y-t.start.y,a=i*i+r*r;if(0===a)return 1/0;const s=(n*i+o*r)/a;let l;return l=s<=0?t.start:s>=1?t.end:new ws.a(t.start.x+s*i,t.start.y+s*r),ws.a.distance(e,l)}midPoint(t,e){return new ws.a((t.x+e.x)/2,(t.y+e.y)/2)}}class Zc extends W.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var t,e;return(null===(t=this.props.style)||void 0===t?void 0:t.size)?(null===(e=this.props)||void 0===e?void 0:e.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var t,e;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(t=this.props.style)||void 0===t?void 0:t.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(e=this.props.style)||void 0===e?void 0:e.color,position:"absolute",cursor:"pointer",zIndex:500}}nextIndex(t){return(t+1)%this.POINT_COUNT}previousIndex(t){return(t-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(t){return t%2==0}isOutOfBounds(t,e){return t<-this.DRAG_BUFFER||t>e+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 qc extends Zc{create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e],o=W.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:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.cornerTouchStart(t,e),onPointerUp:t=>this.cornerTouchEnd(t),onPointerMove:t=>this.cornerTouchMove(t,e),"data-sb-cropping-corner":e},W.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));t.push(o)}return t}cornerTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.items[e],i=ws.a.fromHtmlElement(o);this.parentOffset=new ws.a(n.x-i.x,n.y-i.y),this.props.cornerMoveStart({index:e,point:this.props.points[e]})}cornerTouchMove(t,e){if(!this.parentOffset)return;const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),{x:o,y:i}=Object(Ol.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[e];this.props.points[e]=new ws.a(o+r,i+r),Tc.isConvex(this.props.points)?this.props.cornerMoved({index:e,point:this.props.points[e]}):this.props.points[e]=a}cornerTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null,this.props.cornerMoveEnd()}render(){return W.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 Xc extends Zc{create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e];let o=this.props.points[this.nextIndex(e)];const i=W.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(o.x-n.x)/2-this.pointSize/2+"px",top:n.y+(o.y-n.y)/2-this.pointSize/2+"px"}),key:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.lineTouchStart(t,e),onPointerMove:t=>this.lineTouchMove(t,e),onPointerUp:t=>this.lineTouchEnd(t),"data-sb-cropping-side":e},W.default.createElement("div",{style:this.invisibleHandleStyle}));t.push(i)}return t}lineTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.items[e],i=ws.a.fromHtmlElement(o),r=this.props.points[e],a=this.props.points[this.nextIndex(e)];this.point0Start=v.copy(this.props.points[this.previousIndex(e)]),this.point1Start=v.copy(r),this.point2Start=v.copy(a),this.point3Start=v.copy(this.props.points[this.nextIndex(this.nextIndex(e))]),this.point1Offset=new ws.a(r.x-i.x,r.y-i.y),this.point2Offset=new ws.a(a.x-i.x,a.y-i.y),this.parentOffset=new ws.a(n.x-i.x,n.y-i.y)}lineTouchMove(t,e){if(!this.parentOffset)return;const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.props.points[this.previousIndex(e)];let i=new ws.a(null,null),r=new ws.a(null,null);const a=this.props.points[this.nextIndex(e+1)],s=n.x-this.parentOffset.x,l=n.y-this.parentOffset.y;if(this.isHorizontal(e)){const t=l+this.point1Offset.y,e=l+this.point2Offset.y,n=t-this.point1Start.y;i.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)),i.y=t,r.y=e}else{const t=s+this.point1Offset.x,e=s+this.point2Offset.x,n=t-this.point1Start.x;i.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)),i.x=t,r.x=e}i=ws.a.clamp(i,this.props.containerSize),r=ws.a.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,i,o,this.isHorizontal(e)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(e)?"y":"x")||this.areEdgesCrossing(o,i,r,a)||Tc.isConvex([o,i,r,a])&&(this.props.points[e].x=i.x,this.props.points[e].y=i.y,this.props.points[this.nextIndex(e)].x=r.x,this.props.points[this.nextIndex(e)].y=r.y,this.props.lineMoved({points:[{index:e,coordinates:i},{index:this.nextIndex(e),coordinates:r}],previousPoint:o,nextPoint:a,isHorizontal:this.isHorizontal(e)}))}lineTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null}isNearOpposingPoint(t,e,n,o){if(t[o]>n[o]){if(e[o]-10<n[o])return!0}else if(e[o]>n[o]-10)return!0;return!1}areEdgesCrossing(t,e,n,o){const i=t.x,r=t.y,a=e.x,s=e.y,l=n.x,c=n.y,u=o.x,d=o.y;return((i-l)*(s-c)-(r-c)*(a-l))*((i-u)*(s-d)-(r-d)*(a-u))<0&&((l-i)*(d-r)-(c-r)*(u-i))*((l-a)*(d-s)-(c-s)*(u-a))<0}render(){return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class $c extends W.default.Component{render(){return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},W.default.createElement(qc,{ref:t=>this.corners=t,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}),W.default.createElement(Xc,{ref:t=>this.lines=t,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 t=0;t<this.corners.POINT_COUNT;t++){const e=this.props.coordinatePoints[t];this.corners.items[t]&&(this.corners.items[t].style.left=e.x-this.corners.pointSize/2+"px",this.corners.items[t].style.top=e.y-this.corners.pointSize/2+"px");let n=this.props.coordinatePoints[this.corners.nextIndex(t)];this.lines.items[t]&&(this.lines.items[t].style.left=e.x+(n.x-e.x)/2-this.corners.pointSize/2+"px",this.lines.items[t].style.top=e.y+(n.y-e.y)/2-this.corners.pointSize/2+"px")}}snapTo(t){const e=[t.polygonLine.previousPoint,t.polygonLine.points[0].coordinates],n=[t.polygonLine.points[1].coordinates,t.polygonLine.nextPoint],o=[t.magneticLine.start,t.magneticLine.end];this.props.coordinatePoints[t.polygonLine.points[0].index]=Tc.intersection(e,o),this.props.coordinatePoints[t.polygonLine.points[1].index]=Tc.intersection(n,o),this.props.cornerMoveEnd(),this.setFrame()}}class Kc extends W.default.Component{constructor(t){super(t),this.state={movingLine:void 0}}render(){return W.default.createElement("div",null,W.default.createElement($c,{ref:t=>this.handles=t,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:t=>{this.setFrame(),this.props.cornerMoved(t)},cornerMoveEnd:this.props.cornerMoveEnd,lineMoved:t=>{this.setFrame(),this.setState({movingLine:t})}}),W.default.createElement(Yc,{style:this.props.magneticLineStyle,lines:this.props.magneticLines,movingLine:this.state.movingLine,snapTo:t=>{var e,n;null===(e=this.handles)||void 0===e||e.snapTo(t),null===(n=this.polygon)||void 0===n||n.setFrame()}}),W.default.createElement(wc,{size:this.props.size,points:this.props.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:t=>this.polygon=t}))}setFrame(){var t,e;null===(t=this.polygon)||void 0===t||t.setFrame(),null===(e=this.handles)||void 0===e||e.setFrame()}}class Jc extends W.default.Component{render(){return W.default.createElement("img",{ref:t=>this.image=t,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute"},src:this.props.src,alt:".",onLoad:t=>{t.target&&this.props.onImageLoaded(t.target)}})}}class tu extends W.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:t,imageMargin:e,rotations:n,scale:o,duration:i}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=mt.b`
34
+ `;return Wt.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},Wt.default.createElement(e,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),Wt.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"}),Wt.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"}),Wt.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 ou extends Wt.default.Component{render(){return this.props.text?Wt.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},Wt.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:kn.TransparentGray,color:kn.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class iu extends Wt.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,o,i;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),l=kc.a.width(null!==(e=this.props.animateToPoints)&&void 0!==e?e:r.points);if(!s)return null;if(!r.points)return null;const c=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!==(i=null===(o=this.customStyle)||void 0===o?void 0:o.textColor)&&void 0!==i?i:r.highlighted?a.highlightedTextColor:a.textColor;return Wt.default.createElement(Ic.div,{ref:e=>this.label=e,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:kc.a.lowestX(r.points),y:kc.a.highestY(r.points)+3,backgroundColor:c,fontSize:12,width:l,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:kc.a.lowestX(this.props.animateToPoints),y:kc.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class ru{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 au{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.countingRepeatDelay=-1,this.style=new ru}}class su{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class lu{constructor(){this.enabled=!1,this.style=new su}}class cu extends Z.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new au,this.detectionParameters=new Q.BarcodeScannerConfiguration,this.scanAndCount=new lu,this.onBarcodesDetected=function(e){}}static fromJson(e){const t=new cu;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 uu{constructor(e){this.coreResult=e,this.barcodes=[],this.originalImageSize=null,this.barcodes=e.barcodes,e.originalImage&&(this.originalImageSize=new eu.a(e.originalImage.width,e.originalImage.height))}isEmpty(){return 0===this.barcodes.length}}class du{static warn(e){console.warn("[ScanbotSDK]",e)}}class hu{static convertLinesToViewportLines(e,t){if(t&&e)return t.map((t=>({start:new kc.a(t.start.x*e.width,t.start.y*e.height),end:new kc.a(t.end.x*e.width,t.end.y*e.height)})))}static convertToViewportPointsFromParentSize(e,t){return t?eu.a.isEmpty(e)?void 0:t.map((t=>kc.a.scaleUpTo(t,e))):eu.a.toPolygon(e)}static calculateScale(e){let t,n=0,o=0;return 1>e.width/e.height?(t=e.height/1,n=(1-e.width/t)/2):(t=e.width/1,o=(1-e.height/t)/2),{x:n,y:o,containerScale:t}}static findScale(e,t){let n,o=0,i=0;return t.ratio(!0)>e.ratio(!0)?(n=e.width/t.width,i=(t.height-e.height/n)/2):(n=e.height/t.height,o=(t.width-e.width/n)/2),{x:o,y:i,scale:n}}static preventDefaultCallback(e){e.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",hu.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",hu.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 mu=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};bn.a;bn.b;class fu extends bn.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=cu.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e){return mu(this,void 0,void 0,(function*(){const t=hu.findContainerOrThrow(e);return new Promise(((n,o)=>{Object(Wt.render)(Wt.default.createElement(fu,{container:t,configuration:e,onSuccess:n,onFailure:o}),t)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return mu(this,void 0,void 0,(function*(){du.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){du.warn("Barcode detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return mu(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 mu(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return mu(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,o,i;return mu(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 uu(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===(o=this.finder)||void 0===o?void 0:o.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(e){console.log(e)}finally{this.detectionRunning=!1;const e=()=>requestAnimationFrame((()=>this.detect())),t=(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)?0:this.configuration.captureDelay;r&&0!=t?setTimeout(e,t):e()}}))}setUseBackendService(e){console.log("Now using backend service for recognition: ",e),this.backendurl=e}recognizeBarcodes(e,t){var n,o,i,r,a,s,l,c;return mu(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(e=!1);const l=e?bn.c.DEFAULT_DETECTION_RESOLUTION:bn.c.DETECTION_RESULTION_4K,c=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:l;this.camera.finderFrame=null===(o=this.finder)||void 0===o?void 0:o.holeRect;const u=yield null===(i=this.camera)||void 0===i?void 0:i.createImageData(c,!1);if(!u)return;t&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:F.wrapperToBase64(u)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",bn.c.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));new eu.a(u.width,u.height);this.barcodeScannerHandle||(this.barcodeScannerHandle=yield this.bridge.copyArgs.createBarcodeScanner(new Q.BarcodeScannerConfiguration(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===(c=(l=this.props.configuration).onError)||void 0===c||c.call(l,e))}}))}setRecognitionResolution(e){this.desiredRecognitionResolution=e}getResolution(){return mu(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?e(eu.a.fromJson(n)):this.camera.didLoadVideo=()=>{const t=this.camera.videoSize();e(eu.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,o,i,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 Wt.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),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},Wt.default.createElement(yn.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}})),Wt.default.createElement(ou,{top:null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.style.topLabelTop,text:s}),Wt.default.createElement(tu,{ref:e=>this.scannedImage=e,image:this.state.image}),this.state.isFinderVisible&&Wt.default.createElement(An.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),Wt.default.createElement(ou,{bottom:100,text:this.state.bottomHintText}),Wt.default.createElement(nu,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&Wt.default.createElement(zc,{ref:e=>{e&&(this.overlay=e)},configuration:this.configuration.overlay,onPolygonSelected:e=>{const t=new uu({barcodes:[e]});this.configuration.onBarcodesDetected(t)},onBarcodeFound:(e,t,n)=>{var o;(null===(o=this.configuration.overlay)||void 0===o?void 0:o.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(e,t,n)},LabelComponent:iu,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&Wt.default.createElement(Jc,{ref:e=>this.bottomActionBar=e,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(Tn.PushBottom,this.barcodes)},onShutterButtonClick:()=>mu(this,void 0,void 0,(function*(){(new M).flash(),this.setState({action:"processing"});const e=(new Date).getTime();let t=yield this.recognizeBarcodes(!1,!1);const n=new uu(null!=t?t:{barcodes:[]});console.log("Recognition took:",((new Date).getTime()-e)/1e3);const o=this.countLabelText(n.barcodes);this.setState({action:"manual",bottomHintText:o}),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()}}),Wt.default.createElement(On,{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 pu(e,t){return e&&(e.hasFacingOptions&&t.flipCameraButton.visible||e.isTorchAvailable&&t.flashButton.visible)||t.zoomButton.visible}function gu(e){const t=e.zoomSteps.findIndex((t=>t==e.defaultZoomFactor)),[n,o]=Object(Wt.useState)(e.torchEnabledInitially),[i,r]=Object(Wt.useState)(t),a=e.zoomSteps[i],[s,l]=Object(Wt.useState)("BACK"==e.initialCameraModule?"environment":"user"),c=function(e){var t,n;const o=null===(n=null===(t=null==e?void 0:e.camera)||void 0===t?void 0:t.video)||void 0===n?void 0:n.parentElement,i=()=>o?o.getBoundingClientRect():null,[r,a]=Object(Wt.useState)(i());return Object(Wt.useEffect)((()=>{if(o){const e=()=>a(i());e();const t=new ResizeObserver(e);return t.observe(o),()=>{t.disconnect()}}}),[o]),r}(e.scanner),u=!!c;if(Object(Wt.useEffect)((()=>{var t;(null===(t=e.capabilities)||void 0===t?void 0:t.isTorchAvailable)&&u&&e.scanner.setTorchState(n)}),[e.capabilities,u,n]),Object(Wt.useEffect)((()=>{var t;u&&(null===(t=e.scanner)||void 0===t||t.setZoom(a))}),[u,a]),!e.capabilities||!c)return null;if(!pu(e.capabilities,e.config))return null;const d=c.height-e.bottomPadding-48;return Wt.default.createElement(zt.Box,{style:{position:"absolute",marginTop:d,marginLeft:c.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},Wt.default.createElement(mn,Object.assign({},e.config.flashButton,{visible:e.capabilities.isTorchAvailable&&e.config.flashButton.visible,icon:n?zt.FlashlightOn:zt.FlashlightOff,active:n,onClick:()=>o(!n)})),Wt.default.createElement("div",{style:{width:20}}),Wt.default.createElement(mn,Object.assign({},e.config.zoomButton,{text:`${a.toFixed(1)}x`,active:i!==t,onClick:()=>r((i+1)%e.zoomSteps.length)})),Wt.default.createElement("div",{style:{width:20}}),Wt.default.createElement(mn,Object.assign({},e.config.flipCameraButton,{visible:e.capabilities.hasFacingOptions&&e.config.flipCameraButton.visible,active:"user"===s,icon:zt.FlipCameraIos,onClick:()=>{var t;const n="environment"===s?"user":"environment";l(n),null===(t=e.scanner)||void 0===t||t.setCameraDirection(n)}})))}const vu=Object(Wt.createContext)(null);class Cu{static compute(e,t,n){const o=(kc.a.lowestY(e)+kc.a.highestY(e))/2,i={badgeY:o,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},i),{labelY:Math.max(kc.a.highestY(e)+Cu.LABEL_AND_BADGE_PADDING,t?o-Cu.AR_BADGE_SIZE/2-Cu.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},i),{labelY:Math.min(kc.a.lowestY(e)-Cu.LABEL_AND_BADGE_PADDING,t.visible?o+Cu.AR_BADGE_SIZE/2+Cu.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:o,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${Cu.LABEL_AND_BADGE_PADDING/2}px))`},labelY:o,labelStyle:{transform:t.visible?`translateX(-50%) translateY(${Cu.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},i),{labelY:0,labelStyle:{display:"none"}}):void 0}}Cu.AR_BADGE_SIZE=48,Cu.LABEL_AND_BADGE_PADDING=10;var bu=Cu;function yu(e){return e.style.visible?""==e.content?null:Wt.default.createElement(Ic.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},e.positionBadge),animate:e.animateToPoints?e.positionBadge:{},transition:e.transition},Wt.default.createElement(Xt,{styleConfig:Object.assign(Object.assign({},e.style.background),{cornerRadius:bu.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},e.verticalPositions.badgeStyle),{width:bu.AR_BADGE_SIZE,height:bu.AR_BADGE_SIZE,color:Ht.b.getColorValue(e.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==e?void 0:e.onClick()},Wt.default.createElement(zt.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e.content))):null}var Au=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};class Su extends iu{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:o,counterBadge:i}=this.props;const r=n,a=this.state.element,s=null!==(e=this.props.animateToPoints)&&void 0!==e?e:a.points,l=a.code,c=a.highlighted,u=(kc.a.lowestX(s)+kc.a.highestX(s))/2;void 0===o&&(o="BELOW");const d=bu.compute(s,i,o),h=void 0===r||!1===r.titleDeselected.visible&&!1===r.subtitleDeselected.visible,m={x:u,y:Math.round(d.labelY)},f={x:u,y:Math.round(d.badgeY)},p={duration:.25,easing:"linear"};return Wt.default.createElement(Wt.default.Fragment,null,r&&Wt.default.createElement(Ic.div,{ref:e=>this.label=e,style:Object.assign(Object.assign({},m),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?m:{},transition:p},Wt.default.createElement(Xt,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:h?"inline-block":"block",zIndex:1500},d.labelStyle),styleConfig:c?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)}},Wt.default.createElement(wu,{barcode:l,barcodeImageVisible:r.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:c?r.titleSelected:r.titleDeselected,barcodeSubtitle:c?r.subtitleSelected:r.subtitleDeselected}))),Wt.default.createElement(yu,{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:i,positionBadge:f,content:this.badgeContent(),verticalPositions:d,transition:p,animateToPoints:this.props.animateToPoints}))}}function wu(e){var{barcode:t}=e,n=Au(e,["barcode"]);const o=Object(Wt.useContext)(vu).useBarcodeMappedData(t);return Wt.default.createElement(sn,Object.assign({barcodeMappedData:o},n))}var Eu=n(10);function xu(e){const t=Object(Wt.useRef)(),n=Object(Wt.useRef)(null),[o,i]=(Object(Wt.useContext)(nn),Object(Wt.useState)(void 0)),[r,a]=Object(Wt.useState)(!1);Object(Wt.useEffect)((()=>{var n,o;e.scanningPaused?null===(n=t.current)||void 0===n||n.pause():null===(o=t.current)||void 0===o||o.resume()}),[e.scanningPaused]);const s=function(e){const t=new au;t.visible=e.visible;const n=e.polygon instanceof Eu.c,o=e.polygon,i=e,r=n?o.selected:i.polygon.partiallyScanned,a=n?o.deselected:i.polygon.partiallyScanned;return e.polygon.visible?(t.style.highlightedPolygonFillColor=Ht.b.getColorValue(r.fillColor),t.style.highlightedPolygonStrokeColor=Ht.b.getColorValue(r.strokeColor),t.style.highlightedPolygonStrokeWidth=r.strokeWidth,t.style.highlightedPolygonCornerRadius=r.cornerRadius,t.style.polygonFillColor=Ht.b.getColorValue(a.fillColor),t.style.polygonStrokeColor=Ht.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),l=Object.assign(Object.assign({},e.barcodeScannerViewConfig),{onBarcodesDetected:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.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,o.originalImageSize,o.barcodes),null===(c=(l=e.barcodeScannerViewConfig).onBarcodesDetected)||void 0===c||c.call(l,o)},_onDetectionFailed:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.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 eu.a(o.width,o.height),[]),null===(c=(l=e.barcodeScannerViewConfig)._onDetectionFailed)||void 0===c||c.call(l,o)}});return Object(Wt.useEffect)((()=>{const t=pu(o,e.actionBarConfig);e.setActionButtonsVisible(t),a(t)}),[o,e.actionBarConfig]),Wt.default.createElement(Wt.default.Fragment,null,e.arOverlay.visible&&Wt.default.createElement(zc,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:Su,labelComponentConfig:e.arOverlay,onBarcodeFound:e.arOnBarcodeEnter,onPolygonClick:e.arOnBarcodeClick,configuration:s}),Wt.default.createElement(gu,{config:e.actionBarConfig,scanner:t.current,capabilities:o,bottomPadding:e.actionBarBottomPadding,torchEnabledInitially:e.cameraConfiguration.flashEnabled,zoomSteps:e.cameraConfiguration.zoomSteps,defaultZoomFactor:e.cameraConfiguration.defaultZoomFactor,initialCameraModule:e.cameraConfiguration.cameraModule}),Wt.default.createElement(fu,{ref:t,viewFinderPadding:e.viewFinderPadding,configuration:l,onSuccess:()=>class{static setFromScanner(e,t){var n;if(!e.current)return;const o=e.current.getCapabilities();t({hasFacingOptions:(null==o?void 0:o.facingMode)&&o.facingMode.length>0,isTorchAvailable:null!==(n=e.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}.setFromScanner(t,i),onFailure:e.onCameraPermissionDenied,onLicenseError:e.onLicenseError}))}function Bu(e){return Object(Wt.useMemo)((()=>{const t=(new cu).videoConstraints;return t.width.ideal=e.cameraConfiguration.idealPreviewResolution.width,t.height.ideal=e.cameraConfiguration.idealPreviewResolution.height,t.facingMode="FRONT"===e.cameraConfiguration.cameraModule?"user":"environment",{videoConstraints:t,backgroundColor:Ht.b.getColorValue(e.backgroundColor),userGuidance:e.userGuidance,finder:e.viewFinder,detectionParameters:new Q.BarcodeScannerConfiguration({live:!0,engineMode:e.recognizerConfiguration.engineMode,barcodeFormatConfigurations:[new G.BarcodeFormatCommonConfiguration({formats:e.recognizerConfiguration.barcodeFormats.length>0?e.recognizerConfiguration.barcodeFormats:void 0,regexFilter:e.recognizerConfiguration.barcodesRegexFilter,gs1Handling:e.recognizerConfiguration.gs1Handling})]}),desiredRecognitionResolution:e.recognizerConfiguration.maximumRecognizerResolution}}),[e])}var Iu=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Tu(e){const[t,n]=Object(Wt.useState)(null),[o,i]=Object(Wt.useState)(!0),r=Object(Wt.useMemo)((()=>"__sb_"+Math.random()),[]),a=e.barcodeMapper,s=e.configuration.useCase,l=Object.assign(Object.assign({},Bu(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}),c=n=>Iu(this,void 0,void 0,(function*(){let o;o=null===t?[]:[new Vt.BarcodeScannerUIItem({count:1,barcode:n})];const i={items:o};e.onSubmit(i)}));Object(Wt.useEffect)((()=>{t&&(gn.INSTANCE.beep(e.configuration.sound),Cn.INSTANCE.vibrate(e.configuration.vibration))}),[t]),Object(Wt.useEffect)((()=>{null===t||s.confirmationSheetEnabled||c(t)}),[t,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(t);Object(Wt.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(Wt.useContext)(nn);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(vu.Provider,{value:e.barcodeMapper},Wt.default.createElement(dn,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{c(t)},barcodeMappedData:u},{sheetColorLoaded:(h=s).sheetColor,sheetColorLoading:h.barcodeInfoMapping.sheetColor,barcodeImageVisible:h.barcodeImageVisible,barcodeTitle:h.barcodeTitle,barcodeSubtitle:h.barcodeSubtitle,cancelButton:h.cancelButton,submitButton:h.submitButton,dividerColor:h.dividerColor,loadingMessage:h.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),Wt.default.createElement(zt.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},Wt.default.createElement(xu,{cameraConfiguration:e.configuration.cameraConfiguration,scanningPaused:null!==t,setActionButtonsVisible:i,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:o?80:0},barcodeScannerViewConfig:l,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 h}function ku(e){const t=Object.assign(Object.assign({},e.title),{text:Ht.b.getLocalizedText(e.title.text,e.textReplacementArgs)});return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(tn,Object.assign({},e.leftButton)),Wt.default.createElement(zt.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},Wt.default.createElement(Qt.a,{config:t})),Wt.default.createElement(tn,Object.assign({},e.rightButton)))}function Ou(){return Wt.default.createElement("div",{style:{width:30,height:6,backgroundColor:zt.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function Du(e){return Wt.default.createElement(zt.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:e.innerRef},e.dragProps),Wt.default.createElement(Ou,null),Wt.default.createElement(ku,Object.assign({},e.drawerHeaderContentProps)))}function Lu(e){return Wt.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},Wt.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 Pu(e){return e.isVisible?Wt.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},e.style.placeholderIcon.visible&&Wt.default.createElement(zt.Avatar,{style:{backgroundColor:Ht.b.getColorValue(e.style.placeholderIconBackground),width:100,height:100}},Wt.default.createElement(Lu,{color:Ht.b.getColorValue(e.style.placeholderIcon.color)})),Wt.default.createElement(zt.Typography,{style:{marginTop:20},variant:"h6"},Wt.default.createElement(Qt.a,{config:e.style.placeholderTitle})),Wt.default.createElement(zt.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},Wt.default.createElement(Qt.a,{config:e.style.placeholderSubtitle})),e.onStartClick&&e.style.startScanningButton.visible&&Wt.default.createElement(ln,Object.assign({style:{width:"60%",marginTop:20}},e.style.startScanningButton,{visible:!0,onClick:e.onStartClick}))):null}function _u(e,t,n){const o=Object(Wt.useRef)(),i=Object(Wt.useRef)(null),[r,a]=Object(Wt.useState)(),[s,l]=Object(Wt.useState)(!1),c=Object(Wt.useRef)([]),u=e=>{let n="none";if(c.current.length>0){const t=200,o=((e,t)=>{let n=e[0],o=Math.abs(n.time-t);for(let i=1;i<e.length;i++){const r=Math.abs(e[i].time-t);r<o&&(n=e[i],o=r)}return n})(c.current,e.timeStamp-t),i=o.y-e.clientY,r=100;i>r?n="up":i<-r&&(n="down")}c.current.splice(0,c.current.length),t(new kc.a(e.clientX,e.clientY),n)},d={onPointerDown:e=>{e.target.setPointerCapture(e.pointerId),l(!0),i.current=new kc.a(e.clientX,e.clientY),a(kc.a.empty()),e.stopPropagation()},onPointerMove:t=>{if(!s)return;const n=new kc.a(t.clientX,t.clientY);o.current=t,a(n),e(n),c.current.push({x:t.clientX,y:t.clientY,time:t.timeStamp})},onPointerUp:e=>{e.target.releasePointerCapture(e.pointerId),l(!1),u(e)},onPointerCancel:e=>{e.target.releasePointerCapture(e.pointerId),l(!1),n()}};return{startPoint:i,currentPoint:r,props:d,stop:()=>{o.current.stopPropagation()},dragOngoing:s}}var Ru=n(33);function Fu(e){const[t,n]=Object(Wt.useState)(0),[o,i]=Object(Wt.useState)(!1),r=Object(Wt.useRef)(null),a=Object(Wt.useContext)(nn).height,s=e=>{n(e),i(!0),setTimeout((()=>{i(!1)}),500)},l=t=>{const n=t-c.startPoint.current.y;return Object(Ru.a)((e.isOpen?100:0)-100*n/(window.innerHeight-a-e.closedSheetVisibleHeight),0,100)},c=_u((e=>{n(l(e.y))}),((t,n)=>{if(t.y===c.startPoint.current.y)return;let o;o=l(t.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(o="swipe-to-open"),"down"===n&&(o="swipe-to-close"),e.onSwipe(o)}),(()=>{}));return Object(Wt.useEffect)((()=>{o||c.dragOngoing||!r||(e.isOpen||0===t?e.isOpen&&100!==t&&s(100):s(0))}),[e.isOpen,t,c.dragOngoing]),Wt.createElement("div",null,Wt.createElement(jt.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${Ut} - ${a}px - ${e.closedSheetVisibleHeight}px) * ${t} / 100 + ${e.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:o?"height 500ms":void 0,backgroundColor:Ht.b.getColorValue(e.contentStyle.sheetColor)},elevation:24}},Wt.createElement(Du,{innerRef:e=>{r.current=e},drawerHeaderContentProps:e.drawerHeaderContentProps,dragProps:c.props}),e.children,Wt.createElement(Pu,{isVisible:e.isPlaceholderVisible,style:e.contentStyle,onStartClick:()=>e.onSwipe("swipe-to-close")})))}var Mu=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n};function Wu(e){var{inputRef:t}=e,n=Mu(e,["inputRef"]);const o=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return Wt.default.createElement("input",Object.assign({},o,{ref:t}))}function Nu(e){const t=!!e.barcode,[n,o]=Wt.default.useState(""),i=Wt.default.useRef(null),r={backgroundColor:Ht.b.getColorValue(e.dialogStyling.sheetColor)};return Object(Wt.useEffect)((()=>{t&&o(String(e.barcode.count))}),[t]),Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(un,{open:t,modalOverlayColor:e.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var e;return null===(e=i.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)}}},Wt.default.createElement(zt.DialogContent,{style:r},Wt.default.createElement(zt.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},Wt.default.createElement(Qt.a,{config:e.dialogStyling.title})),Wt.default.createElement(zt.Typography,{fontSize:14,textAlign:"center"},Wt.default.createElement(Qt.a,{config:e.dialogStyling.info})),Wt.default.createElement(zt.Box,{sx:{display:"flex",border:"2px solid",borderColor:Ht.b.getColorValue(e.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},Wt.default.createElement(Wu,{inputRef:i,value:n,onChange:e=>{const t=parseInt(e.target.value.replaceAll(/[^0-9]/g,""));o(t>=0?t.toString():"")},type:"text",pattern:"[0-9]*"}),e.dialogStyling.clearTextButton.visible&&Wt.default.createElement(jt.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>o(""),htmlColor:Ht.b.getColorValue(e.dialogStyling.clearTextButton.color)}))),Wt.default.createElement(zt.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},Wt.default.createElement(jt.a,{container:!0,spacing:2},Wt.default.createElement(jt.a,{item:!0,xs:12},Wt.default.createElement(jt.a,{color:Ht.b.getColorValue(e.dialogStyling.dividerColor)})),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},onClick:e.onCancel},e.dialogStyling.cancelButton))),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({icon:zt.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},e.dialogStyling.updateButton)))))))}function Vu(e){return Wt.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:Ht.b.getColorValue(e.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},Wt.default.createElement(jt.a,{style:{height:"100%",color:Ht.b.getColorValue(e.config.iconColor),paddingRight:e.visibleOffset/2,cursor:"pointer"}}))}const zu=0,ju=800,Hu=1200;function Uu(e){switch(e){case"mobile":return Object(zt.useMediaQuery)("(min-width:"+zu+"px) and (max-width:"+(ju-1)+"px)");case"tablet":return Object(zt.useMediaQuery)("(min-width:"+ju+"px) and (max-width:"+(Hu-1)+"px)");case"desktop":return Object(zt.useMediaQuery)("(min-width:"+Hu+"px)")}}function Zu(e){switch(e){case"mobile":return Object(zt.useMediaQuery)("(min-width:"+zu+"px)");case"tablet":return Object(zt.useMediaQuery)("(min-width:"+ju+"px)");case"desktop":return Object(zt.useMediaQuery)("(min-width:"+Hu+"px)")}}const Gu=150;function Qu(e){const[t,n]=Object(Wt.useState)(0),[o,i]=Object(Wt.useState)(!1);let r;const a=_u((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?()=>{c(0)}:void 0;c(Gu,t)}else c(0)}),(()=>{c(0)})),s=Object(Wt.useContext)(vu),l=s.useBarcodeMappedData(e.barcode);Object(Wt.useEffect)((()=>{const t={barcode:e.barcode,callback:()=>e.onDelete(e.barcode)};return s.addOnEvictionListener(t),()=>{s.removeOnEvictionListener(t)}}),[]);const c=(t,o)=>{const a=t>=Gu,s=-r.getBoundingClientRect().width;n(a?s:0),i(!0),setTimeout((()=>{i(!1),a&&e.onDelete(e.barcode),o&&o()}),200)},u=Uu("desktop")&&e.swipeToDeleteConfig.enabled,d=!u&&e.swipeToDeleteConfig.enabled;return Object(Wt.useEffect)((()=>{d||c(0)}),[d]),Wt.default.createElement(zt.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:e=>{e&&(r=e)}},Wt.default.createElement(Vu,{config:e.swipeToDeleteConfig,visibleOffset:Gu}),Wt.default.createElement(zt.Box,Object.assign({sx:{width:"100%",backgroundColor:Ht.b.getColorValue(e.sheetColor),transform:`translateX(${t}px)`,transition:o?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px",columnGap:"16px"}},d?a.props:{}),Wt.default.createElement(sn,Object.assign({barcodeMappedData:l},e)),null!==e.readonlyCount&&Wt.default.createElement(zt.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",color:Ht.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",e.readonlyCount),u&&Wt.default.createElement(jt.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",color:Ht.b.getColorValue("?sbColorOnSurface")},onClick:()=>e.onDelete(e.barcode)}),Wt.default.createElement(zt.Box,{sx:{width:"0px"}})))}function Yu(e){const t=Ht.b.getColorValue(e.sheetContent.dividerColor),n=e.sheetContent.manualCountChangeEnabled&&"COUNTING"===e.mode,o=(t,n)=>{let o=e.indicatorColor.partial;return n===t.count?o=e.indicatorColor.complete:0===n&&(o=e.indicatorColor.notScanned),Ht.b.getColorValue(o)};return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Divider,{style:{borderColor:t}}),e.barcodes.length>0&&Wt.default.createElement(jt.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},Wt.default.createElement(jt.a,{sx:{p:0}},e.barcodes.map((({barcode:i,count:r},a)=>{const s=e.expectedBarcodes.find((e=>e.barcodeValue===i.text));return Wt.default.createElement(jt.a,{key:a,sx:{padding:0,borderBottom:`1px solid ${t}`}},e.indicatorColor&&Wt.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:o(s,r),position:"absolute"}}),Wt.default.createElement(Qu,{barcode:i,animateBackAfterDelete:e.animateBackAfterDelete,onDelete:()=>e.onBarcodeChange({type:"remove",barcode:i}),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:[i],computeNewCount:()=>t})},onNumberClick:()=>e.onNumberClick({barcode:i,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 Xu(e){const t=e.badgeStyle||{},n=e.overlap||"circular";return Wt.default.createElement(zt.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 Ku(e){if(!e.buttonStyling.visible)return null;return Wt.default.createElement(zt.Box,{style:e.style},Wt.default.createElement(Xu,{text:e.text,backgroundColor:Ht.b.getColorValue(e.buttonStyling.badgeBackgroundColor),foregroundColor:Ht.b.getColorValue(e.buttonStyling.badgeForegroundColor)},Wt.default.createElement(zt.IconButton,{sx:{backgroundColor:Ht.b.getColorValue(e.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:Ht.b.getColorValue(e.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:e.onClick,disableRipple:!0,disableFocusRipple:!0},Wt.default.createElement(jt.a,{sx:{color:Ht.b.getColorValue(e.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:Ht.b.getColorValue(e.buttonStyling.activeForegroundColor)}}}))))}const qu=(e,t)=>(null===e.format||null===t.format||e.format===t.format)&&e.text===t.text,Ju=(e,t)=>e.find((e=>((e,t)=>e.barcodeValue===t.text)(e,t)));class $u{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 ed(e){const t=Object(Wt.useContext)(Ht.a).getColorValue,n={backgroundColor:t(e.sheetColor)};return Wt.default.createElement(un,{modalOverlayColor:e.modalOverlayColor,open:e.open},Wt.default.createElement(zt.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},Wt.default.createElement(zt.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},Wt.default.createElement(Qt.a,{config:e.title})),Wt.default.createElement(zt.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},Wt.default.createElement(Qt.a,{config:e.subtitle}))),Wt.default.createElement(zt.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},Wt.default.createElement(jt.a,{container:!0,spacing:2},Wt.default.createElement(jt.a,{item:!0,xs:12},Wt.default.createElement(jt.a,{color:t(e.dividerColor)})),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},icon:e.cancelButton.icon,onClick:e.cancelButton.onClick},e.cancelButton.style))),Wt.default.createElement(jt.a,{item:!0,xs:6},Wt.default.createElement(ln,Object.assign({style:{width:"100%"},icon:e.okButton.icon,onClick:e.okButton.onClick},e.okButton.style))))))}function td(e){return e.open?Wt.default.createElement(ed,{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 nd{constructor(e,t,n){this.barcodeItemSubtitleText=e,this.foundBarcodes=t,this.expectedBarcodes=n}useBarcodeMappedData(e){var t,n,o;const i=null!==(n=null===(t=this.foundBarcodes.find((t=>qu(t.barcode,e))))||void 0===t?void 0:t.count.toString())&&void 0!==n?n:"0",r=Ju(this.expectedBarcodes,e);return{state:"LOADED",value:{title:`${null!==(o=r.title)&&void 0!==o?o:e.text}`,subtitle:Ht.b.getLocalizedText(this.barcodeItemSubtitleText,[i,null==r?void 0:r.count.toString()]),barcodeImage:r.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function od(e){const t=Object(Wt.useContext)(nn);return Wt.default.createElement(jt.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:t.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:Ht.b.getColorValue(e.sheetContent.sheetColor)}},Wt.default.createElement(jt.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},Wt.default.createElement(ku,Object.assign({},e.headerProps))),e.barcodeList,Wt.default.createElement(Pu,{isVisible:e.isEmptyStateVisible,style:e.sheetContent}))}var id=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function rd(e){const t=Object(Wt.useRef)(),n=Object(Wt.useRef)(new Date("2001-01-01")),[o,i]=Object(Wt.useReducer)(function(e,t,n,o){return(i,r)=>{const a=e.useCase,s="FindAndPickScanningMode"===a._type,l=s?"COUNTING":a.mode,c=s?a.expectedBarcodes:[],u=e=>{let t=[...i];const n=r.barcodes||[r.barcode];for(const o of n){const n=t.findIndex((e=>qu(e.barcode,o)));if(-1===n)t.push({barcode:o,count:e(0)});else{const o=t[n];t[n]=Object.assign(Object.assign({},o),{count:e(o.count,o)})}}return t},d=(e,n)=>{var i;if(t.current=new Date,!n)return e;const r=null===(i=Ju(c,n.barcode))||void 0===i?void 0:i.count;return void 0===r||r===e?e:(o(),e+1)};switch(r.type){case"onBarcodesDetected":{if((new Date).getTime()-t.current.getTime()<a.countingRepeatDelay||!n.current)return[...i];if(s)return a.arOverlay.automaticSelectionEnabled?u(d):[...i];const e=a.arOverlay;if(!e.visible||e.automaticSelectionEnabled){let e=!1;return u((n=>{let i="COUNTING"===l?n+1:1;return i===n||e||(t.current=new Date,o()),i}))}return u((e=>e))}case"onARCodeClick":return u(((e,t)=>{if(s)return d(e,t);const n="UNIQUE"===l?1-e:e+1;return n>0&&o(),n}));case"onCountEditDialogChange":{let e=()=>r.count||0;if(s){const t=Ju(c,r.barcode);r.count>t.count&&(e=()=>t.count)}return u(e)}case"setCount":return u(r.computeNewCount);case"remove":return i.map((e=>Object.assign(Object.assign({},e),{count:qu(e.barcode,r.barcode)?0:e.count})));case"clear":return i.map((e=>Object.assign(Object.assign({},e),{count:0})));case"setHtmlElements":let e=!1;const h=i.map((t=>qu(t.barcode,r.barcode)?(e=!0,Object.assign(Object.assign({},t),{polygonElement:r.polygonElement,labelElement:r.labelElement})):t));return e||h.push({barcode:r.barcode,count:0,labelElement:r.labelElement,polygonElement:r.polygonElement}),h}}}(e.configuration,n,e.scanningEnabled,(()=>{gn.INSTANCE.beep(e.configuration.sound),Cn.INSTANCE.vibrate(e.configuration.vibration)})),[]),[r,a]=Wt.default.useState(null),[s,l]=Object(Wt.useState)(!1),c=Object(Wt.useMemo)((()=>"__sb_"+Math.random()),[]),[u,d]=Object(Wt.useState)(!0),h=e.barcodeMapper,[m,f]=Object(Wt.useState)(null),p="FindAndPickScanningMode"===e.configuration.useCase._type,g=e.configuration.useCase,v=p?"COUNTING":g.mode,C=Object(Wt.useRef)(Object.assign(Object.assign({},Bu(e.configuration)),{onBarcodesDetected:e=>{i({type:"onBarcodesDetected",barcodes:e.barcodes})},_onDetectionFailed(e){},onError:e.onError,captureDelay:1e3/60}));Object(Wt.useEffect)((()=>{if(p){const t=A();for(const n of t){const t=[(e=n.barcodeValue,new Q.BarcodeItem({text:e,format:null,quad:[],quadNormalized:[],sourceImage:null,rawBytes:null,upcEanExtension:null,extractedDocument:null}))];i({type:"setCount",barcodes:t,computeNewCount:()=>0})}}var e}),[]),Object(Wt.useEffect)((()=>{C.current.container=t.current}),[t]),Object(Wt.useEffect)((()=>{if(p)for(const e of o){const t=g.arOverlay,n=e.polygonElement,o=e.labelElement;if(w(e.barcode)){const i=_(e.barcode);let r=e.count+"/"+i.expectedCount;g.arOverlay.automaticSelectionEnabled||0!==e.count||(r=Wt.default.createElement(zt.TouchApp,null)),i.isFulFilled()?(null==n||n.style(Ht.b.getPolygonColorValues(t.polygon.completed,t.polygon.visible)),null==o||o.styleBadge(t.badge.completed,Wt.default.createElement(zt.Check,null))):(null==n||n.style(Ht.b.getPolygonColorValues(t.polygon.partiallyScanned,t.polygon.visible)),null==o||o.styleBadge(t.badge.partiallyScanned,r))}else null==n||n.style(Ht.b.getPolygonColorValues(t.polygon.rejected,t.polygon.visible)),null==o||o.styleBadge(t.badge.rejected,Wt.default.createElement(zt.Close,null))}else for(const e of o){if(e.polygonElement){const t=g.arOverlay.polygon,n=e.count>0?t.selected:t.deselected;e.polygonElement.style(Ht.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))}}),[o]);const b=o.reduce(((e,t)=>e+t.count),0),y=()=>A().every((e=>o.some((t=>t.barcode.text===e.barcodeValue&&t.count===e.count)))),A=()=>p?g.expectedBarcodes:[],S=e=>Ju(A(),e),w=e=>!!S(e),E=()=>p?o.filter((e=>w(e.barcode))):o.filter((e=>e.count>0)),x=()=>id(this,void 0,void 0,(function*(){const t=E().map((e=>new Vt.BarcodeScannerUIItem({count:"COUNTING"===v?e.count:1,barcode:e.barcode})));e.onSubmit({items:t})})),B=Wt.default.createElement(Yu,{expectedBarcodes:A(),barcodes:E(),animateBackAfterDelete:p,onBarcodeChange:i,sheetContent:g.sheetContent,onNumberClick:e=>a(e),mode:v,indicatorColor:p&&{partial:g.scanningPartiallyColor,complete:g.scanningCompletedColor,notScanned:g.scanningNotScannedColor}}),I={textReplacementArgs:[b.toString()],leftButton:Object.assign(Object.assign({},g.sheetContent.clearAllButton),{onClick:()=>i({type:"clear"})}),rightButton:Object.assign(Object.assign({},g.sheetContent.submitButton),{onClick:()=>id(this,void 0,void 0,(function*(){if(p){const e=g;let t=null;e.partialScannedAlertDialogEnabled&&!y()&&(t=e.partialScannedAlertDialog),e.confirmationAlertDialogEnabled&&y()&&(t=e.confirmationAlertDialog),t?f(t):yield x()}else yield x()}))}),title:g.sheetContent.title},T=Uu("mobile"),k="BUTTON"!==g.sheet.mode&&T?"SMALL"===g.sheet.collapsedVisibleHeight?69:128:0,O=T&&"BUTTON"===g.sheet.mode,D=O?76:0,L=(u?80:0)+D,P=Object(Wt.useContext)(nn),_=e=>{const t=o.find((t=>t.barcode.text===e.text)),n=S(e);return new $u(null==n?void 0:n.count,null==t?void 0:t.count)},R=A().reduce(((e,t)=>e+t.count),0);p&&I.textReplacementArgs.push(R.toString());const F=p?new nd(g.sheetContent.barcodeItemSubtitle.text,o,A()):h,M=!p&&0===b;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(vu.Provider,{value:F},Wt.default.createElement(jt.a,{container:!0,sx:{display:"flex",flexDirection:T?"column":"row",height:`calc(${P.remainingVisibleBodyHeight} - ${k}px)`},alignItems:"stretch"},Wt.default.createElement(jt.a,{id:c,item:!0,ref:t,component:"div",xs:T?12:7,zIndex:100},O&&Wt.default.createElement(Ku,{style:{position:"absolute",marginTop:`calc(${P.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:p?`${b}/${R}`:b.toString(),onClick:()=>l(!s),buttonStyling:g.sheet.listButton}),Wt.default.createElement(xu,{viewFinderPadding:{minTopPadding:P.minTopPaddingForContent,minBottomPadding:L},arOverlay:(()=>{if(p){const e=g.arOverlay;return Object.assign(Object.assign({},e),{counterBadge:Object.assign({},e.badge.partiallyScanned)})}const e=g.arOverlay,t=e.counterBadge;return Object.assign(Object.assign({},e),{counterBadge:Object.assign(Object.assign({},t),{visible:t.visible&&"COUNTING"===v})})})(),containerId:c,barcodeScannerViewConfig:C.current,onCameraPermissionDenied:e.onCameraPermissionDenied,actionBarConfig:e.configuration.actionBar,actionBarBottomPadding:16+D,setActionButtonsVisible:d,arOnBarcodeClick:e=>{i({type:"onARCodeClick",barcode:e})},arOnBarcodeEnter:(e,t,n)=>{if(!n||!t)return;i({type:"setHtmlElements",barcode:e,labelElement:n,polygonElement:t})},scanningPaused:s&&T,cameraConfiguration:e.configuration.cameraConfiguration,onLicenseError:e.onError}),T&&Wt.default.createElement(Fu,{closedSheetVisibleHeight:k,sheetStyle:g.sheet,contentStyle:g.sheetContent,manualCountEditDialog:g.manualCountEditDialog,isPlaceholderVisible:M,onBarcodeChange:e=>i(e),drawerHeaderContentProps:I,isOpen:s,onSwipe:e=>{l("swipe-to-open"===e)}},B)),Zu("tablet")&&Wt.default.createElement(od,{headerProps:I,sheetContent:g.sheetContent,isEmptyStateVisible:M,barcodeList:B})),Wt.default.createElement(Nu,{barcode:r,dialogStyling:g.manualCountEditDialog,onCancel:()=>a(null),setCounter:(e,t)=>{i({type:"onCountEditDialogChange",barcode:e,count:t}),a(null)}}),Wt.default.createElement(td,{open:null!==m,style:m,onDismiss:()=>f(null),onSubmit:x})))}const ad=Object(Wt.createContext)(null),sd={didCatch:!1,error:null};class ld extends Wt.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=sd}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:i,reason:"imperative-api"}),this.setState(sd)}}componentDidCatch(e,t){var n,o;null===(n=(o=this.props).onError)||void 0===n||n.call(o,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:o}=this.props;var i,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,o)&&(null===(i=(r=this.props).onReset)||void 0===i||i.call(r,{next:o,prev:e.resetKeys,reason:"keys"}),this.setState(sd))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:o}=this.props,{didCatch:i,error:r}=this.state;let a=e;if(i){const e={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)a=t(e);else if(n)a=Object(Wt.createElement)(n,e);else{if(null!==o&&!Object(Wt.isValidElement)(o))throw r;a=o}}return Object(Wt.createElement)(ad.Provider,{value:{didCatch:i,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}function cd(){const e=Object(Wt.useRef)(!0);return Object(Wt.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}function ud(e){const t=cd(),[,n]=Object(Wt.useReducer)((e=>e+1),0),o=Object(Wt.useRef)();return Object(Wt.useMemo)((()=>{o.current={loading:!0,value:void 0,error:null}}),[e]),function(e,t){Object(Wt.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=>{o.current=e,t.current&&n()})),e?o.current:null}var dd=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class hd{constructor(e,t){this.barcodeItemMapper=e,this.onError=t,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=e=>xn(e),this.onEvictionListeners=new Set}getBarcodeMappedData(e){const t=this.hash(e);if(!this.cache.has(t)){const n=(()=>dd(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const t=new Vt.BarcodeScannerUIItem({count:1,barcode:e});return this.barcodeItemMapper(t)}{const t=yield F.toDataUrl(yield eg.instance.imageToJpeg(e.sourceImage));return{title:e.text,subtitle:e.format,barcodeImage:t}}})))();this.cache.set(t,n)}return this.cache.get(t)}useBarcodeMappedData(e){const t=Object(Wt.useRef)(!1),n=ud(e&&this.getBarcodeMappedData(e));if(Object(Wt.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 o;return o=n.value?"LOADED":n.error&&!t.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:o}}addOnEvictionListener(e){this.onEvictionListeners.add(e)}removeOnEvictionListener(e){this.onEvictionListeners.delete(e)}}Vt.BarcodeItemErrorState;function md(e){return Wt.default.createElement(ed,{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:zt.Replay,onClick:e.handleRetry}})}function fd(e){const t=Object(Wt.useContext)(nn);return Wt.default.createElement(zt.Box,{sx:{paddingTop:t.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:Ht.b.getColorValue(e.config.background)}},Wt.default.createElement(zt.Box,{sx:{height:t.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},e.config.icon.visible&&Wt.default.createElement(zt.Box,null,Wt.default.createElement(zt.Avatar,{sx:{width:100,height:100,backgroundColor:Ht.b.getColorValue(e.config.iconBackground),margin:"24px"}},Wt.default.createElement(jt.a,{sx:{fontSize:50,color:Ht.b.getColorValue(e.config.icon.color)}}))),Wt.default.createElement(zt.Typography,{sx:{fontSize:20,textAlign:"center"}},Wt.default.createElement(Qt.a,{config:e.config.enableCameraTitle})),Wt.default.createElement(zt.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},Wt.default.createElement(Qt.a,{config:e.config.enableCameraExplanation})),Wt.default.createElement(zt.Box,{sx:{paddingTop:"16px"}},Wt.default.createElement(tn,Object.assign({},e.config.closeButton,{onClick:e.onAppClose})))))}function pd(e){const t=Object(Wt.useRef)(Object(zt.createTheme)({palette:{primary:{main:kn.ScanbotPrimary},secondary:{main:kn.DarkGray}}})),[n,o]=Object(Wt.useState)(!1),[i,r]=Object(Wt.useState)(!1),[a,s]=Object(Wt.useState)(e.configuration.timeouts.initialScanDelay<=0),l=Object(Wt.useRef)(!1),c=Object(Wt.useRef)(),u=Object(Wt.useRef)(),d=e.configuration.useCase,h="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,m=Object(Wt.useMemo)((()=>new hd(null==h?void 0:h.barcodeItemMapper,((e,t)=>{o(!0),c.current=()=>{o(!1),e()},u.current=()=>{o(!1),t()}}))),[]);let f;if(Object(Wt.useMemo)((()=>{Ht.b.setPalette(e.configuration.palette),Ht.b.setLocalization(e.configuration.localization)}),[e.configuration]),Object(Wt.useEffect)((()=>{if(e.configuration.timeouts.autoCancelTimeout>0){const t=setTimeout((()=>{e.onClose()}),e.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(t)}}}),[]),Object(Wt.useEffect)((()=>{if(e.configuration.timeouts.initialScanDelay>0){const t=setTimeout((()=>{s(!0)}),e.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(t)}}}),[]),Object(Wt.useEffect)((()=>{l.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)f=Wt.default.createElement(Tu,{configuration:e.configuration,barcodeMapper:m,onClose:e.onClose,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");f=Wt.default.createElement(rd,{configuration:e.configuration,barcodeMapper:m,onSubmit:e.onSubmit,onError:e.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l})}return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Zt,null),Wt.default.createElement(ld,{onError:e.onError,fallback:Wt.default.createElement("div",null,"Error")},Wt.default.createElement(Ht.a.Provider,{value:Object(Ht.c)(e.configuration.palette)},Wt.default.createElement(zt.ThemeProvider,{theme:t.current},h&&Wt.default.createElement(md,Object.assign({open:n,handleCancel:u.current,handleRetry:c.current,modalOverlayColor:h.modalOverlayColor,dividerColor:h.dividerColor,sheetColor:h.sheetColor},h.errorState)),Wt.default.createElement(jt.a,{sx:{height:`100 * ${Ut}`,width:"100vw",backgroundColor:Ht.b.getColorValue(e.configuration.backgroundColor)}},Wt.default.createElement(on,Object.assign({onBackPress:e.onClose},e.configuration.topBar),!i&&f,i&&Wt.default.createElement(fd,{onAppClose:e.onClose,config:e.configuration.cameraPermission})))))))}class gd{constructor(e){this.document=e}}var vd=n(16);function Cd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.489746)",fill:"transparent"}),Wt.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}),Wt.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}),Wt.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}),Wt.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}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M172.051 142.95V124.876L96.3274 152.397V170.471L172.051 142.95Z",fill:t})))}function bd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.237671)",fill:"transparent"}),Wt.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}),Wt.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}),Wt.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}),Wt.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}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M172.844 188.832H86.629V113.394L172.844 148.212V188.832Z",fill:"url(#paint0_linear_557_1465)"})),Wt.default.createElement("defs",null,Wt.default.createElement("linearGradient",{id:"paint0_linear_557_1465",x1:"130.151",y1:"118.368",x2:"129.736",y2:"188.832",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),Wt.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function yd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",fill:"transparent"}),Wt.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}),Wt.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}),Wt.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}),Wt.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}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M172.844 188.594H86.629V113.156L172.844 147.974V188.594Z",fill:"url(#paint0_linear_557_1462)"})),Wt.default.createElement("defs",null,Wt.default.createElement("linearGradient",{id:"paint0_linear_557_1462",x1:"130.151",y1:"118.13",x2:"129.736",y2:"188.594",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{stopColor:t,stopOpacity:"0"}),Wt.default.createElement("stop",{offset:"0.722496",stopColor:t}))))}function Ad(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.252197)",fill:"transparent"}),Wt.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}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.232 131.072H70.4609V134.579H192.232V131.072Z",fill:t}),Wt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M137.023 124.445H70.4609V127.951H137.023V124.445Z",fill:t}),Wt.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}),Wt.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}),Wt.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}),Wt.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}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M124.937 70.8245H143.011L115.49 146.438H97.4164L124.937 70.8245Z",fill:t})),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M157.336 70.8245H162.725L134.954 146.438H129.565L157.336 70.8245Z",fill:t})))}function Sd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"240",viewBox:"0 0 286 240",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.371094)",fill:"transparent"}),Wt.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}),Wt.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}),Wt.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}),Wt.default.createElement("path",{d:"M166.838 91.7213H128.493V88.658H166.838V91.7213Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M167.041 103.232H128.696V100.169H167.041V103.232Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M177.817 140.631H74.0316V137.568H177.817V140.631Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M208.701 108.301H191.401V105.238H208.701V108.301Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M208.904 119.812H191.603V116.748H208.904V119.812Z",fill:"#A5A5A5"}),Wt.default.createElement("path",{d:"M191.401 128.035V131.098H208.904V128.035H191.401Z",fill:"#A5A5A5"}),Wt.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"}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M126.999 68.3479H145.072L117.552 150.417H99.4783L126.999 68.3479Z",fill:t})),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M164.554 68.3479H169.942L142.171 150.417H136.783L164.554 68.3479Z",fill:t})))}function wd(e){const{color:t}=e;return Wt.default.createElement("svg",{width:"286",height:"239",viewBox:"0 0 286 239",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("rect",{width:"286",height:"238.748",transform:"translate(0 0.118896)",fill:"transparent"}),Wt.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}),Wt.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}),Wt.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}),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M111.248 68.0957H129.322L101.801 150.165H83.7275L111.248 68.0957Z",fill:t})),Wt.default.createElement("g",{style:{mixBlendMode:"soft-light"}},Wt.default.createElement("path",{d:"M154.606 68.0957H159.994L132.223 150.165H126.835L154.606 68.0957Z",fill:t})))}function Ed(e){if(e.source instanceof vd.j)return null;const t="#FFFFFF";return Wt.default.createElement(zt.Box,{sx:{backgroundColor:"rgb(191, 191, 191)",borderRadius:1,width:"100%",height:250}},Wt.default.createElement(zt.Box,{sx:{padding:"10px",display:"flex",alignItems:"center",justifyContent:"center",height:"calc(100% - 20px)"}},(()=>{if(e.source instanceof vd.k)return Wt.default.createElement(Cd,{color:t});if(e.source instanceof vd.i)return Wt.default.createElement(bd,{color:t});if(e.source instanceof vd.d)return Wt.default.createElement(yd,{color:t});if(e.source instanceof vd.a)return Wt.default.createElement(Ad,{color:t});if(e.source instanceof vd.e)return Wt.default.createElement(Sd,{color:t});if(e.source instanceof vd.b)return Wt.default.createElement(wd,{color:t});if(e.source instanceof vd.c){const n=e.source;return Wt.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 xd(e){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(un,{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 * ${Ut} - 2 * 24px)`,backgroundColor:Ht.b.getColorValue(e.config.backgroundColor)}}},Wt.default.createElement(zt.Typography,{component:"div"},Wt.default.createElement(zt.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},Wt.default.createElement(Qt.a,{style:Object.assign({fontWeight:600,fontSize:16},rn(1)),config:e.config.title}),Wt.default.createElement(zt.Box,null,Wt.default.createElement(tn,{onClick:e.onClose,visible:e.config.topBarDoneButton.visible,text:e.config.topBarDoneButton.text,background:e.config.topBarDoneButton.background,foreground:e.config.topBarDoneButton.foreground,icon:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),debugName:"close-introduction"}))),Wt.default.createElement(zt.Box,{sx:{width:"100%",border:`1px solid ${Ht.b.getColorValue(e.config.dividerColor)}`,marginBottom:"12px"}}),Wt.default.createElement(Qt.a,{config:e.config.subtitle,style:{fontSize:16,paddingBottom:"10px"}}),e.config.items.map(((e,t)=>{const n=e.image instanceof vd.j;return Wt.default.createElement(zt.Box,{key:t,sx:{display:"flex",flexDirection:"column"}},Wt.default.createElement(zt.Box,{sx:{pt:n?0:"10px",pb:n?0:"10px"}},Wt.default.createElement(Ed,{source:e.image})),Wt.default.createElement(Qt.a,{style:{fontWeight:500,fontSize:14,padding:1,paddingLeft:15,textIndent:-15},config:e.text}))})))))}function Bd(e){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{sx:{backgroundColor:Ht.b.getColorValue(e.backgroundColor),display:"flex",justifyContent:"space-between",alignItems:"center",height:50,width:"100vw"}},Wt.default.createElement(zt.Box,{style:{flexBasis:0,flexGrow:1}},e.leftContent),Wt.default.createElement(zt.Box,null,Wt.default.createElement("h1",{style:{fontSize:18,fontWeight:500,textAlign:"center"}},Wt.default.createElement(Qt.a,{config:e.centerTitle,replacementArgs:e.centerTitleReplacementArgs}))),Wt.default.createElement(zt.Box,{style:{flexBasis:0,flexGrow:1,textAlign:"right",whiteSpace:"nowrap"}},e.rightContent)))}function Id(e){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Menu,{anchorEl:e.anchor,open:null!==e.anchor,onClose:e.onClose,MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:Ht.b.getColorValue(e.backgroundColor),minWidth:e.minWidth}}}},e.children))}function Td(e){const t=Ht.b.getColorValue(e.textColor);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.MenuItem,{tabIndex:0,disabled:e.disabled,autoFocus:e.autoFocus,"aria-label":Ht.b.getLocalizedText(e.ariaLabel),onClick:e.onClick,sx:Object.assign(Object.assign({"&, &:hover, &:focus":{backgroundColor:"transparent"}},Kt(t)),{paddingX:"8px",marginX:"8px"})},e.children))}function kd(e){const[t,n]=Wt.default.useState(!1),[o,i]=Wt.default.useState(null),r=Boolean(o),a=e.config.screens.camera.topBarCameraSelect;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(tn,{id:"sb-button-camera-select",ariaLabel:Ht.b.getLocalizedText(a.button.accessibilityDescription),onClick:e=>i(e.currentTarget),visible:a.button.visible,text:"",background:{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0},foreground:{color:a.button.color,iconVisible:!0,useShadow:!1},icon:Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(jt.a,null),!r&&Wt.default.createElement(jt.a,{sx:{marginX:"-4px"}}),r&&Wt.default.createElement(jt.a,{sx:{marginX:"-4px"}})),buttonWidth:48}),Wt.default.createElement(Id,{anchor:o,ariaLabelledBy:"sb-button-camera-select",backgroundColor:a.backgroundColor,onClose:()=>i(null),minWidth:"calc(min(100% - 40px, 323px))"},Wt.default.createElement(zt.MenuItem,{disabled:!0,sx:{borderBottomColor:Ht.b.getColorValue(a.dividerColor),borderBottomStyle:"solid",borderBottomWidth:"1px",fontSize:14,marginTop:"-4px",marginBottom:"4px",marginX:"4px",width:"calc(100% - 8px)",opacity:"1 !important"}},Wt.default.createElement(Qt.a,{config:a.title})),e.cameraSelectConfig.availableCameras.map((o=>{const r=o.deviceId===e.cameraSelectConfig.activeCamera.deviceId,s=r?a.menuEntryActive:a.menuEntry;return Wt.default.createElement(Td,{disabled:t,key:o.deviceId,autoFocus:r,ariaLabel:s.accessibilityDescription,textColor:s.title.color,onClick:()=>{i(null),n(!0),e.cameraSelectConfig.onSelect(o).finally((()=>n(!1)))}},s.icon.visible&&Wt.default.createElement(jt.a,{style:{color:Ht.b.getColorValue(s.icon.color),marginRight:"8px"}}),Wt.default.createElement(zt.Typography,{variant:"inherit",noWrap:!0},Wt.default.createElement(Qt.a,{config:Object.assign(Object.assign({},s.title),{text:o.label})})),r&&Wt.default.createElement(jt.a,{style:{color:Ht.b.getColorValue(s.icon.color),marginLeft:"auto",paddingLeft:15,fontSize:16}}))}))))}function Od(e){const t=e.config.screens.camera;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Bd,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:Wt.default.createElement(tn,{ariaLabel:Ht.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:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),debugName:"close-camera-screen"}),centerTitle:t.topBarTitle,rightContent:Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{style:{display:"flex",justifyContent:"space-around",alignItems:"center",whiteSpace:"nowrap",maxWidth:120,marginLeft:"auto"}},Wt.default.createElement(kd,{config:e.config,cameraSelectConfig:e.cameraSelectConfig}),Wt.default.createElement(tn,{ariaLabel:Ht.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:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),onClick:e.onShowIntroButtonClick,buttonWidth:20})))}))}function Dd(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.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}),Wt.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 Ld(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement(Wt.default.Fragment,null,Wt.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}},Wt.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}),Wt.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 Pd(e){return"NoButtonMode"===e.config._type?Wt.default.createElement(Wt.default.Fragment,null):"PagePreviewMode"===e.config._type?Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Button,{"data-sb-button-preview":!0,"arial-label":Ht.b.getLocalizedText(e.config.accessibilityDescription),disabled:!e.enabled,sx:Object.assign({paddingY:"11px"},Kt(e.config.pageCounter.background.fillColor)),onClick:e.onClick},Wt.default.createElement(Xu,{text:`${e.count}`,backgroundColor:Ht.b.getColorValue(e.config.pageCounter.background.fillColor),badgeStyle:{borderColor:Ht.b.getColorValue(e.config.pageCounter.background.strokeColor),borderWidth:e.config.pageCounter.background.strokeWidth,borderStyle:"solid"},overlap:"rectangular",foregroundColor:Ht.b.getColorValue(e.config.pageCounter.foregroundColor)},e.previewImageUrl&&Wt.default.createElement("img",{style:{maxWidth:40,maxHeight:56},src:e.previewImageUrl,alt:"Preview image of the last page"}),!e.previewImageUrl&&Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(e.config.imagePlaceholderColor),width:40,height:56}})))):"TextButtonMode"===e.config._type?Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Button,{"data-sb-button-preview":!0,disabled:!e.enabled,onClick:e.onClick,"aria-label":Ht.b.getLocalizedText(e.config.accessibilityDescription),sx:Object.assign(Object.assign({},Kt(e.config.style.color)),{textTransform:"none"})},Wt.default.createElement(Qt.a,{config:e.config.style,replacementArgs:[`${e.count}`]}))):void 0}function _d(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"65",height:"65",viewBox:"0 0 65 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.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)"},Wt.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"})),Wt.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)"},Wt.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"})),Wt.default.createElement("defs",null,Wt.default.createElement("linearGradient",{id:"paint0_linear_779_506",x1:"60.3614",y1:"33.7149",x2:"37.0173",y2:"64.479",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{stopColor:t}),Wt.default.createElement("stop",{offset:"0.847585",stopColor:t,stopOpacity:"0"})),Wt.default.createElement("linearGradient",{id:"paint1_linear_779_506",x1:"8.69831",y1:"51.1273",x2:"20.179",y2:"68.157",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{stopColor:t}),Wt.default.createElement("stop",{offset:"0.370714",stopColor:t,stopOpacity:"0"})))))}function Rd(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("g",{clipPath:"url(#clip0_780_4723)"},Wt.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"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.4s",repeatCount:"indefinite"})),Wt.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"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.2s",repeatCount:"indefinite"})),Wt.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"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-1.0s",repeatCount:"indefinite"})),Wt.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"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.8s",repeatCount:"indefinite"})),Wt.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"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.6s",repeatCount:"indefinite"})),Wt.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"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.4s",repeatCount:"indefinite"})),Wt.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"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"-0.2s",repeatCount:"indefinite"})),Wt.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"},Wt.default.createElement("animate",{attributeName:"fill-opacity",values:"1;0.75;0.5;0.25;0;0",dur:"1.6s",begin:"0s",repeatCount:"indefinite"}))),Wt.default.createElement("defs",null,Wt.default.createElement("clipPath",{id:"clip0_780_4723"},Wt.default.createElement("rect",{width:"44",height:"44",fill:t,transform:"translate(0.5)"})))))}function Fd(e){const t=Ht.b.getColorValue(e.innerColor),n=Ht.b.getColorValue(e.outerColor);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"65",height:"64",viewBox:"0 0 65 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.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}),Wt.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 Md(e){const t="manual"===e.state||"auto"===e.state&&e.config.enabledInAutoSnappingMode;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Button,{disabled:!t,onClick:e.onClick,"aria-label":Ht.b.getLocalizedText(e.config.accessibilityDescription),"data-sb-button-shutter":!0,sx:Object.assign({width:56,margin:0,padding:0},Kt(e.config.innerColor))},"auto"===e.state&&Wt.default.createElement(_d,{key:"auto",color:e.config.outerColor}),"loading"===e.state&&Wt.default.createElement(Rd,{key:"loading",color:e.config.outerColor}),"manual"===e.state&&Wt.default.createElement(Fd,{key:"manual",innerColor:e.config.innerColor,outerColor:e.config.outerColor})))}function Wd(e){const t={backgroundColor:Ht.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 o=2===n.length?6:12,[i,r]=Wt.default.useState(!0);Object(Wt.useEffect)((()=>{r(e.open)}),[e.open]);const a=i?1:.5;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(un,{modalOverlayColor:e.config.modalOverlayColor,open:e.open,PaperProps:{style:{borderRadius:"8px"}},onClose:e.onCancelClick},Wt.default.createElement(zt.DialogContent,{sx:Object.assign(Object.assign({},t),{p:2,pb:1,textAlign:"center"})},Wt.default.createElement(zt.Typography,{sx:{fontSize:"16px",fontWeight:"bold"}},Wt.default.createElement(Qt.a,{config:e.config.title})),Wt.default.createElement(zt.Typography,{sx:{fontSize:"14px",lineHeight:"16pt",pt:1}},Wt.default.createElement(Qt.a,{config:e.config.subtitle}))),Wt.default.createElement(zt.DialogActions,{sx:Object.assign(Object.assign({},t),{pt:1})},Wt.default.createElement(jt.a,{container:!0,spacing:2},Wt.default.createElement(jt.a,{item:!0,xs:12},Wt.default.createElement(jt.a,{color:Ht.b.getColorValue(e.config.dividerColor)})),n.map(((e,t)=>{return Wt.default.createElement(jt.a,{item:!0,xs:o,key:t},Wt.default.createElement(ln,{disabled:!i,style:Object.assign({width:"100%",opacity:a},(n=e.config,en(Ht.b.getColorValue(n.background.fillColor))?Kt(n.foreground.color):Object.assign(Object.assign({},qt(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,ariaLabel:Ht.b.getLocalizedText(e.config.accessibilityDescription)}));var n}))))))}const Nd=["image/jpeg","image/jpg","image/png","image/bmp","image/dib","image/tiff"];var Vd=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function zd(e){const t=e.config.screens.camera.bottomBar,n="auto"===e.buttonStates.snappingModeState?t.autoSnappingModeButton:t.manualSnappingModeButton,o="auto"===e.buttonStates.snappingModeState?Dd:Ld,i="on"===e.buttonStates.torchState?t.torchOnButton:t.torchOffButton,r=Wt.default.createRef();Object(Wt.useEffect)((()=>{r.current&&(r.current.oncancel=e.onFileSelectDialogClosed)}),[r.current]);const[a,s]=Wt.default.useState(!1),l=()=>s(!0);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{"data-sb-bottom-bar":!0,sx:{backgroundColor:Ht.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:112,display:"flex",alignItems:"center",justifyContent:"center"}},Wt.default.createElement(zt.Box,{sx:{maxWidth:400,display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)"}},Wt.default.createElement("div",null,Wt.default.createElement(Jt,{onClick:e.scanLimitReached?l:e.onFileSelectDialogOpened,enabled:e.buttonStates.importButtonEnabled,config:t.importButton,iconButtonComponent:e.scanLimitReached?"button":"label",icon:({color:e})=>Wt.default.createElement(jt.a,{sx:{color:e}}),debugName:"import"},!e.scanLimitReached&&Wt.default.createElement("input",{hidden:!0,type:"file",accept:Nd.join(", "),ref:r,onChange:t=>{var n,o;e.onFileSelectDialogClosed();const i=null===(o=null===(n=null==t?void 0:t.target)||void 0===n?void 0:n.files)||void 0===o?void 0:o[0];i&&(()=>{Vd(this,void 0,void 0,(function*(){const t=e.sdk.detectAndCropDocument(yield i.arrayBuffer(),"CONSUME_IMAGE");e.onFileUploaded(t)}))})()},value:""}))),Wt.default.createElement("div",null,Wt.default.createElement(Jt,{enabled:e.buttonStates.snappingModeButtonEnabled,config:n,icon:o,onClick:e.snappingModeButtonClick,debugName:"snapping-mode"})),Wt.default.createElement(Md,{state:e.buttonStates.shutterButtonState,onClick:e.scanLimitReached?l:e.onShutterButtonClick,config:e.config.screens.camera.bottomBar.shutterButton}),Wt.default.createElement("div",null,Wt.default.createElement(Jt,{enabled:e.buttonStates.torchButtonEnabled,config:i,icon:t=>(e.buttonStates.torchState,Wt.default.createElement(jt.a,{sx:t})),onClick:e.onTorchButtonClick,debugName:"torch"})),Wt.default.createElement("div",null,Wt.default.createElement(Pd,{enabled:e.buttonStates.reviewButtonEnabled,config:t.previewButton,count:e.buttonStates.reviewButtonCount,previewImageUrl:e.buttonStates.reviewButtonPreviewImageUrl,onClick:e.onReviewButtonClick})))),Wt.default.createElement(Wd,{open:a,config:e.config.screens.camera.limitReachedAlertDialog,onCancelClick:()=>{},onActionClick:()=>{},onOkClick:()=>{s(!1)}}))}function jd(e){const t=Ht.b.getColorValue(e.color),n=221/376,o=`calc(${e.maxHeight} - ${e.paddingTop}px - ${e.paddingBottom}px)`,i=e.maxWidth,r=`min(${`calc(${o} * ${n})`}, ${i})`,a=`min(${o}, ${`calc(${i} / ${n})`})`;return Wt.default.createElement(Wt.default.Fragment,null,Wt.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"},Wt.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"}),Wt.default.createElement("defs",null,Wt.default.createElement("linearGradient",{id:"paint0_linear_441_9693",x1:"110.664",y1:"375.7",x2:"110.664",y2:"1",gradientUnits:"userSpaceOnUse"},Wt.default.createElement("stop",{offset:"0.029183",stopColor:t,stopOpacity:"0"}),Wt.default.createElement("stop",{offset:"0.204626",stopColor:t})))))}function Hd(e){return Wt.default.createElement(Wt.default.Fragment,null,e.config.visible&&Wt.default.createElement(Xt,{styleConfig:{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%"}},Wt.default.createElement(Qt.a,{config:e.config.title})))}function Ud(e){const t=e.config.screens.camera.userGuidance.statesTitles,n="auto"===e.snappingMode?t.readyToCapture:t.captureManual,o={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 Wt.default.createElement(Qt.a,{config:Object.assign(Object.assign({},e.config.screens.camera.userGuidance.title),{text:Ht.b.getLocalizedText(o[e.text])})})}const Zd=`calc(100 * ${Ut} - 50px - 112px)`,Gd="0.5s";function Qd(e){const t=e.config.screens.camera,n=e.bottomUserGuidanceVisible?56:0;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:Zd}},e.documentScannerView),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:Zd,backgroundColor:"white",opacity:e.showCameraBlink?1:0,transition:e.showCameraBlink?"":"opacity 0.5s ease-in"}}),Wt.default.createElement(zt.Box,{sx:{height:Zd,position:"relative"}},Wt.default.createElement(Hd,{config:t.topUserGuidance}),e.bottomUserGuidanceVisible&&Wt.default.createElement(zt.Box,{key:"bottomUserGuidance",sx:{position:"absolute",marginTop:`calc(${Zd} - ${n}px)`,width:"100%",display:"flex",justifyContent:"center"}},Wt.default.createElement(Xt,{styleConfig:{fillColor:t.userGuidance.background.fillColor,strokeColor:t.userGuidance.background.strokeColor,strokeWidth:t.userGuidance.background.strokeWidth,cornerRadius:4},sx:{padding:"6px 10px"}},Wt.default.createElement(Ud,{config:e.config,text:e.userGuidanceText,snappingMode:e.snappingMode}))),t.scanAssistanceOverlay.visible&&!t.viewFinder.visible&&Wt.default.createElement(zt.Box,{key:"scanAssistanceOverlay",sx:{backgroundColor:Ht.b.getColorValue(t.scanAssistanceOverlay.backgroundColor),height:"100%",display:"flex",justifyContent:"center",alignItems:"center",opacity:e.showHand?1:0,transition:"opacity 0.5s"}},Wt.default.createElement(jd,{color:t.scanAssistanceOverlay.foregroundColor,maxWidth:"80%",maxHeight:`min(calc(${Zd} * 0.85), 600px)`,paddingTop:40,paddingBottom:n}))))}const Yd={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 Xd{constructor(e){this.hint=e}}class Kd{constructor(){this.outline=new qd,this.captureButton=new th}}class qd{constructor(){this.polygon=new Jd,this.path=new $d,this.label=new eh}}class Jd{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent",this.strokeWidthCapturing=2,this.strokeWidthSearching=2}}class $d{constructor(){this.stroke="green",this.strokeWidth=4}}class eh{}class th{constructor(){this.color="#FFF"}}class nh extends U.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new r.DocumentScannerParameters,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new Xd(Yd),this.style=new Kd,this.onDocumentDetected=function(e){},this.finder=Object(Z.b)(),this.finder.visible=!1}static fromJson(e){var t,n;const o=new nh;if(U.a.mapValuesDeep(null!==(t=e.finder)&&void 0!==t?t:{},o.finder),this.mapValues(e,o,["text","style","videoConstraints","detectionParameters"]),o.detectionParameters=new r.DocumentScannerParameters(null!==(n=e.detectionParameters)&&void 0!==n?n:{}),e.text&&e.text.hint&&this.mapValues(e.text.hint,o.text.hint),e.style){this.mapValues(e.style,o.style,["outline","captureButton"]);const t=e.style.outline;if(t){this.mapValues(t,o.style.outline,["polygon","path","label"]);const e=t.polygon;e&&this.mapValues(e,o.style.outline.polygon);const n=t.path;n&&this.mapValues(n,o.style.outline.path);const i=t.label;i&&this.mapValues(i,o.style.outline.label)}const n=e.style.captureButton;n&&this.mapValues(n,o.style.captureButton)}return this.mapVideoConstraints(e,o),o}}var oh=n(46),ih={insert:"head",singleton:!1};Hc()(oh.a,ih),oh.a.locals;class rh extends Wt.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return Wt.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],o=this.props.points[(t+1)%this.LINE_COUNT];e.push(Wt.default.createElement("line",{key:t,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:o.x,y2:o.y}))}return e}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}rh.CLASSNAME="scanbot-document-outline";class ah extends Wt.default.Component{constructor(e){super(e),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(e,t,n,o){if(t&&t.some((e=>Number.isNaN(e.x)||Number.isNaN(e.y))))return;const i={points:e,animatedPoints:t,isOk:n,isVisible:o};this.setState(i)}pointStringOrLatestValidPoints(e){return e&&e.length>0?kc.a.toSvgString(e):kc.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=Qc()(rh.CLASSNAME,{[`${rh.CLASSNAME}-ok`]:this.state.isOk},{[`${rh.CLASSNAME}-visible`]:this.state.isVisible},{[`${rh.CLASSNAME}-hidden`]:!this.state.isVisible});return Wt.default.createElement(Ic.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 sh=ah;class lh extends Wt.default.Component{constructor(e){super(e),this.state={path:void 0}}render(){var e,t;return this.state.path?Wt.default.createElement(Ic.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:`${rh.CLASSNAME}-path`}):null}animate(e){const t="M"+kc.a.toSvgString(e)+"z";this.setState({path:t})}clear(){this.setState({path:void 0})}}class ch extends Wt.default.Component{render(){return Wt.default.createElement(Ic.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},Wt.default.createElement(sh,{ref:e=>this.polygon=e,style:this.props.polygonStyle}),Wt.default.createElement(lh,{ref:e=>this.path=e,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(e,t,n){var o;const i="processing"!==n&&!!e,r=null!==(o=this.previous)&&void 0!==o?o:e,a=this.previous?e:void 0;this.polygon.update(r,a,t,i),this.previous=e,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class uh extends Wt.default.Component{constructor(){super(...arguments),this.hintLabelClassName="scanbot-document-hint-text",this.state={text:"Initializing...",ok:!1,validPoints:!1}}render(){const{ok:e,text:t,validPoints:n}=this.state,o="searching"===this.props.action||"capturing"===this.props.action,i="processing"!==this.props.action&&n,r=Qc()({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:i,[`${this.hintLabelClassName}-hidden`]:!i});return Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},Wt.default.createElement(ch,{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}),o&&Wt.default.createElement("label",{ref:e=>this.label=e,style:this.props.style.label,className:r,dangerouslySetInnerHTML:{__html:t}}))}update(e,t,n){this.polygon.update(t,e,this.props.action),this.label&&(this.label.innerHTML=n)}}class dh{static isConvex(e){if(e.length<4)return!0;let t=!1,n=e.length;for(let o=0;o<n;o++){const i=e[(o+2)%n].x-e[(o+1)%n].x,r=e[(o+2)%n].y-e[(o+1)%n].y,a=e[o].x-e[(o+1)%n].x,s=i*(e[o].y-e[(o+1)%n].y)-r*a;if(0==o)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],o=kc.a.subtract(e[1],n),i=t[0],r=kc.a.subtract(t[1],i);if(0===kc.a.cross(o,r))return;const a=kc.a.cross(kc.a.subtract(i,n),o)/kc.a.cross(o,r);return kc.a.add(i,kc.a.multiply(r,a))}}class hh{constructor(e,t=hh.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 dh.distanceBetweenPoints(e,t)/this.maxDistance>this.sensitivity}calculateMaxDistance(e){let t=new kc.a(0,0),n=new kc.a(e.width,e.height);return dh.distanceBetweenPoints(t,n)}}hh.DEFAULT_SENSITIVITY=.5;var mh=n(32),fh=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};bn.b;bn.a;class ph extends bn.c{constructor(e){if(super(e),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>fh(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=nh.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 fh(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(((o,i)=>{Object(Wt.render)(Wt.default.createElement(ph,{container:n,configuration:e,onSuccess:o,onFailure:i,sdk:t}),n)}))}))}detectAndCrop(){var e,t,n,o;return fh(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(ph.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);return n?(Mt.a.debug("Detect & Crop document of size: "+n.height*n.width),yield this.bridge.transferArgs.detectAndCropDocument(n)):null}}catch(e){return null===(o=(n=this.configuration).onError)||void 0===o||o.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 fh(this,void 0,void 0,(function*(){e.componentDidMount.call(this),this.detect(),this.scannerToken=this.bridge.copyArgs.createDocumentScanner(new r.DocumentScannerParameters(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 fh(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,o;return fh(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 o=this.getStatusString(n),i="OK"===o,r=o.startsWith("OK")?this.scalePolygonPointsToPixels(n.pointsNormalized):void 0;this.outline.update(i,r,_.getProperty(this.configuration.text.hint,o)),null===(t=(e=this.props).onStatusStringUpdate)||void 0===t||t.call(e,o),yield this.handleAutoCapture(i,r)}catch(e){null===(o=(n=this.configuration).onError)||void 0===o||o.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,o;return fh(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(bn.c.DEFAULT_DETECTION_RESOLUTION,!1);return n&&this.enabled?yield this.bridge.transferArgs.documentScannerDetect(yield this.scannerToken,n):null}catch(e){return null===(o=(n=this.configuration).onError)||void 0===o||o.call(n,e),null}}))}handleAutoCapture(e,t){return fh(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 hh(e)}if(this.runMovementPredicate(t))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>fh(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,o;const{action:i}=this.state,{configuration:r}=this,a=null===(e=r.style)||void 0===e?void 0:e.captureButton;return Wt.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},Wt.default.createElement(yn.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}})),this.configuration.finder.visible&&Wt.default.createElement(An.a,{ref:e=>{this.finder=e},padding:this.props.viewFinderPadding,guidanceConfiguration:new mh.a({visible:!1}),configuration:this.configuration.finder}),Wt.default.createElement(uh,{ref:e=>{this.outline=e},style:null===(n=r.style)||void 0===n?void 0:n.outline,action:i,autoCaptureSensitivity:this.autoCaptureSensitivity}),!(null!==(o=this.props.hideShutterButton)&&void 0!==o&&o)&&Wt.default.createElement(Xc,{color:(null==a?void 0:a.color)?a.color:"FFF",action:i,onClick:this.enabled?r.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(e){var t;if(e){const n=this.getCameraFrameSize(),o=eu.a.fromHtmlElement(this.camera.video),i=hu.findScale(o,n);(null===(t=this.finder)||void 0===t?void 0:t.holeRect)&&(e=e.map((e=>new kc.a((e.x*this.finder.holeRect.width+this.finder.holeRect.x)/o.width,(e.y*this.finder.holeRect.height+this.finder.holeRect.y)/o.height)))),e=null==(e=hu.convertToViewportPointsFromParentSize(n,e))?void 0:e.map((e=>kc.a.scaleToPoint(e,i.x,i.y,i.scale)))}return e}runMovementPredicate(e){const t=this.polygonMovementPredicate.check(e);return this.polygonMovementPredicate.update(e),t}getCameraFrameSize(){return this.camera.calculateFrameSize(bn.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}ph.DETECT_AND_CROP_RESOLUTION=0;var gh=ph;function vh(e){const[t,n]=Object(Wt.useState)(!1);return Object(Wt.useEffect)((()=>{const t=setTimeout((()=>{n(!0)}),e);return()=>clearTimeout(t)}),[]),t}var Ch=n(13);function bh(e){if(!e.visible)return null;const t=e.config.screens.camera.cameraPermission;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Dialog,{fullScreen:!0,open:e.visible,transitionDuration:0},Wt.default.createElement(Bd,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:null,rightContent:null,centerTitle:e.config.screens.camera.topBarTitle}),Wt.default.createElement(zt.Box,{style:{height:`calc(100 * ${Ut} - 50px)`,backgroundColor:Ht.b.getColorValue(t.background),display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(t.iconBackground),borderRadius:40,width:80,height:80,display:"flex",justifyContent:"center",alignItems:"center"}},Wt.default.createElement(jt.a,{style:{color:Ht.b.getColorValue(t.icon.color)},sx:{fontSize:40}})),Wt.default.createElement("h4",{style:{margin:12}},Wt.default.createElement(Qt.a,{style:{fontSize:18,fontWeight:500},config:t.enableCameraTitle})),Wt.default.createElement(zt.Box,{style:{marginBottom:"12px",maxWidth:350,textAlign:"center"}},Wt.default.createElement(Qt.a,{config:t.enableCameraExplanation})),Wt.default.createElement(zt.Box,null,Wt.default.createElement(tn,{icon:Wt.default.createElement(zt.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 yh{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 Ah=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Sh(e,t){return Ah(this,void 0,void 0,(function*(){return{value:yield e,source:t}}))}var wh=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Eh(e){var t;const n=e.configuration.screens.camera,[o,i]=Object(Wt.useState)(n.cameraConfiguration.autoSnappingEnabled?"auto":"manual"),[r,a]=Object(Wt.useState)(n.cameraConfiguration.flashEnabled),[s,l]=Wt.default.useState(!1),c=Object(Wt.useRef)(null);const[u,d]=Object(Wt.useState)((()=>!yh.get("hasSeenIntroduction",!1)||n.introduction.showAutomatically));Object(Wt.useEffect)((()=>{e.scanLimitReached&&i("manual")}),[e.scanLimitReached]);const h=null===(t=e.pages)||void 0===t?void 0:t[e.pages.length-1],[m,f]=Object(Wt.useState)(null),p=ud(null==h?void 0:h.finalImageUrl());Object(Wt.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"===o,v={minTopPadding:20+(n.topUserGuidance.visible?40:0),minBottomPadding:20+(g?56:0)},[C,b]=Object(Wt.useState)(!1),y=0===n.timeouts.initialScanDelay||vh(n.timeouts.initialScanDelay),[A,S]=Object(Wt.useState)("START"),[w,E]=Object(Wt.useState)(!0),{documentScannerView:x,documentScannerViewRef:B,torchSupported:I,scannerInitialized:T,activeCamera:k,availableCameras:O,setActiveCamera:D}=function(e){const t=e.configuration.screens.camera,n=t.cameraConfiguration,o=!e.pauseAR&&("ENABLED"===t.polygon.visibility||"AUTO_CAPTURE_ONLY"===t.polygon.visibility&&"auto"===e.snappingMode),i=e=>o?Ht.b.getColorValue(e):"#00000000",r=(new nh).videoConstraints;r.facingMode="FRONT"===n.cameraModule?"user":"environment";const a=!e.scanningPaused&&"auto"===e.snappingMode,s={videoConstraints:r,onError:e.onError,backgroundColor:Ht.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:i(t.polygon.autoSnapProgress.strokeColor),strokeWidth:t.polygon.autoSnapProgress.strokeWidth},polygon:{strokeWidthSearching:t.polygon.documentNotOk.strokeWidth,strokeSearching:i(t.polygon.documentNotOk.strokeColor),fillSearching:i(t.polygon.documentNotOk.fillColor),strokeWidthCapturing:t.polygon.documentOk.strokeWidth,fillCapturing:i(t.polygon.documentOk.fillColor),strokeCapturing:i(t.polygon.documentOk.strokeColor)}}},finder:t.viewFinder},l=Object(Wt.useRef)(null);Object(Wt.useEffect)((()=>()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.dispose()}),[]),Object(Wt.useEffect)((()=>{l.current&&(a?l.current.enableAutoCapture():l.current.disableAutoCapture())}),[e.scanningPaused,e.snappingMode,l.current]);const[c,u]=Object(Wt.useState)(!1);Object(Wt.useEffect)((()=>{l.current&&c&&l.current.setTorchState(e.torchEnabled).catch((e=>{}))}),[e.torchEnabled,l.current,c]);const[d,h]=Object(Wt.useState)(!1),[m,f]=Object(Wt.useState)(null),[p,g]=Object(Wt.useState)([]);Object(Wt.useEffect)((()=>{l.current||h(!1)}),[l.current]);const v=Wt.default.createElement(gh,{sdk:e.sdk,ref:l,configuration:s,onSuccess:function(){var e,t,n;u(null===(e=l.current)||void 0===e?void 0:e.getActiveCameraInfo().supportsTorchControl),h(!0);const o=null===(t=l.current)||void 0===t?void 0:t.getActiveCameraInfo();f(null!=o?o:null),g(o?[o]:[]),null===(n=l.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:l,torchSupported:c,scannerInitialized:d,activeCamera:m,availableCameras:p,setActiveCamera:function(e){var t;return f(e),null===(t=l.current)||void 0===t?void 0:t.switchCamera(e.deviceId)}}}({sdk:e.sdk,configuration:e.configuration,onImageCaptured:e=>{R(Sh(Promise.resolve(e),"AUTO_SNAP"))},onUserGuidanceTextUpdate:function(e){(!w||"ERROR_NOTHING_DETECTED"!==e&&L)&&(S(e),E(!1))},snappingMode:o,scanningPaused:e.scanningPaused||!y,torchEnabled:r,onError:t=>{t instanceof Ch.a?b(!0):e.onError(t)},viewFinderPadding:v,pauseAR:!e.visible||e.scanningPaused||!y}),L=vh(1e3),[P,_]=Object(Wt.useState)(!1);Object(Wt.useEffect)((()=>{requestAnimationFrame((()=>_(!1)))}),[P]);function R(t){_(n.captureFeedback.cameraBlinkEnabled),Cn.INSTANCE.vibrate(e.configuration.screens.camera.vibration),e.onImageCaptured(t)}return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{display:e.visible?"block":"none","data-sb-screen-camera":!0,style:{position:"absolute",width:"100vw"}},Wt.default.createElement(xd,{config:n.introduction,isOpen:u,onClose:()=>{d(!1),yh.set("hasSeenIntroduction",!0)}}),Wt.default.createElement(Od,{cameraSelectConfig:{availableCameras:O,activeCamera:k,onSelect:e=>wh(this,void 0,void 0,(function*(){yield D(e),a(!1)}))},onCloseButtonClick:()=>{var t;0===e.pages.length?null===(t=e.onClose)||void 0===t||t.call(e):l(!0)},config:e.configuration,onShowIntroButtonClick:()=>d(!0)}),Wt.default.createElement(Qd,{config:e.configuration,sdk:e.sdk,documentScannerView:x,showHand:w,userGuidanceText:A,bottomUserGuidanceVisible:g,snappingMode:o,showCameraBlink:P}),Wt.default.createElement(zd,{buttonStates:{importButtonEnabled:!e.scanningPaused,snappingModeState:o,snappingModeButtonEnabled:!e.scanLimitReached,torchState:r&&I?"on":"off",torchButtonEnabled:I,reviewButtonCount:e.pages.length,reviewButtonPreviewImageUrl:m,reviewButtonEnabled:e.pages.length>0,shutterButtonState:e.scanningPaused||!T?"loading":o},sdk:e.sdk,onFileSelectDialogOpened:function(){c.current=o,i("manual")},onFileSelectDialogClosed:function(){c.current&&(i(c.current),c.current=null)},onFileUploaded:t=>e.onImageCaptured(Sh(t,"IMPORTED")),snappingModeButtonClick:()=>i((e=>function(e){return"auto"===e?"manual":"auto"}(e))),onTorchButtonClick:()=>a((e=>!e)),onReviewButtonClick:e.onReviewButtonClick,onShutterButtonClick:function(){var e;return wh(this,void 0,void 0,(function*(){E(!1),R(Sh(null===(e=B.current)||void 0===e?void 0:e.detectAndCrop(),"MANUAL_SNAP"))}))},scanLimitReached:e.scanLimitReached,config:e.configuration}),Wt.default.createElement(Wd,{open:s,config:e.configuration.screens.camera.cancelAlertDialog,onCancelClick:()=>l(!1),onActionClick:()=>{},onOkClick:e.onClose}),Wt.default.createElement(bh,{visible:C,onCloseClick:e.onClose,config:e.configuration})))}function xh(e){const t=Object(Wt.useMemo)((()=>Object(zt.createTheme)({components:{MuiButtonBase:{styleOverrides:{root:{"&:hover, &:focus":{outline:"none"}}},defaultProps:{disableRipple:!0}}}})),[]);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.ThemeProvider,{theme:t},Wt.default.createElement(zt.Typography,{component:"div"},e.children)))}function Bh(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_856_1211",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_856_1211)"},Wt.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 Ih(e){const t=e.config,n=e.isQualityAcceptable?t.acceptWhenOkButton:t.acceptWhenNotOkButton;return Wt.default.createElement(zt.Box,{sx:{backgroundColor:Ht.b.getColorValue(e.backgroundColor),height:78,display:"flex",width:"100%",zIndex:1e3,justifyContent:"center"}},Wt.default.createElement(zt.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:24,flexGrow:1,marginX:"min(24px, 5vw)",maxWidth:400}},Wt.default.createElement(Jt,{config:e.config.retakeButton,icon:Bh,enabled:!0,debugName:"ack-retake",onClick:e.onRetake}),Wt.default.createElement(Jt,{config:n,icon:e=>Wt.default.createElement(zt.Check,{style:e}),enabled:!0,debugName:"ack-use-scan",onClick:e.onAccept})))}function Th(e){if(!e.config.visible)return null;const t=Ht.b.getColorValue(e.config.color);return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_447_6066",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_447_6066)"},Wt.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}),Wt.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 kh(e){if(!e.visible||!e.config.visible)return null;const t=e.config.background;return Wt.default.createElement(zt.Box,{style:Object.assign({backgroundColor:Ht.b.getColorValue(t.fillColor),borderWidth:t.strokeWidth,borderColor:Ht.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)},Wt.default.createElement(Th,{config:e.config.icon}),Wt.default.createElement(Qt.a,{style:{marginLeft:"10px",fontSize:"14px",lineHeight:"16px",fontWeight:400},config:e.config.title}))}function Oh(e){return Wt.default.createElement("img",{"data-sb-acknowledgment-image":!0,style:{display:"block",maxWidth:"90%",objectFit:"contain",flex:1,height:`calc(100 * ${Ut} - 78px - 52px - 20px)`},src:e.image,alt:""})}function Dh(e){if(!e.visible)return null;const t=e.isQualityAcceptable;return Wt.default.createElement("div",{style:{display:"inherit",flexDirection:"inherit",justifyContent:"inherit",alignItems:"inherit",height:"100%"}},Wt.default.createElement(Oh,{image:e.base64Image}),Wt.default.createElement(kh,{visible:!t,config:e.banner.config}),Wt.default.createElement(Ih,{isQualityAcceptable:t,backgroundColor:e.bottomBar.backgroundColor,config:e.bottomBar.config,onRetake:e.bottomBar.onRetake,onAccept:e.bottomBar.onAccept}))}function Lh(e){const t=Ht.b.getColorValue(e.config.checkMarkColor),n=Ht.b.getColorValue(e.config.checkMarkBackgroundColor);return Wt.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"},Wt.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}),Wt.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 Ph(e){if(!e.visible)return null;if("PageSnapFeedbackNone"===e.mode._type)return null;if("PageSnapFunnelAnimation"===e.mode._type)return Wt.default.createElement(Oh,{image:e.base64Image});if("PageSnapCheckMarkAnimation"===e.mode._type)return Wt.default.createElement(Lh,{config:e.mode});throw new Error(`Unknown PageSnapFeedbackMode: ${e.mode}`)}var _h=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Rh(e){const t=ud(e.croppedDetectionResult);Object(Wt.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,o=e.configuration.screens.camera.captureFeedback,i=e.configuration.outputSettings,r=n.acknowledgementMode,[a,s]=Wt.default.useState(null),[l,c]=Wt.default.useState(null),u=Wt.default.useRef(null),d=null!==l,h=()=>"ALWAYS"===r||"NONE"!==r&&(!!d&&("BAD_QUALITY"===r&&!l)),m=t=>{setTimeout((()=>{f(),e.onAccept(t,u.current)}),1500)},f=()=>{s(null),c(null)},p={null:-1,VERY_POOR:0,POOR:1,REASONABLE:2,GOOD:3,EXCELLENT:4};let g;Object(Wt.useEffect)((()=>{var a;if(null==t?void 0:t.value){const l=t.value.value;let d=null!==(a=l.croppedImage)&&void 0!==a?a:l.originalImage;function h(){return _h(this,void 0,void 0,(function*(){null!==i.defaultFilter&&"FILTERED_DOCUMENT"===i.documentAnalysisMode&&(d=yield e.sdk.imageFilter(d,i.defaultFilter,"COPY_IMAGE"));if("PageSnapFunnelAnimation"===o.snapFeedbackMode._type||"ALWAYS"===r||"BAD_QUALITY"===r){const t=yield e.sdk.imageToJpeg(d),n=yield F.toBase64(t,!1);s(n)}if("NONE"===r)return c(!0),void m(t.value);if(null===l.croppedImage)return void c(!1);const a=yield e.sdk.createDocumentQualityAnalyzer(),h=yield a.analyze(d);u.current=h.quality,yield a.release();const f=p[h.quality]>=p[n.minimumQuality];c(f),f&&"BAD_QUALITY"===r&&m(t.value)}))}return h(),()=>{f()}}}),[null==t?void 0:t.value]),g=h()?n.backgroundColor:"PageSnapFeedbackNone"===o.snapFeedbackMode._type?"transparent":o.snapFeedbackMode.overlayColor,g=Ht.b.getColorValue(g);const v=o.cameraBlinkEnabled?Gd:"0s";return Wt.default.createElement(jt.a,{open:e.visible},Wt.default.createElement(zt.Fade,{tabIndex:-1,"data-sb-screen-acknowledgment":!0,in:e.visible,timeout:250,style:{position:"absolute",width:"100vw",height:`calc(100 * ${Ut})`,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",transitionDelay:e.visible?v:"0s"}},Wt.default.createElement(zt.Box,{style:{display:e.visible?"flex":"none",flexDirection:"column",justifyContent:"center",alignItems:"center",backgroundColor:g,zIndex:1e3}},Wt.default.createElement(Ph,{visible:!h()&&d,base64Image:a,mode:o.snapFeedbackMode}),Wt.default.createElement(Dh,{visible:h(),isQualityAcceptable:l,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)}}}))))}var Fh=n(2);function Mh(e){const t=e.config.screens.review,[n,o]=Wt.default.useState(null);return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Bd,{backgroundColor:Ht.b.getColorValue(e.config.appearance.topBarBackgroundColor),leftContent:Wt.default.createElement(tn,{disabled:!e.buttonsEnabled,onClick:e.onCloseButtonClick,visible:t.topBarBackButton.visible,text:t.topBarBackButton.text,background:t.topBarBackButton.background,foreground:t.topBarBackButton.foreground,icon:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),debugName:"close-review-screen"}),centerTitle:t.topBarTitle,centerTitleReplacementArgs:[`${e.numPages}`],rightContent:Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(tn,{disabled:!e.buttonsEnabled,onClick:e=>o(e.currentTarget),visible:t.topBarMoreButton.visible,text:"",background:new Fh.BackgroundStyle({strokeColor:"transparent",fillColor:"transparent",strokeWidth:0}),foreground:new Fh.ForegroundStyle({color:t.topBarMoreButton.color,iconVisible:!0}),icon:Wt.default.createElement(jt.a,{sx:{fontSize:24}}),debugName:"more",id:"sb-button-review-more",ariaLabel:Ht.b.getLocalizedText(t.topBarMoreButton.accessibilityDescription)}),Wt.default.createElement(zt.Menu,{anchorEl:n,open:null!==n,onClose:()=>o(null),MenuListProps:{"aria-labelledby":"sb-button-review-more"},slotProps:{paper:{style:{backgroundColor:Ht.b.getColorValue(t.morePopup.backgroundColor)}}}},Wt.default.createElement(Td,{disabled:!1,autoFocus:!0,ariaLabel:t.morePopup.deleteAll.accessibilityDescription,onClick:()=>{o(null),e.onDeleteButtonClick()},textColor:t.morePopup.deleteAll.title.color},Wt.default.createElement(jt.a,{sx:{color:Ht.b.getColorValue(t.morePopup.deleteAll.icon.color),visibility:t.morePopup.deleteAll.icon.visible?"visible":"hidden"}}),Wt.default.createElement(Qt.a,{config:t.morePopup.deleteAll.title,style:{marginLeft:8}}))))}))}function Wh(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.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}),Wt.default.createElement("path",{d:"M16.8624 19V22H18.8624V19H21.8624V17H18.8624V14H16.8624V17H13.8624V19H16.8624Z",fill:t}))}function Nh(e){const t=Ht.b.getColorValue(e.color);return Wt.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.default.createElement("mask",{id:"mask0_856_1229",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},Wt.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),Wt.default.createElement("g",{mask:"url(#mask0_856_1229)"},Wt.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 Vh(){return Zu("tablet")?80:160}function zh(e){const t=Zu("tablet"),n=e.config.screens.review,o=Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Xt,{style:{height:42,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,textTransform:"none",padding:"0 20px",width:"100%"},styleConfig:Object.assign(Object.assign({},n.bottomBar.submitButton.background),{cornerRadius:4})},Wt.default.createElement(Qt.a,{config:{text:Ht.b.getLocalizedText(n.bottomBar.submitButton.text),visible:!0,color:n.bottomBar.submitButton.foreground.color,useShadow:n.bottomBar.submitButton.foreground.useShadow}}))),i=Object.assign(Object.assign({padding:"4px"},qt(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 Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:Vh(),width:"100%"}},Wt.default.createElement(zt.Box,{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:t?"space-between":"center",height:80}},t&&Wt.default.createElement(zt.Box,{visibility:"hidden"}),Wt.default.createElement(zt.Box,{style:{display:"flex",flexDirection:"row",maxWidth:"600px",justifyContent:"space-around",flexGrow:1}},Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.addButton,icon:Wh,onClick:e.onAddPageClick,debugName:"add-page"}),Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.retakeButton,icon:Bh,onClick:e.onRetakeClick,debugName:"retake"}),Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.cropButton,icon:e=>Wt.default.createElement(jt.a,{sx:{color:e}}),onClick:e.onCropClick,debugName:"crop-button"}),Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.rotateButton,icon:e=>Wt.default.createElement(jt.a,{sx:{color:e}}),onClick:e.onRotateClick,debugName:"rotate-button"}),Wt.default.createElement(Jt,{enabled:e.buttonsEnabled,config:n.bottomBar.deleteButton,icon:Nh,onClick:e.onDeleteClick,debugName:"delete-button"})),t&&Wt.default.createElement(zt.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":Ht.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:172,marginX:"4px"},i),onClick:e.onSubmitClick},o)),!t&&Wt.default.createElement(zt.Box,{style:{padding:"12px",display:"flex"}},Wt.default.createElement(zt.Button,{"data-sb-button-submit":!0,disabled:!e.buttonsEnabled,"aria-label":Ht.b.getLocalizedText(n.bottomBar.submitButton.text),sx:Object.assign({flexGrow:1,maxWidth:600,margin:"0 auto"},i),onClick:e.onSubmitClick},o))))}function jh(e){return Wt.default.createElement(zt.Box,{style:{display:"flex",width:"100%",backgroundColor:Ht.b.getColorValue(e.config.backgroundColor),justifyContent:"space-between",alignItems:"end",padding:"16px 0"}},Wt.default.createElement(zt.Box,{style:{width:72,height:20}}),Wt.default.createElement(zt.Box,null,Wt.default.createElement(Xt,{styleConfig:{strokeColor:e.config.pageCounter.background.strokeColor,fillColor:e.config.pageCounter.background.fillColor,strokeWidth:e.config.pageCounter.background.strokeWidth,cornerRadius:4}},Wt.default.createElement(Qt.a,{config:e.config.pageCounter.title,replacementArgs:[`${e.currentPage}`,`${e.totalNumPages}`],style:{fontSize:14,padding:"8px 12px"}}))),Wt.default.createElement(zt.Box,null,Wt.default.createElement(zt.IconButton,{onClick:e.onZoomButtonClick,"aria-label":Ht.b.getLocalizedText(e.config.zoomButton.accessibilityDescription),sx:Object.assign({backgroundColor:Ht.b.getColorValue(e.config.zoomButton.backgroundColor),color:Ht.b.getColorValue(e.config.zoomButton.foregroundColor),margin:"0 16px",visibility:e.config.zoomButton.visible?"visible":"hidden","&:hover":{backgroundColor:Ht.b.getColorValue(e.config.zoomButton.activeBackgroundColor),color:Ht.b.getColorValue(e.config.zoomButton.activeForegroundColor)}},qt(e.config.zoomButton.foregroundColor))},Wt.default.createElement(jt.a,null))))}function Hh(){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wt.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"},Wt.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"})),Wt.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"},Wt.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 Uh(e){return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Dialog,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},slotProps:{backdrop:{style:{backgroundColor:"transparent"}}},open:e.open,transitionDuration:100},Wt.default.createElement(zt.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"}},Wt.default.createElement(Hh,null))))}function Zh(e){const t=e.config.visible&&e.active;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement("div",{style:{width:"40px"}},Wt.default.createElement(zt.Button,{[`data-sb-button-${e.debugName}`]:!0,sx:Object.assign({color:Ht.b.getColorValue(e.config.color),minWidth:"auto",visibility:t?"visible":"hidden",paddingX:"4px",marginX:"4px"},Kt(e.config.color)),onClick:e.onClick,"aria-label":Ht.b.getLocalizedText(e.config.accessibilityDescription)},Wt.default.createElement(e.icon,null))))}var Gh=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Qh(e){var t,n;const o=ud(e.page.finalImageUrl()),[i,r]=Wt.default.useState(null),[a,s]=Wt.default.useState(!1);Object(Wt.useEffect)((()=>{(()=>{Gh(this,void 0,void 0,(function*(){!e.animateRotation&&o.value&&(yield new Promise((e=>{const t=document.createElement("img");t.onload=e,t.src=o.value})),r(o.value),s(!1)),e.animateRotation&&s(!0)}))})()}),[o.value,e.animateRotation]);const l=Wt.default.useRef(null),c=(()=>{const e=l.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 o=1/(e.clientWidth/e.clientHeight),i=t.clientWidth/t.clientHeight;n=t.clientHeight>e.naturalWidth&&t.clientWidth>e.naturalHeight?Math.max(e.naturalHeight/t.clientHeight,1):o<i?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===i&&null!==e.onAnimateRotationDone.current?(null===(n=(t=e.onAnimateRotationDone).current)||void 0===n||n.call(t),null):Wt.default.createElement(Wt.default.Fragment,null,i&&Wt.default.createElement("img",{"data-sb-carousel-page":!0,ref:l,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),c),src:i,alt:`Page ${e.index}`}))}function Yh(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function Xh(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&n.every((n=>{const o=e[n],i=t[n];return"function"==typeof o?`${o}`==`${i}`:Yh(o)&&Yh(i)?Xh(o,i):o===i}))}function Kh(e){return e.concat().sort(((e,t)=>e.name>t.name?1:-1)).map((e=>e.options))}function qh(e){return"number"==typeof e}function Jh(e){return"string"==typeof e}function $h(e){return"boolean"==typeof e}function em(e){return"[object Object]"===Object.prototype.toString.call(e)}function tm(e){return Math.abs(e)}function nm(e){return Math.sign(e)}function om(e,t){return tm(e-t)}function im(e){return cm(e).map(Number)}function rm(e){return e[am(e)]}function am(e){return Math.max(0,e.length-1)}function sm(e,t){return t===am(e)}function lm(e,t=0){return Array.from(Array(e),((e,n)=>t+n))}function cm(e){return Object.keys(e)}function um(e,t){return[e,t].reduce(((e,t)=>(cm(t).forEach((n=>{const o=e[n],i=t[n],r=em(o)&&em(i);e[n]=r?um(o,i):i})),e)),{})}function dm(e,t){return"undefined"!=typeof t.MouseEvent&&e instanceof t.MouseEvent}function hm(){let e=[];const t={add:function(n,o,i,r={passive:!0}){let a;if("addEventListener"in n)n.addEventListener(o,i,r),a=()=>n.removeEventListener(o,i,r);else{const e=n;e.addListener(i),a=()=>e.removeListener(i)}return e.push(a),t},clear:function(){e=e.filter((e=>e()))}};return t}function mm(e,t,n,o){const i=hm(),r=1e3/60;let a=null,s=0,l=0;function c(e){if(!l)return;a||(a=e);const i=e-a;for(a=e,s+=i;s>=r;)n(r),s-=r;o(s/r),l&&t.requestAnimationFrame(c)}function u(){t.cancelAnimationFrame(l),a=null,s=0,l=0}return{init:function(){i.add(e,"visibilitychange",(()=>{e.hidden&&(a=null,s=0)}))},destroy:function(){u(),i.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:u,update:()=>n(r),render:o}}function fm(e=0,t=0){const n=tm(e-t);function o(t){return t<e}function i(e){return e>t}function r(e){return o(e)||i(e)}return{length:n,max:t,min:e,constrain:function(n){return r(n)?o(n)?e:t:n},reachedAny:r,reachedMax:i,reachedMin:o,removeOffset:function(e){return n?e-n*Math.ceil((e-t)/n):e}}}function pm(e,t,n){const{constrain:o}=fm(0,e),i=e+1;let r=a(t);function a(e){return n?tm((i+e)%i):o(e)}function s(){return r}function l(){return pm(e,s(),n)}const c={get:s,set:function(e){return r=a(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function gm(e,t,n,o,i,r,a,s,l,c,u,d,h,m,f,p,g,v,C){const{cross:b,direction:y}=e,A=["INPUT","SELECT","TEXTAREA"],S={passive:!1},w=hm(),E=hm(),x=fm(50,225).constrain(m.measure(20)),B={mouse:300,touch:400},I={mouse:500,touch:600},T=f?43:25;let k=!1,O=0,D=0,L=!1,P=!1,_=!1,R=!1;function F(e){if(!dm(e,o)&&e.touches.length>=2)return M(e);const t=r.readPoint(e),n=r.readPoint(e,b),a=om(t,O),l=om(n,D);if(!P&&!R){if(!e.cancelable)return M(e);if(P=a>l,!P)return M(e)}const u=r.pointerMove(e);a>p&&(_=!0),c.useFriction(.3).useDuration(.75),s.start(),i.add(y(u)),e.preventDefault()}function M(e){const t=u.byDistance(0,!1).index!==d.get(),n=r.pointerUp(e)*(f?I:B)[R?"mouse":"touch"],o=function(e,t){const n=d.add(-1*nm(e)),o=u.byDistance(e,!f).distance;return f||tm(e)<x?o:g&&t?.5*o:u.byIndex(n.get(),0).distance}(y(n),t),i=function(e,t){if(0===e||0===t)return 0;if(tm(e)<=tm(t))return 0;const n=om(tm(e),tm(t));return tm(n/e)}(n,o),a=T-10*i,s=v+i/50;P=!1,L=!1,E.clear(),c.useDuration(a).useFriction(s),l.distance(o,!f),R=!1,h.emit("pointerUp")}function W(e){_&&(e.stopPropagation(),e.preventDefault(),_=!1)}return{init:function(e){if(!C)return;function s(s){($h(C)||C(e,s))&&function(e){const s=dm(e,o);if(R=s,_=f&&s&&!e.buttons&&k,k=om(i.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),c.useFriction(0).useDuration(0),i.set(a),function(){const e=R?n:t;E.add(e,"touchmove",F,S).add(e,"touchend",M).add(e,"mousemove",F,S).add(e,"mouseup",M)}(),O=r.readPoint(e),D=r.readPoint(e,b),h.emit("pointerDown")}(s)}const l=t;w.add(l,"dragstart",(e=>e.preventDefault()),S).add(l,"touchmove",(()=>{}),S).add(l,"touchend",(()=>{})).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",M).add(l,"contextmenu",M).add(l,"click",W,!0)},destroy:function(){w.clear(),E.clear()},pointerDown:function(){return L}}}function vm(e,t){let n,o;function i(e){return e.timeStamp}function r(n,o){const i="client"+("x"===(o||e.scroll)?"X":"Y");return(dm(n,t)?n:n.touches[0])[i]}return{pointerDown:function(e){return n=e,o=e,r(e)},pointerMove:function(e){const t=r(e)-r(o),a=i(e)-i(n)>170;return o=e,a&&(n=e),t},pointerUp:function(e){if(!n||!o)return 0;const t=r(o)-r(n),a=i(e)-i(n),s=i(e)-i(o)>170,l=t/a;return a&&!s&&tm(l)>.1?l:0},readPoint:r}}function Cm(e,t,n,o,i,r,a){const s=[e].concat(o);let l,c,u=[],d=!1;function h(e){return i.measureSize(a.measure(e))}return{init:function(i){r&&(c=h(e),u=o.map(h),l=new ResizeObserver((n=>{($h(r)||r(i,n))&&function(n){for(const r of n){if(d)return;const n=r.target===e,a=o.indexOf(r.target),s=n?c:u[a];if(tm(h(n?e:o[a])-s)>=.5){i.reInit(),t.emit("resize");break}}}(n)})),n.requestAnimationFrame((()=>{s.forEach((e=>l.observe(e)))})))},destroy:function(){d=!0,l&&l.disconnect()}}}function bm(e,t,n,o,i){const r=i.measure(10),a=i.measure(50),s=fm(.1,.99);let l=!1;function c(){return!l&&(!!e.reachedAny(n.get())&&!!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(i){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",u=tm(e[l]-t.get()),d=n.get()-t.get(),h=s.constrain(u/a);n.subtract(d*h),!i&&tm(d)<r&&(n.set(e.constrain(n.get())),o.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function ym(e,t,n,o){const i=t.min+.1,r=t.max+.1,{reachedMin:a,reachedMax:s}=fm(i,r);return{loop:function(t){if(!function(e){return 1===e?s(n.get()):-1===e&&a(n.get())}(t))return;const i=e*(-1*t);o.forEach((e=>e.add(i)))}}}function Am(e,t,n,o,i){const{reachedAny:r,removeOffset:a,constrain:s}=o;function l(e){return e.concat().sort(((e,t)=>tm(e)-tm(t)))[0]}function c(t,o){const i=[t,t+n,t-n];if(!e)return t;if(!o)return l(i);const r=i.filter((e=>nm(e)===o));return r.length?l(r):rm(i)-n}const u={byDistance:function(n,o){const l=i.get()+n,{index:u,distance:d}=function(n){const o=e?a(n):s(n),i=t.map(((e,t)=>({diff:c(e-o,0),index:t}))).sort(((e,t)=>tm(e.diff)-tm(t.diff))),{index:r}=i[0];return{index:r,distance:o}}(l),h=!e&&r(l);return!o||h?{index:u,distance:n}:{index:u,distance:n+c(t[u]-d,0)}},byIndex:function(e,n){return{index:e,distance:c(t[e]-i.get(),n)}},shortcut:c};return u}function Sm(e,t,n,o,i,r,a,s){const l={passive:!0,capture:!0};let c=0;function u(e){"Tab"===e.code&&(c=(new Date).getTime())}return{init:function(d){s&&(r.add(document,"keydown",u,!1),t.forEach(((t,u)=>{r.add(t,"focus",(t=>{($h(s)||s(d,t))&&function(t){if((new Date).getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const r=n.findIndex((e=>e.includes(t)));qh(r)&&(i.useDuration(0),o.index(r,0),a.emit("slideFocus"))}(u)}),l)})))}}}function wm(e){let t=e;function n(e){return qh(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 Em(e,t){const n="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},o=t.style;let i=!1;return{clear:function(){i||(o.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){i||(o.transform=n(e.direction(t)))},toggleActive:function(e){i=!e}}}function xm(e,t,n,o,i,r,a,s,l){const c=im(i),u=im(i).reverse(),d=function(){const e=a[0];return f(m(u,e),n,!1)}().concat(function(){const e=t-a[0]-1;return f(m(c,e),-n,!0)}());function h(e,t){return e.reduce(((e,t)=>e-i[t]),t)}function m(e,t){return e.reduce(((e,n)=>h(e,t)>0?e.concat([n]):e),[])}function f(i,a,c){const u=function(e){return r.map(((n,i)=>({start:n-o[i]+.5+e,end:n+t-.5+e})))}(a);return i.map((t=>{const o=c?0:-n,i=c?n:0,r=c?"end":"start",a=u[t][r];return{index:t,loopPoint:a,slideLocation:wm(-1),translate:Em(e,l[t]),target:()=>s.get()>a?o:i}}))}return{canLoop:function(){return d.every((({index:e})=>h(c.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:o}=e,i=t();i!==o.get()&&(n.to(i),o.set(i))}))},loopPoints:d}}function Bm(e,t,n){let o,i=!1;return{init:function(r){n&&(o=new MutationObserver((e=>{i||($h(n)||n(r,e))&&function(e){for(const n of e)if("childList"===n.type){r.reInit(),t.emit("slidesChanged");break}}(e)})),o.observe(e,{childList:!0}))},destroy:function(){o&&o.disconnect(),i=!0}}}function Im(e,t,n,o){const i={};let r,a=null,s=null,l=!1;return{init:function(){r=new IntersectionObserver((e=>{l||(e.forEach((e=>{const n=t.indexOf(e.target);i[n]=e})),a=null,s=null,n.emit("slidesInView"))}),{root:e.parentElement,threshold:o}),t.forEach((e=>r.observe(e)))},destroy:function(){r&&r.disconnect(),l=!0},get:function(e=!0){if(e&&a)return a;if(!e&&s)return s;const t=function(e){return cm(i).reduce(((t,n)=>{const o=parseInt(n),{isIntersecting:r}=i[o];return(e&&r||!e&&!r)&&t.push(o),t}),[])}(e);return e&&(a=t),e||(s=t),t}}}function Tm(e,t,n,o,i,r,a,s,l){const{startEdge:c,endEdge:u,direction:d}=e,h=qh(n);return{groupSlides:function(e){return h?function(e,t){return im(e).filter((e=>e%t==0)).map((n=>e.slice(n,n+t)))}(e,n):function(e){return e.length?im(e).reduce(((n,h,m)=>{const f=rm(n)||0,p=0===f,g=h===am(e),v=i[c]-r[f][c],C=i[c]-r[h][u],b=!o&&p?d(a):0,y=tm(C-(!o&&g?d(s):0)-(v+b));return m&&y>t+l&&n.push(h),g&&n.push(e.length),n}),[]).map(((t,n,o)=>{const i=Math.max(o[n-1]||0);return e.slice(i,t)})):[]}(e)}}}function km(e,t,n,o,i,r,a){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:h,dragFree:m,dragThreshold:f,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:C,watchResize:b,watchSlides:y,watchDrag:A,watchFocus:S}=r,w={measure:function(e){const{offsetTop:t,offsetLeft:n,offsetWidth:o,offsetHeight:i}=e;return{top:t,right:n+o,bottom:t+i,left:n,width:o,height:i}}},E=w.measure(t),x=n.map(w.measure),B=function(e,t){const n="rtl"===t,o="y"===e,i=!o&&n?-1:1;return{scroll:o?"y":"x",cross:o?"x":"y",startEdge:o?"top":n?"right":"left",endEdge:o?"bottom":n?"left":"right",measureSize:function(e){const{height:t,width:n}=e;return o?t:n},direction:function(e){return e*i}}}(l,c),I=B.measureSize(E),T=function(e){return{measure:function(t){return e*(t/100)}}}(I),k=function(e,t){const n={start:function(){return 0},center:function(e){return o(e)/2},end:o};function o(e){return t-e}return{measure:function(o,i){return Jh(e)?n[e](o):e(t,o,i)}}}(s,I),O=!d&&!!C,D=d||!!C,{slideSizes:L,slideSizesWithGaps:P,startGap:_,endGap:R}=function(e,t,n,o,i,r){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&i,u=function(){if(!c)return 0;const e=n[0];return tm(t[s]-e[s])}(),d=function(){if(!c)return 0;const e=r.getComputedStyle(rm(o));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),h=n.map(a),m=n.map(((e,t,n)=>{const o=!t,i=sm(n,t);return o?h[t]+u:i?h[t]+d:n[t+1][s]-e[s]})).map(tm);return{slideSizes:h,slideSizesWithGaps:m,startGap:u,endGap:d}}(B,E,x,n,D,i),F=Tm(B,I,g,d,E,x,_,R,2),{snaps:M,snapsAligned:W}=function(e,t,n,o,i){const{startEdge:r,endEdge:a}=e,{groupSlides:s}=i,l=s(o).map((e=>rm(e)[a]-e[0][r])).map(tm).map(t.measure),c=o.map((e=>n[r]-e[r])).map((e=>-tm(e))),u=s(c).map((e=>e[0])).map(((e,t)=>e+l[t]));return{snaps:c,snapsAligned:u}}(B,k,E,x,F),N=-rm(M)+rm(P),{snapsContained:V,scrollContainLimit:z}=function(e,t,n,o,i){const r=fm(-t+e,0),a=n.map(((e,t)=>{const{min:o,max:i}=r,a=r.constrain(e),s=!t,c=sm(n,t);return s?i:c||l(o,a)?o:l(i,a)?i:a})).map((e=>parseFloat(e.toFixed(3)))),s=function(){const e=a[0],t=rm(a);return fm(a.lastIndexOf(e),a.indexOf(t)+1)}();function l(e,t){return om(e,t)<1}return{snapsContained:function(){if(t<=e+i)return[r.max];if("keepSnaps"===o)return a;const{min:n,max:l}=s;return a.slice(n,l)}(),scrollContainLimit:s}}(I,N,W,C,2),j=O?V:W,{limit:H}=function(e,t,n){const o=t[0];return{limit:fm(n?o-e:rm(t),o)}}(N,j,d),U=pm(am(j),u,d),Z=U.clone(),G=im(n),Q=mm(o,i,(e=>(({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:o}},i)=>{o||n.constrain(e.pointerDown()),t.seek(i)})(se,e)),(e=>(({scrollBody:e,translate:t,location:n,offsetLocation:o,scrollLooper:i,slideLooper:r,dragHandler:a,animation:s,eventHandler:l,scrollBounds:c,options:{loop:u}},d)=>{const h=e.settled(),m=!c.shouldConstrain(),f=u?h:h&&m;f&&!a.pointerDown()&&(s.stop(),l.emit("settle")),f||l.emit("scroll");const p=n.get()*d+K.get()*(1-d);o.set(p),u&&(i.loop(e.direction()),r.loop()),t.to(o.get())})(se,e))),Y=j[U.get()],X=wm(Y),K=wm(Y),q=wm(Y),J=wm(Y),$=function(e,t,n,o,i,r){let a=0,s=0,l=i,c=r,u=e.get(),d=0;function h(e){return l=e,f}function m(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return a},seek:function(t){const i=t/1e3,r=l*i,h=o.get()-e.get();let m=0;return l?(n.set(e),a+=h/r,a*=c,u+=a,e.add(a*i),m=u-d):(a=0,n.set(o),e.set(o),m=h),s=nm(m),d=u,f},settled:function(){return tm(o.get()-t.get())<.001},useBaseFriction:function(){return m(r)},useBaseDuration:function(){return h(i)},useFriction:m,useDuration:h};return f}(X,q,K,J,h,.68),ee=Am(d,j,N,H,J),te=function(e,t,n,o,i,r,a){function s(i){const s=i.distance,l=i.index!==t.get();r.add(s),s&&(o.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(n.set(t.get()),t.set(i.index),a.emit("select"))}return{distance:function(e,t){s(i.byDistance(e,t))},index:function(e,n){const o=t.clone().set(e);s(i.byIndex(o.get(),n))}}}(Q,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),oe=hm(),ie=Im(t,n,a,p),{slideRegistry:re}=function(e,t,n,o,i,r){const{groupSlides:a}=i,{min:s,max:l}=o;return{slideRegistry:function(){const o=a(r),i=!e||"keepSnaps"===t;return 1===n.length?[r]:i?o:o.slice(s,l).map(((e,t,n)=>{const o=!t,i=sm(n,t);return o?lm(rm(n[0])+1):i?lm(am(r)-rm(n)[0]+1,rm(n)[0]):e}))}()}}(O,C,j,z,F,G),ae=Sm(e,n,re,te,$,oe,a,S),se={ownerDocument:o,ownerWindow:i,eventHandler:a,containerRect:E,slideRects:x,animation:Q,axis:B,dragHandler:gm(B,e,o,i,J,vm(B,i),X,Q,te,$,ee,U,a,T,m,f,v,.68,A),eventStore:oe,percentOfView:T,index:U,indexPrevious:Z,limit:H,location:X,offsetLocation:q,previousLocation:K,options:r,resizeHandler:Cm(t,a,i,n,B,b,w),scrollBody:$,scrollBounds:bm(H,q,J,$,T),scrollLooper:ym(N,H,q,[X,q,K,J]),scrollProgress:ne,scrollSnapList:j.map(ne.get),scrollSnaps:j,scrollTarget:ee,scrollTo:te,slideLooper:xm(B,I,N,L,P,M,j,q,n),slideFocus:ae,slidesHandler:Bm(t,a,y),slidesInView:ie,slideIndexes:G,slideRegistry:re,slidesToScroll:F,target:J,translate:Em(B,t)};return se}const Om={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 Dm(e){function t(e,t){return um(e,t||{})}const n={mergeOptions:t,optionsAtMedia:function(n){const o=n.breakpoints||{},i=cm(o).filter((t=>e.matchMedia(t).matches)).map((e=>o[e])).reduce(((e,n)=>t(e,n)),{});return t(n,i)},optionsMediaQueries:function(t){return t.map((e=>cm(e.breakpoints||{}))).reduce(((e,t)=>e.concat(t)),[]).map(e.matchMedia)}};return n}function Lm(e,t,n){const o=e.ownerDocument,i=o.defaultView,r=Dm(i),a=function(e){let t=[];return{init:function(n,o){return t=o.filter((({options:t})=>!1!==e.optionsAtMedia(t).active)),t.forEach((t=>t.init(n,e))),o.reduce(((e,t)=>Object.assign(e,{[t.name]:t})),{})},destroy:function(){t=t.filter((e=>e.destroy()))}}}(r),s=hm(),l=function(){let e,t={};function n(e){return t[e]||[]}const o={init:function(t){e=t},emit:function(t){return n(t).forEach((n=>n(e,t))),o},off:function(e,i){return t[e]=n(e).filter((e=>e!==i)),o},on:function(e,i){return t[e]=n(e).concat([i]),o},clear:function(){t={}}};return o}(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=r,{on:h,off:m,emit:f}=l,p=B;let g,v,C,b,y=!1,A=c(Om,Lm.globalOptions),S=c(A),w=[];function E(t){const n=km(e,C,b,o,i,t,l);if(t.loop&&!n.slideLooper.canLoop()){return E(Object.assign({},t,{loop:!1}))}return n}function x(t,n){y||(A=c(A,t),S=u(A),w=n||w,function(){const{container:t,slides:n}=S,o=Jh(t)?e.querySelector(t):t;C=o||e.children[0];const i=Jh(n)?C.querySelectorAll(n):n;b=[].slice.call(i||C.children)}(),g=E(S),d([A,...w.map((({options:e})=>e))]).forEach((e=>s.add(e,"change",B))),S.active&&(g.translate.to(g.location.get()),g.animation.init(),g.slidesInView.init(),g.slideFocus.init(O),g.eventHandler.init(O),g.resizeHandler.init(O),g.slidesHandler.init(O),g.options.loop&&g.slideLooper.loop(),C.offsetParent&&b.length&&g.dragHandler.init(O),v=a.init(O,w)))}function B(e,t){const n=k();I(),x(c({startIndex:n},e),t),l.emit("reInit")}function I(){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 T(e,t,n){S.active&&!y&&(g.scrollBody.useBaseFriction().useDuration(!0===t?0:S.duration),g.scrollTo.index(e,n||0))}function k(){return g.index.get()}const O={canScrollNext:function(){return g.index.add(1).get()!==k()},canScrollPrev:function(){return g.index.add(-1).get()!==k()},containerNode:function(){return C},internalEngine:function(){return g},destroy:function(){y||(y=!0,s.clear(),I(),l.emit("destroy"),l.clear())},off:m,on:h,emit:f,plugins:function(){return v},previousScrollSnap:function(){return g.indexPrevious.get()},reInit:p,rootNode:function(){return e},scrollNext:function(e){T(g.index.add(1).get(),e,-1)},scrollPrev:function(e){T(g.index.add(-1).get(),e,1)},scrollProgress:function(){return g.scrollProgress.get(g.location.get())},scrollSnapList:function(){return g.scrollSnapList},scrollTo:T,selectedScrollSnap:k,slideNodes:function(){return b},slidesInView:function(){return g.slidesInView.get()},slidesNotInView:function(){return g.slidesInView.get(!1)}};return x(t,n),setTimeout((()=>l.emit("init")),0),O}function Pm(e={},t=[]){const n=Object(Wt.useRef)(e),o=Object(Wt.useRef)(t),[i,r]=Object(Wt.useState)(),[a,s]=Object(Wt.useState)(),l=Object(Wt.useCallback)((()=>{i&&i.reInit(n.current,o.current)}),[i]);return Object(Wt.useEffect)((()=>{Xh(n.current,e)||(n.current=e,l())}),[e,l]),Object(Wt.useEffect)((()=>{(function(e,t){if(e.length!==t.length)return!1;const n=Kh(e),o=Kh(t);return n.every(((e,t)=>Xh(e,o[t])))})(o.current,t)||(o.current=t,l())}),[t,l]),Object(Wt.useEffect)((()=>{if("undefined"!=typeof window&&window.document&&window.document.createElement&&a){Lm.globalOptions=Pm.globalOptions;const e=Lm(a,n.current,o.current);return r(e),()=>e.destroy()}r(void 0)}),[a,r]),[s,i]}Lm.globalOptions=void 0,Pm.globalOptions=void 0;function _m(e){var t,n,o;const i=Object(Wt.useMemo)((()=>{var t;return null!==(t=e.currentPosition)&&void 0!==t?t:0}),[]),r={duration:20,startIndex:i},[a,s]=Pm(r);Object(Wt.useEffect)((()=>{s&&s.on("select",(()=>{e.onGoToPage(null==s?void 0:s.selectedScrollSnap())}))}),[s]),Object(Wt.useEffect)((()=>{s&&(e.buttonsEnabled?s.reInit({watchDrag:!0}):s.reInit({watchDrag:!1}))}),[e.buttonsEnabled]);const l=Vh();return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{sx:{flexGrow:1,backgroundColor:Ht.b.getColorValue(e.configuration.screens.review.backgroundColor),width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"32px"}},Wt.default.createElement(Zh,{config:e.configuration.screens.review.switchPreviousPageButton,icon:jt.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition-1),active:e.currentPosition>0,debugName:"carousel-back"}),Wt.default.createElement("div",{className:"embla",ref:a,style:{overflow:"hidden",width:"100%",height:"100%"}},Wt.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)=>Wt.default.createElement("div",{className:"embla__slide",key:t.id,style:{position:"relative",minWidth:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0"}},Wt.default.createElement(Qh,{page:t,animateRotation:t.id===e.currentlyRotatingPageId,onAnimateRotationDone:e.onRotationAnimationDone,index:n+1,style:{maxHeight:`calc(100 * ${Ut} - ${50+l+72+32}px)`,maxWidth:"100%"}})))))),Wt.default.createElement(Zh,{config:e.configuration.screens.review.switchNextPageButton,icon:jt.a,onClick:()=>null==s?void 0:s.scrollTo(e.currentPosition+1),active:e.currentPosition<(null===(o=null===(n=e.document)||void 0===n?void 0:n.pages)||void 0===o?void 0:o.length)-1,debugName:"carousel-forward"})))}var Rm=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Fm(e){var t,n,o,i,r,a;const s=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),[l,c]=Wt.default.useState(!1);Object(Wt.useEffect)((()=>{e.visible&&!e.configuration.screens.review.enabled&&e.onSubmit()}),[e.visible]),Object(Wt.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&&!l&&e.onClose()}),[null===(n=e.document)||void 0===n?void 0:n.pages,e.visible,l]);const[u,d]=Object(Wt.useState)(!0),[h,m]=Object(Wt.useState)(null),f=Object(Wt.useRef)(null),[p,g]=Object(Wt.useState)(!1),[v,C]=Object(Wt.useState)(!1);return Object(Wt.useEffect)((()=>{d(!p&&!v)}),[p,v]),e.visible?Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Uh,{open:l}),Wt.default.createElement(Wd,{open:p,config:e.configuration.screens.review.deletePageAlertDialog,onCancelClick:()=>g(!1),onActionClick:()=>{g(!1),e.onRetakeImage(e.currentPosition)},onOkClick:()=>Rm(this,void 0,void 0,(function*(){var t,n,o;c(!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===(o=e.document)||void 0===o?void 0:o.deletePage(s),c(!1),g(!1)}))}),Wt.default.createElement(Wd,{open:v,config:e.configuration.screens.review.deleteAllPagesAlertDialog,onCancelClick:()=>C(!1),onOkClick:()=>Rm(this,void 0,void 0,(function*(){var t;c(!0),yield null===(t=e.document)||void 0===t?void 0:t.deleteAllPages(),c(!1),C(!1)}))}),Wt.default.createElement(zt.Box,{"data-sb-screen-review":!0,display:e.visible?"flex":"none",style:{position:"absolute",width:"100vw",height:`calc(100 * ${Ut})`,flexDirection:"column",alignItems:"center",justifyContent:"center"}},Wt.default.createElement(Mh,{config:e.configuration,numPages:null===(i=null===(o=e.document)||void 0===o?void 0:o.pages)||void 0===i?void 0:i.length,onCloseButtonClick:e.onClose,onDeleteButtonClick:()=>C(!0),buttonsEnabled:u}),Wt.default.createElement(_m,{buttonsEnabled:u,document:e.document,currentPosition:e.currentPosition,onGoToPage:e.onGoToPage,configuration:e.configuration,onRotationAnimationDone:f,currentlyRotatingPageId:h}),Wt.default.createElement(jh,{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)}),Wt.default.createElement(zh,{config:e.configuration,onSubmitClick:e.onSubmit,onAddPageClick:()=>{e.onInsertImage(e.currentPosition+1)},onRetakeClick:()=>e.onRetakeImage(e.currentPosition),onCropClick:()=>e.onCropButtonClick(e.currentPosition),onRotateClick:()=>Rm(this,void 0,void 0,(function*(){var t,n;if(null!==f.current)return;d(!1),c(!0);const o=null===(t=e.document)||void 0===t?void 0:t.pageAtIndex(e.currentPosition),i=new Promise((e=>{f.current=e,m(o.id)})),r=null===(n=e.document)||void 0===n?void 0:n.cropAndRotatePage(o,null,1);yield Promise.all([i,r]),yield o.finalImageUrl(),f.current=null,m(null),d(!0),c(!1)})),onDeleteClick:()=>g(!0),buttonsEnabled:u}))):null}var Mm=function(e,t){return Number(e.toFixed(t))},Wm=function(e,t,n){n&&"function"==typeof n&&n(e,t)},Nm={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}},Vm=function(e){"number"==typeof e&&cancelAnimationFrame(e)},zm=function(e){e.mounted&&(Vm(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function jm(e,t,n,o){if(e.mounted){var i=(new Date).getTime();zm(e),e.animation=function(){if(!e.mounted)return Vm(e.animation);var r=(new Date).getTime()-i,a=(0,Nm[t])(r/n);r>=n?(o(1),e.animation=null):e.animation&&(o(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Hm(e,t,n,o){var i=function(e){var t=e.scale,n=e.positionX,o=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(o))}(t);if(e.mounted&&i){var r=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=t.scale-s,d=t.positionX-l,h=t.positionY-c;0===n?r(t.scale,t.positionX,t.positionY):jm(e,o,n,(function(e){r(s+u*e,l+d*e,c+h*e)}))}}var Um=function(e,t){var n=e.wrapperComponent,o=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!o)throw new Error("Components are not mounted");var r=function(e,t,n){var o=e.offsetWidth,i=e.offsetHeight,r=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:o,wrapperHeight:i,newContentWidth:r,newDiffWidth:o-r,newContentHeight:a,newDiffHeight:i-a}}(n,o,t),a=r.wrapperWidth,s=r.wrapperHeight,l=function(e,t,n,o,i,r,a){var s=e>t?n*(a?1:.5):0,l=o>i?r*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:o-i-l,maxPositionY:l}}(a,r.newContentWidth,r.newDiffWidth,s,r.newContentHeight,r.newDiffHeight,Boolean(i));return l},Zm=function(e,t,n,o){return Mm(o?e<t?t:e>n?n:e:e,2)},Gm=function(e,t){var n=Um(e,t);return e.bounds=n,n};function Qm(e,t,n,o,i,r,a){var s=n.minPositionX,l=n.minPositionY,c=n.maxPositionX,u=n.maxPositionY,d=0,h=0;return a&&(d=i,h=r),{x:Zm(e,s-d,c+d,o),y:Zm(t,l-h,u+h,o)}}function Ym(e,t,n,o,i,r){var a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY,u=o-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:c}):Qm(l-t*u,c-n*u,i,r,0,0,null)}function Xm(e,t,n,o,i){var r=t-(i?o:0);return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=r?r:e}var Km=function(e,t){var n=e.setup.panning.excluded,o=e.isInitialized,i=e.wrapperComponent,r=t.target,a="shadowRoot"in r&&"composedPath"in t?t.composedPath().some((function(e){return e instanceof Element&&(null==i?void 0:i.contains(e))})):null==i?void 0:i.contains(r);return!!(o&&r&&a)&&!Of(r,n)},qm=function(e){var t=e.isInitialized,n=e.isPanning,o=e.setup.panning.disabled;return!(!t||!n||o)};function Jm(e,t,n,o,i){var r=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(null!==a&&null!==s&&(t!==u||n!==d)){var h=Qm(t,n,s,r,o,i,a),m=h.x,f=h.y;e.setTransformState(c,m,f)}}var $m=function(e,t){var n=e.setup,o=e.transformState.scale,i=n.minScale,r=n.disablePadding;return t>0&&o>=i&&!r?t:0};function ef(e,t,n,o,i,r,a,s,l,c){if(i){var u;if(t>a&&n>a)return(u=a+(e-a)*c)>l?l:u<a?a:u;if(t<r&&n<r)return(u=r+(e-r)*c)<s?s:u>r?r:u}return o?t:Zm(e,r,a,i)}function tf(e,t){var n=function(e){var t=e.mounted,n=e.setup,o=n.disabled,i=n.velocityAnimation,r=e.transformState.scale;return!(i.disabled&&!(r>1)&&o&&!t)}(e);if(n){var o=e.lastMousePosition,i=e.velocityTime,r=e.setup,a=e.wrapperComponent,s=r.velocityAnimation.equalToMove,l=Date.now();if(o&&i&&a){var c=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),u=t.x-o.x,d=t.y-o.y,h=u/c,m=d/c,f=l-i,p=u*u+d*d,g=Math.sqrt(p)/f;e.velocity={velocityX:h,velocityY:m,total:g}}e.lastMousePosition=t,e.velocityTime=l}}function nf(e,t){var n=e.transformState.scale;zm(e),Gm(e,n),void 0!==window.TouchEvent&&t instanceof TouchEvent?function(e,t){var n=t.touches,o=e.transformState,i=o.positionX,r=o.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-i,y:s-r}}}(e,t):function(e,t){var n=e.transformState,o=n.positionX,i=n.positionY;e.isPanning=!0;var r=t.clientX,a=t.clientY;e.startCoords={x:r-o,y:a-i}}(e,t)}function of(e){var t=e.transformState.scale,n=e.setup,o=n.minScale,i=n.alignmentAnimation,r=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,c=i.animationType;if(!(r||t<o||!a&&!s)){var u=function(e){var t=e.transformState,n=t.positionX,o=t.positionY,i=t.scale,r=e.setup,a=r.disabled,s=r.limitToBounds,l=r.centerZoomedOut,c=e.wrapperComponent;if(!a&&c&&e.bounds){var u=e.bounds,d=u.maxPositionX,h=u.minPositionX,m=u.maxPositionY,f=u.minPositionY,p=n>d||n<h,g=o>m||o<f,v=Ym(e,n>d?c.offsetWidth:e.setup.minPositionX||0,o>m?c.offsetHeight:e.setup.minPositionY||0,i,e.bounds,s||l),C=v.x,b=v.y;return{scale:i,positionX:p?C:n,positionY:g?b:o}}}(e);u&&Hm(e,u,l,c)}}function rf(e,t,n){var o=e.startCoords,i=e.setup.alignmentAnimation,r=i.sizeX,a=i.sizeY;if(o){var s=function(e,t,n){var o=e.startCoords,i=e.transformState,r=e.setup.panning,a=r.lockAxisX,s=r.lockAxisY,l=i.positionX,c=i.positionY;if(!o)return{x:l,y:c};var u=t-o.x,d=n-o.y;return{x:a?l:u,y:s?c:d}}(e,t,n),l=s.x,c=s.y,u=$m(e,r),d=$m(e,a);tf(e,{x:l,y:c}),Jm(e,l,c,u,d)}}function af(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,o=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var r=null==o?void 0:o.getBoundingClientRect(),a=null==i?void 0:i.getBoundingClientRect(),s=(null==r?void 0:r.width)||0,l=(null==r?void 0:r.height)||0,c=(null==a?void 0:a.width)||0,u=(null==a?void 0:a.height)||0,d=s<c||l<u;!t&&n&&(null==n?void 0:n.total)>.1&&d?function(e){var t=e.velocity,n=e.bounds,o=e.setup,i=e.wrapperComponent,r=function(e){var t=e.mounted,n=e.velocity,o=e.bounds,i=e.setup,r=i.disabled,a=i.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&r&&!t||!n||!o)}(e);if(r&&t&&n&&i){var a=t.velocityX,s=t.velocityY,l=t.total,c=n.maxPositionX,u=n.minPositionX,d=n.maxPositionY,h=n.minPositionY,m=o.limitToBounds,f=o.alignmentAnimation,p=o.zoomAnimation,g=o.panning,v=g.lockAxisY,C=g.lockAxisX,b=p.animationType,y=f.sizeX,A=f.sizeY,S=f.velocityAlignmentTime,w=function(e,t){var n=e.setup.velocityAnimation,o=n.equalToMove,i=n.animationTime,r=n.sensitivity;return o?i*t*r:i}(e,l),E=Math.max(w,S),x=$m(e,y),B=$m(e,A),I=x*i.offsetWidth/100,T=B*i.offsetHeight/100,k=c+I,O=u-I,D=d+T,L=h-T,P=e.transformState,_=(new Date).getTime();jm(e,b,E,(function(t){var n=e.transformState,o=n.scale,i=n.positionX,r=n.positionY,l=((new Date).getTime()-_)/S,p=1-(0,Nm[f.animationType])(Math.min(1,l)),g=1-t,b=i+a*g,y=r+s*g,A=ef(b,P.positionX,i,C,m,u,c,O,k,p),w=ef(y,P.positionY,r,v,m,h,d,L,D,p);i===b&&r===y||e.setTransformState(o,A,w)}))}}(e):of(e)}}function sf(e,t,n,o){var i=e.setup,r=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Xm(Mm(t,2),r,a,0,!1),c=Ym(e,n,o,l,Gm(e,l),s);return{scale:l,positionX:c.x,positionY:c.y}}function lf(e,t,n){var o=e.transformState.scale,i=e.wrapperComponent,r=e.setup,a=r.minScale,s=r.limitToBounds,l=r.zoomAnimation,c=l.disabled,u=l.animationTime,d=l.animationType,h=c||o>=a;if((o>=1||s)&&of(e),!h&&i&&e.mounted){var m=sf(e,a,t||i.offsetWidth/2,n||i.offsetHeight/2);m&&Hm(e,m,u,d)}}var cf=function(){return cf=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},cf.apply(this,arguments)};function uf(e,t,n){if(n||2===arguments.length)for(var o,i=0,r=t.length;i<r;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var df=1,hf=0,mf=0,ff={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}},pf=function(e){var t,n,o,i;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:df,scale:null!==(n=e.initialScale)&&void 0!==n?n:df,positionX:null!==(o=e.initialPositionX)&&void 0!==o?o:hf,positionY:null!==(i=e.initialPositionY)&&void 0!==i?i:mf}},gf=function(e){var t=cf({},ff);return Object.keys(e).forEach((function(n){var o="undefined"!=typeof e[n];if("undefined"!=typeof ff[n]&&o){var i=Object.prototype.toString.call(ff[n]),r="[object Object]"===i,a="[object Array]"===i;t[n]=r?cf(cf({},ff[n]),e[n]):a?uf(uf([],ff[n],!0),e[n],!0):e[n]}})),t},vf=function(e,t,n){var o=e.transformState.scale,i=e.wrapperComponent,r=e.setup,a=r.maxScale,s=r.minScale,l=r.zoomAnimation,c=r.smooth,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var d=c?o*Math.exp(t*n):o+t*n;return Xm(Mm(d,3),s,a,u,!1)};function Cf(e,t,n,o,i){var r=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,c=a.positionY;if(!r)return console.error("No WrapperComponent found");var u=(r.offsetWidth/2-l)/s,d=(r.offsetHeight/2-c)/s,h=sf(e,vf(e,t,n),u,d);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");Hm(e,h,o,i)}function bf(e,t,n,o){var i=e.setup,r=e.wrapperComponent,a=i.limitToBounds,s=pf(e.props),l=e.transformState,c=l.scale,u=l.positionX,d=l.positionY;if(r){var h=Um(e,s.scale),m=Qm(s.positionX,s.positionY,h,a,0,0,r),f={scale:s.scale,positionX:m.x,positionY:m.y};c===s.scale&&u===s.positionX&&d===s.positionY||(null==o||o(),Hm(e,f,t,n))}}var yf=function(e){return function(t,n,o){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===o&&(o="easeOut"),Cf(e,1,t,n,o)}},Af=function(e){return function(t,n,o){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===o&&(o="easeOut"),Cf(e,-1,t,n,o)}},Sf=function(e){return function(t,n,o,i,r){void 0===i&&(i=300),void 0===r&&(r="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,c=a.scale,u=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&u&&d){var h={positionX:Number.isNaN(t)?s:t,positionY:Number.isNaN(n)?l:n,scale:Number.isNaN(o)?c:o};Hm(e,h,i,r)}}},wf=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),bf(e,t,n)}},Ef=function(e){return function(t,n,o){void 0===n&&(n=200),void 0===o&&(o="easeOut");var i=e.transformState,r=e.wrapperComponent,a=e.contentComponent;if(r&&a){var s=Lf(t||i.scale,r,a);Hm(e,s,n,o)}}},xf=function(e){return function(t,n,o,i){void 0===o&&(o=600),void 0===i&&(i="easeOut"),zm(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 o=e.wrapperComponent,i=e.contentComponent,r=e.transformState,a=e.setup,s=a.limitToBounds,l=a.minScale,c=a.maxScale;if(!o||!i)return r;var u,d,h,m,f,p,g,v,C=o.getBoundingClientRect(),b=t.getBoundingClientRect(),y=(u=o,d=i,h=r,m=t.getBoundingClientRect(),f=u.getBoundingClientRect(),p=d.getBoundingClientRect(),g=f.x*h.scale,v=f.y*h.scale,{x:(m.x-p.x+g)/h.scale,y:(m.y-p.y+v)/h.scale}),A=y.x,S=y.y,w=b.width/r.scale,E=b.height/r.scale,x=o.offsetWidth/w,B=o.offsetHeight/E,I=Xm(n||Math.min(x,B),l,c,0,!1),T=(C.width-w*I)/2,k=(C.height-E*I)/2,O=Qm((C.left-A)*I+T,(C.top-S)*I+k,Um(e,I),s,0,0,o);return{positionX:O.x,positionY:O.y,scale:I}}(e,a,n);Hm(e,s,o,i)}}},Bf=function(e){return{instance:e,zoomIn:yf(e),zoomOut:Af(e),setTransform:Sf(e),resetTransform:wf(e),centerView:Ef(e),zoomToElement:xf(e)}},If=function(e){return{instance:e,state:e.transformState}},Tf=function(e){var t={};return Object.assign(t,If(e)),Object.assign(t,Bf(e)),t};function kf(){try{return{get passive(){return!0,!1}}}catch(e){return!1}}var Of=function(e,t){return t.some((function(t){return e.matches("".concat(t,", .").concat(t,", ").concat(t," *, .").concat(t," *"))}))},Df=function(e){e&&clearTimeout(e)},Lf=function(e,t,n){var o=n.offsetWidth*e,i=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-o)/2,positionY:(t.offsetHeight-i)/2}};function Pf(e,t,n){var o=t.getBoundingClientRect(),i=0,r=0;if("clientX"in e)i=(e.clientX-o.left)/n,r=(e.clientY-o.top)/n;else{var a=e.touches[0];i=(a.clientX-o.left)/n,r=(a.clientY-o.top)/n}return(Number.isNaN(i)||Number.isNaN(r))&&console.error("No mouse or touch offset found"),{x:i,y:r}}var _f=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))},Rf=function(e,t){var n=e.props,o=n.onWheel,i=n.onZoom,r=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,c=a.centerZoomedOut,u=a.zoomAnimation,d=a.wheel,h=a.disablePadding,m=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,o,i=function(e){return e?e.deltaY<0?1:-1:0}(e);return o=i,"number"==typeof(n=t)?n:o}(t,null),b=function(e,t,n,o,i){var r=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,c=s.minScale,u=s.zoomAnimation,d=s.disablePadding,h=u.size,m=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var f=r+t*n;if(i)return f;var p=!o&&!m;return Xm(Mm(f,3),c,l,h,p&&!d)}(e,C,m?v*Math.abs(t.deltaY):g,!t.ctrlKey);if(s!==b){var y=Gm(e,b),A=Pf(t,r,s),S=l&&(p||0===f||c||h),w=Ym(e,A.x,A.y,b,y,S),E=w.x,x=w.y;e.previousWheelEvent=t,e.setTransformState(b,E,x),Wm(Tf(e),t,o),Wm(Tf(e),t,i)}},Ff=function(e,t){var n=e.props,o=n.onWheelStop,i=n.onZoomStop;Df(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(lf(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var r=function(e,t){var n=e.previousWheelEvent,o=e.transformState.scale,i=e.setup,r=i.maxScale,a=i.minScale;return!!n&&(o<r||o>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&&(Df(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,Wm(Tf(e),t,o),Wm(Tf(e),t,i))}),160))},Mf=function(e){for(var t=0,n=0,o=0;o<2;o+=1)t+=e.touches[o].clientX,n+=e.touches[o].clientY;return{x:t/2,y:n/2}},Wf=function(e,t){var n=e.contentComponent,o=e.pinchStartDistance,i=e.wrapperComponent,r=e.transformState.scale,a=e.setup,s=a.limitToBounds,l=a.centerZoomedOut,c=a.zoomAnimation,u=a.alignmentAnimation,d=c.disabled,h=c.size;if(null!==o&&n){var m=function(e,t,n){var o=n.getBoundingClientRect(),i=e.touches,r=Mm(i[0].clientX-o.left,5),a=Mm(i[0].clientY-o.top,5);return{x:(r+Mm(i[1].clientX-o.left,5))/2/t,y:(a+Mm(i[1].clientY-o.top,5))/2/t}}(t,r,n);if(Number.isFinite(m.x)&&Number.isFinite(m.y)){var f=_f(t),p=function(e,t){var n=e.pinchStartScale,o=e.pinchStartDistance,i=e.setup,r=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=i.disablePadding,c=s.size,u=s.disabled;if(!n||null===o||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:Xm(Mm(t/o*n,2),a,r,c,!u&&!l)}(e,f),g=Mf(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 b=Gm(e,p),y=s&&(d||0===h||l),A=Ym(e,m.x,m.y,p,b,y),S=A.x,w=A.y;e.pinchMidpoint=m,e.lastDistance=f;var E=u.sizeX,x=u.sizeY,B=Qm(S+v,w+C,b,s,$m(e,E),$m(e,x),i),I=B.x,T=B.y;e.setTransformState(p,I,T)}}}},Nf=function(e,t){var n=e.props.onZoomStop,o=e.setup.doubleClick.animationTime;Df(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout((function(){e.doubleClickStopEventTimer=null,Wm(Tf(e),t,n)}),o)};function Vf(e,t){var n=e.setup,o=e.doubleClickStopEventTimer,i=e.transformState,r=e.contentComponent,a=i.scale,s=e.props,l=s.onZoomStart,c=s.onZoom,u=n.doubleClick,d=u.disabled,h=u.mode,m=u.step,f=u.animationTime,p=u.animationType;if(!d&&!o){if("reset"===h)return function(e,t){var n=e.props,o=n.onZoomStart,i=n.onZoom,r=e.setup.doubleClick,a=r.animationTime,s=r.animationType;Wm(Tf(e),t,o),bf(e,a,s,(function(){return Wm(Tf(e),t,i)})),Nf(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}(h,e.transformState.scale),v=vf(e,g,m);if(a!==v){Wm(Tf(e),t,l);var C=Pf(t,r,a),b=sf(e,v,C.x,C.y);if(!b)return console.error("Error during zoom event. New transformation state was not calculated.");Wm(Tf(e),t,c),Hm(e,b,f,p),Nf(e,t)}}}var zf=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,Gm(t,t.transformState.scale),t.setup=gf(e)},this.initializeWindowEvents=function(){var e,n,o=kf(),i=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==i?void 0:i.defaultView;null===(n=t.wrapperComponent)||void 0===n||n.addEventListener("wheel",t.onWheelPanning,o),null==r||r.addEventListener("mousedown",t.onPanningStart,o),null==r||r.addEventListener("mousemove",t.onPanning,o),null==r||r.addEventListener("mouseup",t.onPanningStop,o),null==i||i.addEventListener("mouseleave",t.clearPanning,o),null==r||r.addEventListener("keyup",t.setKeyUnPressed,o),null==r||r.addEventListener("keydown",t.setKeyPressed,o)},this.cleanupWindowEvents=function(){var e,n,o=kf(),i=null===(e=t.wrapperComponent)||void 0===e?void 0:e.ownerDocument,r=null==i?void 0:i.defaultView;null==r||r.removeEventListener("mousedown",t.onPanningStart,o),null==r||r.removeEventListener("mousemove",t.onPanning,o),null==r||r.removeEventListener("mouseup",t.onPanningStop,o),null==i||i.removeEventListener("mouseleave",t.clearPanning,o),null==r||r.removeEventListener("keyup",t.setKeyUnPressed,o),null==r||r.removeEventListener("keydown",t.setKeyPressed,o),document.removeEventListener("mouseleave",t.clearPanning,o),zm(t),null===(n=t.observer)||void 0===n||n.disconnect()},this.handleInitializeWrapperEvents=function(e){var n=kf();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(Tf(t))})),n&&(t.setCenter(),t.observer=new ResizeObserver((function(){var n,o=e.offsetWidth,i=e.offsetHeight;(o>0||i>0)&&(t.onInitCallbacks.forEach((function(e){return e(Tf(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,o=n.disabled,i=n.wheelDisabled,r=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,c=t.target;return!(!s||l||o||!c||i&&!t.ctrlKey||r&&t.ctrlKey||Of(c,a))}(t,e);n&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(function(e,t){var n=e.props,o=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(zm(e),Wm(Tf(e),t,o),Wm(Tf(e),t,i))}(t,e),Rf(t,e),Ff(t,e))}},this.onWheelPanning=function(e){var n=t.setup,o=n.disabled,i=n.wheel,r=n.panning;if(t.wrapperComponent&&t.contentComponent&&!o&&i.wheelDisabled&&!r.disabled&&r.wheelPanning&&!e.ctrlKey){e.preventDefault(),e.stopPropagation();var a=t.transformState,s=a.positionX,l=a.positionY,c=s-e.deltaX,u=l-e.deltaY,d=r.lockAxisX?s:c,h=r.lockAxisY?l:u,m=t.setup.alignmentAnimation,f=m.sizeX,p=m.sizeY,g=$m(t,f),v=$m(t,p);d===s&&h===l||Jm(t,d,h,g,v)}},this.onPanningStart=function(e){var n=t.setup.disabled,o=t.props.onPanningStart;n||Km(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(),zm(t),nf(t,e),Wm(Tf(t),e,o))},this.onPanning=function(e){var n=t.setup.disabled,o=t.props.onPanning;n||qm(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),rf(t,e.clientX,e.clientY),Wm(Tf(t),e,o))},this.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(af(t),Wm(Tf(t),e,n))},this.onPinchStart=function(e){var n=t.setup.disabled,o=t.props,i=o.onPinchingStart,r=o.onZoomStart;if(!n){var a=function(e,t){var n=e.setup.pinch,o=n.disabled,i=n.excluded,r=e.isInitialized,a=t.target;return!(!r||o||!a||Of(a,i))}(t,e);a&&(function(e,t){var n=_f(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1;var o=Mf(t);e.pinchLastCenterX=o.x,e.pinchLastCenterY=o.y,zm(e)}(t,e),zm(t),Wm(Tf(t),e,i),Wm(Tf(t),e,r))}},this.onPinch=function(e){var n=t.setup.disabled,o=t.props,i=o.onPinching,r=o.onZoom;if(!n){var a=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,o=e.pinchStartDistance;return!(!n||t||!o)}(t);a&&(e.preventDefault(),e.stopPropagation(),Wf(t,e),Wm(Tf(t),e,i),Wm(Tf(t),e,r))}},this.onPinchStop=function(e){var n,o,i=t.props,r=i.onPinchingStop,a=i.onZoomStop;t.pinchStartScale&&(o=(n=t).pinchMidpoint,n.velocity=null,n.lastDistance=null,n.pinchMidpoint=null,n.pinchStartScale=null,n.pinchStartDistance=null,lf(n,null==o?void 0:o.x,null==o?void 0:o.y),Wm(Tf(t),e,r),Wm(Tf(t),e,a))},this.onTouchPanningStart=function(e){var n=t.setup.disabled,o=t.props.onPanningStart;if(!n&&Km(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,zm(t);var i=e.touches,r=1===i.length,a=2===i.length;r&&(zm(t),nf(t,e),Wm(Tf(t),e,o)),a&&t.onPinchStart(e)}},this.onTouchPanning=function(e){var n=t.setup.disabled,o=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!qm(t))return;e.preventDefault(),e.stopPropagation();var i=e.touches[0];rf(t,i.clientX,i.clientY),Wm(Tf(t),e,o)}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,o=e.setup,i=e.wrapperComponent,r=o.doubleClick,a=r.disabled,s=r.excluded,l=t.target,c=null==i?void 0:i.contains(l);return!(!(n&&l&&c)||a||Of(l,s))}(t,e);n&&Vf(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,o){var i=t.props.onTransformed;if(Number.isNaN(e)||Number.isNaN(n)||Number.isNaN(o))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=o,t.applyTransformation();var r=Tf(t);t.onChangeCallbacks.forEach((function(e){return e(r)})),Wm(r,{scale:e,positionX:n,positionY:o},i)}},this.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=Lf(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},this.handleTransformStyles=function(e,n,o){return t.props.customTransform?t.props.customTransform(e,n,o):function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")}(e,n,o)},this.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,o=e.positionX,i=e.positionY,r=t.handleTransformStyles(o,i,n);t.contentComponent.style.transform=r}},this.getContext=function(){return Tf(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,Gm(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(n),t.initializeWindowEvents(),t.isInitialized=!0;var o=Tf(t);Wm(o,void 0,t.props.onInit)},this.props=e,this.setup=gf(this.props),this.transformState=pf(this.props)},jf=Wt.default.createContext(null),Hf=Wt.default.forwardRef((function(e,t){var n,o,i=Object(Wt.useRef)(new zf(e)).current,r=(n=e.children,o=Bf(i),"function"==typeof n?n(o):n);return Object(Wt.useImperativeHandle)(t,(function(){return Bf(i)}),[i]),Object(Wt.useEffect)((function(){i.update(e)}),[i,e]),Wt.default.createElement(jf.Provider,{value:i},r)}));Wt.default.forwardRef((function(e,t){var n,o=Object(Wt.useRef)(null),i=Object(Wt.useContext)(jf);return Object(Wt.useEffect)((function(){return i.onChange((function(e){if(o.current){o.current.style.transform=i.handleTransformStyles(0,0,1/e.instance.transformState.scale)}}))}),[i]),Wt.default.createElement("div",cf({},e,{ref:(n=[o,t],function(e){n.forEach((function(t){"function"==typeof t?t(e):null!=t&&(t.current=e)}))})}))}));var Uf="transform-component-module_wrapper__SPB86",Zf="transform-component-module_content__FBWxo";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.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 Gf=function(e){var t=e.children,n=e.wrapperClass,o=void 0===n?"":n,i=e.contentClass,r=void 0===i?"":i,a=e.wrapperStyle,s=e.contentStyle,l=e.wrapperProps,c=void 0===l?{}:l,u=e.contentProps,d=void 0===u?{}:u,h=Object(Wt.useContext)(jf),m=h.init,f=h.cleanupWindowEvents,p=Object(Wt.useRef)(null),g=Object(Wt.useRef)(null);return Object(Wt.useEffect)((function(){var e=p.current,t=g.current;return null!==e&&null!==t&&m&&(null==m||m(e,t)),function(){null==f||f()}}),[]),Wt.default.createElement("div",cf({},c,{ref:p,className:"react-transform-wrapper ".concat(Uf," ").concat(o),style:a}),Wt.default.createElement("div",cf({},d,{ref:g,className:"react-transform-component ".concat(Zf," ").concat(r),style:s}),t))};function Qf(e){var t;const n=ud(null===(t=e.page)||void 0===t?void 0:t.finalImageUrl());if(!(e.visible&&n.value))return null;const o=e.config.closeButton;return Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(zt.Box,{style:{touchAction:"none",backgroundColor:Ht.b.getColorValue(e.config.overlayColor)}},Wt.default.createElement(zt.Box,{style:{textAlign:"right",height:"45px",paddingRight:8}},Wt.default.createElement(tn,{onClick:e.onCloseButtonClick,visible:o.visible,text:o.text,background:o.background,foreground:o.foreground,ariaLabel:Ht.b.getLocalizedText(o.accessibilityDescription),iconPosition:"right",icon:Wt.default.createElement(jt.a,{style:{paddingLeft:4}})})),Wt.default.createElement(Hf,{centerOnInit:!0},Wt.default.createElement(Gf,{wrapperStyle:{width:"100%"},contentStyle:{width:"100%"}},Wt.default.createElement(zt.Box,{style:{width:"100%",height:`calc(100 *${Ut} - 45px)`,display:"flex",justifyContent:"center",alignItems:"center",touchAction:"none"}},Wt.default.createElement("img",{src:n.value,alt:"Zoomed image",style:{maxWidth:"100%",maxHeight:"100%"}}))))))}var Yf=n(40);class Xf{constructor(){this.disabled=!1,this.color="transparent"}}class Kf{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20,this.filter=""}}class qf{constructor(){this.color="#1ec31e",this.width=4}}class Jf{constructor(){this.padding=10}}class $f{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class ep{constructor(){this.width=2,this.color="white"}}class tp{constructor(){this.size=20,this.color="white"}}class np extends Yf.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new Jf,this.style.magneticLines=new Xf,this.style.polygon=new qf,this.style.polygon.handles=new Kf,this.style.magnifier=new $f,this.style.magnifier.border=new ep,this.style.magnifier.crosshair=new tp}static fromJson(e){const t=new np;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 op extends Wt.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(e){return Wt.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},Wt.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,o,i,r;return Wt.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===(i=null===(o=this.props.lines)||void 0===o?void 0:o.vertical)||void 0===i?void 0:i.scaled)||void 0===r?void 0:r.map((e=>this.fromPoint(e))))}snapToClosestIfAnyAreClose(){var e,t,n,o;const i=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(i.isHorizontal&&(r=null===(o=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===o?void 0:o.scaled),!r||0===r.length)return;const a=this.midPoint(i.points[0].coordinates,i.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:i})}distanceToLine(e,t){const n=t.x-e.start.x,o=t.y-e.start.y,i=e.end.x-e.start.x,r=e.end.y-e.start.y,a=i*i+r*r;if(0===a)return 1/0;const s=(n*i+o*r)/a;let l;return l=s<=0?e.start:s>=1?e.end:new kc.a(e.start.x+s*i,e.start.y+s*r),kc.a.distance(t,l)}midPoint(e,t){return new kc.a((e.x+t.x)/2,(e.y+t.y)/2)}}class ip extends Wt.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 rp extends ip{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],o=Wt.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},Wt.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));e.push(o)}return e}cornerTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=kc.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),o=this.items[t],i=kc.a.fromHtmlElement(o);this.parentOffset=new kc.a(n.x-i.x,n.y-i.y),this.props.cornerMoveStart({index:t,point:this.props.points[t]})}cornerTouchMove(e,t){if(!this.parentOffset)return;const n=kc.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),{x:o,y:i}=Object(Ru.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 kc.a(o+r,i+r),dh.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 Wt.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 ap extends ip{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 o=this.props.points[this.nextIndex(t)];const i=Wt.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(o.x-n.x)/2-this.pointSize/2+"px",top:n.y+(o.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},Wt.default.createElement("div",{style:this.invisibleHandleStyle}));e.push(i)}return e}lineTouchStart(e,t){e.target.setPointerCapture(e.pointerId);const n=kc.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),o=this.items[t],i=kc.a.fromHtmlElement(o),r=this.props.points[t],a=this.props.points[this.nextIndex(t)];this.point0Start=_.copy(this.props.points[this.previousIndex(t)]),this.point1Start=_.copy(r),this.point2Start=_.copy(a),this.point3Start=_.copy(this.props.points[this.nextIndex(this.nextIndex(t))]),this.point1Offset=new kc.a(r.x-i.x,r.y-i.y),this.point2Offset=new kc.a(a.x-i.x,a.y-i.y),this.parentOffset=new kc.a(n.x-i.x,n.y-i.y)}lineTouchMove(e,t){if(!this.parentOffset)return;const n=kc.a.fromCoordinates(e.clientX,e.clientY,this.props.rotations,this.props.scale),o=this.props.points[this.previousIndex(t)];let i=new kc.a(null,null),r=new kc.a(null,null);const a=this.props.points[this.nextIndex(t+1)],s=n.x-this.parentOffset.x,l=n.y-this.parentOffset.y;if(this.isHorizontal(t)){const e=l+this.point1Offset.y,t=l+this.point2Offset.y,n=e-this.point1Start.y;i.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)),i.y=e,r.y=t}else{const e=s+this.point1Offset.x,t=s+this.point2Offset.x,n=e-this.point1Start.x;i.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)),i.x=e,r.x=t}i=kc.a.clamp(i,this.props.containerSize),r=kc.a.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,i,o,this.isHorizontal(t)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(t)?"y":"x")||this.areEdgesCrossing(o,i,r,a)||dh.isConvex([o,i,r,a])&&(this.props.points[t].x=i.x,this.props.points[t].y=i.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:i},{index:this.nextIndex(t),coordinates:r}],previousPoint:o,nextPoint:a,isHorizontal:this.isHorizontal(t)}))}lineTouchEnd(e){e.target.releasePointerCapture(e.pointerId),this.parentOffset=null}isNearOpposingPoint(e,t,n,o){if(e[o]>n[o]){if(t[o]-10<n[o])return!0}else if(t[o]>n[o]-10)return!0;return!1}areEdgesCrossing(e,t,n,o){const i=e.x,r=e.y,a=t.x,s=t.y,l=n.x,c=n.y,u=o.x,d=o.y;return((i-l)*(s-c)-(r-c)*(a-l))*((i-u)*(s-d)-(r-d)*(a-u))<0&&((l-i)*(d-r)-(c-r)*(u-i))*((l-a)*(d-s)-(c-s)*(u-a))<0}render(){return Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class sp extends Wt.default.Component{render(){return Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},Wt.default.createElement(rp,{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}),Wt.default.createElement(ap,{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],o=[e.magneticLine.start,e.magneticLine.end];this.props.coordinatePoints[e.polygonLine.points[0].index]=dh.intersection(t,o),this.props.coordinatePoints[e.polygonLine.points[1].index]=dh.intersection(n,o),this.props.cornerMoveEnd(),this.setFrame()}}class lp extends Wt.default.Component{constructor(e){super(e),this.state={movingLine:void 0}}render(){return Wt.default.createElement("div",null,Wt.default.createElement(sp,{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})}}),Wt.default.createElement(op,{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()}}),Wt.default.createElement(rh,{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 cp extends Wt.default.Component{render(){return Wt.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 up extends Wt.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:o,duration:i}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=Sn.b`
35
35
  from {transform: rotate(${r}deg) scale(${this.previousScale}); }
36
36
  to {transform: rotate(${a}deg) scale(${o});
37
- }`,l=mt.a.div`position: absolute; animation: ${s} ${i}s;`;return this.previousScale=o,W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:t=>this.container=t},W.default.createElement(l,{style:{width:this.calculate(t,"width"),height:this.calculate(t,"height"),transform:`rotate(${a}deg) scale(${o})`,marginTop:this.marginWithAspect(e,"y",t),marginLeft:this.marginWithAspect(e,"x",t)},onAnimationStart:()=>{this.animating=!0},onAnimationEnd:()=>{this.animating=!1}},this.props.children))}marginWithAspect(t,e,n){if(!t||!n)return 0;n.width,n.height;return t[e]}calculate(t,e){return t?t[e]:"100%"}}class eu extends W.default.Component{componentDidMount(){rl.disableScreenMovement()}componentWillUnmount(){rl.enableScreenMovement()}render(){return W.default.createElement("div",null)}}class nu{constructor(t,e){this.element=t,this.size=e}}class ou{}class iu extends W.default.Component{render(){return W.default.createElement("div",{style:this.props.style},W.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const t=this.half();return W.default.createElement("line",{x1:t,y1:0,x2:t,y2:this.props.size,stroke:this.props.color,strokeWidth:"2"})}horizontal(){const t=this.half();return W.default.createElement("line",{x1:0,y1:t,x2:this.props.size,y2:t,stroke:this.props.color,strokeWidth:"2"})}}class ru extends W.default.Component{get crosshairSize(){var t,e;return null===(e=null===(t=this.props.style)||void 0===t?void 0:t.crosshair)||void 0===e?void 0:e.size}constructor(t){super(t),this.MAX_ROTATIONS=4,this.state={frame:g.a.empty(),cropImageFitSize:Ys.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?W.default.createElement("div",{style:this.style().container},W.default.createElement("img",{style:this.style().image,ref:t=>this.destination=t,src:this.props.src,alt:"."}),W.default.createElement(iu,{style:this.style().crosshair,size:this.crosshairSize,color:this.props.style.crosshair.color})):null}update(t){if(!this.state.visible)return;this.destination.src=t.source.element.src;const e=g.a.fromPoint(ws.a.scaleUpTo(t.origin,new Ys.a(this.props.style.zoom,this.props.style.zoom)),this.props.style.size),n=t.container.width-(this.props.style.margin+this.props.style.size),o=this.isPointTopLeft(t.origin,t.source.size,t.rotations);this.setState({frame:e,cropImageFitSize:t.source.size,rotation:{count:t.rotations,scale:t.scale},margin:{left:o?n:this.props.style.margin},container:{width:t.container.width},scale:{width:t.source.size.width/t.container.width,height:t.source.size.height/t.container.height}})}isPointTopLeft(t,e,n){const o=t.x,i=t.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?o<a&&i<a:1===r?o<a&&i>e.height-a:2===r?o>e.width-a&&i>e.height-a:o>e.width-a&&i<a}setIsVisible(t,e){this.setState({visible:t},e)}normalizeRotations(t){return t%this.MAX_ROTATIONS}}var au=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class su extends W.default.Component{constructor(t){super(t),this.onResizeCallback=()=>{},this.MAX_ROTATIONS=4,this.BASE_SCALE=1,this.state={image:void 0,documentDetectionResult:void 0,polygon:void 0,calculatedSize:Ys.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:ws.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(t){return au(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize cropping component: Cannot find container element with the id provided.");return new Promise(((n,o)=>{Object(W.render)(W.default.createElement(su,{onReady:n,onError:o,container:e,configuration:Qc.fromJson(t)}),e)}))}))}componentDidMount(){var t,e,n;return au(this,void 0,void 0,(function*(){const o=null===(t=this.configuration)||void 0===t?void 0:t.image,i=yield mu.instance.detectAndCropDocument(o),r=yield b.toDataUrl(yield mu.instance.imageToJpeg(o));this.setState({documentDetectionResult:i,image:r,polygon:null!==(n=null===(e=this.configuration)||void 0===e?void 0:e.polygon)&&void 0!==n?n:i.pointsNormalized,magneticLines:{vertical:{original:i.verticalLinesNormalized},horizontal:{original:i.horizontalLinesNormalized}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return au(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(t){return au(this,void 0,void 0,(function*(){Ys.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=t,this.initializeSizes())}))}onResize(){const t=this.state.points.map((t=>new ws.a(t.x/this.state.calculatedSize.width,t.y/this.state.calculatedSize.height)));this.initializeSizes(t)}initializeSizes(t,e,n){const o=new Ys.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),i=new Ys.a(this.container.width(),this.container.height()),r=b.getObjectFitSize(i,o),a=new Ys.a(r.width,r.height),s=null!=t?t:this.state.polygon,l=rl.convertToViewportPointsFromParentSize(a,s),c=null!=e?e:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=rl.convertLinesToViewportLines(a,c),h=rl.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:l,magneticLines:{horizontal:{original:c,scaled:d},vertical:{original:u,scaled:h}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var t,e,n,o,i,r;const a=wc.CLASSNAME,s=zs()({[a]:!0,[`${a}-visible`]:!0}),l=this.configuration.style.polygon.width,c=(null===(t=this.state.animation)||void 0===t?void 0:t.scale)?l/this.state.animation.scale:l,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return W.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&W.default.createElement(eu,null),W.default.createElement(ru,{ref:t=>this.magnifier=t,style:this.configuration.style.magnifier}),W.default.createElement(tu,{ref:t=>this.container=t,size:this.state.calculatedSize,rotations:null===(e=this.state.animation)||void 0===e?void 0:e.rotations,scale:null===(n=this.state.animation)||void 0===n?void 0:n.scale,duration:null===(o=this.state.animation)||void 0===o?void 0:o.duration,imageMargin:this.state.imageMargin},W.default.createElement(Jc,{src:this.state.image,onImageLoaded:t=>this.onImageLoaded(t)}),W.default.createElement(Kc,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${c}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(i=this.state.animation)||void 0===i?void 0:i.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(t){var e;null===(e=this.magnifier)||void 0===e||e.setIsVisible(!0,(()=>{var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}))}updateMagnifier(t){var e;null===(e=this.magnifier)||void 0===e||e.update(this.magnifierOptions(t))}magnifierOptions(t){const e=new ou;return e.source=new nu(this.htmlImage,this.state.calculatedSize),e.container=new Ys.a(this.container.width(),this.container.height()),e.origin=t.point,e.rotations=this.state.animation.rotations,e.scale=this.state.animation.scale,e}hideMagnifier(){var t;null===(t=this.magnifier)||void 0===t||t.setIsVisible(!1)}apply(){var t;return au(this,void 0,void 0,(function*(){const e=ws.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),o=yield mu.instance.imageCrop(null===(t=this.configuration)||void 0===t?void 0:t.image,e);return{image:yield mu.instance.imageRotate(o,n,"CONSUME_IMAGE"),polygon:e,rotations:this.rotations}}))}toCoreRotations(t){switch(t%this.MAX_ROTATIONS){case 0:return"NONE";case 1:return"CLOCKWISE_90";case 2:return"CLOCKWISE_180";case 3:return"COUNTERCLOCKWISE_90"}}rotate(t){return au(this,void 0,void 0,(function*(){if(this.container.isAnimating())return void console.warn("Unable to rotate: previous rotation animation in progress");const e=this.calculateScale(this.rotations,t,this.state.calculatedSize);this.setState({animation:{rotations:this.rotations+t,scale:e,duration:1}})}))}detect(){return au(this,void 0,void 0,(function*(){const t=this.state.documentDetectionResult;this.initializeSizes(t.pointsNormalized,t.horizontalLinesNormalized,t.verticalLinesNormalized)}))}dispose(){const{container:t}=this.props;if(!t)throw Error("Component wasn't created with openCroppingView. Remove component from render tree to dispose.");Object(W.render)(null,t)}get rotations(){var t,e;const n=null===(t=this.state.animation)||void 0===t?void 0:t.rotations;return n&&0!==n?n:null!==(e=this.configuration.rotations)&&void 0!==e?e:0}get configuration(){return this._configuration||(this._configuration=Qc.fromJson(this.props.configuration)),this._configuration}calculateScale(t,e,n){return e?(t+e)%2==0?this.BASE_SCALE:this.calculateRatio(n):this.BASE_SCALE}calculateRatio(t){return Math.min(this.container.width()/t.height,this.container.height()/t.width)}calculateMargin(t){return t.width>t.height?{x:0,y:this.container.height()/2-t.height/2}:{x:this.container.width()/2-t.width/2,y:0}}}var lu=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.a;ht.b;class cu extends ht.c{constructor(t){super(t),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(t,e,n){return lu(this,void 0,void 0,(function*(){const o=document.getElementById(t.containerId);if(!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,r)=>{Object(W.render)(W.default.createElement(cu,{container:o,configuration:t,onTextDetected:e,onSuccess:i,onFailure:r,textDataScanner:n}),o)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return lu(this,void 0,void 0,(function*(){il.warn("TextData detection resumed"),yield this.resume()}))}pauseDetection(){il.warn("TextData detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return lu(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.textDataScanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return lu(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return lu(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.textDataScanner.cleanRecognitionQueue(),this.paused=!0}detect(){var t,e,n,o;return lu(this,void 0,void 0,(function*(){const i=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let r=!1;try{this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const n=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(cu.FRAME_RESOLUTION);if(!n)return;i&&this.forceUpdate();const o=yield this.props.textDataScanner.recognize(n);if(!this.enabled)return;if(null===o)return;o&&(r=!0,this.props.onTextDetected(o),this.camera.reusableImageBuffer=o.originalImage.data)}catch(t){null===(o=(n=this.configuration).onError)||void 0===o||o.call(n,t)}finally{r?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}render(){var t;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),W.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),this.state.isFinderVisible&&W.default.createElement(pt.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}cu.FRAME_RESOLUTION=1200;var uu=cu,du=n(34),hu=n(25),fu=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class pu{static get UI(){if(!i.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return pu._ui2}static initialize(t){var e;return fu(this,void 0,void 0,(function*(){const n=new pu,o=t.engine||pu.defaultEnginePath,a=!!t.allowThreads,s=null!==(e=t.requestSuffix)&&void 0!==e?e:`?${n.version}`,l=[t.licenseKey,o,window.location.hostname,i.CDN_PATH+i.DEFAULT_WASM_FOLDER,{captureConsole:!1,allowThreads:a,requestSuffix:s}];return n.bridge=new u(o,{allowSimd:!0,allowThreads:a,requestSuffix:s},l),pu.instance=n,window.scanbotSdk=n,I.a.initialize(t.verboseLogging),t.allowThreads&&!Object(r.a)()&&(I.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&I.a.debugWarn("The site is not cross-origin isolated. This prevents multithreading in the ScanbotSDK. To enable multithreading, you need to set the 'Cross-Origin-Opener-Policy' and 'Cross-Origin-Embedder-Policy' http headers. See our documentation for details.")),this.cameras.initialize(null==t?void 0:t.bestCameraDetectionStrategy),n}))}createDocumentScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{return e=yield Bc.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createMrzScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{const n=new S(this,this.bridge.copyArgs.createMRZRecognizer(t.recognizerConfiguration));return e=yield Wc.create(t,n),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createBarcodeScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{return e=yield sl.create(t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}openCroppingView(t){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield su.create(t)}))}createTextDataScanner(t){return fu(this,void 0,void 0,(function*(){try{t=k.fromJson(t);const e=yield this.createGenericTextLineScanner(t,t.onTextDetected,t.ocrConfiguration);return yield this.licenseCheck(),e}catch(t){throw t}}))}createVINScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{t=D.fromJson(t);const n=e=>{""!==e.rawText&&t.onTextDetected(e)},o=new T.GenericTextLineScannerTypes.ScannerConfiguration(Object.assign(Object.assign({},t.ocrConfiguration),{validator:new T.GenericTextLineScannerTypes.PresetContentValidator({preset:"VEHICLE_IDENTIFICATION_NUMBER"})}));return e=yield this.createGenericTextLineScanner(t,n,o),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}createGenericDocumentRecognizerScanner(t){return fu(this,void 0,void 0,(function*(){let e;try{const o=n(48).default;return e=yield o.create(this,t),yield this.licenseCheck(),e}catch(t){throw e&&e.dispose(),t}}))}toDataUrl(t){return fu(this,void 0,void 0,(function*(){return B.throwIfMissingBuffer(t),yield b.toDataUrl(t)}))}detectDocument(t,e={},n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(t);const o=yield this.bridge.copyArgs.createDocumentDetector(e),i=this.getBridge(n),r=yield i.documentDetectorDetect(o,t);return yield this.release(o,"documentDetector"),r}))}detectAndCropDocument(t,e="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(t);const n=this.getBridge(e);return yield n.detectAndCropDocument(t)}))}detectBarcodes(t,e={},n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){yield this.licenseCheck(),B.throwIfMissingBuffer(t),"string"==typeof t&&(t=yield b.loadFromUrl(t));const o=Object.assign({},e);o.live=!1;const i=yield this.bridge.copyArgs.createBarcodeRecognizer(o),r=yield this.getBridge(n).recognizeBarcodes(i,t);return yield this.release(i,"barcodeRecognizer"),r}))}parseBarcodeDocument(t,e){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.copyArgs.parseBarcodeDocument(t,e)}))}createSimpleMRZRecognizer(){return fu(this,void 0,void 0,(function*(){const t=new T.MRZTypes.RecognizerConfiguration({accumulatedResultsVerifierConfig:{maximumNumberOfAccumulatedFrames:0}});return new S(this,this.bridge.copyArgs.createMRZRecognizer(t))}))}createOcrEngine(){return fu(this,void 0,void 0,(function*(){return new x(this,yield this.bridge.copyArgs.createOcrEngine())}))}createDocumentQualityAnalyzer(t={}){return fu(this,void 0,void 0,(function*(){const e=yield this.bridge.copyArgs.createDocumentQualityAnalyzer(t);return new R(this,e)}))}imageRotate(t,e,n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const o=this.getBridge(n);return yield o.imageRotate(t,e)}))}imageFilter(t,e,n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const o=this.getBridge(n);return yield o.imageApplyFilter(t,e)}))}imageCrop(t,e,n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const o=this.getBridge(n);return yield o.imageCrop(t,e)}))}imageResize(t,e,n="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const o=this.getBridge(n);return yield o.imageResize(t,e)}))}getLicenseInfo(){return fu(this,void 0,void 0,(function*(){const t=yield this.bridge.copyArgs.getLicenseInfo();return d.fromJson(t)}))}beginPdf(t){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new f(this,yield this.bridge.copyArgs.beginPdf(t))}))}beginTiff(t={}){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new m(this,yield this.bridge.copyArgs.beginTiff(t))}))}createGenericDocumentRecognizer(t){return fu(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new dc(this,yield this.bridge.copyArgs.genericDocumentRecognizerCreate(t))}))}imageToJpeg(t,e="COPY_IMAGE"){return fu(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(e).encodeJpeg(t)}))}get version(){return i.VERSION}get utils(){return this._utils||(this._utils=new y),this._utils}release(t,e){return fu(this,void 0,void 0,(function*(){t&&(I.a.debug(`Releasing object ${null!=e?e:"unknown"}`),yield this.bridge.copyArgs.releaseObject(t))}))}getBridge(t){return"CONSUME_IMAGE"===t?this.bridge.transferArgs:this.bridge.copyArgs}licenseCheck(){return fu(this,void 0,void 0,(function*(){const t=yield this.getLicenseInfo();if(!t.isValid())throw console.error(`LicenseError: ${t.status}`),new P(t)}))}createGenericTextLineScanner(t,e,n){return fu(this,void 0,void 0,(function*(){const o=this.bridge.copyArgs.createGenericTextLineScanner(n),i=new L(this,o);return yield uu.create(t,e,i)}))}destroy(){this.bridge.destroy(),pu.instance=void 0}}pu.defaultEnginePath="",pu._ui2=i.BUILD_WITH_UI?cc:void 0,pu.cameras=hu.a.INSTANCE,pu.Config=T,pu._stats=du.a.INSTANCE;var mu=e.a=pu},function(t,e,n){"use strict";var o=n(38),i=n.n(o)()((function(t){return t[1]}));i.push([t.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: 12px;\n transform: translate(-50%, -100%);\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",""]),e.a=i},function(t,e,n){"use strict";var o=n(38),i=n.n(o)()((function(t){return t[1]}));i.push([t.i,".scanbot-document-hint-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n border-radius: 0.25em;\n padding: 0.05em 0.3em 0.05em 0.3em;\n font-family: sans-serif;\n font-size: 0.9em;\n font-weight: 300;\n}\n",""]),e.a=i},function(t,e){var n,o,i=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d<e;)l&&l[d].run();d=-1,e=c.length}l=null,u=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||u||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){const{render:o,hydrate:i,unmountComponentAtNode:r}=n(0);function a(t){return{render(e){o(e,t)},unmount(){r(t)}}}e.createRoot=a,e.hydrateRoot=function(t,e){return i(e,t),a(t)}},function(t,e){t.exports=function(t,e,n,o){var i=n?n.call(o,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),l=0;l<r.length;l++){var c=r[l];if(!s(c))return!1;var u=t[c],d=e[c];if(!1===(i=n?n.call(o,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},function(t,e,n){"use strict";e.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(t,e,n){"use strict";function o(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}n.d(e,"a",(function(){return r}));var i=/^((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=o((function(t){return i.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}))},function(t,e,n){"use strict";n.r(e),n.d(e,"ScanbotSDK",(function(){return o}));const o=n(39).a},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return h}));var o=n(0),i=n(12),r=n(14),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(t){const e=new s;return this.mapValues(t,e,["videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(e,t),this.mapVideoConstraints(t,e),e}}var l=n(9),c=n(23),u=n(26),d=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};i.a;class h extends i.c{constructor(t){super(t),this.enabled=!0,this.configuration=t.configuration}static create(t,e){var n;return d(this,void 0,void 0,(function*(){const i=null!==(n=e.container)&&void 0!==n?n:document.getElementById(e.containerId);if(e=s.fromJson(e),!i)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,r)=>{Object(o.render)(o.default.createElement(h,{container:i,configuration:e,onSuccess:n,onFailure:r,sdk:t}),i)}))}))}componentDidMount(){var t,e;super.componentDidMount();try{this.genericDocumentRecognizer=this.props.sdk.createGenericDocumentRecognizer(this.configuration.detectorParameters)}catch(n){null===(e=(t=this.configuration).onError)||void 0===e||e.call(t,n)}this.detect()}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return d(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.enabled=!1,yield(yield this.genericDocumentRecognizer).release()}))}detect(){var t,e,n,o,r,a;return d(this,void 0,void 0,(function*(){try{if(!this.enabled)return;this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const r=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(i.c.DEFAULT_DETECTION_RESOLUTION);if(!r)return;const a=yield(yield this.genericDocumentRecognizer).recognize(r,new l.GenericDocumentRecognizerTypes.RecognitionParameters({mode:"LIVE"}),"CONSUME_IMAGE");if(!this.enabled)return;this.camera.reusableImageBuffer=a.originalImage.data,null===(o=(n=this.configuration).onDocumentDetected)||void 0===o||o.call(n,a)}catch(t){null===(a=(r=this.configuration).onError)||void 0===a||a.call(r,t)}finally{requestAnimationFrame((()=>this.detect()))}}))}render(){var t;const e=this.configuration;return o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),o.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},o.default.createElement(c.a,{key:"camera",configuration:this.configuration,videoConstraints:e.videoConstraints,mirrored:e.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),this.configuration.finder.visible&&o.default.createElement(u.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder})))}}},function(t,e,n){"use strict";n.r(e);var o=/^((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)-.*))$/,i=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}((function(t){return o.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91}));e.default=i}])}));
37
+ }`,l=Sn.a.div`position: absolute; animation: ${s} ${i}s;`;return this.previousScale=o,Wt.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"},ref:e=>this.container=e},Wt.default.createElement(l,{style:{width:this.calculate(e,"width"),height:this.calculate(e,"height"),transform:`rotate(${a}deg) scale(${o})`,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 dp extends Wt.default.Component{componentDidMount(){hu.disableScreenMovement()}componentWillUnmount(){hu.enableScreenMovement()}render(){return Wt.default.createElement("div",null)}}class hp{constructor(e,t){this.element=e,this.size=t}}class mp{}class fp extends Wt.default.Component{render(){return Wt.default.createElement("div",{style:this.props.style},Wt.default.createElement("svg",null,this.vertical(),this.horizontal()))}half(){return this.props.size/2}vertical(){const e=this.half();return Wt.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 Wt.default.createElement("line",{x1:0,y1:e,x2:this.props.size,y2:e,stroke:this.props.color,strokeWidth:"2"})}}class pp extends Wt.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:P.a.empty(),cropImageFitSize:eu.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?Wt.default.createElement("div",{style:this.style().container},Wt.default.createElement("img",{style:this.style().image,ref:e=>this.destination=e,src:this.props.src,alt:"."}),Wt.default.createElement(fp,{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=P.a.fromPoint(kc.a.scaleUpTo(e.origin,new eu.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),o=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:o?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 o=e.x,i=e.y,r=this.normalizeRotations(n),a=this.state.container.width/4;return 0===r?o<a&&i<a:1===r?o<a&&i>t.height-a:2===r?o>t.width-a&&i>t.height-a:o>t.width-a&&i<a}setIsVisible(e,t){this.setState({visible:e},t)}normalizeRotations(e){return e%this.MAX_ROTATIONS}}var gp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class vp extends Wt.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:eu.a.empty(),animation:{rotations:0,scale:1,duration:0},points:[],magneticLines:{horizontal:{original:[],scaled:[]},vertical:{original:[],scaled:[]}},imageMargin:kc.a.empty()},this.onResizeCallback=this.onResize.bind(this)}static create(e,t){return gp(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(((o,i)=>{Object(Wt.render)(Wt.default.createElement(vp,{sdk:t,onReady:o,onError:i,container:n,configuration:np.fromJson(e)}),n)}))}))}componentDidMount(){var e,t,n;return gp(this,void 0,void 0,(function*(){const o=null===(e=this.configuration)||void 0===e?void 0:e.image,i=yield this.sdk.detectAndCropDocument(o),r=yield F.toDataUrl(yield this.sdk.imageToJpeg(o));this.setState({documentDetectionResult:i,image:r,polygon:null!==(n=null===(t=this.configuration)||void 0===t?void 0:t.polygon)&&void 0!==n?n:i.pointsNormalized,magneticLines:{vertical:{original:i.verticalLinesNormalized},horizontal:{original:i.horizontalLinesNormalized}}}),this.props.onReady&&this.props.onReady(this),addEventListener("resize",this.onResizeCallback),addEventListener("orientationchange",this.onResizeCallback)}))}componentWillUnmount(){return gp(this,void 0,void 0,(function*(){removeEventListener("resize",this.onResizeCallback),removeEventListener("orientationchange",this.onResizeCallback)}))}onImageLoaded(e){return gp(this,void 0,void 0,(function*(){eu.a.isEmpty(this.state.calculatedSize)&&(this.htmlImage=e,this.initializeSizes())}))}onResize(){const e=this.state.points.map((e=>new kc.a(e.x/this.state.calculatedSize.width,e.y/this.state.calculatedSize.height)));this.initializeSizes(e)}initializeSizes(e,t,n){const o=new eu.a(this.htmlImage.naturalWidth,this.htmlImage.naturalHeight),i=new eu.a(this.container.width(),this.container.height()),r=F.getObjectFitSize(i,o),a=new eu.a(r.width,r.height),s=null!=e?e:this.state.polygon,l=hu.convertToViewportPointsFromParentSize(a,s),c=null!=t?t:this.state.magneticLines.horizontal.original,u=null!=n?n:this.state.magneticLines.vertical.original,d=hu.convertLinesToViewportLines(a,c),h=hu.convertLinesToViewportLines(a,u);this.setState({calculatedSize:a,points:l,magneticLines:{horizontal:{original:c,scaled:d},vertical:{original:u,scaled:h}},animation:{duration:0,rotations:this.rotations,scale:this.calculateScale(0,this.rotations,a)},imageMargin:this.calculateMargin(a)})}render(){var e,t,n,o,i,r;const a=rh.CLASSNAME,s=Qc()({[a]:!0,[`${a}-visible`]:!0}),l=this.configuration.style.polygon.width,c=(null===(e=this.state.animation)||void 0===e?void 0:e.scale)?l/this.state.animation.scale:l,u=this.configuration.style.padding||0,d=`calc(100% - 2*${u}px)`;return Wt.default.createElement("div",{style:{position:"relative",width:d,height:d,padding:u}},Wt.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.configuration.disableScroll&&Wt.default.createElement(dp,null),Wt.default.createElement(pp,{ref:e=>this.magnifier=e,style:this.configuration.style.magnifier}),Wt.default.createElement(up,{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===(o=this.state.animation)||void 0===o?void 0:o.duration,imageMargin:this.state.imageMargin},Wt.default.createElement(cp,{src:this.state.image,onImageLoaded:e=>this.onImageLoaded(e)}),Wt.default.createElement(lp,{style:{width:"100%",height:"100%",zIndex:500},size:this.state.calculatedSize,polygonStyle:{cursor:"pointer",stroke:this.configuration.style.polygon.color,strokeWidth:`${c}px`},handleStyle:this.configuration.style.polygon.handles,magneticLineStyle:this.configuration.style.magneticLines,polygonClasses:s,points:this.state.points,rotations:null===(i=this.state.animation)||void 0===i?void 0:i.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 mp;return t.source=new hp(this.htmlImage,this.state.calculatedSize),t.container=new eu.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 gp(this,void 0,void 0,(function*(){const t=kc.a.toPolygon(this.state.points,this.state.calculatedSize),n=this.toCoreRotations(this.rotations),o=yield this.sdk.imageCrop(null===(e=this.configuration)||void 0===e?void 0:e.image,t);return{image:yield this.sdk.imageRotate(o,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 gp(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 gp(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([new kc.a(0,0),new kc.a(1,0),new kc.a(1,1),new kc.a(0,1)],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(Wt.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=np.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}}}var Cp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function bp(e){const t=e.config.screens.cropping,n=Wt.default.useRef(null),o=Wt.default.useRef(null),[i,r]=Wt.default.useState(!0),a=Object(Wt.useRef)(0),s=Wt.default.useRef(Promise.resolve());return Object(Wt.useEffect)((()=>{if(n.current&&e.page)return s.current=s.current.then((()=>Cp(this,void 0,void 0,(function*(){r(!0);const i=yield e.page.cropData();if(!n.current)return;a.current=i.rotations;const s=yield vp.create({containerId:"sb-cropping-container",image:i.image,polygon:i.crop,rotations:i.rotations,style:{polygon:{color:Ht.b.getColorValue(t.croppingPolygonColor),handles:{color:Ht.b.getColorValue(t.croppingHandlerColor),border:"transparent",filter:"drop-shadow(0px 0px 2px #00000070)"}}}},e.sdk);o.current=s,r(!1)})))),()=>{s.current=s.current.then((()=>Cp(this,void 0,void 0,(function*(){var e;null===(e=o.current)||void 0===e||e.dispose()}))))}}),[n.current,e.page]),e.page?Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Uh,{open:i}),Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(t.backgroundColor),width:"100%",height:`calc(100 * ${Ut})`,display:"flex",flexDirection:"column",touchAction:"none",userSelect:"none",WebkitTapHighlightColor:"transparent"}},Wt.default.createElement(Bd,{backgroundColor:e.config.appearance.topBarBackgroundColor,leftContent:Wt.default.createElement(tn,{ariaLabel:Ht.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:i}),centerTitle:t.topBarTitle,rightContent:Wt.default.createElement(tn,{ariaLabel:Ht.b.getLocalizedText(t.topBarConfirmButton.accessibilityDescription),onClick:()=>Cp(this,void 0,void 0,(function*(){if(!o.current)return void e.onCloseButtonClick();const t=o.current;r(!0);const n=kc.a.toPolygon(t.state.points,t.state.calculatedSize),i=(4+t.rotations-a.current)%4;yield e.onApplyCrop(n,i),r(!1)})),visible:t.topBarConfirmButton.visible,text:t.topBarConfirmButton.text,background:t.topBarConfirmButton.background,foreground:t.topBarConfirmButton.foreground,debugName:"cropping-screen-apply",disabled:i})}),Wt.default.createElement(zt.Box,{style:{flexGrow:1,width:"100%"},ref:n,id:"sb-cropping-container"}),Wt.default.createElement(zt.Box,{style:{backgroundColor:Ht.b.getColorValue(e.config.appearance.bottomBarBackgroundColor),height:80,width:"100%",display:"flex",justifyContent:"center"}},Wt.default.createElement(zt.Box,{style:{maxWidth:400,display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1,padding:"0 20px"}},Wt.default.createElement(Jt,{enabled:!i,config:t.bottomBar.detectButton,icon:({color:e})=>Wt.default.createElement(jt.a,{style:{color:e}}),onClick:()=>Cp(this,void 0,void 0,(function*(){var e;r(!0),yield null===(e=o.current)||void 0===e?void 0:e.detect(),r(!1)})),debugName:"retake"}),Wt.default.createElement(Jt,{enabled:!i,config:t.bottomBar.rotateButton,icon:({color:e})=>Wt.default.createElement(jt.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.rotate(1)},debugName:"retake"}),Wt.default.createElement(Jt,{enabled:!i,config:t.bottomBar.resetButton,icon:({color:e})=>Wt.default.createElement(jt.a,{style:{color:e}}),onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.resetPolygon()},debugName:"retake"}))))):null}var yp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Ap{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 eg.instance}getOriginalImage(){return yp(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(this.data.originalImageId)}))}getPolygon(){var e;return 4===(null===(e=this.data.polygon)||void 0===e?void 0:e.length)?this.data.polygon:Ap.FULL_SIZE_POLYGON}cropData(){return yp(this,void 0,void 0,(function*(){return{crop:this.getPolygon(),rotations:this.data.rotations,image:yield this.getOriginalImage()}}))}finalRawImage(){return yp(this,void 0,void 0,(function*(){if(null===this.data.documentImageId){let e=yield this.getOriginalImage();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 o=Ap.ROTATIONS[this.data.rotations%4];e=yield this.sdk().imageRotate(e,o,"CONSUME_IMAGE");const i=yield this.sdk().storage.insertSBPageImage(e);return Dp._internal_updateProperty(this.data,"documentImageId",i),yield this.document.updateStorageDocument(),e}return yield this.sdk().storage.getSBPageImage(this.data.documentImageId)}))}finalImageUrl(){return null===this._finalImageUrl&&(this._finalImageUrl=(()=>yp(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 yp(this,void 0,void 0,(function*(){null!==this.data.documentImageId&&(yield this.sdk().storage.deleteImageById(this.data.documentImageId),Dp._internal_updateProperty(this.data,"documentImageId",null)),yield this.document.updateStorageDocument(),URL.revokeObjectURL(yield this._finalImageUrl),this._finalImageUrl=null}))}}Ap.ROTATIONS=["NONE","CLOCKWISE_90","CLOCKWISE_180","COUNTERCLOCKWISE_90"],Ap.FULL_SIZE_POLYGON=[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];class Sp{constructor(e){this.name="SBStorageError",this.message=e}}var wp=n(6),Ep=n(41);class xp extends wp.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,this.unfilteredDocumentImageId=null,void 0!==e.filters&&(this.filters=null!=e.filters?e.filters.map((e=>Ep.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?e.documentDetectionStatus:null),void 0!==e.documentQuality&&(this.documentQuality=null!=e.documentQuality?e.documentQuality:null),void 0!==e.source&&(this.source=null!=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),void 0!==e.unfilteredDocumentImageId&&(this.unfilteredDocumentImageId=null!=e.unfilteredDocumentImageId?e.unfilteredDocumentImageId:null)}}class Bp extends wp.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 xp(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 Ip extends Bp{constructor(){super(...arguments),this.pages=[]}}class Tp extends xp{}var kp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Op{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 Dp{getData(){return this.data}get isDraft(){return this.data.id===Dp.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 Ap(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 Ap(this,e))))}sdk(){return eg.instance}get pageCount(){return this.pages.length}pageAtIndex(e){return this.pages[e]}static loadFromStorage(e){return kp(this,void 0,void 0,(function*(){const t=yield eg.instance.storage.getSBDocument(e);if(void 0===t)throw new Sp("Document not found in database.");return new Dp(t)}))}static create(e){return kp(this,void 0,void 0,(function*(){const t=eg.instance;let n;if(e.loadFromStorage())n=yield Dp.loadFromStorage(e.documentId);else{const o=yield t.storage.getSBDocument(Dp.DOCUMENT_DRAFT_ID),i=void 0!==o;if(e.cleanSession&&i){for(const e of o.pages)yield t.storage.deleteImages(e);Dp._internal_updateProperty(o,"pages",[])}const r=i?o:new Ip({id:Dp.DOCUMENT_DRAFT_ID,creationTimestamp:Date.now(),pages:[],documentImageSizeLimit:e.documentImageSizeLimit});n=new Dp(r)}return n.data.filters=e.filters,yield n.updateStorageDocument(),n}))}updateStorageDocument(){return kp(this,void 0,void 0,(function*(){return yield this.sdk().storage.insertSBDocument(this)}))}delete(){return kp(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,o){return kp(this,void 0,void 0,(function*(){void 0===o&&(o=this.pages.length);const i=new Tp({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);Dp._internal_updateProperty(i,"originalImageId",r),this.splicePage(o,0,i),yield this.updateStorageDocument()}))}deleteFromPosition(e){return kp(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 kp(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 kp(this,void 0,void 0,(function*(){for(;this.pages.length>0;)yield this.deleteFromPosition(0)}))}cropAndRotateAtIndex(e,t,n){return kp(this,void 0,void 0,(function*(){const o=this.pageAtIndex(e);yield this.cropAndRotatePage(o,t,n)}))}cropAndRotatePage(e,t,n){return kp(this,void 0,void 0,(function*(){const o=this.data.pages[this.pages.indexOf(e)];4===(null==t?void 0:t.length)&&Dp._internal_updateProperty(o,"polygon",t),null!=n&&(o.rotations+=n),yield e.invalidateImage(),yield this.updateStorageDocument()}))}updateDataProperty(e,t){Dp._internal_updateProperty(this.data,e,t)}static _internal_updateProperty(e,t,n){e[t]=n}deleteId(){delete this.data.id}convertToFinalVersion(){return kp(this,void 0,void 0,(function*(){if(this.isDraft){this.deleteId();const e=yield this.updateStorageDocument();Dp._internal_updateProperty(this.data,"id",e),yield this.sdk().storage.deleteSBDocument(Dp.DOCUMENT_DRAFT_ID)}return this}))}insertRenderedBuffer(e,t){return kp(this,void 0,void 0,(function*(){const n=yield this.sdk().storage.insertSBPageImage(e);return Dp._internal_updateProperty(this.data,t,n),e}))}createPdf(e){return kp(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 kp(this,void 0,void 0,(function*(){const n=yield this.sdk().beginTiff(e);yield n.addPages(this,t);const o=yield n.complete();return yield this.saveRenderedTiff(o),o}))}loadPdf(){return kp(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.pdfId)}))}loadTiff(){return kp(this,void 0,void 0,(function*(){return yield this.loadBuffer(this.data.tiffId)}))}loadBuffer(e){return kp(this,void 0,void 0,(function*(){return yield this.sdk().storage.getSBPageImage(e)}))}saveRenderedPdf(e){return kp(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"pdfId")}))}saveRenderedTiff(e){return kp(this,void 0,void 0,(function*(){return yield this.insertRenderedBuffer(e,"tiffId")}))}}Dp.DOCUMENT_DRAFT_ID=-1;var Lp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};function Pp(e){var t;Object(Wt.useMemo)((()=>{Ht.b.setPalette(e.configuration.palette),Ht.b.setLocalization(e.configuration.localization)}),[e.configuration]);const n=cd(),[o,i]=Object(Wt.useState)(null);Object(Wt.useEffect)((()=>{const t=new Op({config:e.configuration,documentId:e.documentId});Dp.create(t).then((t=>{var n;t instanceof Dp?i(t):null===(n=e.onError)||void 0===n||n.call(e,t)}))}),[]);const[r,a]=Wt.default.useState({screen:"camera",insertMode:{name:"insert back"}}),s="acknowledgment"===r.screen?r:null;return Object(Wt.useEffect)((()=>{const t=e.configuration.screens.camera.timeouts.autoCancelTimeout;if(0!==t){const n=setTimeout(e.onClose,t);return()=>clearTimeout(n)}}),[]),Wt.default.createElement(Wt.default.Fragment,null,Wt.default.createElement(Zt,null),Wt.default.createElement(xh,null,Wt.default.createElement(Rh,{visible:"acknowledgment"===r.screen,configuration:e.configuration,sdk:e.sdk,croppedDetectionResult:null==s?void 0:s.croppedDetectionResult,onAccept:(t,i)=>{if(!s)throw new Error("Internal error: Invalid routing state");let r;const l=[];if("insert back"===s.insertMode.name){const n=o.addPage(t.value,i,t.source);l.push(n),r=e.configuration.outputSettings.pagesScanLimit>0&&o.pages.length+1===e.configuration.outputSettings.pagesScanLimit?{screen:"review",position:o.pages.length+1}:{screen:"camera",insertMode:{name:"insert back"}}}else{const e=s.insertMode.position,n=o.addPage(t.value,i,t.source,e);l.push(n),r={screen:"review",position:e},"replace"===s.insertMode.name&&l.push((()=>Lp(this,void 0,void 0,(function*(){yield o.deleteFromPosition(e),yield n})))())}Promise.all(l).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}),Wt.default.createElement(Eh,{visible:["camera","acknowledgment"].includes(r.screen),scanningPaused:"camera"!==r.screen||null===o,configuration:e.configuration,onClose:()=>Lp(this,void 0,void 0,(function*(){(null==o?void 0:o.isDraft)&&(yield o.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,o.pageCount-1)}),sdk:e.sdk,pages:null!==(t=null==o?void 0:o.pages)&&void 0!==t?t:[],scanLimitReached:(()=>{var t;return!(e.configuration.outputSettings.pagesScanLimit<=0)&&(("camera"!==r.screen||"replace"!==r.insertMode.name)&&(null===(t=null==o?void 0:o.pages)||void 0===t?void 0:t.length)>=e.configuration.outputSettings.pagesScanLimit)})(),onError:e.onError}),Wt.default.createElement(Fm,{document:o,currentPosition:"review"===r.screen?r.position:null,visible:"review"===r.screen,configuration:e.configuration,onClose:()=>a({screen:"camera",insertMode:{name:"insert back"}}),onSubmit:()=>Lp(this,void 0,void 0,(function*(){const t=yield o.convertToFinalVersion(),n=new gd(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})}),Wt.default.createElement(Qf,{visible:"zoom"===r.screen,page:"zoom"===r.screen?o.pageAtIndex(r.position):null,config:e.configuration.screens.review.zoomOverlay,onCloseButtonClick:()=>a({screen:"review",position:"zoom"===r.screen?r.position:0})}),Wt.default.createElement(bp,{sdk:e.sdk,page:"crop"===r.screen?o.pageAtIndex(r.position):null,config:e.configuration,onCloseButtonClick:()=>a({screen:"review",position:"crop"===r.screen?r.position:0}),onApplyCrop:(e,t)=>Lp(this,void 0,void 0,(function*(){if("crop"!==r.screen)throw new Error("Internal error: Invalid routing state");yield o.cropAndRotateAtIndex(r.position,e,t),a({screen:"review",position:r.position})}))})))}var _p=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Rp{static createDocumentScanner(e,t){return new Promise(((n,o)=>{const{root:i,unmount:r}=this.createRoot(),a=e=>_p(this,void 0,void 0,(function*(){yield r(),o(e)}));i.render(Wt.default.createElement(Wt.default.StrictMode,null," ",Wt.default.createElement(Pp,{configuration:e,documentId:t,onClose:()=>_p(this,void 0,void 0,(function*(){yield r(),n(null)})),onSubmit:e=>_p(this,void 0,void 0,(function*(){yield r(),n(e)})),onError:a,sdk:eg.instance}))),this.checkLicense(a)}))}static createBarcodeScanner(e){return new Promise(((t,n)=>{gn.INSTANCE.initialize(e.sound);const{root:o,unmount:i}=this.createRoot(),r=e=>_p(this,void 0,void 0,(function*(){yield i(),n(e)}));o.render(Wt.default.createElement(pd,{configuration:e,onClose:()=>_p(this,void 0,void 0,(function*(){yield i(),t(null)})),onSubmit:e=>_p(this,void 0,void 0,(function*(){yield i(),t(e)})),onError:r})),this.checkLicense(r)}))}static createRoot(){const e=Rp.createContainer("barcode-scanner-controller"),t=Object(Nt.createRoot)(e);return{unmount:()=>_p(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){(()=>{_p(this,void 0,void 0,(function*(){try{const t=yield eg.instance.getLicenseInfo();t.isValid()||(yield e(new Pt(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 * ${Ut})`,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}}Rp.Config=Vt;var Fp=Rp,Mp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Wp{constructor(e,t){this._sdk=e,this._recognizer=t}recognize(e,t,n="COPY_IMAGE"){return Mp(this,void 0,void 0,(function*(){const o=this._sdk.getBridge(n);return yield o.documentDataExtractorExtract(this._recognizer,e,t)}))}release(){return Mp(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._recognizer)}))}}class Np extends Z.a{constructor(){super(U.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new p.MrzScannerConfiguration,this.onMrzDetected=function(e){},this.finder.aspectRatio=new oe.AspectRatio({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 Np;return this.mapValues(e,t,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(t,e),this.mapVideoConstraints(e,t),t}}var Vp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};bn.a;bn.b;class zp extends bn.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=Np.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(e,t){return Vp(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(((o,i)=>{Object(Wt.render)(Wt.default.createElement(zp,{container:n,configuration:e,onSuccess:o,onFailure:i,mrzRecognizer:t}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Vp(this,void 0,void 0,(function*(){du.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){du.warn("Mrz detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Vp(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 Vp(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Vp(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var e,t,n,o,i;return Vp(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 o=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(zp.FRAME_RESOLUTION);if(!o)return;r&&this.forceUpdate();const i=yield this.props.mrzRecognizer.recognize(o,"CONSUME_IMAGE");if(!this.enabled)return;if(null===i)return;this.camera.reusableImageBuffer=null==i?void 0:i.originalImage.data,i.success?(delete i.originalImage,a=!0,this.configuration.onMrzDetected(i)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(i.originalImage))}catch(e){null===(i=(o=this.configuration).onError)||void 0===i||i.call(o,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 Wt.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},Wt.default.createElement(yn.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&&Wt.default.createElement(An.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}zp.FRAME_RESOLUTION=1200;var jp=zp,Hp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};bn.a;bn.b;class Up extends bn.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,n){return Hp(this,void 0,void 0,(function*(){const o=document.getElementById(e.containerId);if(!o)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((i,r)=>{Object(Wt.render)(Wt.default.createElement(Up,{container:o,configuration:e,onTextDetected:t,onSuccess:i,onFailure:r,textPatternScanner:n}),o)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Hp(this,void 0,void 0,(function*(){du.warn("Text pattern detection resumed"),yield this.resume()}))}pauseDetection(){du.warn("Text pattern detection paused"),this.pause()}componentDidMount(){const e=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Hp(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.textPatternScanner.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return Hp(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Hp(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.props.textPatternScanner.cleanRecognitionQueue(),this.paused=!0}detect(){var e,t,n,o;return Hp(this,void 0,void 0,(function*(){const i=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(Up.FRAME_RESOLUTION);if(!n)return;i&&this.forceUpdate();const o=yield this.props.textPatternScanner.recognize(n);if(!this.enabled)return;if(null===o)return;o&&(r=!0,this.props.onTextDetected(o),this.camera.reusableImageBuffer=o.originalImage.data)}catch(e){null===(o=(n=this.configuration).onError)||void 0===o||o.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 Wt.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),Wt.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},Wt.default.createElement(yn.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&&Wt.default.createElement(An.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}Up.FRAME_RESOLUTION=1200;var Zp=Up,Gp=n(37),Qp=n(27);var Yp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class Xp{constructor(){this.tokenCounter=0,this.taskMap=new Map,this.worker=function(){const e=n(53).default.replace("data:application/javascript;charset=utf-8;base64,",""),t=atob(e),o=new Blob([t],{type:"application/javascript"}),i=URL.createObjectURL(o);return new Worker(i)}(),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=>{if(!e.error)return void console.log("SBSDK: Error event triggered, but no error present",e);if(!e.error.cause)return void console.error("SBSDK: Error event triggered, but no cause present",e.error);const t=e.error.cause.token;if(this.taskMap.has(t)){(0,this.taskMap.get(t).reject)(e.error),this.taskMap.delete(t)}else console.error("Unknown token:",t)}}generateUniqueToken(){return this.tokenCounter++,"token_"+this.tokenCounter+"_"+Math.random().toString(36).substr(2,9)}query(e){return Yp(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})}))}))}}var Kp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class qp{constructor(){this.db=new Xp}clear(){return Kp(this,void 0,void 0,(function*(){yield this.db.query({type:"clear"})}))}delete(){return Kp(this,void 0,void 0,(function*(){yield this.db.query({type:"delete"})}))}getCroppedDetectionResults(e=!0){return Kp(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)),o=yield this.getCroppedDetectionResultImages(n);for(const e of t)this.mapImages(e,o);return t}))}getCroppedDetectionResult(e){return Kp(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,o;e.originalImage=null===(n=t.find((t=>t.documentId===e.id&&"original"===t.type)))||void 0===n?void 0:n.data,e.croppedImage=null===(o=t.find((t=>t.documentId===e.id&&"cropped"===t.type)))||void 0===o?void 0:o.data}getCroppedDetectionResultImages(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:e})}))}getCroppedDetectionResultImage(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"getImages",data:[e]})}))}storeCroppedDetectionResult(e){return Kp(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}),o=[{documentId:n,data:e.originalImage,type:"original"},{documentId:n,data:e.croppedImage,type:"cropped"}];return yield this.db.query({type:"storeImages",data:o}),n}))}getSBDocumentIds(){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocumentIds"})}))}insertSBDocument(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"insertSBDocument",data:e.getData()})}))}deleteSBDocument(e){return Kp(this,void 0,void 0,(function*(){const t="number"==typeof e?e:e.getData().id;return yield this.db.query({type:"deleteSBDocument",data:t})}))}getSBDocument(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"getSBDocument",data:e})}))}insertSBPageImage(e){return Kp(this,void 0,void 0,(function*(){const t={image:e};return yield this.db.query({type:"insertSBPageImage",data:t})}))}getSBPageImage(e){return Kp(this,void 0,void 0,(function*(){return(yield this.db.query({type:"getSBPageImage",data:e})).image}))}deleteImageById(e){return Kp(this,void 0,void 0,(function*(){return yield this.db.query({type:"deleteSBPageImages",data:[e]})}))}deleteImages(e){return Kp(this,void 0,void 0,(function*(){const t=e instanceof Ap?e.getData():e,n=[t.originalImageId];t.documentImageId&&n.push(t.documentImageId),t.unfilteredDocumentImageId&&n.push(t.unfilteredDocumentImageId),yield this.db.query({type:"deleteSBPageImages",data:n})}))}}var Jp=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};class $p{constructor(){this.storage=new qp}static get UI(){if(!A.BUILD_WITH_UI)throw new Error("UI components are not included in Scanbot.min.js. Please use ScanbotSDK.ui2.min.js instead.");return $p._ui2}static initialize(e){var t;return Jp(this,void 0,void 0,(function*(){const n=new $p,o=e.enginePath||$p.defaultEnginePath,i=!!e.allowThreads,r=null!==(t=e.requestSuffix)&&void 0!==t?t:`?${n.version}`;if(!o)throw new Error("To initialize the ScanbotSDK, please specify the enginePath option. This option should specify the location of the accompanying WASM and JS files in the bundle folder. It can either point to your server or a CDN. Please note that this option has been renamed from engine -> enginePath recently. Please see our documentation for more details on how to set up the enginePath correctly.");const a=[e.licenseKey,o,window.location.hostname,"",{captureConsole:!1,allowThreads:i,requestSuffix:r}];return n.bridge=new I(o,{allowSimd:!0,allowThreads:i,requestSuffix:r},a),$p.instance=n,window.scanbotSdk=n,Mt.a.initialize(e.verboseLogging),e.allowThreads&&!Object(S.a)()&&(Mt.a.debugWarn("Threads are not available in this environment. The SDK will run in single-threaded mode."),window.hasOwnProperty("crossOriginIsolated")&&!window.crossOriginIsolated&&Mt.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 Jp(this,void 0,void 0,(function*(){let t;try{return t=yield gh.create(e,this),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createMrzScanner(e){var t;return Jp(this,void 0,void 0,(function*(){let n;try{const o=new N(this,this.bridge.copyArgs.createMRZScanner(null!==(t=e.recognizerConfiguration)&&void 0!==t?t:{}));return n=yield jp.create(e,o),yield this.licenseCheck(),n}catch(e){throw n&&n.dispose(),e}}))}createBarcodeScanner(e){return Jp(this,void 0,void 0,(function*(){let t;try{return t=yield fu.create(e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}openCroppingView(e){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield vp.create(e,this)}))}createTextPatternScanner(e){return Jp(this,void 0,void 0,(function*(){try{e=Dt.fromJson(e);const t=yield this.createTextPatternScannerView(e,e.onTextDetected,e.ocrConfiguration);return yield this.licenseCheck(),t}catch(e){throw e}}))}createVINScanner(e){return Jp(this,void 0,void 0,(function*(){let t;try{e=Lt.fromJson(e);const n=t=>{""!==t.rawText&&e.onTextDetected(t)},o=new h.TextPatternScannerConfiguration(Object.assign(Object.assign({},e.ocrConfiguration),{validator:new h.PresetContentValidator({preset:"VEHICLE_IDENTIFICATION_NUMBER"})}));return t=yield this.createTextPatternScannerView(e,n,o),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}createDocumentDataExtractorScanner(e){return Jp(this,void 0,void 0,(function*(){let t;try{const o=n(54).default;return t=yield o.create(this,e),yield this.licenseCheck(),t}catch(e){throw t&&t.dispose(),e}}))}toDataUrl(e){return Jp(this,void 0,void 0,(function*(){return _t.throwIfMissingBuffer(e),yield F.toDataUrl(e)}))}detectDocument(e,t={},n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){yield this.licenseCheck(),_t.throwIfMissingBuffer(e);const o=yield this.bridge.copyArgs.createDocumentScanner(t),i=this.getBridge(n),r=yield i.documentScannerDetect(o,e);return yield this.release(o,"documentDetector"),r}))}detectAndCropDocument(e,t="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){yield this.licenseCheck(),_t.throwIfMissingBuffer(e);const n=this.getBridge(t);return yield n.detectAndCropDocument(e)}))}detectBarcodes(e,t={},n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){yield this.licenseCheck(),_t.throwIfMissingBuffer(e),"string"==typeof e&&(e=yield F.loadFromUrl(e));const o=Object.assign({},t);o.live=!1;const i=yield this.bridge.copyArgs.createBarcodeScanner(o),r=yield this.getBridge(n).scanBarcodes(i,e);return yield this.release(i,"barcodeRecognizer"),r}))}parseBarcodeDocument(e,t){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),yield this.bridge.copyArgs.parseBarcodeDocument(e,t)}))}createSimpleMRZRecognizer(){return Jp(this,void 0,void 0,(function*(){const e=new p.MrzScannerConfiguration({frameAccumulationConfiguration:{maximumNumberOfAccumulatedFrames:0}});return new N(this,this.bridge.copyArgs.createMRZScanner(e))}))}createOcrEngine(){return Jp(this,void 0,void 0,(function*(){return new z(this,yield this.bridge.copyArgs.createOcrEngine())}))}createDocumentQualityAnalyzer(e={}){return Jp(this,void 0,void 0,(function*(){const t=yield this.bridge.copyArgs.createDocumentQualityAnalyzer(e);return new Ft(this,t)}))}imageRotate(e,t,n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const o=this.getBridge(n);return yield o.imageRotate(e,t)}))}imageFilter(e,t,n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const o=this.getBridge(n);return yield o.imageApplyFilter(e,t)}))}imageCrop(e,t,n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const o=this.getBridge(n);return yield o.imageCrop(e,t)}))}imageResize(e,t,n="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){_t.throwIfMissingBuffer(e);const o=this.getBridge(n);return yield o.imageResize(e,t)}))}getLicenseInfo(){return Jp(this,void 0,void 0,(function*(){const e=yield this.bridge.copyArgs.getLicenseInfo();return T.fromJson(e)}))}beginPdf(e){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new O(this,yield this.bridge.copyArgs.beginPdf(e))}))}beginTiff(e={}){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new L(this,yield this.bridge.copyArgs.beginTiff(e))}))}createDocumentDataExtractor(e){return Jp(this,void 0,void 0,(function*(){return yield this.licenseCheck(),new Wp(this,yield this.bridge.copyArgs.documentDataExtractorCreate(e))}))}imageToJpeg(e,t="COPY_IMAGE"){return Jp(this,void 0,void 0,(function*(){yield this.licenseCheck();return this.getBridge(t).encodeJpeg(e)}))}get version(){return A.VERSION}get utils(){return this._utils||(this._utils=new M),this._utils}release(e,t){return Jp(this,void 0,void 0,(function*(){e&&(Mt.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 Jp(this,void 0,void 0,(function*(){const e=yield this.getLicenseInfo();if(!e.isValid())throw console.error(`LicenseError: ${e.status}`),new Pt(e)}))}createTextPatternScannerView(e,t,n){return Jp(this,void 0,void 0,(function*(){const o=this.bridge.copyArgs.createTextPatternScanner(n),i=new H(this,o);return yield Zp.create(e,t,i)}))}destroy(){this.bridge.destroy(),$p.instance=void 0}}$p.defaultEnginePath="",$p._ui2=A.BUILD_WITH_UI?Fp:void 0,$p.cameras=Qp.a.INSTANCE,$p.Config=y,$p._stats=Gp.a.INSTANCE;var eg=t.a=$p},function(e,t,n){"use strict";var o=n(43),i=n.n(o)()((function(e){return e[1]}));i.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: 12px;\n transform: translate(-50%, -100%);\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=i},function(e,t,n){"use strict";var o=n(43),i=n.n(o)()((function(e){return e[1]}));i.push([e.i,".scanbot-document-hint-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n text-align: center;\n background-color: rgba(0, 0, 0, 0.4);\n color: white;\n border-radius: 0.25em;\n padding: 0.05em 0.3em 0.05em 0.3em;\n font-family: sans-serif;\n font-size: 0.9em;\n font-weight: 300;\n}\n",""]),t.a=i},function(e,t){var n,o,i=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{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&m())}function m(){if(!u){var e=s(h);u=!0;for(var t=c.length;t;){for(l=c,c=[];++d<t;)l&&l[d].run();d=-1,t=c.length}l=null,u=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.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];c.push(new f(e,t)),1!==c.length||u||s(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){const{render:o,hydrate:i,unmountComponentAtNode:r}=n(0);function a(e){return{render(t){o(t,e)},unmount(){r(e)}}}t.createRoot=a,t.hydrateRoot=function(e,t){return i(t,e),a(e)}},function(e,t){e.exports=function(e,t,n,o){var i=n?n.call(o,e,t):void 0;if(void 0!==i)return!!i;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),l=0;l<r.length;l++){var c=r[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(i=n?n.call(o,u,d,c):void 0)||void 0===i&&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";function o(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 i=/^((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=o((function(e){return i.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 o}));const o=n(44).a},function(e,t,n){"use strict";n.r(t),t.default="data:application/javascript;charset=utf-8;base64,InVzZSBzdHJpY3QiOwoKY29uc3QgREJfTkFNRSA9ICJTQlNES0Jhc2UiOwoKY29uc3QgU1RPUkVTID0gewogICAgQ1JPUFBFRF9ERVRFQ1RJT05fUkVTVUxUUzogImNyb3BwZWREZXRlY3Rpb25SZXN1bHRzIiwKICAgIFNCX0RPQ1VNRU5UUzogIlNCRG9jdW1lbnRzIiwKICAgIElNQUdFUzogImltYWdlcyIKfTsKCmZ1bmN0aW9uIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4gLyo6IHN0cmluZyovLCByZXF1ZXN0IC8qOiBJREJSZXF1ZXN0Ki8pIHsKICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IGV2ZW50LnRhcmdldC5yZXN1bHQgfSk7CiAgICB9Owp9CgpmdW5jdGlvbiBvcGVuREIoKSAvKjogUHJvbWlzZTxJREJEYXRhYmFzZT4qL3sKICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7CgogICAgICAgIC8qKiBOQiEgVXBkYXRlIHZlcnNpb24gd2hlbiBEQiBtb2RlbCBjaGFuZ2VzICovCiAgICAgICAgY29uc3QgREJfVkVSU0lPTiA9IDU7CiAgICAgICAgY29uc3QgcmVxdWVzdCA9IGluZGV4ZWREQi5vcGVuKERCX05BTUUsIERCX1ZFUlNJT04pOwoKICAgICAgICByZXF1ZXN0Lm9uc3VjY2VzcyA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgcmVzb2x2ZShldmVudC50YXJnZXRbInJlc3VsdCJdKTsKICAgICAgICB9OwogICAgICAgIHJlcXVlc3Qub25lcnJvciA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgY29uc3QgY29kZSA9IGV2ZW50LnRhcmdldCA/IGV2ZW50LnRhcmdldFsiZXJyb3JDb2RlIl0gOiAiVW5rbm93biBlcnJvciBjb2RlIjsKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJFcnJvciBvcGVuaW5nIGRhdGFiYXNlOiAiICsgY29kZSk7CiAgICAgICAgfTsKICAgICAgICByZXF1ZXN0Lm9udXBncmFkZW5lZWRlZCA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgLy8gVE9ETzogJ29udXBncmFkZW5lZWRlZCcgaXMgb25seSBjYWxsZWQgd2hlbiBGSVJTVCBvcGVuaW5nIHRoZSBkYXRhYmFzZQogICAgICAgICAgICAvLyAgQU5EIHdoZW4gdGhlIHZlcnNpb24gbnVtYmVyIGlzIGluY3JlYXNlZC4gV2hhdCBlbHNlIG5lZWRzIHRvIGJlIGRvbmUgaGVyZT8KICAgICAgICAgICAgY29uc3QgZGIgPSBldmVudC50YXJnZXQgLyogYXMgSURCT3BlbkRCUmVxdWVzdCovLnJlc3VsdDsKCiAgICAgICAgICAgIGZvciAoY29uc3Qga2V5IGluIFNUT1JFUykgewogICAgICAgICAgICAgICAgY29uc3QgbmFtZSA9IFNUT1JFU1trZXldOwogICAgICAgICAgICAgICAgLy8gVE9ETyBjYW4ndCBqdXN0IGRlbGV0ZSBpbiBwcm9kdWN0aW9uLCBuZWVkIHRvIG1pZ3JhdGUgZGF0YQogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICBkYi5kZWxldGVPYmplY3RTdG9yZShuYW1lKTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgICAgICAgICAgLy8gQ2FuJ3QgZGVsZXRlIG9iamVjdCBzdG9yZSB0aGF0IGRvZXNuJ3QgZXhpc3QKICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygiRXJyb3IgZGVsZXRpbmcgb2JqZWN0IHN0b3JlOiAiLCBuYW1lKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkYi5jcmVhdGVPYmplY3RTdG9yZShuYW1lLCB7IGtleVBhdGg6ICJpZCIsIGF1dG9JbmNyZW1lbnQ6IHRydWUgfSk7CiAgICAgICAgICAgIH0KICAgICAgICB9OwogICAgfSk7Cn0KCmFzeW5jIGZ1bmN0aW9uIGdldFRyYW5zYWN0aW9uKHN0b3JlTmFtZXMgLyo6IHN0cmluZ1tdKi8pIC8qOiBQcm9taXNlPElEQlRyYW5zYWN0aW9uPiovewogICAgY29uc3QgZGIgPSBhd2FpdCBvcGVuREIoKTsKICAgIC8vIFRPRE8gaXMgaXQgZXZlciBhY3R1YWxseSBuZWNlc3NhcnkgdG8gd2FpdCBmb3IgYSB0cmFuc2FjdGlvbidzICdvbmNvbXBsZXRlJyBldmVudD8KICAgIHJldHVybiBkYi50cmFuc2FjdGlvbihzdG9yZU5hbWVzLCAicmVhZHdyaXRlIik7Cn0KCmFzeW5jIGZ1bmN0aW9uIGdldFN0b3JlKG5hbWUgLyo6IHN0cmluZyovKSAvKjogUHJvbWlzZTxJREJPYmplY3RTdG9yZT4qL3sKICAgIGNvbnN0IHRyYW5zYWN0aW9uID0gYXdhaXQgZ2V0VHJhbnNhY3Rpb24oW25hbWVdKTsKICAgIHJldHVybiB0cmFuc2FjdGlvbi5vYmplY3RTdG9yZShuYW1lKTsKfQoKYXN5bmMgZnVuY3Rpb24gZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdFN0b3JlKCkgLyo6IFByb21pc2U8SURCT2JqZWN0U3RvcmU+Ki97CiAgICByZXR1cm4gZ2V0U3RvcmUoImNyb3BwZWREZXRlY3Rpb25SZXN1bHRzIik7Cn0KCmFzeW5jIGZ1bmN0aW9uIGdldEltYWdlc1N0b3JlKCkgLyo6IFByb21pc2U8SURCT2JqZWN0U3RvcmU+Ki97CiAgICByZXR1cm4gZ2V0U3RvcmUoImltYWdlcyIpOwp9Cgphc3luYyBmdW5jdGlvbiBjbGVhcigpIHsKICAgIGZvciAoY29uc3Qga2V5IGluIFNUT1JFUykgewogICAgICAgIGNvbnN0IG5hbWUgPSBTVE9SRVNba2V5XTsKICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKG5hbWUpOwogICAgICAgIHN0b3JlLmNsZWFyKCk7CiAgICB9Cn0KCmFzeW5jIGZ1bmN0aW9uIGRlbGV0ZURCKCkgewogICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICBjb25zdCByZXF1ZXN0ID0gaW5kZXhlZERCLmRlbGV0ZURhdGFiYXNlKERCX05BTUUpOwogICAgICAgIHJlcXVlc3Qub25zdWNjZXNzID0gZXZlbnQgPT4gewogICAgICAgICAgICByZXNvbHZlKGV2ZW50KTsKICAgICAgICB9OwogICAgICAgIHJlcXVlc3Qub25lcnJvciA9IGV2ZW50ID0+IHsKICAgICAgICAgICAgcmVqZWN0KGV2ZW50KTsKICAgICAgICB9OwogICAgfSk7Cn0KCmZ1bmN0aW9uIHRocm93RXhjZXB0aW9uKHRva2VuLCBxdWVyeSwgbWVzc2FnZSkgewogICAgdGhyb3cgbmV3IEVycm9yKCJTQkluZGV4ZWREQiB3b3JrZXIgZXJyb3I6ICIgKyBKU09OLnN0cmluZ2lmeSh7CiAgICAgICAgInRva2VuIjogdG9rZW4sCiAgICAgICAgInF1ZXJ5IjogcXVlcnksCiAgICAgICAgIm1lc3NhZ2UiOiBtZXNzYWdlCiAgICB9KSk7Cn0KCnNlbGYub25tZXNzYWdlID0gYXN5bmMgKGV2ZW50IC8qOiBNZXNzYWdlRXZlbnQqLykgPT4gewoKICAgIGNvbnN0IHRva2VuID0gZXZlbnQuZGF0YS50b2tlbjsKICAgIGNvbnN0IHF1ZXJ5ID0gZXZlbnQuZGF0YS5xdWVyeTsKCiAgICB0cnkgewogICAgICAgIGlmIChxdWVyeS50eXBlID09PSAnY2xlYXInKSB7CiAgICAgICAgICAgIGF3YWl0IGNsZWFyKCk7CiAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IHRydWUgfSk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZGVsZXRlJykgewogICAgICAgICAgICBhd2FpdCBkZWxldGVEQigpOwogICAgICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgdG9rZW46IHRva2VuLCBkYXRhOiB0cnVlIH0pOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gJ3N0b3JlQ3JvcHBlZERldGVjdGlvblJlc3VsdCcpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0U3RvcmUoKTsKICAgICAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmFkZChxdWVyeS5kYXRhKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdHMnKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdFN0b3JlKCk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXRBbGwoKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnZ2V0Q3JvcHBlZERldGVjdGlvblJlc3VsdCcpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRDcm9wcGVkRGV0ZWN0aW9uUmVzdWx0U3RvcmUoKTsKICAgICAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLmdldChxdWVyeS5kYXRhKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAnc3RvcmVJbWFnZXMnKSB7CiAgICAgICAgICAgIGNvbnN0IGltYWdlcyA9IHF1ZXJ5LmRhdGE7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0SW1hZ2VzU3RvcmUoKTsKICAgICAgICAgICAgZm9yIChjb25zdCBpbWFnZSBvZiBpbWFnZXMpIHsKICAgICAgICAgICAgICAgIHN0b3JlLmFkZChpbWFnZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgICAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICdnZXRJbWFnZXMnKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0SW1hZ2VzU3RvcmUoKTsKICAgICAgICAgICAgY29uc3QgZG9jdW1lbnRJZHMgPSBxdWVyeS5kYXRhOwogICAgICAgICAgICAvLyBUT0RPIGdldCBmcm9tIHN0b3JlIGJ5IGZvcmVpZ24ga2V5PwogICAgICAgICAgICBzdG9yZS5nZXRBbGwoKS5vbnN1Y2Nlc3MgPSBldmVudCA9PiB7CiAgICAgICAgICAgICAgICBjb25zdCBpbWFnZXMgPSBldmVudC50YXJnZXQucmVzdWx0OwogICAgICAgICAgICAgICAgY29uc3QgZmlsdGVyZWRJbWFnZXMgPSBpbWFnZXMuZmlsdGVyKGltYWdlID0+IGRvY3VtZW50SWRzLmluY2x1ZGVzKGltYWdlLmRvY3VtZW50SWQpKTsKICAgICAgICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyB0b2tlbjogdG9rZW4sIGRhdGE6IGZpbHRlcmVkSW1hZ2VzIH0pOwogICAgICAgICAgICB9OwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImdldFNCRG9jdW1lbnRJZHMiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXRBbGxLZXlzKCk7CiAgICAgICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHJlcXVlc3QpOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImluc2VydFNCRG9jdW1lbnQiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5wdXQocXVlcnkuZGF0YSk7CiAgICAgICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHJlcXVlc3QpOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCRG9jdW1lbnQiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLlNCX0RPQ1VNRU5UUyk7CiAgICAgICAgICAgIGF3YWl0IHN0b3JlLmRlbGV0ZShxdWVyeS5kYXRhKTsKICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgICAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJnZXRTQkRvY3VtZW50IikgewogICAgICAgICAgICBjb25zdCBzdG9yZSA9IGF3YWl0IGdldFN0b3JlKFNUT1JFUy5TQl9ET0NVTUVOVFMpOwogICAgICAgICAgICBjb25zdCByZXF1ZXN0ID0gc3RvcmUuZ2V0KHF1ZXJ5LmRhdGEpOwogICAgICAgICAgICBwb3N0UmVzdWx0T25TdWNjZXNzKHRva2VuLCByZXF1ZXN0KTsKICAgICAgICB9IGVsc2UgaWYgKHF1ZXJ5LnR5cGUgPT09ICJpbnNlcnRTQlBhZ2VJbWFnZSIpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICAgICAgY29uc3QgcmVxdWVzdCA9IHN0b3JlLnB1dChxdWVyeS5kYXRhKTsKICAgICAgICAgICAgcG9zdFJlc3VsdE9uU3VjY2Vzcyh0b2tlbiwgcmVxdWVzdCk7CiAgICAgICAgfSBlbHNlIGlmIChxdWVyeS50eXBlID09PSAiZ2V0U0JQYWdlSW1hZ2UiKSB7CiAgICAgICAgICAgIGNvbnN0IHN0b3JlID0gYXdhaXQgZ2V0U3RvcmUoU1RPUkVTLklNQUdFUyk7CiAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBzdG9yZS5nZXQocXVlcnkuZGF0YSk7CiAgICAgICAgICAgIHBvc3RSZXN1bHRPblN1Y2Nlc3ModG9rZW4sIHJlcXVlc3QpOwogICAgICAgIH0gZWxzZSBpZiAocXVlcnkudHlwZSA9PT0gImRlbGV0ZVNCUGFnZUltYWdlcyIpIHsKICAgICAgICAgICAgY29uc3Qgc3RvcmUgPSBhd2FpdCBnZXRTdG9yZShTVE9SRVMuSU1BR0VTKTsKICAgICAgICAgICAgY29uc3QgaWRzID0gcXVlcnkuZGF0YTsKICAgICAgICAgICAgZm9yIChjb25zdCBpZCBvZiBpZHMpIHsKICAgICAgICAgICAgICAgIGF3YWl0IHN0b3JlLmRlbGV0ZShpZCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgc2VsZi5wb3N0TWVzc2FnZSh7IHRva2VuOiB0b2tlbiwgZGF0YTogdHJ1ZSB9KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksICJVbmtub3duIHF1ZXJ5IHR5cGUiKTsKICAgICAgICB9CiAgICB9IGNhdGNoIChlcnJvcikgewogICAgICAgIGNvbnNvbGUubG9nKCJFcnJvciBpbiBTQkluZGV4ZWREQiB3b3JrZXI6ICIsIGVycm9yKTsKICAgICAgICB0aHJvd0V4Y2VwdGlvbih0b2tlbiwgcXVlcnksIGVycm9yLm1lc3NhZ2UgfHwgZXJyb3IpOwogICAgfQp9Ow=="},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return d}));var o=n(0),i=n(12),r=n(14),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 l=n(25),c=n(24),u=function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};i.a;class d extends i.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 i=null!==(n=t.container)&&void 0!==n?n:document.getElementById(t.containerId);if(t=s.fromJson(t),!i)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,r)=>{Object(o.render)(o.default.createElement(d,{container:i,configuration:t,onSuccess:n,onFailure:r,sdk:e}),i)}))}))}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,o,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(i.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===(o=(n=this.configuration).onDocumentDetected)||void 0===o||o.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 o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),o.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},o.default.createElement(l.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&&o.default.createElement(c.a,{ref:e=>{this.finder=e},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder})))}}},function(e,t,n){"use strict";n.r(t);var o=/^((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)-.*))$/,i=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.default=i}])}));