@scandit/web-datacapture-core 7.2.0 → 7.3.0-beta.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 (191) hide show
  1. package/build/js/{Camera-CWDY5hQK.d.ts → Camera-C8CzJUpi.d.ts} +6 -6
  2. package/build/js/Camera.d.ts +1 -1
  3. package/build/js/Camera.js +1 -1
  4. package/build/js/CameraAccess.d.ts +1 -1
  5. package/build/js/CameraAccess.js +1 -1
  6. package/build/js/CameraRelated.d.ts +1 -1
  7. package/build/js/Common.d.ts +1 -1
  8. package/build/js/DataCaptureContext.d.ts +1 -1
  9. package/build/js/DataCaptureContext.js +1 -1
  10. package/build/js/DataCaptureContextRelated.d.ts +1 -1
  11. package/build/js/DataCaptureVersion.js +1 -1
  12. package/build/js/DataCaptureView.d.ts +1 -1
  13. package/build/js/DataCaptureView.js +1 -1
  14. package/build/js/Defaults.d.ts +1 -1
  15. package/build/js/Feedback.js +1 -1
  16. package/build/js/FrameData.d.ts +1 -1
  17. package/build/js/ImageFrameSource.d.ts +1 -1
  18. package/build/js/LocationSelection.d.ts +1 -1
  19. package/build/js/ScanditIcon.js +1 -1
  20. package/build/js/ScanditIconBuilder.d.ts +3 -1
  21. package/build/js/ScanditIconBuilder.js +1 -1
  22. package/build/js/SingleImageUploader.d.ts +1 -1
  23. package/build/js/Sound.js +1 -1
  24. package/build/js/ViewfinderPlusRelated.d.ts +1 -1
  25. package/build/js/assets/beepSound.js +1 -1
  26. package/build/js/chunks/chunk-2Q5FZVGV.js +1 -1
  27. package/build/js/chunks/chunk-2WFRFPNN.js +3 -0
  28. package/build/js/chunks/chunk-457L5N2F.js +1 -1
  29. package/build/js/chunks/chunk-46WJFV3I.js +1 -1
  30. package/build/js/chunks/{chunk-BIGR7VVJ.js → chunk-5FLNDPTB.js} +1 -1
  31. package/build/js/chunks/chunk-5UHINP4E.js +1 -0
  32. package/build/js/chunks/chunk-6X73W3EO.js +2 -0
  33. package/build/js/chunks/{chunk-DVQH5JLR.js → chunk-72A5262S.js} +1 -1
  34. package/build/js/chunks/chunk-72DAONJI.js +1 -1
  35. package/build/js/chunks/chunk-77BBIAZE.js +1 -1
  36. package/build/js/chunks/chunk-7AAS2OBY.js +1 -0
  37. package/build/js/chunks/chunk-7CQVGY6N.js +1 -0
  38. package/build/js/chunks/chunk-7HWKBORK.js +5 -0
  39. package/build/js/chunks/chunk-7W6SXOJ7.js +4 -0
  40. package/build/js/chunks/chunk-ACXIZNMK.js +1 -1
  41. package/build/js/chunks/chunk-AIC4H5KG.js +1 -1
  42. package/build/js/chunks/chunk-B5JOQVFY.js +1 -1
  43. package/build/js/chunks/chunk-BL6D2W34.js +1 -0
  44. package/build/js/chunks/chunk-BWKNTXLA.js +5 -0
  45. package/build/js/chunks/chunk-CXBLYHGE.js +1 -1
  46. package/build/js/chunks/chunk-D3V72IPH.js +1 -0
  47. package/build/js/chunks/chunk-E3TDSWVQ.js +1 -1
  48. package/build/js/chunks/{chunk-MST2ECFN.js → chunk-FFTRSHP6.js} +1 -1
  49. package/build/js/chunks/{chunk-5E7ISPKS.js → chunk-FPCLZS52.js} +1 -1
  50. package/build/js/chunks/chunk-FSWALUUO.js +1 -1
  51. package/build/js/chunks/chunk-FTD535WI.js +1 -1
  52. package/build/js/chunks/chunk-GZIGVBIW.js +1 -0
  53. package/build/js/chunks/chunk-H4TH4342.js +1 -1
  54. package/build/js/chunks/chunk-IGJQFAQU.js +1 -1
  55. package/build/js/chunks/chunk-J2UL6U3I.js +1 -1
  56. package/build/js/chunks/chunk-JVZYXEYO.js +1 -1
  57. package/build/js/chunks/chunk-LA6TM76R.js +1 -1
  58. package/build/js/chunks/chunk-LSZZVJ6B.js +1 -0
  59. package/build/js/chunks/chunk-MU4VAJIM.js +1 -1
  60. package/build/js/chunks/chunk-MU6SADSF.js +1 -0
  61. package/build/js/chunks/chunk-O5WO3W32.js +1 -0
  62. package/build/js/chunks/{chunk-YKP6UYCY.js → chunk-OZQL57EF.js} +1 -1
  63. package/build/js/chunks/chunk-Q34FICPU.js +1 -0
  64. package/build/js/chunks/chunk-Q7JWDX4U.js +1 -1
  65. package/build/js/chunks/chunk-QZQTCHGN.js +21 -0
  66. package/build/js/chunks/{chunk-AYWOZOZP.js → chunk-SCB3YPEP.js} +1 -1
  67. package/build/js/chunks/chunk-T3AOBMAS.js +1 -1
  68. package/build/js/chunks/chunk-T5EUB6UG.js +1 -1
  69. package/build/js/chunks/chunk-TCJPGGHY.js +1 -1
  70. package/build/js/chunks/chunk-TXNSQTT7.js +6 -0
  71. package/build/js/chunks/{chunk-CBF2PLFL.js → chunk-U2OJFO7J.js} +1 -1
  72. package/build/js/chunks/{chunk-FFFXM7UY.js → chunk-UUGROS73.js} +1 -1
  73. package/build/js/chunks/chunk-V2ZMK4M5.js +1 -0
  74. package/build/js/chunks/chunk-VSMJ4PXT.js +1 -0
  75. package/build/js/chunks/chunk-WHE3FIHW.js +1 -0
  76. package/build/js/chunks/chunk-XR65N6EG.js +1 -1
  77. package/build/js/chunks/chunk-YOAZ4K7N.js +11 -0
  78. package/build/js/chunks/chunk-YWWKDNXO.js +1 -0
  79. package/build/js/chunks/chunk-ZE2WH3AH.js +1 -1
  80. package/build/js/index.d.ts +16 -17
  81. package/build/js/index.js +3 -3
  82. package/build/js/private/AnchorPositions.d.ts +2 -2
  83. package/build/js/private/CameraAccess.d.ts +1 -1
  84. package/build/js/private/CameraAccess.js +1 -1
  85. package/build/js/private/CameraManager.d.ts +1 -1
  86. package/build/js/private/CameraManager.js +1 -1
  87. package/build/js/private/CanvasDrawerWithMetrics.d.ts +1 -1
  88. package/build/js/private/CoreModuleLicenseTextProvider.d.ts +2 -2
  89. package/build/js/private/DataCaptureContextRelated.d.ts +1 -1
  90. package/build/js/private/FrameReaders/FrameReader.d.ts +1 -1
  91. package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +1 -1
  92. package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +1 -1
  93. package/build/js/private/FrameReaders/index.d.ts +1 -1
  94. package/build/js/private/NormalizedConfigureOptions.d.ts +11 -11
  95. package/build/js/private/ViewControls+related.js +1 -1
  96. package/build/js/private/ViewControls_related.d.ts +2 -2
  97. package/build/js/private/ViewStyles.js +1 -1
  98. package/build/js/private/ViewsRegistry.d.ts +1 -1
  99. package/build/js/private/ui/atoms/AimerSvgIcon.d.ts +17 -0
  100. package/build/js/private/ui/atoms/AimerSvgIcon.js +10 -0
  101. package/build/js/private/ui/atoms/ArrowDownSvgIcon.js +1 -1
  102. package/build/js/private/ui/atoms/ArrowLeftSvgIcon.js +1 -1
  103. package/build/js/private/ui/atoms/ArrowRightSvgIcon.js +1 -1
  104. package/build/js/private/ui/atoms/ArrowUpSvgIcon.js +1 -1
  105. package/build/js/private/ui/atoms/ArrowsUp.js +1 -1
  106. package/build/js/private/ui/atoms/CalendarExclamationMarkSvgIcon.js +1 -1
  107. package/build/js/private/ui/atoms/CameraSwitchReverseSvgIcon.js +1 -1
  108. package/build/js/private/ui/atoms/CameraSwitchSvgIcon.js +1 -1
  109. package/build/js/private/ui/atoms/Card.d.ts +21 -0
  110. package/build/js/private/ui/atoms/Card.js +1 -0
  111. package/build/js/private/ui/atoms/CardList.d.ts +60 -0
  112. package/build/js/private/ui/atoms/CardList.js +1 -0
  113. package/build/js/private/ui/atoms/CheckSvgIcon.js +1 -1
  114. package/build/js/private/ui/atoms/ChevronDownSvgIcon.js +1 -1
  115. package/build/js/private/ui/atoms/ChevronLeftSvgIcon.js +1 -1
  116. package/build/js/private/ui/atoms/ChevronRightSvgIcon.js +1 -1
  117. package/build/js/private/ui/atoms/ChevronUpSvgIcon.js +1 -1
  118. package/build/js/private/ui/atoms/CrossSvgIcon.js +1 -1
  119. package/build/js/private/ui/atoms/Dot5xSvgIcon.js +1 -1
  120. package/build/js/private/ui/atoms/ExclamationMarkSvgIcon.js +1 -1
  121. package/build/js/private/ui/atoms/GlassSvgIcon.js +1 -1
  122. package/build/js/private/ui/atoms/HandLensCheckSvgIcon.js +1 -1
  123. package/build/js/private/ui/atoms/KeyboardSvgIcon.d.ts +17 -0
  124. package/build/js/private/ui/atoms/KeyboardSvgIcon.js +10 -0
  125. package/build/js/private/ui/atoms/LowStockSvgIcon.js +1 -1
  126. package/build/js/private/ui/atoms/OnexSvgIcon.js +1 -1
  127. package/build/js/private/ui/atoms/PrinterSvgIcon.js +1 -1
  128. package/build/js/private/ui/atoms/ProgressBar.js +1 -1
  129. package/build/js/private/ui/atoms/QuestionMarkSvgIcon.js +1 -1
  130. package/build/js/private/ui/atoms/RestartSvgIcon.d.ts +17 -0
  131. package/build/js/private/ui/atoms/RestartSvgIcon.js +11 -0
  132. package/build/js/private/ui/atoms/RoundedCheckSvgIcon.js +1 -1
  133. package/build/js/private/ui/atoms/RoundedCrossSvgIcon.d.ts +17 -0
  134. package/build/js/private/ui/atoms/RoundedCrossSvgIcon.js +11 -0
  135. package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.js +1 -1
  136. package/build/js/private/ui/atoms/ShutterButton.js +2 -2
  137. package/build/js/private/ui/atoms/StarFilledSvgIcon.js +1 -1
  138. package/build/js/private/ui/atoms/StarHalfFilledSvgIcon.js +1 -1
  139. package/build/js/private/ui/atoms/StarOutlinedSvgIcon.js +1 -1
  140. package/build/js/private/ui/atoms/SvgIcon.js +1 -1
  141. package/build/js/private/ui/atoms/ToPickSvgIcon.js +1 -1
  142. package/build/js/private/ui/atoms/Toast.d.ts +1 -1
  143. package/build/js/private/ui/atoms/Toast.js +1 -1
  144. package/build/js/private/ui/atoms/TwoxSvgIcon.js +1 -1
  145. package/build/js/private/ui/atoms/WrongItemSvgIcon.js +1 -1
  146. package/build/js/private/ui/colors.d.ts +2 -1
  147. package/build/js/private/ui/colors.js +1 -1
  148. package/build/js/private/ui/molecules/HintPresenter.d.ts +1 -1
  149. package/build/js/private/ui/molecules/HintPresenter.js +1 -1
  150. package/build/js/private/ui/molecules/LoadingOverlay.js +1 -1
  151. package/build/js/private/utils/css.js +1 -1
  152. package/build/js/private/utils/html.js +1 -1
  153. package/build/js/private/utils/index.js +1 -1
  154. package/build/js/private/utils/replaceImagesInViewUtils.js +1 -1
  155. package/build/js/sdk.d.ts +1 -1
  156. package/build/js/worker/WorkerMain.d.ts +1 -1
  157. package/build/js/worker/WorkerMain.js +1 -1
  158. package/build/js/worker/{dataCapture.inlineWorker.d.ts → coreCapture.inlineWorker.d.ts} +1 -1
  159. package/build/js/worker/{dataCapture.inlineWorker.js → coreCapture.inlineWorker.js} +1 -1
  160. package/build/js/worker/dataCaptureEngine.d.ts +1 -1
  161. package/build/js/worker/dataCaptureEngine.js +1 -1
  162. package/build/js/worker/dataCaptureLoader.d.ts +2 -2
  163. package/build/js/worker/dataCaptureWorkerRelated.d.ts +1 -1
  164. package/build/js/worker/helper.d.ts +2 -1
  165. package/build/js/worker/helper.js +1 -1
  166. package/build/js/worker/importWasmScript.js +1 -1
  167. package/build/js/worker/index.d.ts +1 -1
  168. package/build/js/worker/index.js +1 -1
  169. package/package.json +1 -1
  170. package/build/js/chunks/chunk-2NHLNMAU.js +0 -1
  171. package/build/js/chunks/chunk-3OBWS6CO.js +0 -1
  172. package/build/js/chunks/chunk-5TKCHVG2.js +0 -1
  173. package/build/js/chunks/chunk-6FPW3MIJ.js +0 -3
  174. package/build/js/chunks/chunk-BYMYBEMT.js +0 -1
  175. package/build/js/chunks/chunk-CWOHXN5B.js +0 -1
  176. package/build/js/chunks/chunk-EXY5MS5K.js +0 -5
  177. package/build/js/chunks/chunk-FNFCPBQI.js +0 -1
  178. package/build/js/chunks/chunk-GE4CBD4E.js +0 -1
  179. package/build/js/chunks/chunk-GSJH2EXJ.js +0 -2
  180. package/build/js/chunks/chunk-I22KIYBM.js +0 -1
  181. package/build/js/chunks/chunk-JXJQSWYG.js +0 -1
  182. package/build/js/chunks/chunk-KRIYEHHW.js +0 -11
  183. package/build/js/chunks/chunk-LY6NJOQH.js +0 -1
  184. package/build/js/chunks/chunk-T5FGQOCF.js +0 -6
  185. package/build/js/chunks/chunk-TJJYIG7M.js +0 -1
  186. package/build/js/chunks/chunk-U6BTTEV6.js +0 -1
  187. package/build/js/chunks/chunk-U7XZE33G.js +0 -21
  188. package/build/js/chunks/chunk-VEXAGRW7.js +0 -4
  189. package/build/js/chunks/chunk-VIZTTYLK.js +0 -1
  190. package/build/js/chunks/chunk-VXPXBTR2.js +0 -1
  191. package/build/js/chunks/chunk-YS6R5ZYE.js +0 -1
@@ -1,10 +1,10 @@
1
1
  /// <reference types="emscripten" />
2
2
  import { Serializable } from './private/Serializable.js';
3
- import { Size, Orientation, MarginsWithUnitJSON, PointWithUnitJSON, Anchor, MarginsWithUnit, PointWithUnit, Point, Quadrilateral, JSONType, RectJSON, PointJSON, Rect } from './Common.js';
3
+ import { MarginsWithUnitJSON, PointWithUnitJSON, Anchor, MarginsWithUnit, PointWithUnit, Size, Orientation, Point, Quadrilateral, JSONType, PointJSON, RectJSON, Rect } from './Common.js';
4
4
  import { WatermarkStack } from './private/FrameReaders/WatermarkStack.js';
5
5
  import { Optional, MethodSignature } from './tsHelper.js';
6
6
  import './ScanditIcon.js';
7
- import { DataCaptureContextSettings, DataCaptureContextSettingsJSON } from './DataCaptureContextSettings.js';
7
+ import { DataCaptureContextSettingsJSON, DataCaptureContextSettings } from './DataCaptureContextSettings.js';
8
8
  import { LogoStyle, FocusGestureJSON, ZoomGestureJSON, FocusGesture, ZoomGesture } from './DataCaptureViewPlusRelated.js';
9
9
  import { Control } from './ViewControls.js';
10
10
  import { DidTapCustomLocationsViewListener, StateToRender, StateToRenderDomView } from './private/CustomLocationsView.js';
@@ -595,7 +595,7 @@ interface NativeDataCaptureMode {
595
595
  setEnabled(enabled: boolean): Promise<void>;
596
596
  }
597
597
  interface DataCaptureModeJSON<S = JSONType> {
598
- type: "barcodeCapture" | "barcodeTracking" | "idCapture" | "parser" | "sparkScan" | "barcodeFind" | "barcodeCheck" | "labelCapture";
598
+ type: "barcodeCapture" | "barcodeTracking" | "idCapture" | "parser" | "sparkScan" | "barcodeFind" | "barcodeAr" | "labelCapture";
599
599
  enabled: boolean;
600
600
  settings: S;
601
601
  }
@@ -1291,8 +1291,8 @@ interface Module extends EmscriptenModule {
1291
1291
  removeBarcodeFindFromContext: (context: DataCaptureContext, mode: EmscriptenClassHandle) => void;
1292
1292
  addBarcodeFindBasicOverlayToView: (view: DataCaptureView, overlay: EmscriptenClassHandle) => void;
1293
1293
  removeBarcodeFindBasicOverlayFromView: (view: DataCaptureView, overlay: EmscriptenClassHandle) => void;
1294
- addBarcodeCheckToContext: (context: DataCaptureContext, mode: EmscriptenClassHandle) => void;
1295
- removeBarcodeCheckFromContext: (context: DataCaptureContext, mode: EmscriptenClassHandle) => void;
1294
+ addBarcodeArToContext: (context: DataCaptureContext, mode: EmscriptenClassHandle) => void;
1295
+ removeBarcodeArFromContext: (context: DataCaptureContext, mode: EmscriptenClassHandle) => void;
1296
1296
  OpenSourceSoftwareLicenseInfo: {
1297
1297
  getLicenseText(): string;
1298
1298
  };
@@ -1783,4 +1783,4 @@ declare class Camera implements FrameSource, Serializable<CameraJSON> {
1783
1783
  private isZoomAvailable;
1784
1784
  }
1785
1785
 
1786
- export { type AugmentedWorker as $, type PrivateFrameHandler as A, DataCaptureContext$1 as B, CameraPosition as C, DataCaptureLoader as D, type DataCaptureContextListener as E, FocusGestureStrategy as F, type ContextStatusJSON as G, ContextStatus as H, PrivateMirrorAxis as I, type DataCaptureOverlay as J, type DataCaptureViewListener as K, type DataCaptureViewJSON as L, DataCaptureView$1 as M, type NativeDataCaptureMode as N, type FrameData as O, type PrivateChangeSet as P, type PrivateLoadableFrameData as Q, convertToPublicFrameData as R, type DataCaptureLoaderOptions as S, TorchState as T, type PerformanceMetrics as U, VideoResolution as V, DataCaptureEngine as W, type Module as X, type GenericHint as Y, type DataCaptureCallbackMessage as Z, type AnyDataCaptureActionMessage as _, type FrameSource as a, HintWidth as a$, type ModuleHandler as a0, type DataCaptureActionMessageKey as a1, type EngineWorkerResponse as a2, type ExtractCentaurusLicenseResponse as a3, type RequestFrameDataResponse as a4, type IsFeatureSupportedResponse as a5, type GetViewfinderInfo as a6, type GetOpenSourceSoftwareLicenseInfoResponse as a7, type WorkerResponse as a8, type LoadLibraryDataCaptureAction as a9, type DidTapTrackedBarcode as aA, type OnFrameProcessingStartedMessage as aB, type OnFrameProcessingFinishedMessage as aC, type OnFrameSkippedMessage as aD, type ShowToastMessage as aE, type HideToastMessage as aF, type ShowGuidanceMessage as aG, type HideGuidanceMessage as aH, type StartUpdateTimerMessage as aI, type StopUpdateTimerMessage as aJ, type PayloadForCommand as aK, type DataCaptureWorker as aL, type EmscriptenClassHandle as aM, type DataCaptureContext as aN, type DataCaptureImageBufferFrameSource as aO, type GestureListener as aP, type GestureRecognizer as aQ, type DataCaptureView as aR, type JSONParseable as aS, type DataCaptureContextDeserializerResult as aT, type DataCaptureContextDeserializer as aU, type CaptureModeDeserializerInstance as aV, type ModuleMirrorAxis as aW, type Vector as aX, type WasmFrameData as aY, HintFont as aZ, HintTextAlignment as a_, type CreateContextDataCaptureAction as aa, type SetFrameSourceDataCaptureAction as ab, type ProcessFrameDataCaptureAction as ac, type RequestFrameDataDataCaptureAction as ad, type DeleteFrameDataDataCaptureAction as ae, type VisibilityChangeAction as af, type IsFeatureSupportedAction as ag, type UpdateContextDataCaptureAction as ah, type DisposeDataCaptureAction as ai, type FlushAnalyticsDataCaptureAction as aj, type ReportCameraPropertiesDataCaptureAction as ak, type SetLogLevelDataCaptureAction as al, type ExtractCentaurusLicenseDataCaptureAction as am, type OnTapAction as an, type HintPresenterV2updateAction as ao, type GetViewfinderInfoAction as ap, type GetOpenSourceSoftwareLicenseInfoAction as aq, type AddNativeOverlayAction as ar, type RemoveNativeOverlayAction as as, type DataCaptureCallbackMessageKeys as at, type SuccessFeedbackWorkerMessage as au, type ShowHintWorkerMessage as av, type UpdateHintWorkerMessage as aw, type IsFeatureSupportedMessage as ax, type HideHintWorkerMessage as ay, type PerformanceMetricsReportMessage as az, FrameSourceState as b, HintHeight as b0, HintCornerStyle as b1, HintIcon as b2, HintAnchor as b3, type HintStyle as b4, GuidanceHintAnchor as b5, GuidanceHintStyle as b6, type GuidanceHint as b7, ToastHintStyle as b8, type ToastHint as b9, type CameraManagerEventParameters as bA, CameraManager as bB, LicensedFeature as ba, type HintPresenterV2 as bb, type PlatformHintPresenter as bc, type LoadLibraryParameters as bd, type CreateContextParameters as be, type UpdateContextParameters as bf, type SetFrameSourceParameters as bg, type ProcessFrameParameters as bh, type ReportCameraPropertiesParameters as bi, type WorkerFunctions as bj, FrameReaderAbstract as bk, ColorType as bl, type PoolCapacityOptions as bm, type FrameCapture as bn, FrameReader as bo, CameraPosition$1 as bp, CameraResolutionConstraint$1 as bq, AspectRatio as br, type DeviceCamera$1 as bs, CameraAccess$1 as bt, MeteringMode as bu, CameraResolutionConstraint as bv, type ExtendedMediaTrackCapabilities as bw, type ExtendedMediaTrackConstraintSet as bx, type GUI as by, CameraManagerEvent as bz, type FrameSourceListener as c, type FrameSourceJSON as d, type CameraJSON as e, type VideoFrameResolution as f, Camera as g, type CameraSettingsJSONBase as h, type CameraSettingsFromJSON as i, type CameraSettingsJSON as j, isCameraFrameSource as k, CameraSettings as l, CameraAccess as m, type DeviceCamera as n, type Change as o, type PrivateDataCaptureMode as p, type DataCaptureMode as q, type DataCaptureModeJSON as r, type PrivateDataCaptureComponent as s, type DataCaptureComponentJSON as t, type DataCaptureComponent as u, type PrivateDataCaptureContextOptions as v, type PrivateDataCaptureContext as w, type DataCaptureContextCreationOptions as x, type DataCaptureContextJSON as y, type PrivateFrameHandlerResponse as z };
1786
+ export { type AugmentedWorker as $, type PrivateFrameHandler as A, DataCaptureContext$1 as B, CameraPosition as C, DataCaptureLoader as D, type DataCaptureContextListener as E, FocusGestureStrategy as F, type ContextStatusJSON as G, ContextStatus as H, PrivateMirrorAxis as I, type DataCaptureOverlay as J, type DataCaptureViewListener as K, type DataCaptureViewJSON as L, DataCaptureView$1 as M, type NativeDataCaptureMode as N, type FrameData as O, type PrivateChangeSet as P, type PrivateLoadableFrameData as Q, convertToPublicFrameData as R, type DataCaptureLoaderOptions as S, TorchState as T, type PerformanceMetrics as U, VideoResolution as V, DataCaptureEngine as W, type Module as X, type DataCaptureCallbackMessage as Y, type GenericHint as Z, type AnyDataCaptureActionMessage as _, type FrameSource as a, HintWidth as a$, type ModuleHandler as a0, type DataCaptureActionMessageKey as a1, type EngineWorkerResponse as a2, type ExtractCentaurusLicenseResponse as a3, type RequestFrameDataResponse as a4, type IsFeatureSupportedResponse as a5, type GetViewfinderInfo as a6, type GetOpenSourceSoftwareLicenseInfoResponse as a7, type WorkerResponse as a8, type LoadLibraryDataCaptureAction as a9, type DidTapTrackedBarcode as aA, type OnFrameProcessingStartedMessage as aB, type OnFrameProcessingFinishedMessage as aC, type OnFrameSkippedMessage as aD, type ShowToastMessage as aE, type HideToastMessage as aF, type ShowGuidanceMessage as aG, type HideGuidanceMessage as aH, type StartUpdateTimerMessage as aI, type StopUpdateTimerMessage as aJ, type PayloadForCommand as aK, type DataCaptureWorker as aL, type EmscriptenClassHandle as aM, type DataCaptureContext as aN, type DataCaptureImageBufferFrameSource as aO, type GestureListener as aP, type GestureRecognizer as aQ, type DataCaptureView as aR, type JSONParseable as aS, type DataCaptureContextDeserializerResult as aT, type DataCaptureContextDeserializer as aU, type CaptureModeDeserializerInstance as aV, type ModuleMirrorAxis as aW, type Vector as aX, type WasmFrameData as aY, HintFont as aZ, HintTextAlignment as a_, type CreateContextDataCaptureAction as aa, type SetFrameSourceDataCaptureAction as ab, type ProcessFrameDataCaptureAction as ac, type RequestFrameDataDataCaptureAction as ad, type DeleteFrameDataDataCaptureAction as ae, type VisibilityChangeAction as af, type IsFeatureSupportedAction as ag, type UpdateContextDataCaptureAction as ah, type DisposeDataCaptureAction as ai, type FlushAnalyticsDataCaptureAction as aj, type ReportCameraPropertiesDataCaptureAction as ak, type SetLogLevelDataCaptureAction as al, type ExtractCentaurusLicenseDataCaptureAction as am, type OnTapAction as an, type HintPresenterV2updateAction as ao, type GetViewfinderInfoAction as ap, type GetOpenSourceSoftwareLicenseInfoAction as aq, type AddNativeOverlayAction as ar, type RemoveNativeOverlayAction as as, type DataCaptureCallbackMessageKeys as at, type SuccessFeedbackWorkerMessage as au, type ShowHintWorkerMessage as av, type UpdateHintWorkerMessage as aw, type IsFeatureSupportedMessage as ax, type HideHintWorkerMessage as ay, type PerformanceMetricsReportMessage as az, FrameSourceState as b, HintHeight as b0, HintCornerStyle as b1, HintIcon as b2, HintAnchor as b3, type HintStyle as b4, GuidanceHintAnchor as b5, GuidanceHintStyle as b6, type GuidanceHint as b7, ToastHintStyle as b8, type ToastHint as b9, type CameraManagerEventParameters as bA, CameraManager as bB, LicensedFeature as ba, type HintPresenterV2 as bb, type PlatformHintPresenter as bc, type LoadLibraryParameters as bd, type CreateContextParameters as be, type UpdateContextParameters as bf, type SetFrameSourceParameters as bg, type ProcessFrameParameters as bh, type ReportCameraPropertiesParameters as bi, type WorkerFunctions as bj, FrameReaderAbstract as bk, ColorType as bl, type PoolCapacityOptions as bm, type FrameCapture as bn, FrameReader as bo, CameraPosition$1 as bp, CameraResolutionConstraint$1 as bq, AspectRatio as br, type DeviceCamera$1 as bs, CameraAccess$1 as bt, MeteringMode as bu, CameraResolutionConstraint as bv, type ExtendedMediaTrackCapabilities as bw, type ExtendedMediaTrackConstraintSet as bx, type GUI as by, CameraManagerEvent as bz, type FrameSourceListener as c, type FrameSourceJSON as d, type CameraJSON as e, type VideoFrameResolution as f, Camera as g, CameraAccess as h, type DeviceCamera as i, type CameraSettingsJSONBase as j, type CameraSettingsFromJSON as k, type CameraSettingsJSON as l, isCameraFrameSource as m, CameraSettings as n, type Change as o, type PrivateDataCaptureMode as p, type DataCaptureMode as q, type DataCaptureModeJSON as r, type PrivateDataCaptureComponent as s, type DataCaptureComponentJSON as t, type DataCaptureComponent as u, type PrivateDataCaptureContextOptions as v, type PrivateDataCaptureContext as w, type DataCaptureContextCreationOptions as x, type DataCaptureContextJSON as y, type PrivateFrameHandlerResponse as z };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { g as Camera, e as CameraJSON, f as VideoFrameResolution } from './Camera-CWDY5hQK.js';
2
+ export { g as Camera, e as CameraJSON, f as VideoFrameResolution } from './Camera-C8CzJUpi.js';
3
3
  import './Common.js';
4
4
  import './private/Serializable.js';
5
5
  import './private/FrameReaders/WatermarkStack.js';
@@ -1 +1 @@
1
- export{a as Camera}from'./chunks/chunk-LY6NJOQH.js';
1
+ export{a as Camera}from'./chunks/chunk-YWWKDNXO.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { m as CameraAccess, n as DeviceCamera } from './Camera-CWDY5hQK.js';
2
+ export { h as CameraAccess, i as DeviceCamera } from './Camera-C8CzJUpi.js';
3
3
  import './private/Serializable.js';
4
4
  import './Common.js';
5
5
  import './private/FrameReaders/WatermarkStack.js';
@@ -1 +1 @@
1
- export{a as CameraAccess}from'./chunks/chunk-5TKCHVG2.js';
1
+ export{a as CameraAccess}from'./chunks/chunk-7AAS2OBY.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { C as CameraPosition, l as CameraSettings, i as CameraSettingsFromJSON, j as CameraSettingsJSON, h as CameraSettingsJSONBase, F as FocusGestureStrategy, a as FrameSource, d as FrameSourceJSON, c as FrameSourceListener, b as FrameSourceState, T as TorchState, V as VideoResolution, k as isCameraFrameSource } from './Camera-CWDY5hQK.js';
2
+ export { C as CameraPosition, n as CameraSettings, k as CameraSettingsFromJSON, l as CameraSettingsJSON, j as CameraSettingsJSONBase, F as FocusGestureStrategy, a as FrameSource, d as FrameSourceJSON, c as FrameSourceListener, b as FrameSourceState, T as TorchState, V as VideoResolution, m as isCameraFrameSource } from './Camera-C8CzJUpi.js';
3
3
  import './private/Serializable.js';
4
4
  import './Common.js';
5
5
  import './private/FrameReaders/WatermarkStack.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { Serializable, StringSerializable } from './private/Serializable.js';
2
+ import { StringSerializable, Serializable } from './private/Serializable.js';
3
3
 
4
4
  interface PointJSON {
5
5
  x: number;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { o as Change, u as DataCaptureComponent, t as DataCaptureComponentJSON, B as DataCaptureContext, x as DataCaptureContextCreationOptions, y as DataCaptureContextJSON, q as DataCaptureMode, r as DataCaptureModeJSON, N as NativeDataCaptureMode, P as PrivateChangeSet, s as PrivateDataCaptureComponent, w as PrivateDataCaptureContext, v as PrivateDataCaptureContextOptions, p as PrivateDataCaptureMode, A as PrivateFrameHandler, z as PrivateFrameHandlerResponse } from './Camera-CWDY5hQK.js';
2
+ export { o as Change, u as DataCaptureComponent, t as DataCaptureComponentJSON, B as DataCaptureContext, x as DataCaptureContextCreationOptions, y as DataCaptureContextJSON, q as DataCaptureMode, r as DataCaptureModeJSON, N as NativeDataCaptureMode, P as PrivateChangeSet, s as PrivateDataCaptureComponent, w as PrivateDataCaptureContext, v as PrivateDataCaptureContextOptions, p as PrivateDataCaptureMode, A as PrivateFrameHandler, z as PrivateFrameHandlerResponse } from './Camera-C8CzJUpi.js';
3
3
  import './Common.js';
4
4
  import './DataCaptureContextSettings.js';
5
5
  import './license/OpenSourceSoftwareLicenseInfo.js';
@@ -1 +1 @@
1
- export{a as DataCaptureContext}from'./chunks/chunk-VEXAGRW7.js';
1
+ export{a as DataCaptureContext}from'./chunks/chunk-7W6SXOJ7.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { H as ContextStatus, G as ContextStatusJSON, E as DataCaptureContextListener, I as PrivateMirrorAxis } from './Camera-CWDY5hQK.js';
2
+ export { H as ContextStatus, G as ContextStatusJSON, E as DataCaptureContextListener, I as PrivateMirrorAxis } from './Camera-C8CzJUpi.js';
3
3
  import './ScanditIcon.js';
4
4
  import './private/Serializable.js';
5
5
  import './Common.js';
@@ -1 +1 @@
1
- export{a as DataCaptureVersion}from'./chunks/chunk-VXPXBTR2.js';
1
+ export{a as DataCaptureVersion}from'./chunks/chunk-Q34FICPU.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  import './Common.js';
3
- export { J as DataCaptureOverlay, M as DataCaptureView, L as DataCaptureViewJSON, K as DataCaptureViewListener } from './Camera-CWDY5hQK.js';
3
+ export { J as DataCaptureOverlay, M as DataCaptureView, L as DataCaptureViewJSON, K as DataCaptureViewListener } from './Camera-C8CzJUpi.js';
4
4
  import './DataCaptureViewPlusRelated.js';
5
5
  import './ViewControls.js';
6
6
  import './private/CustomLocationsView.js';
@@ -1 +1 @@
1
- export{a as DataCaptureView}from'./chunks/chunk-U7XZE33G.js';
1
+ export{a as DataCaptureView}from'./chunks/chunk-QZQTCHGN.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  import * as CSS from 'csstype';
3
- import { V as VideoResolution, F as FocusGestureStrategy, C as CameraPosition } from './Camera-CWDY5hQK.js';
3
+ import { V as VideoResolution, F as FocusGestureStrategy, C as CameraPosition } from './Camera-C8CzJUpi.js';
4
4
  import { MarginsWithUnit, PointWithUnit, Anchor, Color } from './Common.js';
5
5
  import { FocusGestureJSON, FocusGesture, ZoomGestureJSON, ZoomGesture, LogoStyle } from './DataCaptureViewPlusRelated.js';
6
6
  import { RectangularViewfinderStyle, PrivateRectangularViewfinderDefault } from './ViewfinderPlusRelated.js';
@@ -1 +1 @@
1
- export{a as Feedback}from'./chunks/chunk-CBF2PLFL.js';
1
+ export{a as Feedback}from'./chunks/chunk-U2OJFO7J.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { O as FrameData, Q as PrivateLoadableFrameData, R as convertToPublicFrameData } from './Camera-CWDY5hQK.js';
2
+ export { O as FrameData, Q as PrivateLoadableFrameData, R as convertToPublicFrameData } from './Camera-C8CzJUpi.js';
3
3
  import './ScanditIcon.js';
4
4
  import './private/Serializable.js';
5
5
  import './Common.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { a as FrameSource, b as FrameSourceState, c as FrameSourceListener } from './Camera-CWDY5hQK.js';
2
+ import { a as FrameSource, b as FrameSourceState, c as FrameSourceListener } from './Camera-C8CzJUpi.js';
3
3
  import { Serializable } from './private/Serializable.js';
4
4
  import './Common.js';
5
5
  import './private/FrameReaders/WatermarkStack.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { NumberWithUnit, SizeWithUnitAndAspect, SizeWithUnit, NumberWithUnitJSON, SizeWithUnitAndAspectJSON } from './Common.js';
2
+ import { NumberWithUnitJSON, NumberWithUnit, SizeWithUnitAndAspectJSON, SizeWithUnitAndAspect, SizeWithUnit } from './Common.js';
3
3
  import { Serializable } from './private/Serializable.js';
4
4
 
5
5
  interface LocationSelectionJSON {
@@ -1 +1 @@
1
- export{b as ScanditIcon,a as ScanditIconShape}from'./chunks/chunk-3OBWS6CO.js';
1
+ export{b as ScanditIcon,a as ScanditIconShape}from'./chunks/chunk-BL6D2W34.js';
@@ -31,7 +31,9 @@ declare enum ScanditIconType {
31
31
  CameraSwitch = "cameraSwitch",
32
32
  DotFiveX = "dotFiveX",
33
33
  OneX = "oneX",
34
- TwoX = "twoX"
34
+ TwoX = "twoX",
35
+ Restart = "restart",
36
+ Keyboard = "keyboard"
35
37
  }
36
38
  declare const ScanditIconForIconType: Record<ScanditIconType, Promise<{
37
39
  register(): void;
@@ -1 +1 @@
1
- export{c as ScanditIconBuilder,b as ScanditIconForIconType,a as ScanditIconType}from'./chunks/chunk-TJJYIG7M.js';export{a as ScanditIconShape}from'./chunks/chunk-3OBWS6CO.js';
1
+ export{c as ScanditIconBuilder,b as ScanditIconForIconType,a as ScanditIconType}from'./chunks/chunk-GZIGVBIW.js';export{a as ScanditIconShape}from'./chunks/chunk-BL6D2W34.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { d as FrameSourceJSON, b as FrameSourceState, a as FrameSource, c as FrameSourceListener } from './Camera-CWDY5hQK.js';
2
+ import { d as FrameSourceJSON, b as FrameSourceState, a as FrameSource, c as FrameSourceListener } from './Camera-C8CzJUpi.js';
3
3
  import { SingleImageUploaderSettingsJSON, SingleImageUploaderSettings } from './SingleImageUploaderSettings.js';
4
4
  import { Serializable } from './private/Serializable.js';
5
5
  import './Common.js';
package/build/js/Sound.js CHANGED
@@ -1 +1 @@
1
- export{a as Sound}from'./chunks/chunk-GSJH2EXJ.js';
1
+ export{a as Sound}from'./chunks/chunk-6X73W3EO.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { Color, SizeWithUnitAndAspect, ColorJSON, SizeWithUnitAndAspectJSON } from './Common.js';
2
+ import { ColorJSON, Color, SizeWithUnitAndAspect, SizeWithUnitAndAspectJSON } from './Common.js';
3
3
  import { Serializable } from './private/Serializable.js';
4
4
 
5
5
  type ViewfinderTypeNone = "none";
@@ -1 +1 @@
1
- export{a as beepSound}from'../chunks/chunk-JXJQSWYG.js';
1
+ var A="data:audio/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQRChYECGFOAZwEAAAAAAAOWEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHWTbuMU6uEElTDZ1OsggFATbuMU6uEHFO7a1OsggOA7AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmsCrXsYMPQkBNgIxMYXZmNjEuMS4xMDBXQYxMYXZmNjEuMS4xMDBEiYhAd+AAAAAAABZUrmvlrgEAAAAAAABc14EBc8WIg08ub3qWhnCcgQAitZyDdW5kiIEAhoZBX09QVVNWqoNjLqBWu4QExLQAg4EC4ZGfgQK1iEDHcAAAAAAAYmSBIGOik09wdXNIZWFkAQI4AeAuAAAAAAASVMNn+3Nzn2PAgGfImUWjh0VOQ09ERVJEh4xMYXZmNjEuMS4xMDBzc9ZjwItjxYiDTy5vepaGcGfIoUWjh0VOQ09ERVJEh5RMYXZjNjEuMy4xMDAgbGlib3B1c2fIoUWjiERVUkFUSU9ORIeTMDA6MDA6MDAuMzgyMDAwMDAwAB9DtnVBuueBAKOugQAAgCiDbjuDzUwipkvAAbsncWC64YXA60en1ZoN8Z+MzFsMrkjZdE9+kzThwKOugQAVgCikmlGjqD/BMTx8UMHQQIkyzNa4+i/GF8qWxMmwp9/b52ziROwy8+vlu6OogQApgCif9PJP2TVhRpk9OiIKqY7SgqYyraCgntSwzRFSNDAu39ER0KO0gQA9gCi+D4hgiPOvYBIzXCNWGWyjS2R2d67BIFy+lpuz8g8lJ9B/wNMBXD6sTtm6R2FKYKObgQBRgCgjswJcBYTX6v+tXBR9jGkdsn9jRx/Io4uBAGWAKAfGs+Mf06OMgQB5gCgHxrMPn6Jko4yBAI2AKAfGsw+fomSjjIEAoYAoB8azD5+iZKOMgQC1gCgHxrMPn6Jko4yBAMmAKAfGsw+fomSjjIEA3YAoB8azD5+iZKOMgQDxgCgHxrMPn6Jko4yBAQWAKAfGsw+fomSjjIEBGYAoB8azD5+iZKOMgQEtgCgHxrMPn6Jko4yBAUGAKAfGsw+fomSjjIEBVYAoB8azD5+iZKOMgQFpgCgHxrMPn6JkoJWhjIEBfQAoB8azD5+iZHWihAEgpTscU7trkbuPs4EAt4r3gQHxggHA8IED";export{A as beepSound};
@@ -1 +1 @@
1
- var q=Object.create;var o=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var t=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var l=(a,b)=>(b=Symbol[a])?b:Symbol.for("Symbol."+a);var x=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var v=(a,b,c,e)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of s(b))!u.call(a,d)&&d!==c&&o(a,d,{get:()=>b[d],enumerable:!(e=r(b,d))||e.enumerable});return a};var y=(a,b,c)=>(c=a!=null?q(t(a)):{},v(b||!a||!a.__esModule?o(c,"default",{value:a,enumerable:!0}):c,a));var w=function(a,b){this[0]=a,this[1]=b;},z=(a,b,c)=>{var e=(h,g,i,k)=>{try{var m=c[h](g),n=(g=m.value)instanceof w,p=m.done;Promise.resolve(n?g[0]:g).then(j=>n?e(h==="return"?h:"next",g[1]?{done:j.done,value:j.value}:j,i,k):i({value:j,done:p})).catch(j=>e("throw",j,i,k));}catch(j){k(j);}},d=h=>f[h]=g=>new Promise((i,k)=>e(h,g,i,k)),f={};return c=c.apply(a,b),f[l("asyncIterator")]=()=>f,d("next"),d("throw"),d("return"),f};var A=(a,b,c)=>(b=a[l("asyncIterator")])?b.call(a):(a=a[l("iterator")](),b={},c=(e,d)=>(d=a[e])&&(b[e]=f=>new Promise((h,g,i)=>(f=d.call(a,f),i=f.done,Promise.resolve(f.value).then(k=>h({value:k,done:i}),g)))),c("next"),c("return"),b);export{x as a,y as b,w as c,z as d,A as e};
1
+ var q=Object.create;var o=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var t=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var l=(a,b)=>(b=Symbol[a])?b:Symbol.for("Symbol."+a);var x=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var v=(a,b,c,e)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of s(b))!u.call(a,d)&&d!==c&&o(a,d,{get:()=>b[d],enumerable:!(e=r(b,d))||e.enumerable});return a};var y=(a,b,c)=>(c=a!=null?q(t(a)):{},v(b||!a||!a.__esModule?o(c,"default",{value:a,enumerable:true}):c,a));var w=function(a,b){this[0]=a,this[1]=b;},z=(a,b,c)=>{var e=(h,g,i,k)=>{try{var m=c[h](g),n=(g=m.value)instanceof w,p=m.done;Promise.resolve(n?g[0]:g).then(j=>n?e(h==="return"?h:"next",g[1]?{done:j.done,value:j.value}:j,i,k):i({value:j,done:p})).catch(j=>e("throw",j,i,k));}catch(j){k(j);}},d=h=>f[h]=g=>new Promise((i,k)=>e(h,g,i,k)),f={};return c=c.apply(a,b),f[l("asyncIterator")]=()=>f,d("next"),d("throw"),d("return"),f};var A=(a,b,c)=>(b=a[l("asyncIterator")])?b.call(a):(a=a[l("iterator")](),b={},c=(e,d)=>(d=a[e])&&(b[e]=f=>new Promise((h,g,i)=>(f=d.call(a,f),i=f.done,Promise.resolve(f.value).then(k=>h({value:k,done:i}),g)))),c("next"),c("return"),b);export{x as a,y as b,w as c,z as d,A as e};
@@ -0,0 +1,3 @@
1
+ import {b,a as a$3,c,f as f$1}from'./chunk-OZQL57EF.js';import {a as a$1}from'./chunk-EV4OEANA.js';import {a as a$5}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-MU6SADSF.js';import {a as a$4}from'./chunk-LSZZVJ6B.js';var h="scandit-progress-bar",n="aria-valuenow",f="aria-valuemin",w="aria-valuemax",a=class a extends a$1{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=a$2`
2
+ <div id="scandit-progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" />
3
+ `,e.append(a.createStyleElement().cloneNode(true)),this.progress=e.querySelector("#scandit-progress");}static get observedAttributes(){return ["value","min","max"]}static createStyleElement(){return a$4`:host{display:inline-block;--indeterminate-bubble-width:35%;--accent-color:#${b.toJSON()};--start-gradient-color:#${a$3.toJSON()};--end-gradient-color:#${c.toJSON()};--secondary-color:#${f$1.toJSON()};width:100%}:host [role=progressbar]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:.5rem;overflow:hidden;position:relative}:host [role=progressbar]:after,:host [role=progressbar]:before{background:var(--accent-color);border-radius:.5rem;content:" ";height:.5rem;left:0;position:absolute;top:0}:host([variant=gradient]) [role=progressbar]:after,:host([variant=gradient]) [role=progressbar]:before{background:linear-gradient(90deg,var(--start-gradient-color) 0,var(--end-gradient-color) 100%)}:host(:focus-visible){border-radius:.5rem;outline-color:var(--accent-color);outline-offset:5px}:host [role=progressbar]:not([aria-valuenow]):after{animation:indeterminate-progress-bar 2.5s ease infinite;width:var(--indeterminate-bubble-width);z-index:1}:host [role=progressbar][aria-valuenow]:after{animation:none;width:0}:host [role=progressbar][aria-valuenow]:before{background-color:var(--accent-color);border-radius:.5rem;transition:width .3s linear;width:calc(var(--aria-valuenow)*1%)}:host [role=progressbar]{background-color:var(--secondary-color);border-radius:.5rem}@keyframes indeterminate-progress-bar{0%{left:0}50%{left:calc(100% - var(--indeterminate-bubble-width))}}`}get min(){var r;let e=(r=this.getAttribute("min"))!=null?r:0;return Number(e)}get max(){var r;let e=(r=this.getAttribute("max"))!=null?r:1;return Number(e)}set max(e){e!==null&&this.setAttribute("max",String(e));}get value(){let e=this.getAttribute("value");return e==null||e===""?null:Number(e)}set value(e){if(e==null){this.removeAttribute("value");return}e>=this.min&&e<=this.max&&this.setAttribute("value",String(e));}static create(){return document.createElement(h)}static register(){a$5({[a.tag]:a});}attributeChangedCallback(){this.update();}connectedCallback(){this.update();}update(){let{min:e,max:r,value:i,progress:t}=this;if(t==null||t.setAttribute(f,e.toString()),t==null||t.setAttribute(w,r.toString()),i==null){t==null||t.removeAttribute(n),t==null||t.removeAttribute("style");return}if(i>=e&&i<=r){let v=(i-e)/(r-e)*100,l=String(v);t==null||t.setAttribute(n,l),t==null||t.setAttribute("style",`--${n}: ${l}`);}}};a.tag=h;var o=a;o.register();export{o as a};
@@ -1 +1 @@
1
- import {b}from'./chunk-QBDQQMQ5.js';import {b as b$1}from'./chunk-LA6TM76R.js';var d=(e=>(e.Nonzero="nonzero",e.Evenodd="evenodd",e))(d||{}),n=class n extends b{constructor(e){super();this._context=null;this.isNextDrawPending=!1;this.latestCommands=new Uint8Array([]);this.canvas=e,this.doDrawLoop=this.doDraw.bind(this);}get context(){if(!this._context&&(this._context=this.canvas.getContext("2d"),!this._context))throw new TypeError("CanvasRenderingContext cannot be retrieved.");return this._context}draw(e){if(this.latestCommands=e,!this.isCanvasReady()){this.postponeDraw();return}this.isNextDrawPending||(this.isNextDrawPending=!0,requestAnimationFrame(this.doDrawLoop));}updateCanvasSizeAttributes(e,s,t=window.devicePixelRatio){let i=Math.round(e*t),r=Math.round(s*t);(i!==this.canvas.width||r!==this.canvas.height)&&(this.canvas.width=i,this.canvas.height=r,this.context.scale(t,t));}startObservingCanvasResize(){if(!this.resizeObserver){if(!n.ResizeObserver)throw new Error("PrivateCanvasDrawer.ResizeObserver is not set");this.resizeObserver=new n.ResizeObserver(e=>{var r;let[s]=e,{width:t,height:i}=(r=s.contentRect)!=null?r:this.canvas;t===0||i===0||(this.updateCanvasSizeAttributes(t,i),this.latestCommands.length!==0&&(this.draw(this.latestCommands),this.latestCommands=new Uint8Array([])));}),this.resizeObserver.observe(this.canvas);}}endObservingCanvasResize(){this.resizeObserver&&this.resizeObserver.unobserve(this.canvas);}doDraw(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);let e=new b$1(this.latestCommands);for(;!e.isConsumed();){let s=e.extractCommandType();this.drawSingleCommand(s,e);}this.isNextDrawPending=!1;}postponeDraw(){this.startObservingCanvasResize();}isCanvasReady(){return this.canvas.width>0&&this.canvas.height>0}};n.ResizeObserver="ResizeObserver"in globalThis?globalThis.ResizeObserver:void 0;var h=n;export{d as a,h as b};
1
+ import {b}from'./chunk-QBDQQMQ5.js';import {b as b$1}from'./chunk-LA6TM76R.js';var d=(e=>(e.Nonzero="nonzero",e.Evenodd="evenodd",e))(d||{}),n=class n extends b{constructor(e){super();this._context=null;this.isNextDrawPending=false;this.latestCommands=new Uint8Array([]);this.canvas=e,this.doDrawLoop=this.doDraw.bind(this);}get context(){if(!this._context&&(this._context=this.canvas.getContext("2d"),!this._context))throw new TypeError("CanvasRenderingContext cannot be retrieved.");return this._context}draw(e){if(this.latestCommands=e,!this.isCanvasReady()){this.postponeDraw();return}this.isNextDrawPending||(this.isNextDrawPending=true,requestAnimationFrame(this.doDrawLoop));}updateCanvasSizeAttributes(e,s,t=window.devicePixelRatio){let i=Math.round(e*t),r=Math.round(s*t);(i!==this.canvas.width||r!==this.canvas.height)&&(this.canvas.width=i,this.canvas.height=r,this.context.scale(t,t));}startObservingCanvasResize(){if(!this.resizeObserver){if(!n.ResizeObserver)throw new Error("PrivateCanvasDrawer.ResizeObserver is not set");this.resizeObserver=new n.ResizeObserver(e=>{var r;let[s]=e,{width:t,height:i}=(r=s.contentRect)!=null?r:this.canvas;t===0||i===0||(this.updateCanvasSizeAttributes(t,i),this.latestCommands.length!==0&&(this.draw(this.latestCommands),this.latestCommands=new Uint8Array([])));}),this.resizeObserver.observe(this.canvas);}}endObservingCanvasResize(){this.resizeObserver&&this.resizeObserver.unobserve(this.canvas);}doDraw(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height);let e=new b$1(this.latestCommands);for(;!e.isConsumed();){let s=e.extractCommandType();this.drawSingleCommand(s,e);}this.isNextDrawPending=false;}postponeDraw(){this.startObservingCanvasResize();}isCanvasReady(){return this.canvas.width>0&&this.canvas.height>0}};n.ResizeObserver="ResizeObserver"in globalThis?globalThis.ResizeObserver:void 0;var h=n;export{d as a,h as b};
@@ -1 +1 @@
1
- import {c,a,b}from'./chunk-JFRSUCMO.js';import {a as a$2}from'./chunk-EQRBQJYM.js';import {a as a$1}from'./chunk-7XQ3GHYH.js';import {a as a$3}from'./chunk-XR65N6EG.js';var s=class s{constructor(e){this.canUploadFile=!1;this._mounted=!1;this._loading=!1;this._htmlRoot=void 0;this._canvas=void 0;this._onInputCheck=void 0;this._onBeforeFileRead=void 0;this._onImageLoadError=void 0;this._onFileReaderError=void 0;this._onCaptureReady=void 0;this._resizedImageSizeLimit=1440;this._inputElement=void 0;this._buttonElement=void 0;this._chooseImageText="";this._settings=e;}get canvas(){return this._canvas||(this._canvas=document.createElement("canvas")),this._canvas}get canvasContext(){return this._canvasContext||(this._canvasContext=this.canvas.getContext("2d",{willReadFrequently:!0})),this._canvasContext}mount(e){var E;if(this._mounted)return;if(!document.head.querySelector(`[data-component=${s.componentName}]`)){let o=document.createElement("style");o.dataset.component=s.componentName,o.textContent=c,document.head.append(o);}let t=document.createElement("div");t.className=a.SINGLE_IMAGE_UPLOADER_CONTAINER,Object.assign(t.style,b.SINGLE_IMAGE_UPLOADER_CONTAINER_STYLE,this._settings.containerStyle),e.append(t);let{iconElement:n,iconStyle:d,informationElement:i,informationStyle:u,buttonElement:r,buttonStyle:p,onlyCameraCapture:b$1}=this._settings;Object.assign(n.style,b.SINGLE_IMAGE_UPLOADER_ICON_STYLE,d,{maxWidth:"100px",maxHeight:"100px"}),t.append(n),i.hasAttribute(s.DEFAULT_DOM_ATTRIBUTE)&&(Object.assign(i.style,b.SINGLE_IMAGE_UPLOADER_INFORMATION_STYLE,u),i.textContent=a$1.getInstance().get("core.singleImageUploader.title")),t.append(i);let a$3=document.createElement("input");a$3.type="file",a$3.accept="image/*",b$1&&(a$3.capture="environment",a$3.dataset.onlyCaptureOnMobile="environment"),a$3.addEventListener("change",o=>{this.onFileUpload(o);}),a$3.addEventListener("click",o=>{var l;(l=this._onInputCheck)==null||l.call(this,o);}),a$3.addEventListener("keydown",o=>{var l;(l=this._onInputCheck)==null||l.call(this,o);});let c$1=document.createElement("label");c$1.append(a$3),r.hasAttribute(s.DEFAULT_DOM_ATTRIBUTE)&&(Object.assign(r.style,b.SINGLE_IMAGE_UPLOADER_BUTTON_STYLE,p),r.textContent=a$1.getInstance().get("core.singleImageUploader.button")),c$1.append(r),t.append(c$1);let v=document.createRange().createContextualFragment(atob(a$2)).firstElementChild;Object.assign(v.style,{position:"absolute",bottom:"1em",right:"1em",width:"10em"}),t.append(v),this._htmlRoot=t,this._mounted=!0,this._inputElement=a$3,this._buttonElement=r,this._chooseImageText=(E=r.textContent)!=null?E:"";}unmount(){var e,t;this._mounted&&((e=this._htmlRoot)==null||e.remove(),(t=document.head.querySelector(`[data-component=${s.componentName}]`))==null||t.remove(),this._mounted=!1);}setButtonState(e){this._inputElement&&(this._inputElement.disabled=e==="disabled");}getButtonState(){return this._inputElement?this._inputElement.disabled?"disabled":"enabled":"disabled"}onInputCheck(e){this._onInputCheck=e;}onBeforeFileRead(e){this._onBeforeFileRead=e;}onImageLoadError(e){this._onImageLoadError=e;}onFileReaderError(e){this._onFileReaderError=e;}onCaptureReady(e){this._onCaptureReady=e;}onAfterImageProcessed(){this.setLoading(!1);}setLoading(e){this._buttonElement&&(this.setButtonState(e?"disabled":"enabled"),this._buttonElement.textContent=e?"...":this._chooseImageText,this._loading=e);}getResizedImageDimensions(e,t){return e<=this._resizedImageSizeLimit&&t<=this._resizedImageSizeLimit?{width:e,height:t}:e>t?{width:this._resizedImageSizeLimit,height:Math.round(t/e*this._resizedImageSizeLimit)}:{width:Math.round(e/t*this._resizedImageSizeLimit),height:this._resizedImageSizeLimit}}onImageLoad(e){var i;let{height:t,width:n}=this.getResizedImageDimensions(e.naturalWidth,e.naturalHeight);this.canvasContext.canvas.width=n,this.canvasContext.canvas.height=t,this.canvasContext.drawImage(e,0,0,n,t);let d={data:this.canvasContext.getImageData(0,0,n,t).data,width:n,height:t};(i=this._onCaptureReady)==null||i.call(this,d);}onFileReaderLoad(e,t,n){e.value="",t.result!=null&&(n.addEventListener("load",()=>{this.onImageLoad(n);},{once:!0}),n.addEventListener("error",d=>{var i;(i=this._onImageLoadError)==null||i.call(this,d),this.setLoading(!1);},{once:!0}),n.src=t.result);}onFileUpload(e){var u;this.setLoading(!0);let t=e.currentTarget,{files:n}=t;if(n==null||n.length===0){this.setLoading(!1);return}if((u=this._onBeforeFileRead)==null||u.call(this,e),!this.canUploadFile){t.value="",a$3.log(a$3.Level.Warn,"Can't upload file, no capture mode enabled."),this.setLoading(!1);return}let d=new Image,i=new FileReader;i.addEventListener("load",()=>{this.onFileReaderLoad(t,i,d);}),i.addEventListener("error",r=>{var p;(p=this._onFileReaderError)==null||p.call(this,r),this.setLoading(!1);}),i.readAsDataURL(n[0]);}};s.componentName="SingleImageUploaderView",s.DEFAULT_DOM_ATTRIBUTE="data-scandit-default";var I=s;export{I as a};
1
+ import {c,a,b}from'./chunk-JFRSUCMO.js';import {a as a$2}from'./chunk-EQRBQJYM.js';import {a as a$1}from'./chunk-7XQ3GHYH.js';import {a as a$3}from'./chunk-XR65N6EG.js';var s=class s{constructor(e){this.canUploadFile=false;this._mounted=false;this._loading=false;this._htmlRoot=void 0;this._canvas=void 0;this._onInputCheck=void 0;this._onBeforeFileRead=void 0;this._onImageLoadError=void 0;this._onFileReaderError=void 0;this._onCaptureReady=void 0;this._resizedImageSizeLimit=1440;this._inputElement=void 0;this._buttonElement=void 0;this._chooseImageText="";this._settings=e;}get canvas(){return this._canvas||(this._canvas=document.createElement("canvas")),this._canvas}get canvasContext(){return this._canvasContext||(this._canvasContext=this.canvas.getContext("2d",{willReadFrequently:true})),this._canvasContext}mount(e){var E;if(this._mounted)return;if(!document.head.querySelector(`[data-component=${s.componentName}]`)){let o=document.createElement("style");o.dataset.component=s.componentName,o.textContent=c,document.head.append(o);}let t=document.createElement("div");t.className=a.SINGLE_IMAGE_UPLOADER_CONTAINER,Object.assign(t.style,b.SINGLE_IMAGE_UPLOADER_CONTAINER_STYLE,this._settings.containerStyle),e.append(t);let{iconElement:n,iconStyle:d,informationElement:i,informationStyle:u,buttonElement:r,buttonStyle:p,onlyCameraCapture:b$1}=this._settings;Object.assign(n.style,b.SINGLE_IMAGE_UPLOADER_ICON_STYLE,d,{maxWidth:"100px",maxHeight:"100px"}),t.append(n),i.hasAttribute(s.DEFAULT_DOM_ATTRIBUTE)&&(Object.assign(i.style,b.SINGLE_IMAGE_UPLOADER_INFORMATION_STYLE,u),i.textContent=a$1.getInstance().get("core.singleImageUploader.title")),t.append(i);let a$3=document.createElement("input");a$3.type="file",a$3.accept="image/*",b$1&&(a$3.capture="environment",a$3.dataset.onlyCaptureOnMobile="environment"),a$3.addEventListener("change",o=>{this.onFileUpload(o);}),a$3.addEventListener("click",o=>{var l;(l=this._onInputCheck)==null||l.call(this,o);}),a$3.addEventListener("keydown",o=>{var l;(l=this._onInputCheck)==null||l.call(this,o);});let c$1=document.createElement("label");c$1.append(a$3),r.hasAttribute(s.DEFAULT_DOM_ATTRIBUTE)&&(Object.assign(r.style,b.SINGLE_IMAGE_UPLOADER_BUTTON_STYLE,p),r.textContent=a$1.getInstance().get("core.singleImageUploader.button")),c$1.append(r),t.append(c$1);let v=document.createRange().createContextualFragment(atob(a$2)).firstElementChild;Object.assign(v.style,{position:"absolute",bottom:"1em",right:"1em",width:"10em"}),t.append(v),this._htmlRoot=t,this._mounted=true,this._inputElement=a$3,this._buttonElement=r,this._chooseImageText=(E=r.textContent)!=null?E:"";}unmount(){var e,t;this._mounted&&((e=this._htmlRoot)==null||e.remove(),(t=document.head.querySelector(`[data-component=${s.componentName}]`))==null||t.remove(),this._mounted=false);}setButtonState(e){this._inputElement&&(this._inputElement.disabled=e==="disabled");}getButtonState(){return this._inputElement?this._inputElement.disabled?"disabled":"enabled":"disabled"}onInputCheck(e){this._onInputCheck=e;}onBeforeFileRead(e){this._onBeforeFileRead=e;}onImageLoadError(e){this._onImageLoadError=e;}onFileReaderError(e){this._onFileReaderError=e;}onCaptureReady(e){this._onCaptureReady=e;}onAfterImageProcessed(){this.setLoading(false);}setLoading(e){this._buttonElement&&(this.setButtonState(e?"disabled":"enabled"),this._buttonElement.textContent=e?"...":this._chooseImageText,this._loading=e);}getResizedImageDimensions(e,t){return e<=this._resizedImageSizeLimit&&t<=this._resizedImageSizeLimit?{width:e,height:t}:e>t?{width:this._resizedImageSizeLimit,height:Math.round(t/e*this._resizedImageSizeLimit)}:{width:Math.round(e/t*this._resizedImageSizeLimit),height:this._resizedImageSizeLimit}}onImageLoad(e){var i;let{height:t,width:n}=this.getResizedImageDimensions(e.naturalWidth,e.naturalHeight);this.canvasContext.canvas.width=n,this.canvasContext.canvas.height=t,this.canvasContext.drawImage(e,0,0,n,t);let d={data:this.canvasContext.getImageData(0,0,n,t).data,width:n,height:t};(i=this._onCaptureReady)==null||i.call(this,d);}onFileReaderLoad(e,t,n){e.value="",t.result!=null&&(n.addEventListener("load",()=>{this.onImageLoad(n);},{once:true}),n.addEventListener("error",d=>{var i;(i=this._onImageLoadError)==null||i.call(this,d),this.setLoading(false);},{once:true}),n.src=t.result);}onFileUpload(e){var u;this.setLoading(true);let t=e.currentTarget,{files:n}=t;if(n==null||n.length===0){this.setLoading(false);return}if((u=this._onBeforeFileRead)==null||u.call(this,e),!this.canUploadFile){t.value="",a$3.log(a$3.Level.Warn,"Can't upload file, no capture mode enabled."),this.setLoading(false);return}let d=new Image,i=new FileReader;i.addEventListener("load",()=>{this.onFileReaderLoad(t,i,d);}),i.addEventListener("error",r=>{var p;(p=this._onFileReaderError)==null||p.call(this,r),this.setLoading(false);}),i.readAsDataURL(n[0]);}};s.componentName="SingleImageUploaderView",s.DEFAULT_DOM_ATTRIBUTE="data-scandit-default";var I=s;export{I as a};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-GPJEB376.js';import {a as a$2}from'./chunk-XR65N6EG.js';import {a as a$3}from'./chunk-QCZSSQAQ.js';import {a}from'./chunk-MU4VAJIM.js';var J=(p=>(p.WorldFacing="worldFacing",p.UserFacing="userFacing",p))(J||{}),Q=(c=>(c[c.ULTRA_HD=0]="ULTRA_HD",c[c.FULL_HD=1]="FULL_HD",c[c.HD=2]="HD",c[c.SD=3]="SD",c[c.NONE=4]="NONE",c))(Q||{}),$=(v=>(v.AUTO="auto",v.FOUR_TO_THREE="fourToThree",v.SIXTEEN_TO_NINE="sixteenToNine",v))($||{}),T;(l=>{let U=new Map([["DeviceCaptureError","AbortError"],["NotSupportedError","AbortError"],["ScreenCaptureError","AbortError"],["TabCaptureError","AbortError"],["TypeError","AbortError"],["InvalidStateError","NotAllowedError"],["MediaDeviceFailedDueToShutdown","NotAllowedError"],["MediaDeviceKillSwitchOn","NotAllowedError"],["PermissionDeniedError","NotAllowedError"],["PermissionDismissedError","NotAllowedError"],["DevicesNotFoundError","NotFoundError"],["SourceUnavailableError","NotReadableError"],["TrackStartError","NotReadableError"],["ConstraintNotSatisfiedError","OverconstrainedError"]]),P=["rear","back","r\xFCck","arri\xE8re","trasera","tr\xE1s","traseira","posteriore","\u540E\u9762","\u5F8C\u9762","\u80CC\u9762","\u540E\u7F6E","\u5F8C\u7F6E","\u80CC\u7F6E","\u0437\u0430\u0434\u043D\u0435\u0439","\u0627\u0644\u062E\u0644\u0641\u064A\u0629","\uD6C4","arka","achterzijde","\u0E2B\u0E25\u0E31\u0E07","baksidan","bagside","sau","bak","tylny","takakamera","belakang","\u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03C0\u03AF\u03C3\u03C9","spate","h\xE1ts\xF3","zadn\xED","darrere","posterior","zadn\xE1","\u0437\u0430\u0434\u043D\u044F","stra\u017Enja","belakang","\u092C\u0948\u0915"],p=new Set(["Desk View Camera","Schreibtischansicht-Kamera","Cam\xE9ra Desk\xA0View","C\xE1mara de Vista Cenital","C\xE2mara da Vista de Secret\xE1ria","Fotocamera di Panoramica Scrivania","\u684C\u4E0A\u89C6\u89D2\u76F8\u673A","\u30C7\u30B9\u30AF\u30D3\u30E5\u30FC\u30AB\u30E1\u30E9","\u041A\u0430\u043C\u0435\u0440\u0430 \u041E\u0431\u0437\u043E\u0440\u0430 \u0441\u0442\u043E\u043B\u0430","Masa G\xF6r\xFCnt\xFCs\xFC Kameras\u0131","Bureauweergave-camera","\u0643\u0627\u0645\u064A\u0631\u0627 \u0627\u0644\u0639\u0631\u0636 \u0627\u0644\u0631\u0623\u0633\u064A","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E39\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32\u0E42\u0E15\u0E4A\u0E30","Bordsvisningskamera","Kamera til Visning af skrivebord","Camera Desk View","Bordvisning-kamera","Kamera w\xA0aplikacji Widok blatu","Ty\xF6p\xF6yt\xE4n\xE4kym\xE4n kamera","Kamera Tampilan Meja","\u05DE\u05E6\u05DC\u05DE\u05EA \u05F4\u05EA\u05E6\u05D5\u05D2\u05EA \u05E9\u05D5\u05DC\u05D7\u05DF\u05F4","\u039A\u03AC\u03BC\u03B5\u03C1\u03B1 \u03C4\u03B7\u03C2 \u03A0\u03C1\u03BF\u03B2\u03BF\u03BB\u03AE\u03C2 \u03B3\u03C1\u03B1\u03C6\u03B5\u03AF\u03BF\u03C5","Camer\u0103 Vizualizare birou","\xCDr\xF3asztal n\xE9zet kamer\xE1ja","Stoln\xED kamera","C\xE0mera de l\u2019app Vista de l\u2019Escriptori"]),v=new Set(["Front Camera","Frontkamera","Appareil photo avant","C\xE1mara frontal","C\xE2mera Frontal","C\xE2mara frontal","Fotocamera (anteriore)","\u524D\u7F6E\u76F8\u673A","\u524D\u7F6E\u76F8\u6A5F","\u524D\u9762\u30AB\u30E1\u30E9","\u041A\u0430\u043C\u0435\u0440\u0430 \u043D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0435\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","\xD6n Kamera","Camera aan voorzijde","\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627 \u0627\u0644\u0623\u0645\u0627\u0645\u064A\u0629","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32","Kamera p\xE5 framsidan","Forsidekamera","Camera m\u1EB7t tr\u01B0\u1EDBc","Kamera foran","Przedni aparat","Etukamera","Kamera Depan","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05E7\u05D3\u05DE\u05D9\u05EA","\u039C\u03C0\u03C1\u03BF\u03C3\u03C4\u03B9\u03BD\u03AE \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 fa\u021B\u0103","El\xFCls\u0151 kamera","P\u0159edn\xED fotoapar\xE1t","C\xE0mera frontal","Predn\xE1 kamera","\u041F\u0435\u0440\u0435\u0434\u043D\u044F \u043A\u0430\u043C\u0435\u0440\u0430","Prednja kamera","Kamera Depan","\u092B\u093C\u094D\u0930\u0902\u091F \u0915\u0948\u092E\u0930\u093E"]),x=new Set(["Back Camera","R\xFCckkamera","Cam\xE9ra arri\xE8re","C\xE1mara trasera","C\xE2mera Traseira","C\xE2mara traseira","Fotocamera (posteriore)","\u540E\u7F6E\u76F8\u673A","\u5F8C\u7F6E\u76F8\u6A5F","\u80CC\u9762\u30AB\u30E1\u30E9","\u041A\u0430\u043C\u0435\u0440\u0430 \u043D\u0430 \u0437\u0430\u0434\u043D\u0435\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","Arka Kamera","Camera aan achterzijde","\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627 \u0627\u0644\u062E\u0644\u0641\u064A\u0629","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07","Kamera p\xE5 baksidan","Bagsidekamera","Camera m\u1EB7t sau","Kamera bak","Tylny aparat","Takakamera","Kamera Belakang","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03A0\u03AF\u03C3\u03C9 \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 spate","H\xE1ts\xF3 kamera","Zadn\xED fotoapar\xE1t","C\xE0mera posterior","Zadn\xE1 kamera","\u0417\u0430\u0434\u043D\u044F \u043A\u0430\u043C\u0435\u0440\u0430","Stra\u017Enja kamera","Kamera Belakang","\u092C\u0948\u0915 \u0915\u0948\u092E\u0930\u093E"]),c=new Set(["Back Dual Wide Camera","R\xFCckseitige Dual-Weitwinkelkamera","Double appareil photo grand angle arri\xE8re","C\xE1mara trasera dual con gran angular","C\xE2mera Dupla Grande-Angular Traseira","C\xE2mara grande angular dupla traseira","Fotocamera doppia con grandangolo (posteriore)","\u540E\u7F6E\u53CC\u5E7F\u89D2\u955C\u5934","\u5F8C\u7F6E\u96D9\u5EE3\u89D2\u76F8\u6A5F","\u80CC\u9762\u30C7\u30E5\u30A2\u30EB\u5E83\u89D2\u30AB\u30E1\u30E9","\u0417\u0430\u0434\u043D\u044F\u044F \u0434\u0432\u043E\u0439\u043D\u0430\u044F \u0448\u0438\u0440\u043E\u043A\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0430\u044F \u043A\u0430\u043C\u0435\u0440\u0430","\xC7ift Geni\u015F Kamera Arka Y\xFCz\xFC","\u0643\u0627\u0645\u064A\u0631\u0627 \u062E\u0644\u0641\u064A\u0629 \u0645\u0632\u062F\u0648\u062C\u0629 \u0639\u0631\u064A\u0636\u0629","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E04\u0E39\u0E48\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07\u0E21\u0E38\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07","Dubbel vidvinkelkamera p\xE5 baksidan","Camera k\xE9p r\u1ED9ng m\u1EB7t sau","Dobbelt vidvinkelkamera bak","Tylny dwuobiektywowy aparat szerokok\u0105tny","Laajakulmainen kaksoistakakamera","Kamera Lebar Belakang Ganda","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05DB\u05E4\u05D5\u05DC\u05D4 \u05E8\u05D7\u05D1\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03A0\u03AF\u03C3\u03C9 \u03B4\u03B9\u03C0\u03BB\u03AE \u03B5\u03C5\u03C1\u03B5\u03AF\u03B1 \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 dubl\u0103 cu obiectiv superangular spate","H\xE1ts\xF3, kett\u0151s, sz\xE9les l\xE1t\xF3sz\xF6g\u0171 kamera","Zadn\xED du\xE1ln\xED \u0161iroko\xFAhl\xFD fotoapar\xE1t","C\xE0mera dual posterior amb gran angular","Zadn\xE1 du\xE1lna \u0161irokouhl\xE1 kamera","\u0417\u0430\u0434\u043D\u044F \u0437\u0434\u0432\u043E\u0454\u043D\u0430 \u0448\u0438\u0440\u043E\u043A\u043E\u043A\u0443\u0442\u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0430","Stra\u017Enja dvostruka \u0161iroka kamera","Dwikamera Lebar Belakang","\u092C\u0948\u0915 \u0921\u094D\u092F\u0941\u0905\u0932 \u0935\u093E\u0907\u0921 \u0915\u0948\u092E\u0930\u093E"]),O=new Set(["Back Ultra Wide Camera","R\xFCckseitige Ultra-Weitwinkelkamera","Appareil photo ultra grand angle arri\xE8re","C\xE1mara trasera con ultra gran angular","C\xE2mera Ultra-Angular Traseira","C\xE2mara ultra grande angular traseira","Fotocamera con ultra-grandangolo (posteriore)","\u540E\u7F6E\u8D85\u5E7F\u89D2\u76F8\u673A","\u5F8C\u7F6E\u8D85\u5EE3\u89D2\u76F8\u6A5F","\u80CC\u9762\u8D85\u5E83\u89D2\u30AB\u30E1\u30E9","\u0417\u0430\u0434\u043D\u044F\u044F \u0441\u0432\u0435\u0440\u0445\u0448\u0438\u0440\u043E\u043A\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0430\u044F \u043A\u0430\u043C\u0435\u0440\u0430","Ultra Geni\u015F Kamera Arka Y\xFCz\xFC","Ultrabrede camera aan achterzijde","\u0643\u0627\u0645\u064A\u0631\u0627 \u062E\u0644\u0641\u064A\u0629 \u0639\u0631\u064A\u0636\u0629 \u062C\u062F\u064B\u0627","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07\u0E21\u0E38\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E2D\u0E31\u0E25\u0E15\u0E23\u0E49\u0E32","Ultravidvinkelkamera p\xE5 baksidan","Ultravidvinkelkameraet p\xE5 bagsiden","Camera c\u1EF1c r\u1ED9ng m\u1EB7t sau","Ultravidvinkelkamera bak","Tylny aparat ultraszerokok\u0105tny","Ultralaajakulmainen takakamera","Kamera Ultra Lebar Belakang","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05D0\u05D5\u05DC\u05D8\u05E8\u05D4 \u05E8\u05D7\u05D1\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03A0\u03AF\u03C3\u03C9 \u03C5\u03C0\u03B5\u03C1\u03B5\u03C5\u03C1\u03B5\u03AF\u03B1 \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 cu obiectiv ultra\u2011superangular spate","H\xE1ts\xF3, ultrasz\xE9les l\xE1t\xF3sz\xF6g\u0171 kamera","Zadn\xED ultra \u0161iroko\xFAhl\xFD fotoapar\xE1t","C\xE0mera posterior amb ultra gran angular","Zadn\xE1 ultra\u0161irokouhl\xE1 kamera","\u0417\u0430\u0434\u043D\u044F \u043D\u0430\u0434\u0448\u0438\u0440\u043E\u043A\u043E\u043A\u0443\u0442\u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0430","Stra\u017Enja ultra \u0161iroka kamera","Kamera Ultralebar Belakang","\u092C\u0948\u0915 \u0905\u0932\u094D\u091F\u094D\u0930\u093E \u0935\u093E\u0907\u0921 \u0915\u0948\u092E\u0930\u093E"]),d,D=!1;l.mainCameraForPositionOverridesOnDesktop=new Map,l.deviceIdToCameraObjects=new Map,l.inaccessibleDeviceIds=new Set;function ee(e,i){l.mainCameraForPositionOverridesOnDesktop.set(e,i);}l.setMainCameraForPositionOverridesOnDesktop=ee;function ae(){l.mainCameraForPositionOverridesOnDesktop.clear();}l.clearMainCameraForPositionOverridesOnDesktop=ae;function F(){return navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices)}function N(){if(typeof navigator.enumerateDevices=="function")return navigator.enumerateDevices.bind(navigator);if(typeof navigator.mediaDevices=="object"&&typeof navigator.mediaDevices.enumerateDevices=="function")return navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices)}function S(){D=!0;}function B(e){let i=e.toLowerCase();return P.some(a=>i.includes(a))}function w(e){return v.has(e)}l.isIOSFrontCameraLabel=w;function E(e){return x.has(e)}l.isIOSBackCameraLabel=E;function M(e){return c.has(e)}l.isIOSBackDualWideCameraLabel=M;function K(e){return O.has(e)}l.isIOSUltraWideBackCameraLabel=K;function I(e){var a;let i=e.message==="Invalid constraint"?"OverconstrainedError":(a=U.get(e.name))!=null?a:e.name;Object.defineProperty(e,"name",{value:i});}function W(e){if(e.length===0)return {areSomeCameraLabelsFilled:!1,areAllCameraLabelsFilled:!1,areAllCameraLabelsUnfilled:!1};let i=e.every(r=>r.label!==""),a=e.every(r=>r.label==="");return {areSomeCameraLabelsFilled:!a&&!i,areAllCameraLabelsFilled:i,areAllCameraLabelsUnfilled:a}}function R(e,i){var a;return (a=l.mainCameraForPositionOverridesOnDesktop.get(i))!=null?a:e.find(n=>n.position===i)}function j(e,i){if(i==="worldFacing"){let a=e.find(r=>M(r.label));if(a!=null)return a;let n=e.find(r=>E(r.label));if(n!=null)return n}else {let a=e.find(n=>w(n.label));if(a!=null)return a}}function z(e,i){let{areSomeCameraLabelsFilled:a$1,areAllCameraLabelsUnfilled:n}=W(e);if(n)return e[i==="userFacing"?0:e.length-1];if(a$1){let r=e.filter(t=>t.position===i);return r.length===1?r[0]:r[i==="userFacing"?0:r.length-1]}if(a.getUserAgentInfo().getOS().name==="iOS"){let r=j(e,i);if(r)return r}return e.filter(r=>r.position===i).sort((r,t)=>r.label.localeCompare(t.label))[0]}function re(e,i){return a.isDesktopDevice()?R(e,i):z(e,i)}l.getMainCameraForPosition=re;function k(e,i){return e.unshift(e.splice(i,1)[0])}function ie(e,i){function a$1(t,o){let s=l.mainCameraForPositionOverridesOnDesktop.get(o);return s!=null&&t.includes(s)&&(t=t.filter(f=>f!==s),t.unshift(s)),t}let n=e.filter(t=>t.position==="userFacing"),r=e.filter(t=>t.position==="worldFacing");return a.isDesktopDevice()?(n=a$1(n,"userFacing"),r=a$1(r,"worldFacing")):e.every(t=>t.label==="")?r.reverse():(n.sort((t,o)=>t.label.localeCompare(o.label)),r.sort((t,o)=>t.label.localeCompare(o.label)),a.getUserAgentInfo().getOS().name==="iOS"&&(n.some((t,o)=>w(t.label)&&k(n,o)>=0),r.some((t,o)=>K(t.label)&&k(r,o)>=0),r.some((t,o)=>M(t.label)&&k(r,o)>=0)||r.some((t,o)=>E(t.label)&&k(r,o)>=0))),i==="userFacing"?[...n,...r]:[...r,...n]}l.sortCamerasForCameraPosition=ie;function _(e,i){let a=e.getVideoTracks();if(a.length>0){let n=a[0],r;typeof n.getSettings=="function"&&(r=n.getSettings(),r.facingMode!=null&&r.facingMode.length>0&&(i.position=r.facingMode==="environment"?"worldFacing":"userFacing"));let{label:t=""}=n;t.length>0&&(i.label=t);}}l.adjustCameraFromMediaStream=_;function H(e,i,a$1){if(l.deviceIdToCameraObjects.has(e.deviceId))return l.deviceIdToCameraObjects.get(e.deviceId);let{label:n="",deviceId:r}=e,t;return !a.isDesktopDevice()&&a$1.every(o=>o.label===""&&!l.deviceIdToCameraObjects.has(o.deviceId))?t=a$1.length===1||i+1<=Math.floor(a$1.length/2)?"userFacing":"worldFacing":t=B(n)?"worldFacing":"userFacing",{position:t,label:n,deviceId:r}}function A(e){let i=e.map((a,n,r)=>H(a,n,r)).map(a=>(a.deviceId!==""&&l.deviceIdToCameraObjects.set(a.deviceId,a),a)).filter(a=>!/\b(?:ir|infrared)\b/i.test(a.label)).filter(a=>!p.has(a.label)).filter(a=>!l.inaccessibleDeviceIds.has(a.deviceId));if(!a.isDesktopDevice()&&i.length>1&&!i.some(a=>a.position==="worldFacing")){let a=i.length-1,n=i.map(r=>{let t=/\b(\d+)mp?\b/i.exec(r.label);return t!=null?Number.parseInt(t[1],10):Number.NaN});n.some(r=>Number.isNaN(r))||(a=n.lastIndexOf(Math.max(...n))),i[a].position="worldFacing";}return i}async function V(){if(d!=null&&d.length>0&&d.every(e=>e.label===""&&!l.deviceIdToCameraObjects.has(e.deviceId)))try{return await F()({video:!0,audio:!1})}catch(e){}}function G(e,i){var a,n;if(i.length>0&&e.length===i.length&&!i.every((r,t)=>e[t].deviceId===r.deviceId)){let r={};for(let[t,o]of e.entries()){let s=l.deviceIdToCameraObjects.get(o.deviceId);if(s==null||s.label!==((n=(a=i[t])==null?void 0:a.label)!=null?n:""))continue;let f=i[t].deviceId;r[s.deviceId]=f,l.inaccessibleDeviceIds.has(s.deviceId)&&l.inaccessibleDeviceIds.add(f),s.deviceId=f,l.deviceIdToCameraObjects.set(f,s);}a$2.log(a$2.Level.Debug,"Detected updated camera deviceId information and updated it accordingly",r);}}function Z(){typeof navigator.mediaDevices.addEventListener=="function"?navigator.mediaDevices.addEventListener("devicechange",S):navigator.mediaDevices.ondevicechange=S;}async function y(){let e,i=N();if(i)e=await i();else throw new a$1({fullSupport:!1,scannerSupport:!0,missingFeatures:["mediaDevices"]});return e.filter(a=>a.kind==="videoinput")}async function te(e=!1,i=!1){var r;let a$3=a.checkBrowserCompatibility();if(!a$3.fullSupport)throw new a$1(a$3);if(Z(),d==null||e||D){D=!1;let t,o=d!=null?d:[];d=[];try{d=await y(),i||(t=await V(),t!=null&&(d=await y())),a$2.log(a$2.Level.Debug,"Camera list (devices):",...d),d.length>0&&d.every(s=>s.deviceId==="")&&a$2.log(a$2.Level.Debug,"Incomplete camera information listed due to user permission denial, cameras will not be accessible"),G(o,d);}catch(s){throw I(s),s}finally{for(let s of (r=t==null?void 0:t.getVideoTracks())!=null?r:[])s.stop();}}let n=A(d);return a$2.log(a$2.Level.Debug,"Camera list (cameras): ",...n),[...n]}l.getCameras=te;async function Y(e){return a$2.log(a$2.Level.Debug,"Attempt to access camera (parameters):",e.video),new Promise((i,a)=>{window.setTimeout(()=>{let n=F()(e);if(n==null){a(new a$3({name:"AbortError",message:"Cannot get stream from getUserMedia function."}));return}i(n);},0);})}function X(e,i){let a={resizeMode:"none"};switch(e){case 0:return {...a,width:{min:2880,ideal:i==="fourToThree"?2880:3840,max:4096},height:{min:1800,ideal:2160,max:2400}};case 1:return {...a,width:{min:1440,ideal:i==="fourToThree"?1440:1920,max:2160},height:{min:900,ideal:1080,max:1440}};case 2:return {...a,width:{min:960,ideal:i==="fourToThree"?960:1280,max:1440},height:{min:480,ideal:720,max:960}};case 3:return {...a,width:{min:640,ideal:640,max:800},height:{min:360,ideal:i==="fourToThree"?480:360,max:640}};default:return {}}}l.getUserMediaVideoParameters=X;function q(e){e.deviceId!==""&&(a$2.log(a$2.Level.Debug,"Camera marked to be inaccessible:",e),l.inaccessibleDeviceIds.add(e.deviceId));}l.markCameraAsInaccessible=q;async function ne(e,i,a){a$2.log(a$2.Level.Debug,"Attempt to access camera (camera):",e);let n={audio:!1,video:X(i,a)};e.deviceId===""?n.video.facingMode={ideal:e.position==="worldFacing"?"environment":"user"}:n.video.deviceId={exact:e.deviceId};try{let r=await Y(n);return _(r,e),r}catch(r){throw I(r),["OverconstrainedError","NotReadableError","NotAllowedError"].includes(r.name)||q(e),r}}l.accessCameraStream=ne;})(T||(T={}));export{J as a,Q as b,$ as c,T as d};
1
+ import {a as a$1}from'./chunk-GPJEB376.js';import {a as a$2}from'./chunk-XR65N6EG.js';import {a as a$3}from'./chunk-QCZSSQAQ.js';import {a}from'./chunk-MU4VAJIM.js';var J=(p=>(p.WorldFacing="worldFacing",p.UserFacing="userFacing",p))(J||{}),Q=(c=>(c[c.ULTRA_HD=0]="ULTRA_HD",c[c.FULL_HD=1]="FULL_HD",c[c.HD=2]="HD",c[c.SD=3]="SD",c[c.NONE=4]="NONE",c))(Q||{}),$=(v=>(v.AUTO="auto",v.FOUR_TO_THREE="fourToThree",v.SIXTEEN_TO_NINE="sixteenToNine",v))($||{}),T;(l=>{let U=new Map([["DeviceCaptureError","AbortError"],["NotSupportedError","AbortError"],["ScreenCaptureError","AbortError"],["TabCaptureError","AbortError"],["TypeError","AbortError"],["InvalidStateError","NotAllowedError"],["MediaDeviceFailedDueToShutdown","NotAllowedError"],["MediaDeviceKillSwitchOn","NotAllowedError"],["PermissionDeniedError","NotAllowedError"],["PermissionDismissedError","NotAllowedError"],["DevicesNotFoundError","NotFoundError"],["SourceUnavailableError","NotReadableError"],["TrackStartError","NotReadableError"],["ConstraintNotSatisfiedError","OverconstrainedError"]]),P=["rear","back","r\xFCck","arri\xE8re","trasera","tr\xE1s","traseira","posteriore","\u540E\u9762","\u5F8C\u9762","\u80CC\u9762","\u540E\u7F6E","\u5F8C\u7F6E","\u80CC\u7F6E","\u0437\u0430\u0434\u043D\u0435\u0439","\u0627\u0644\u062E\u0644\u0641\u064A\u0629","\uD6C4","arka","achterzijde","\u0E2B\u0E25\u0E31\u0E07","baksidan","bagside","sau","bak","tylny","takakamera","belakang","\u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03C0\u03AF\u03C3\u03C9","spate","h\xE1ts\xF3","zadn\xED","darrere","posterior","zadn\xE1","\u0437\u0430\u0434\u043D\u044F","stra\u017Enja","belakang","\u092C\u0948\u0915"],p=new Set(["Desk View Camera","Schreibtischansicht-Kamera","Cam\xE9ra Desk\xA0View","C\xE1mara de Vista Cenital","C\xE2mara da Vista de Secret\xE1ria","Fotocamera di Panoramica Scrivania","\u684C\u4E0A\u89C6\u89D2\u76F8\u673A","\u30C7\u30B9\u30AF\u30D3\u30E5\u30FC\u30AB\u30E1\u30E9","\u041A\u0430\u043C\u0435\u0440\u0430 \u041E\u0431\u0437\u043E\u0440\u0430 \u0441\u0442\u043E\u043B\u0430","Masa G\xF6r\xFCnt\xFCs\xFC Kameras\u0131","Bureauweergave-camera","\u0643\u0627\u0645\u064A\u0631\u0627 \u0627\u0644\u0639\u0631\u0636 \u0627\u0644\u0631\u0623\u0633\u064A","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E39\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32\u0E42\u0E15\u0E4A\u0E30","Bordsvisningskamera","Kamera til Visning af skrivebord","Camera Desk View","Bordvisning-kamera","Kamera w\xA0aplikacji Widok blatu","Ty\xF6p\xF6yt\xE4n\xE4kym\xE4n kamera","Kamera Tampilan Meja","\u05DE\u05E6\u05DC\u05DE\u05EA \u05F4\u05EA\u05E6\u05D5\u05D2\u05EA \u05E9\u05D5\u05DC\u05D7\u05DF\u05F4","\u039A\u03AC\u03BC\u03B5\u03C1\u03B1 \u03C4\u03B7\u03C2 \u03A0\u03C1\u03BF\u03B2\u03BF\u03BB\u03AE\u03C2 \u03B3\u03C1\u03B1\u03C6\u03B5\u03AF\u03BF\u03C5","Camer\u0103 Vizualizare birou","\xCDr\xF3asztal n\xE9zet kamer\xE1ja","Stoln\xED kamera","C\xE0mera de l\u2019app Vista de l\u2019Escriptori"]),v=new Set(["Front Camera","Frontkamera","Appareil photo avant","C\xE1mara frontal","C\xE2mera Frontal","C\xE2mara frontal","Fotocamera (anteriore)","\u524D\u7F6E\u76F8\u673A","\u524D\u7F6E\u76F8\u6A5F","\u524D\u9762\u30AB\u30E1\u30E9","\u041A\u0430\u043C\u0435\u0440\u0430 \u043D\u0430 \u043F\u0435\u0440\u0435\u0434\u043D\u0435\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","\xD6n Kamera","Camera aan voorzijde","\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627 \u0627\u0644\u0623\u0645\u0627\u0645\u064A\u0629","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E19\u0E49\u0E32","Kamera p\xE5 framsidan","Forsidekamera","Camera m\u1EB7t tr\u01B0\u1EDBc","Kamera foran","Przedni aparat","Etukamera","Kamera Depan","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05E7\u05D3\u05DE\u05D9\u05EA","\u039C\u03C0\u03C1\u03BF\u03C3\u03C4\u03B9\u03BD\u03AE \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 fa\u021B\u0103","El\xFCls\u0151 kamera","P\u0159edn\xED fotoapar\xE1t","C\xE0mera frontal","Predn\xE1 kamera","\u041F\u0435\u0440\u0435\u0434\u043D\u044F \u043A\u0430\u043C\u0435\u0440\u0430","Prednja kamera","Kamera Depan","\u092B\u093C\u094D\u0930\u0902\u091F \u0915\u0948\u092E\u0930\u093E"]),x=new Set(["Back Camera","R\xFCckkamera","Cam\xE9ra arri\xE8re","C\xE1mara trasera","C\xE2mera Traseira","C\xE2mara traseira","Fotocamera (posteriore)","\u540E\u7F6E\u76F8\u673A","\u5F8C\u7F6E\u76F8\u6A5F","\u80CC\u9762\u30AB\u30E1\u30E9","\u041A\u0430\u043C\u0435\u0440\u0430 \u043D\u0430 \u0437\u0430\u0434\u043D\u0435\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","Arka Kamera","Camera aan achterzijde","\u0627\u0644\u0643\u0627\u0645\u064A\u0631\u0627 \u0627\u0644\u062E\u0644\u0641\u064A\u0629","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07","Kamera p\xE5 baksidan","Bagsidekamera","Camera m\u1EB7t sau","Kamera bak","Tylny aparat","Takakamera","Kamera Belakang","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03A0\u03AF\u03C3\u03C9 \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 spate","H\xE1ts\xF3 kamera","Zadn\xED fotoapar\xE1t","C\xE0mera posterior","Zadn\xE1 kamera","\u0417\u0430\u0434\u043D\u044F \u043A\u0430\u043C\u0435\u0440\u0430","Stra\u017Enja kamera","Kamera Belakang","\u092C\u0948\u0915 \u0915\u0948\u092E\u0930\u093E"]),c=new Set(["Back Dual Wide Camera","R\xFCckseitige Dual-Weitwinkelkamera","Double appareil photo grand angle arri\xE8re","C\xE1mara trasera dual con gran angular","C\xE2mera Dupla Grande-Angular Traseira","C\xE2mara grande angular dupla traseira","Fotocamera doppia con grandangolo (posteriore)","\u540E\u7F6E\u53CC\u5E7F\u89D2\u955C\u5934","\u5F8C\u7F6E\u96D9\u5EE3\u89D2\u76F8\u6A5F","\u80CC\u9762\u30C7\u30E5\u30A2\u30EB\u5E83\u89D2\u30AB\u30E1\u30E9","\u0417\u0430\u0434\u043D\u044F\u044F \u0434\u0432\u043E\u0439\u043D\u0430\u044F \u0448\u0438\u0440\u043E\u043A\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0430\u044F \u043A\u0430\u043C\u0435\u0440\u0430","\xC7ift Geni\u015F Kamera Arka Y\xFCz\xFC","\u0643\u0627\u0645\u064A\u0631\u0627 \u062E\u0644\u0641\u064A\u0629 \u0645\u0632\u062F\u0648\u062C\u0629 \u0639\u0631\u064A\u0636\u0629","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E04\u0E39\u0E48\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07\u0E21\u0E38\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07","Dubbel vidvinkelkamera p\xE5 baksidan","Camera k\xE9p r\u1ED9ng m\u1EB7t sau","Dobbelt vidvinkelkamera bak","Tylny dwuobiektywowy aparat szerokok\u0105tny","Laajakulmainen kaksoistakakamera","Kamera Lebar Belakang Ganda","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05DB\u05E4\u05D5\u05DC\u05D4 \u05E8\u05D7\u05D1\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03A0\u03AF\u03C3\u03C9 \u03B4\u03B9\u03C0\u03BB\u03AE \u03B5\u03C5\u03C1\u03B5\u03AF\u03B1 \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 dubl\u0103 cu obiectiv superangular spate","H\xE1ts\xF3, kett\u0151s, sz\xE9les l\xE1t\xF3sz\xF6g\u0171 kamera","Zadn\xED du\xE1ln\xED \u0161iroko\xFAhl\xFD fotoapar\xE1t","C\xE0mera dual posterior amb gran angular","Zadn\xE1 du\xE1lna \u0161irokouhl\xE1 kamera","\u0417\u0430\u0434\u043D\u044F \u0437\u0434\u0432\u043E\u0454\u043D\u0430 \u0448\u0438\u0440\u043E\u043A\u043E\u043A\u0443\u0442\u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0430","Stra\u017Enja dvostruka \u0161iroka kamera","Dwikamera Lebar Belakang","\u092C\u0948\u0915 \u0921\u094D\u092F\u0941\u0905\u0932 \u0935\u093E\u0907\u0921 \u0915\u0948\u092E\u0930\u093E"]),O=new Set(["Back Ultra Wide Camera","R\xFCckseitige Ultra-Weitwinkelkamera","Appareil photo ultra grand angle arri\xE8re","C\xE1mara trasera con ultra gran angular","C\xE2mera Ultra-Angular Traseira","C\xE2mara ultra grande angular traseira","Fotocamera con ultra-grandangolo (posteriore)","\u540E\u7F6E\u8D85\u5E7F\u89D2\u76F8\u673A","\u5F8C\u7F6E\u8D85\u5EE3\u89D2\u76F8\u6A5F","\u80CC\u9762\u8D85\u5E83\u89D2\u30AB\u30E1\u30E9","\u0417\u0430\u0434\u043D\u044F\u044F \u0441\u0432\u0435\u0440\u0445\u0448\u0438\u0440\u043E\u043A\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0430\u044F \u043A\u0430\u043C\u0435\u0440\u0430","Ultra Geni\u015F Kamera Arka Y\xFCz\xFC","Ultrabrede camera aan achterzijde","\u0643\u0627\u0645\u064A\u0631\u0627 \u062E\u0644\u0641\u064A\u0629 \u0639\u0631\u064A\u0636\u0629 \u062C\u062F\u064B\u0627","\u0E01\u0E25\u0E49\u0E2D\u0E07\u0E14\u0E49\u0E32\u0E19\u0E2B\u0E25\u0E31\u0E07\u0E21\u0E38\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E2D\u0E31\u0E25\u0E15\u0E23\u0E49\u0E32","Ultravidvinkelkamera p\xE5 baksidan","Ultravidvinkelkameraet p\xE5 bagsiden","Camera c\u1EF1c r\u1ED9ng m\u1EB7t sau","Ultravidvinkelkamera bak","Tylny aparat ultraszerokok\u0105tny","Ultralaajakulmainen takakamera","Kamera Ultra Lebar Belakang","\u05DE\u05E6\u05DC\u05DE\u05D4 \u05D0\u05D5\u05DC\u05D8\u05E8\u05D4 \u05E8\u05D7\u05D1\u05D4 \u05D0\u05D7\u05D5\u05E8\u05D9\u05EA","\u03A0\u03AF\u03C3\u03C9 \u03C5\u03C0\u03B5\u03C1\u03B5\u03C5\u03C1\u03B5\u03AF\u03B1 \u03BA\u03AC\u03BC\u03B5\u03C1\u03B1","Camer\u0103 cu obiectiv ultra\u2011superangular spate","H\xE1ts\xF3, ultrasz\xE9les l\xE1t\xF3sz\xF6g\u0171 kamera","Zadn\xED ultra \u0161iroko\xFAhl\xFD fotoapar\xE1t","C\xE0mera posterior amb ultra gran angular","Zadn\xE1 ultra\u0161irokouhl\xE1 kamera","\u0417\u0430\u0434\u043D\u044F \u043D\u0430\u0434\u0448\u0438\u0440\u043E\u043A\u043E\u043A\u0443\u0442\u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0430","Stra\u017Enja ultra \u0161iroka kamera","Kamera Ultralebar Belakang","\u092C\u0948\u0915 \u0905\u0932\u094D\u091F\u094D\u0930\u093E \u0935\u093E\u0907\u0921 \u0915\u0948\u092E\u0930\u093E"]),d,D=false;l.mainCameraForPositionOverridesOnDesktop=new Map,l.deviceIdToCameraObjects=new Map,l.inaccessibleDeviceIds=new Set;function ee(e,i){l.mainCameraForPositionOverridesOnDesktop.set(e,i);}l.setMainCameraForPositionOverridesOnDesktop=ee;function ae(){l.mainCameraForPositionOverridesOnDesktop.clear();}l.clearMainCameraForPositionOverridesOnDesktop=ae;function F(){return navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices)}function N(){if(typeof navigator.enumerateDevices=="function")return navigator.enumerateDevices.bind(navigator);if(typeof navigator.mediaDevices=="object"&&typeof navigator.mediaDevices.enumerateDevices=="function")return navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices)}function S(){D=true;}function B(e){let i=e.toLowerCase();return P.some(a=>i.includes(a))}function w(e){return v.has(e)}l.isIOSFrontCameraLabel=w;function E(e){return x.has(e)}l.isIOSBackCameraLabel=E;function M(e){return c.has(e)}l.isIOSBackDualWideCameraLabel=M;function K(e){return O.has(e)}l.isIOSUltraWideBackCameraLabel=K;function I(e){var a;let i=e.message==="Invalid constraint"?"OverconstrainedError":(a=U.get(e.name))!=null?a:e.name;Object.defineProperty(e,"name",{value:i});}function W(e){if(e.length===0)return {areSomeCameraLabelsFilled:false,areAllCameraLabelsFilled:false,areAllCameraLabelsUnfilled:false};let i=e.every(r=>r.label!==""),a=e.every(r=>r.label==="");return {areSomeCameraLabelsFilled:!a&&!i,areAllCameraLabelsFilled:i,areAllCameraLabelsUnfilled:a}}function R(e,i){var a;return (a=l.mainCameraForPositionOverridesOnDesktop.get(i))!=null?a:e.find(t=>t.position===i)}function j(e,i){if(i==="worldFacing"){let a=e.find(r=>M(r.label));if(a!=null)return a;let t=e.find(r=>E(r.label));if(t!=null)return t}else {let a=e.find(t=>w(t.label));if(a!=null)return a}}function z(e,i){let{areSomeCameraLabelsFilled:a$1,areAllCameraLabelsUnfilled:t}=W(e);if(t)return e[i==="userFacing"?0:e.length-1];if(a$1){let r=e.filter(n=>n.position===i);return r.length===1?r[0]:r[i==="userFacing"?0:r.length-1]}if(a.getUserAgentInfo().getOS().name==="iOS"){let r=j(e,i);if(r)return r}return e.filter(r=>r.position===i).sort((r,n)=>r.label.localeCompare(n.label))[0]}function re(e,i){return a.isDesktopDevice()?R(e,i):z(e,i)}l.getMainCameraForPosition=re;function k(e,i){return e.unshift(e.splice(i,1)[0])}function ie(e,i){function a$1(n,o){let s=l.mainCameraForPositionOverridesOnDesktop.get(o);return s!=null&&n.includes(s)&&(n=n.filter(f=>f!==s),n.unshift(s)),n}let t=e.filter(n=>n.position==="userFacing"),r=e.filter(n=>n.position==="worldFacing");return a.isDesktopDevice()?(t=a$1(t,"userFacing"),r=a$1(r,"worldFacing")):e.every(n=>n.label==="")?r.reverse():(t.sort((n,o)=>n.label.localeCompare(o.label)),r.sort((n,o)=>n.label.localeCompare(o.label)),a.getUserAgentInfo().getOS().name==="iOS"&&(t.some((n,o)=>w(n.label)&&k(t,o)>=0),r.some((n,o)=>K(n.label)&&k(r,o)>=0),r.some((n,o)=>M(n.label)&&k(r,o)>=0)||r.some((n,o)=>E(n.label)&&k(r,o)>=0))),i==="userFacing"?[...t,...r]:[...r,...t]}l.sortCamerasForCameraPosition=ie;function _(e,i){let a=e.getVideoTracks();if(a.length>0){let t=a[0],r;typeof t.getSettings=="function"&&(r=t.getSettings(),r.facingMode!=null&&r.facingMode.length>0&&(i.position=r.facingMode==="environment"?"worldFacing":"userFacing"));let{label:n=""}=t;n.length>0&&(i.label=n);}}l.adjustCameraFromMediaStream=_;function H(e,i,a$1){if(l.deviceIdToCameraObjects.has(e.deviceId))return l.deviceIdToCameraObjects.get(e.deviceId);let{label:t="",deviceId:r}=e,n;return !a.isDesktopDevice()&&a$1.every(o=>o.label===""&&!l.deviceIdToCameraObjects.has(o.deviceId))?n=a$1.length===1||i+1<=Math.floor(a$1.length/2)?"userFacing":"worldFacing":n=B(t)?"worldFacing":"userFacing",{position:n,label:t,deviceId:r}}function A(e){let i=e.map((a,t,r)=>H(a,t,r)).map(a=>(a.deviceId!==""&&l.deviceIdToCameraObjects.set(a.deviceId,a),a)).filter(a=>!/\b(?:ir|infrared)\b/i.test(a.label)).filter(a=>!p.has(a.label)).filter(a=>!l.inaccessibleDeviceIds.has(a.deviceId));if(!a.isDesktopDevice()&&i.length>1&&!i.some(a=>a.position==="worldFacing")){let a=i.length-1,t=i.map(r=>{let n=/\b(\d+)mp?\b/i.exec(r.label);return n!=null?Number.parseInt(n[1],10):Number.NaN});t.some(r=>Number.isNaN(r))||(a=t.lastIndexOf(Math.max(...t))),i[a].position="worldFacing";}return i}async function V(){if(d!=null&&d.length>0&&d.every(e=>e.label===""&&!l.deviceIdToCameraObjects.has(e.deviceId)))try{return await F()({video:true,audio:false})}catch(e){}}function G(e,i){var a,t;if(i.length>0&&e.length===i.length&&!i.every((r,n)=>e[n].deviceId===r.deviceId)){let r={};for(let[n,o]of e.entries()){let s=l.deviceIdToCameraObjects.get(o.deviceId);if(s==null||s.label!==((t=(a=i[n])==null?void 0:a.label)!=null?t:""))continue;let f=i[n].deviceId;r[s.deviceId]=f,l.inaccessibleDeviceIds.has(s.deviceId)&&l.inaccessibleDeviceIds.add(f),s.deviceId=f,l.deviceIdToCameraObjects.set(f,s);}a$2.log(a$2.Level.Debug,"Detected updated camera deviceId information and updated it accordingly",r);}}function Z(){typeof navigator.mediaDevices.addEventListener=="function"?navigator.mediaDevices.addEventListener("devicechange",S):navigator.mediaDevices.ondevicechange=S;}async function y(){let e,i=N();if(i)e=await i();else throw new a$1({fullSupport:false,scannerSupport:true,missingFeatures:["mediaDevices"]});return e.filter(a=>a.kind==="videoinput")}async function ne(e=false,i=false){var r;let a$3=a.checkBrowserCompatibility();if(!a$3.fullSupport)throw new a$1(a$3);if(Z(),d==null||e||D){D=false;let n,o=d!=null?d:[];d=[];try{d=await y(),i||(n=await V(),n!=null&&(d=await y())),a$2.debug("Camera list (devices):",...d),d.length>0&&d.every(s=>s.deviceId==="")&&a$2.log(a$2.Level.Debug,"Incomplete camera information listed due to user permission denial, cameras will not be accessible"),G(o,d);}catch(s){throw I(s),s}finally{for(let s of (r=n==null?void 0:n.getVideoTracks())!=null?r:[])s.stop();}}let t=A(d);return a$2.log(a$2.Level.Debug,"Camera list (cameras): ",...t),[...t]}l.getCameras=ne;async function Y(e){return a$2.debug("Attempt to access camera (parameters):",e.video),new Promise((i,a)=>{setTimeout(async()=>{try{let t=await F()(e);if(t==null){a(new a$3({name:"AbortError",message:"Cannot get stream from getUserMedia function."}));return}i(t);}catch(t){a(t);}},0);})}function X(e,i){let a={resizeMode:"none"};switch(e){case 0:return {...a,width:{min:2880,ideal:i==="fourToThree"?2880:3840,max:4096},height:{min:1800,ideal:2160,max:2400}};case 1:return {...a,width:{min:1440,ideal:i==="fourToThree"?1440:1920,max:2160},height:{min:900,ideal:1080,max:1440}};case 2:return {...a,width:{min:960,ideal:i==="fourToThree"?960:1280,max:1440},height:{min:480,ideal:720,max:960}};case 3:return {...a,width:{min:640,ideal:640,max:800},height:{min:360,ideal:i==="fourToThree"?480:360,max:640}};default:return {}}}l.getUserMediaVideoParameters=X;function q(e){e.deviceId!==""&&(a$2.log(a$2.Level.Debug,"Camera marked to be inaccessible:",e),l.inaccessibleDeviceIds.add(e.deviceId));}l.markCameraAsInaccessible=q;async function te(e,i,a){a$2.log(a$2.Level.Debug,"Attempt to access camera (camera):",e);let t={audio:false,video:X(i,a)};e.deviceId===""?t.video.facingMode={ideal:e.position==="worldFacing"?"environment":"user"}:t.video.deviceId={exact:e.deviceId};try{let r=await Y(t);return _(r,e),r}catch(r){throw I(r),["OverconstrainedError","NotReadableError","NotAllowedError"].includes(r.name)||q(e),r}}l.accessCameraStream=te;})(T||(T={}));export{J as a,Q as b,$ as c,T as d};
@@ -0,0 +1 @@
1
+ import {a as a$5}from'./chunk-TCJPGGHY.js';import {b as b$1}from'./chunk-ULRY4SXF.js';import {b}from'./chunk-FTD535WI.js';import {a}from'./chunk-R6E4CT22.js';import {a as a$6}from'./chunk-JKL2W65E.js';import {d}from'./chunk-5FLNDPTB.js';import {a as a$2}from'./chunk-XR65N6EG.js';import {a as a$3}from'./chunk-QCZSSQAQ.js';import {a as a$1}from'./chunk-MU4VAJIM.js';import {f,a as a$4,i}from'./chunk-77BBIAZE.js';var k=(r=>(r.CONTINUOUS="continuous",r.MANUAL="manual",r.NONE="none",r.SINGLE_SHOT="single-shot",r))(k||{}),F=(s=>(s[s.ULTRA_HD=0]="ULTRA_HD",s[s.FULL_HD=1]="FULL_HD",s[s.HD=2]="HD",s[s.SD=3]="SD",s[s.NONE=4]="NONE",s))(F||{}),P=(t=>(t.CAMERA_PROPERTIES="cameraProperties",t.CAMERA_ACCESS_ERROR="cameraAccessError",t))(P||{}),o=class o{constructor(){this.constraint=4;this.checkCameraVideoStreamAccessIfVisibleListener=this.checkCameraVideoStreamAccessIfVisible.bind(this);this.handleWebGLContextLostListener=this.handleWebGLContextLost.bind(this);this.listeners=new Map;this.mirrorImageOverrides=new Map;this.postStreamInitializationListener=this.postStreamInitialization.bind(this);this.triggerManualFocusListener=this.triggerManualFocus.bind(this);this.triggerZoomMoveListener=this.triggerZoomMove.bind(this);this.triggerZoomStartListener=this.triggerZoomStart.bind(this);this.videoResizeListener=a(this.handleVideoResize.bind(this),500);this.videoTrackEndedListener=this.videoTrackEndedRecovery.bind(this);this.videoTrackMuteListener=this.videoTrackMuteRecovery.bind(this);this._synchronousFrameHandling=false;this._glFrameReaders={GRAYSCALE:null,RGBA:null};this._frameReaderType="RGBA";this.isVideoStreamPaused=false;this.cameraPosition="worldFacing",this.gui={isCameraRecoveryVisible:()=>false,setCameraRecoveryVisible:()=>{}},this.isWebGLSupported=!a$1.checkBrowserCompatibility().missingFeatures.includes("webGL"),this.videoElement=document.createElement("video"),this.canvas=document.createElement("canvas"),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener);}get mediaStream(){return this._mediaStream}set mediaStream(e){this._mediaStream=e,e&&(this.mediaTrackCapabilitiesPromise=new Promise(t=>{this.mediaTrackCapabilitiesPromiseResolver=t;}));}get synchronousFrameHandling(){return this._synchronousFrameHandling}get canvas2dContext(){return this._canvas2dContext||(this._canvas2dContext=this.canvas.getContext("2d",{willReadFrequently:true}),this._canvas2dContext==null&&a$2.log(a$2.Level.Warn,"Unable to get 2d canvas context"),this.handleVideoResize()),this._canvas2dContext}get canvasWebGLContext(){var e;if(!this._canvas2dContext&&!this._canvasWebGLContext){if(!this.isWebGLSupported){a$2.log(a$2.Level.Warn,"WebGL context not supported, falling back to 2d canvas context. This may impact the scanning performance.");return}let t=(e=this.canvas.getContext("webgl",{alpha:false,antialias:false}))!=null?e:this.canvas.getContext("experimental-webgl",{alpha:false,antialias:false});t!=null&&(this._canvasWebGLContext=t,this.handleVideoResize());}return this._canvasWebGLContext}static instance(){return o._instance==null&&(o._instance=new o),o._instance}recycle(e){var t;(t=this.getFrameReader())==null||t.recycle(e);}getCurrentFrame(){var e;return (e=this._glFrameReaders.RGBA)==null?void 0:e.readFromSource(this.videoElement)}requestVideoFrame(e,t=this.videoElement){return "requestVideoFrameCallback"in HTMLVideoElement.prototype?t.requestVideoFrameCallback(e):requestAnimationFrame(e)}cancelVideoFrame(e,t=this.videoElement){if("cancelVideoFrameCallback"in HTMLVideoElement.prototype){t.cancelVideoFrameCallback(e);return}cancelAnimationFrame(e);}addListener(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];i.includes(t)||this.listeners.set(e,[...i,t]);}async applyCameraSettings(e){if(this.selectedCameraSettings=e,this.activeCamera==null)throw new a$3(o.noCameraErrorParameters);return this.initializeCameraWithSettings(this.activeCamera,e)}captureImage(){var e;if(((e=this.mediaStream)==null?void 0:e.active)!=null){if(this.canvasWebGLContext!=null)return this.captureImageForWebGLContext();if(this.canvas2dContext!=null)return this.captureImageFor2dContext()}return null}async initializeCameraWithSettings(e,t){if(this.cameraInitializationPromise&&await this.cameraInitializationPromise,e==null)throw new a$3(o.noCameraErrorParameters);return this.setSelectedCamera(e),this.selectedCameraSettings=t,this.activeCameraSettings=t,this.cameraInitializationPromise=this.initializeCameraAndCheckUpdatedSettings(e),this.cameraInitializationPromise}isMirrorImageEnabled(){if(this.selectedCamera&&this.activeCamera){let e=this.mirrorImageOverrides.get(this.activeCamera);return e!=null?e:this.activeCamera.position==="userFacing"}return false}isPinchToZoomEnabled(){return this.pinchToZoomEnabled}isTapToFocusEnabled(){return this.tapToFocusEnabled}async isTorchAvailable(){var e;return this.mediaStream?(await this.waitForCapabilities(),((e=this.mediaTrackCapabilities)==null?void 0:e.torch)===true):false}async playVideo(){return new Promise(e=>{this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height);let t=this.videoElement.play();t==null?e():t.then(e).catch(()=>{e();});})}async reinitializeCamera(){if(this.activeCamera==null)a$2.log(a$2.Level.Debug,"Camera reinitialization delayed");else {a$2.log(a$2.Level.Debug,"Reinitialize camera:",this.activeCamera);try{let e=this.activeCamera;await this.stopStream(),await this.initializeCameraWithSettings(e,this.activeCameraSettings);}catch(e){throw a$2.log(a$2.Level.Warn,"Couldn't access camera:",this.activeCamera,e),this.emit("cameraAccessError",e),e}}}removeListener(e,t){var s;let r=((s=this.listeners.get(e))!=null?s:[]).filter(n=>n!==t);this.listeners.set(e,r);}async setCameraPosition(e){var i;this.setInitialCameraPosition(e);let t=d.getMainCameraForPosition(await d.getCameras(),e);if(t&&t.deviceId!==((i=this.selectedCamera)==null?void 0:i.deviceId))return this.initializeCameraWithSettings(t,this.selectedCameraSettings)}async setExposure(e){var r,s,n,c,d,l,v,p;let t=(s=(r=this.mediaStream)==null?void 0:r.getVideoTracks())!=null?s:[];if(t.length===0||typeof t[0].applyConstraints!="function")return;await this.waitForCapabilities();let i=e.time!=null&&e.time>0?"manual":"continuous";if(((c=(n=this.mediaTrackCapabilities)==null?void 0:n.exposureMode)==null?void 0:c.includes(i))===true){if(await t[0].applyConstraints({advanced:[{exposureMode:i}]}),e.time!=null&&e.time>0&&this.mediaTrackCapabilities.exposureTime){let u=Math.max((d=this.mediaTrackCapabilities.exposureTime.min)!=null?d:.01,Math.min(e.time,(l=this.mediaTrackCapabilities.exposureTime.max)!=null?l:1e5));await t[0].applyConstraints({advanced:[{exposureTime:u}]});}else if(e.compensation!=null&&i==="continuous"&&this.mediaTrackCapabilities.exposureCompensation){let u=Math.max((v=this.mediaTrackCapabilities.exposureCompensation.min)!=null?v:-10,Math.min(e.compensation,(p=this.mediaTrackCapabilities.exposureCompensation.max)!=null?p:10));await t[0].applyConstraints({advanced:[{exposureCompensation:u}]});}}}async setFocus(e){var i,r,s,n,c;if(!this.mediaStream)return;let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function"){await this.waitForCapabilities();let d=e>=0?"manual":"continuous";if(((r=(i=this.mediaTrackCapabilities)==null?void 0:i.focusMode)==null?void 0:r.includes(d))===true&&(await t[0].applyConstraints({advanced:[{focusMode:d}]}),d==="manual"&&this.mediaTrackCapabilities.focusDistance)){let l=Math.max(0,Math.min(e,1))*(((s=this.mediaTrackCapabilities.focusDistance.max)!=null?s:1e3)-((n=this.mediaTrackCapabilities.focusDistance.min)!=null?n:.01))+((c=this.mediaTrackCapabilities.focusDistance.min)!=null?c:.01);await t[0].applyConstraints({advanced:[{focusDistance:l}]});}}}async setFrameRate(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.frameRate)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let n=Math.min((i=this.mediaTrackCapabilities.frameRate.max)!=null?i:240,(r=e.max)!=null?r:240);await s[0].applyConstraints({advanced:[{frameRate:n}]});}}}setInitialCameraPosition(e){this.cameraPosition=e;}setInteractionOptions(e,t,i){this.torchToggleEnabled=e,this.tapToFocusEnabled=t,this.pinchToZoomEnabled=i;}setMirrorImageEnabled(e,t){this.selectedCamera&&(e?(this.videoElement.classList.add(o.MIRRORED_CLASS_NAME),this.canvas.classList.add(o.MIRRORED_CLASS_NAME)):(this.videoElement.classList.remove(o.MIRRORED_CLASS_NAME),this.canvas.classList.remove(o.MIRRORED_CLASS_NAME)),t&&this.mirrorImageOverrides.set(this.selectedCamera,e));}setPinchToZoomEnabled(e){this.pinchToZoomEnabled=e,this.mediaStream&&(this.pinchToZoomEnabled?this.enablePinchToZoomListeners():this.disablePinchToZoomListeners());}setSelectedCamera(e){this.selectedCamera=e;}setSelectedCameraSettings(e){this.selectedCameraSettings=e;}setTapToFocusEnabled(e){this.tapToFocusEnabled=e,this.mediaStream&&(this.tapToFocusEnabled?this.enableTapToFocusListeners():this.disableTapToFocusListeners());}async setTorchEnabled(e){var t;if(this.mediaStream&&((t=this.mediaTrackCapabilities)==null?void 0:t.torch)===true){this.torchEnabled=e;let i=this.mediaStream.getVideoTracks();i.length>0&&typeof i[0].applyConstraints=="function"&&await i[0].applyConstraints({advanced:[{torch:e}]});}}async setZoom(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.zoom)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let n=Math.max((i=this.mediaTrackCapabilities.zoom.min)!=null?i:1,Math.min(e,(r=this.mediaTrackCapabilities.zoom.max)!=null?r:16));await s[0].applyConstraints({advanced:[{zoom:n}]});}}}async setupCameras(){if(this.cameraSetupPromise)return this.cameraSetupPromise;let e=this.isVideoStreamPaused;return this.cameraSetupPromise=this.setupCamerasAndStream(),this.cameraSetupPromise.then(()=>{e||(this.isVideoStreamPaused=false);})}pauseStream(){if(this.mediaStream){for(let e of this.mediaStream.getVideoTracks())e.enabled=false;this.isVideoStreamPaused=true,a$2.log(a$2.Level.Debug,"Paused camera video stream",this.mediaStream);}}resumeStream(){if(this.mediaStream){for(let e of this.mediaStream.getVideoTracks())e.enabled=true;this.isVideoStreamPaused=false,a$2.log(a$2.Level.Debug,"Resumed camera video stream",this.mediaStream);}}async stopStream(e=false){this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=false,this.isVideoStreamPaused=false,this.mediaStream&&(a$2.log(a$2.Level.Debug,`Stop camera video stream access${e?" (abort access detection)":""}:`,this.mediaStream),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),window.clearTimeout(this.cameraAccessTimeout),window.clearInterval(this.videoMetadataCheckInterval),window.clearTimeout(this.getCapabilitiesTimeout),window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),window.clearInterval(this.autofocusInterval),this.videoElement.pause(),await new Promise(t=>{setTimeout(()=>{var i,r,s;for(let n of (r=(i=this.mediaStream)==null?void 0:i.getVideoTracks())!=null?r:[])n.removeEventListener("ended",this.videoTrackEndedListener),n.stop();this.videoElement.srcObject=null,this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.mediaStream=void 0,this.mediaTrackCapabilities=void 0,this.mediaTrackCapabilitiesPromise=void 0,this.mediaTrackCapabilitiesPromiseResolver=void 0,e||(s=this.abortedCameraInitializationResolveCallback)==null||s.call(this),t();},0);}));}stopVideoTracks(){if(this.mediaStream!=null)for(let e of this.mediaStream.getVideoTracks())e.stop();}async toggleTorch(){this.torchEnabled=!this.torchEnabled,await this.setTorchEnabled(this.torchEnabled);}updateCanvasVideoImage(){this.canvas2dContext.drawImage(this.videoElement,0,0);}async waitForCapabilities(){var e;return (e=this.mediaTrackCapabilitiesPromise)!=null?e:Promise.resolve()}setFrameReaderType(e){e!==this._frameReaderType&&(this._frameReaderType=e,a$2.log(a$2.Level.Debug,`Change frame reader type to ${this._frameReaderType} mode`));}async allowPictureInPicture(e){e?(this.videoElement.disablePictureInPicture=false,this.videoElement.removeAttribute("controlslist"),this.videoElement.removeAttribute("disablepictureinpicture")):(this.videoElement.disablePictureInPicture=true,this.videoElement.setAttribute("controlslist","nodownload"),this.videoElement.setAttribute("disablepictureinpicture","true")),await this.reinitializeCamera();}setFrameHandling(e){var t;this._synchronousFrameHandling=e,this._frameReaderOptions=this.getFrameReaderOptions(e),(t=this._glFrameReaders[this._frameReaderType])==null||t.dispose(),delete this._glFrameReaders[this._frameReaderType];}async setClipArea(e){if(this.activeCamera&&this.isVideoAndContextStateValid()){this.clipArea=e?this.frameRectFromViewRect(e):void 0,await this.initializeStreamForResolution(this.activeCamera,this.constraint,this.isVideoStreamPaused);return}this.clipArea=e;}frameRectFromViewRect(e){let t=this.videoElement.videoWidth/this.videoElement.clientWidth||1,i$1=this.videoElement.videoHeight/this.videoElement.clientHeight||1;return new f(new a$4(e.origin.x*t,e.origin.y*i$1),new i(e.size.width*t,e.size.height*i$1))}async accessAutoselectedCamera(e){let t=d.sortCamerasForCameraPosition(e,this.cameraPosition),i=t.shift();for(;i;)try{await this.initializeCameraWithSettings(i,this.selectedCameraSettings);return}catch(r){if(this.setSelectedCamera(),t.length>0){a$2.log(a$2.Level.Warn,"Couldn't access camera:",i,r),i=t.shift();continue}throw r}throw new a$3(o.noCameraErrorParameters)}getFrameReaderOptions(e){return e?{minPoolCapacity:0,maxPoolCapacity:1}:a$1.isDesktopDevice()?{maxPoolCapacity:2,minPoolCapacity:1}:{maxPoolCapacity:10,minPoolCapacity:3}}getFrameReader(){var t;if(this._glFrameReaders[this._frameReaderType])return this._glFrameReaders[this._frameReaderType];if(!this._canvasWebGLContext)return null;let e=(t=this._frameReaderOptions)!=null?t:this.getFrameReaderOptions(this._synchronousFrameHandling);switch(this._frameReaderType){case "GRAYSCALE":{this._glFrameReaders.GRAYSCALE=new a$5(this._canvasWebGLContext,e),this._glFrameReaders.RGBA=new b$1(this._canvasWebGLContext,{minPoolCapacity:1,maxPoolCapacity:2});break}case "RGBA":{this._glFrameReaders.RGBA=new b$1(this._canvasWebGLContext,e);break}default:b(this._frameReaderType);}return a$2.debug(`Created frame reader ${this._frameReaderType}`,e),this._glFrameReaders[this._frameReaderType]}async accessInitialCamera(){let e={position:this.cameraPosition,deviceId:"",label:""};try{await this.initializeCameraWithSettings(e,this.selectedCameraSettings);}catch(t){}finally{this.setSelectedCamera();}return e}recreateCanvas(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this._canvasWebGLContext=void 0,this._canvas2dContext=void 0;for(let t of Object.values(this._glFrameReaders))t==null||t.dispose();let e=document.createElement("canvas");e.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),e.width=this.canvas.width,e.height=this.canvas.height,e.className=this.canvas.className,this.canvas=e;}captureImageFor2dContext(){if(!this.isVideoAndContextStateValid())return null;let{width:e,height:t}=this.canvas;return {colorType:"RGBA",data:this.canvas2dContext.getImageData(0,0,e,t).data,width:e,height:t}}areVideoAndWebGLSizeMismatching(){return this.canvasWebGLContext?this.canvasWebGLContext.drawingBufferWidth!==this.videoElement.videoWidth||this.canvasWebGLContext.drawingBufferHeight!==this.videoElement.videoHeight:true}captureImageForWebGLContext(){if(!this.isVideoAndContextStateValid()||!this.canvasWebGLContext||this.canvasWebGLContext.drawingBufferWidth<=2||this.canvasWebGLContext.drawingBufferHeight<=2||this.areVideoAndWebGLSizeMismatching()||this.getFrameReader()==null)return null;let e=this.getFrameReader().readFromSource(this.videoElement);if(e.data[3]!==255&&e.colorType==="RGBA"){if(a$2.log(a$2.Level.Warn,"Detected incorrect GPU accelerated WebGL image processing, switching to canvas mode"),this.recreateCanvas(),this.canvas2dContext==null)throw new Error("Unable to get 2d canvas context");return this.captureImage()}return e}async checkCameraAccess(e){return new Promise((t,i)=>{this.cameraAccessRejectCallback=r=>{a$2.log(a$2.Level.Debug,"Camera video stream access failure (video data load timeout):",e),this.gui.setCameraRecoveryVisible(true),i(r);},this.setCameraAccessTimeout();})}checkCameraVideoStreamAccessIfVisible(){document.visibilityState==="visible"&&(a$2.log(a$2.Level.Debug,"Page is visible again, waiting for camera video stream start..."),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),this.setCameraAccessTimeout());}async checkVideoMetadata(e){return new Promise((t,i)=>{this.videoElement.onloadeddata=()=>{if(this.videoElement.onloadeddata=null,window.clearTimeout(this.cameraAccessTimeout),this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.videoElement.currentTime>0){this.updateActiveCameraCurrentResolution(e),a$2.log(a$2.Level.Debug,"Camera video stream access success:",e),t();return}let r=performance.now();window.clearInterval(this.videoMetadataCheckInterval),this.videoMetadataCheckInterval=window.setInterval(async()=>{if(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2||this.videoElement.currentTime===0){if(performance.now()-r>o.videoMetadataCheckTimeoutMs){a$2.log(a$2.Level.Warn,"Camera video stream access failure (valid video metadata timeout):",e),window.clearInterval(this.videoMetadataCheckInterval),await this.stopStream(true),i(new a$3(o.notReadableErrorParameters));return}return}window.clearInterval(this.videoMetadataCheckInterval),this.updateActiveCameraCurrentResolution(e),a$2.log(a$2.Level.Debug,"Camera video stream access success:",e),t();},o.videoMetadataCheckIntervalMs);};})}disablePinchToZoomListeners(){this.videoElement.removeEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.removeEventListener("touchmove",this.triggerZoomMoveListener);}disableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.removeEventListener(e,this.triggerManualFocusListener);}emit(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];for(let s of i)s(t);}enablePinchToZoomListeners(){this.videoElement.addEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.addEventListener("touchmove",this.triggerZoomMoveListener);}enableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.addEventListener(e,this.triggerManualFocusListener);}getActiveCamera(e,t,i){return e.length===1?e[0]:e.find(r=>r.deviceId===i||r.label!==""&&r.label===t)}getInitialCameraResolutionConstraint(e){var i;let t;switch((i=this.activeCameraSettings)==null?void 0:i.preferredResolution){case "uhd4k":{t=0;break}case "fullHd":{t=1;break}default:{t=2;break}}return t}async handleCameraInitializationError(e,t,i){if(!["OverconstrainedError","NotReadableError"].includes(i.name)||i.name==="NotReadableError"&&t===4)throw a$2.log(a$2.Level.Debug,"Camera video stream access failure (unrecoverable error)",e,i),i.name!=="NotAllowedError"&&d.markCameraAsInaccessible(e),i;if(i.name==="OverconstrainedError"&&t===4){if(e.deviceId==="")throw a$2.log(a$2.Level.Warn,"Camera video stream access failure (no camera with such type error)",e,i),i;a$2.log(a$2.Level.Warn,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",e,i);let r=e.deviceId;if(await d.getCameras(true),r===e.deviceId)throw a$2.log(a$2.Level.Warn,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",e,i),d.markCameraAsInaccessible(e),i;return a$2.log(a$2.Level.Warn,"Updated camera found (recovered from non-existent deviceId error), attempt to access it",e),this.initializeCameraForResolution(e)}return this.initializeCameraForResolution(e,t+1)}handleVideoResize(){if(!(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2)){if(this.activeCamera&&this.updateActiveCameraCurrentResolution(this.activeCamera),this.canvasWebGLContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight,this.canvasWebGLContext.viewport(0,0,this.canvasWebGLContext.drawingBufferWidth,this.canvasWebGLContext.drawingBufferHeight);}else if(this.canvas2dContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight;}}}handleWebGLContextLost(){a$2.log(a$2.Level.Warn,"WebGL context has been lost, restoring..."),this._canvasWebGLContext=void 0,this.canvasWebGLContext?(this.handleVideoResize(),a$2.log(a$2.Level.Warn,"WebGL context restored")):a$2.log(a$2.Level.Error,"WebGL context restore failed");}async initializeCameraAndCheckUpdatedSettings(e){var t,i,r,s,n;try{if(await this.initializeCameraForResolution(e),this.selectedCameraSettings!==this.activeCameraSettings&&(this.selectedCameraSettings==null||this.activeCameraSettings==null||Object.keys(this.selectedCameraSettings).some(u=>{var b,f;return ((b=this.selectedCameraSettings)==null?void 0:b[u])!==((f=this.activeCameraSettings)==null?void 0:f[u])}))){this.activeCameraSettings=this.selectedCameraSettings,await this.initializeCameraAndCheckUpdatedSettings(e);return}this.activeCameraSettings&&this.activeCameraSettings.zoomFactor>1&&await this.setZoom(this.activeCameraSettings.zoomFactor);let c=(t=this.activeCameraSettings)==null?void 0:t.getProperty("minFrameRate"),d=(i=this.activeCameraSettings)==null?void 0:i.getProperty("maxFrameRate");(c!=null||d!=null)&&await this.setFrameRate({min:c,max:d});let l=(r=this.activeCameraSettings)==null?void 0:r.getProperty("manualLensPosition");l!=null&&await this.setFocus(l);let v=(s=this.activeCameraSettings)==null?void 0:s.getProperty("exposureTargetBias"),p=(n=this.activeCameraSettings)==null?void 0:n.getProperty("exposureDuration");(v!=null||p!=null)&&await this.setExposure({compensation:v,time:p});}finally{this.cameraInitializationPromise=void 0;}}async initializeCameraForResolution(e,t){var i;this.gui.setCameraRecoveryVisible(false),this.constraint=t!=null?t:this.getInitialCameraResolutionConstraint(e),this.mediaStream!=null&&e.deviceId!==""&&((i=this.activeCamera)==null?void 0:i.deviceId)===e.deviceId?await(a$1.isIPhone()?this.initializeStreamForResolution(e,this.constraint):this.updateStreamForResolution(e,this.constraint)):await this.initializeStreamForResolution(e,this.constraint);}async initializeStreamForResolution(e,t,i=false){var r;await this.stopStream();try{let s=(r=this.activeCameraSettings)==null?void 0:r.getProperty("preferredAspectRatio"),n=await d.accessCameraStream(e,t,s),c=await this.clipMediaStreamIfNeeded(n);if(a$2.log(a$2.Level.Debug,"Camera accessed, waiting for camera video stream start..."),typeof c.getVideoTracks()[0].getSettings=="function"){let d=c.getVideoTracks()[0].getSettings();if(d.width!=null&&d.height!=null&&(d.width===2||d.height===2)){if(a$2.log(a$2.Level.Debug,"Camera video stream access failure (invalid video metadata):",e),t===4)throw new a$3(o.notReadableErrorParameters);return await this.stopStream(),this.initializeStreamForResolution(e,t+1)}}this.mediaStream=c,i&&this.pauseStream();for(let d of this.mediaStream.getVideoTracks())d.addEventListener("ended",this.videoTrackEndedListener),d.addEventListener("mute",this.videoTrackMuteListener),d.addEventListener("unmute",this.videoTrackMuteListener);try{await this.setupCameraStreamVideo(e,c);}catch(d){if(t===4)throw d;return this.initializeStreamForResolution(e,t+1)}}catch(s){return this.handleCameraInitializationError(e,t,s)}}isVideoAndContextStateValid(){return this.videoElement.readyState===4&&this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.canvas.width>2&&this.canvas.height>2}postStreamInitialization(){window.clearTimeout(this.getCapabilitiesTimeout),this.getCapabilitiesTimeout=window.setTimeout(()=>{this.storeStreamCapabilities(),this.setupAutofocus();},o.getCapabilitiesTimeoutMs);}async recoverStreamIfNeeded(){var t,i;let e=(t=this.mediaStream)==null?void 0:t.getVideoTracks();((i=e==null?void 0:e[0])==null?void 0:i.readyState)==="ended"&&await this.reinitializeCamera();}reportCameraProperties(e,t,i=true){this.emit("cameraProperties",{deviceId:e,isFrontFacing:t==="userFacing",hasAutofocus:i});}setCameraAccessTimeout(){window.clearTimeout(this.cameraAccessTimeout),this.cameraAccessTimeout=window.setTimeout(async()=>{var e;document.visibilityState==="visible"?(await this.stopStream(true),(e=this.cameraAccessRejectCallback)==null||e.call(this,new a$3(o.notReadableErrorParameters))):(a$2.log(a$2.Level.Debug,"Page is currently not visible, delay camera video stream access detection"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener));},o.cameraAccessTimeoutMs);}setupAutofocus(){if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),this.mediaStream&&this.mediaTrackCapabilities){let e=this.mediaTrackCapabilities.focusMode;Array.isArray(e)&&!e.includes("continuous")&&e.includes("single-shot")&&(window.clearInterval(this.autofocusInterval),this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),o.autofocusIntervalMs));}}async setupCameraStreamVideo(e,t){this.videoElement.addEventListener("loadedmetadata",this.postStreamInitializationListener),this.videoElement.addEventListener("resize",this.videoResizeListener),this.tapToFocusEnabled&&this.enableTapToFocusListeners(),this.pinchToZoomEnabled&&this.enablePinchToZoomListeners();let i=Promise.race([this.checkCameraAccess(e),this.checkVideoMetadata(e),new Promise(r=>{this.abortedCameraInitializationResolveCallback=r;})]);return this.videoElement.srcObject=t,this.videoElement.load(),await this.playVideo(),this.handleVideoResize(),this.reportCameraProperties(e.deviceId,e.position),i}async setupCamerasAndStream(){var e,t;try{let i;this.selectedCamera==null&&(i=await this.accessInitialCamera());let r=await d.getCameras(false,true),s=(t=(e=this.mediaStream)==null?void 0:e.getVideoTracks()[0])==null?void 0:t.getSettings().deviceId;if(this.mediaStream&&i){let n=this.getActiveCamera(r,i.label,s);if(n){if(d.adjustCameraFromMediaStream(this.mediaStream,n),a$1.isDesktopDevice()&&(d.setMainCameraForPositionOverridesOnDesktop(this.cameraPosition,n),d.setMainCameraForPositionOverridesOnDesktop(n.position,n)),r.length===1||d.getMainCameraForPosition(r,this.cameraPosition)===n){a$2.log(a$2.Level.Debug,"Initial camera access was correct (main camera), keep camera:",n),this.setSelectedCamera(n),this.updateActiveCameraCurrentResolution(n),await this.recoverStreamIfNeeded();return}a$2.log(a$2.Level.Debug,"Initial camera access was incorrect (not main camera), change camera",{...i,deviceId:s});}else a$2.log(a$2.Level.Debug,"Initial camera access was incorrect (unknown camera), change camera",{...i,deviceId:s});}if(this.selectedCamera==null){await this.accessAutoselectedCamera(r);return}await this.initializeCameraWithSettings(this.selectedCamera,this.selectedCameraSettings);}finally{this.cameraSetupPromise=void 0;}}storeStreamCapabilities(){var e;if(this.mediaStream){let t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getCapabilities=="function"&&(this.mediaTrackCapabilities=t[0].getCapabilities()),this.mediaTrackCapabilitiesPromiseResolver&&this.mediaTrackCapabilitiesPromiseResolver();}this.activeCamera&&this.reportCameraProperties(this.activeCamera.deviceId,this.activeCamera.position,((e=this.mediaTrackCapabilities)==null?void 0:e.focusMode)==null||this.mediaTrackCapabilities.focusMode.includes("continuous"));}async triggerAutoFocus(){await this.triggerFocusMode("single-shot");}async triggerFocusMode(e){if(this.mediaStream){let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function")try{await t[0].applyConstraints({advanced:[{focusMode:e}]});}catch(i){}}}async triggerManualFocus(e){if(e){if(e.preventDefault(),e.type==="touchend"&&e.touches.length>0)return;if(this.pinchToZoomDistance!=null){this.pinchToZoomDistance=void 0;return}}if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),!this.mediaStream||!this.mediaTrackCapabilities)return;let t=this.mediaTrackCapabilities.focusMode;Array.isArray(t)&&t.includes("single-shot")&&(t.includes("continuous")&&t.includes("manual")?await this.triggerManualFocusForContinuous():t.includes("continuous")||await this.triggerManualFocusForSingleShot());}async triggerManualFocusForContinuous(){var i;if(!this.mediaStream)return;this.manualToAutofocusResumeTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("continuous");},o.manualToAutofocusResumeTimeoutMs);let e=true,t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getConstraints=="function"&&(e=((i=t[0].getConstraints().advanced)==null?void 0:i.some(r=>r.focusMode==="manual"))===true),e?(await this.triggerFocusMode("continuous"),this.manualFocusWaitTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("manual");},o.manualFocusWaitTimeoutMs)):await this.triggerFocusMode("manual");}async triggerManualFocusForSingleShot(){window.clearInterval(this.autofocusInterval),this.manualToAutofocusResumeTimeout=window.setTimeout(()=>{this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),o.autofocusIntervalMs);},o.manualToAutofocusResumeTimeoutMs);try{await this.triggerFocusMode("single-shot");}catch(e){}}async triggerZoomMove(e){this.pinchToZoomDistance==null||(e==null?void 0:e.touches.length)!==2||e.preventDefault();}triggerZoomStart(e){var r,s,n,c;if((e==null?void 0:e.touches.length)!==2||(e.preventDefault(),this.pinchToZoomDistance=Math.hypot((e.touches[1].screenX-e.touches[0].screenX)/screen.width,(e.touches[1].screenY-e.touches[0].screenY)/screen.height),!this.mediaStream||!((r=this.mediaTrackCapabilities)!=null&&r.zoom)))return;let t=this.mediaStream.getVideoTracks();if(t.length===0||typeof t[0].getConstraints!="function")return;this.pinchToZoomInitialZoom=(s=this.mediaTrackCapabilities.zoom.min)!=null?s:1;let i=t[0].getConstraints();if(i.advanced){let d=(n=i.advanced.find(l=>"zoom"in l))==null?void 0:n.zoom;d!=null&&(this.pinchToZoomInitialZoom=typeof d=="number"?d:(c=d.ideal)!=null?c:1);}}updateActiveCameraCurrentResolution(e){this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&(e.currentResolution={width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}),e.deviceId!==""&&(this.activeCamera=e,this.setMirrorImageEnabled(this.isMirrorImageEnabled(),false));}async updateStreamForResolution(e,t){var i;if(this.mediaStream==null)await this.initializeCameraForResolution(e,t);else try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio");a$2.log(a$2.Level.Debug,"Setting new resolution for active camera video stream..."),await this.mediaStream.getVideoTracks()[0].applyConstraints(d.getUserMediaVideoParameters(t,r)),await new Promise(n=>{this.videoElement.addEventListener("timeupdate",()=>{n();},{once:true});});let s=this.mediaStream.getVideoTracks()[0].getSettings();a$2.log(a$2.Level.Debug,"New active camera video stream resolution set",{width:s.width,height:s.height});}catch(r){if(t===4)throw r;await this.updateStreamForResolution(e,t+1);}}async videoTrackEndedRecovery(){if(document.visibilityState==="visible")try{a$2.log(a$2.Level.Debug,'Detected video track "ended" event, try to reinitialize camera'),await this.reinitializeCamera();}catch(e){}else a$2.log(a$2.Level.Debug,"Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener);}videoTrackMuteRecovery(e){if(this.videoElement.onloadeddata!=null){a$2.log(a$2.Level.Debug,`Detected video track "${e.type}" event, delay camera video stream access detection`),this.setCameraAccessTimeout();return}let t=e.type==="mute";t!==this.gui.isCameraRecoveryVisible()&&(a$2.log(a$2.Level.Debug,`Detected video track "${e.type}" event, ${t?"enable":"disable"} camera recovery`),this.gui.setCameraRecoveryVisible(t));}async clipMediaStreamIfNeeded(e){if(!this.clipArea)return e;let t=this.videoElement.cloneNode();t.srcObject=e,t.load();let i=document.createElement("canvas");i.width=this.clipArea.size.width,i.height=this.clipArea.size.height;let r=i.getContext("2d",{alpha:false,willReadFrequently:false});return r?(t.addEventListener("play",this.drawClippedFrame.bind(this,this.clipArea,t,r),{once:true}),t.addEventListener("pause",this.cleanupClippedStream.bind(this,t),{once:true}),await t.play(),i.captureStream()):e}drawClippedFrame(e,t,i){i.drawImage(t,e.origin.x,e.origin.y,e.size.width,e.size.height,0,0,e.size.width,e.size.height),this.clippedFrameRequestID=this.requestVideoFrame(this.drawClippedFrame.bind(this,e,t,i),t);}cleanupClippedStream(e){this.clippedFrameRequestID&&(this.cancelVideoFrame(this.clippedFrameRequestID,e),this.clippedFrameRequestID=void 0);}};o.autofocusIntervalMs=1500,o.cameraAccessTimeoutMs=4e3,o.getCapabilitiesTimeoutMs=500,o.manualFocusWaitTimeoutMs=400,o.manualToAutofocusResumeTimeoutMs=5e3,o.noCameraErrorParameters={name:"NoCameraAvailableError",message:"No camera available"},o.notReadableErrorParameters={name:"NotReadableError",message:"Could not initialize camera correctly"},o.videoMetadataCheckIntervalMs=50,o.videoMetadataCheckTimeoutMs=4e3,o.MIRRORED_CLASS_NAME=a$6.MIRRORED_CLASS_NAME,o._instance=null;var L=o;export{k as a,F as b,P as c,L as d};
@@ -0,0 +1,2 @@
1
+ import {a,b as b$1}from'./chunk-2Q5FZVGV.js';var B=a(k=>{(function(){var g=function(){this.init();};g.prototype={init:function(){var e=this||r;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=false,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator=typeof window<"u"&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=false,e.usingWebAudio=true,e.autoSuspend=true,e.ctx=null,e.autoUnlock=true,e._setup(),e},volume:function(e){var t=this||r;if(e=parseFloat(e),t.ctx||A(),typeof e<"u"&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,r.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var o=t._howls[n]._getSoundIds(),l=0;l<o.length;l++){var s=t._howls[n]._soundById(o[l]);s&&s._node&&(s._node.volume=s._volume*e);}return t}return t._volume},mute:function(e){var t=this||r;t.ctx||A(),t._muted=e,t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e?0:t._volume,r.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var o=t._howls[n]._getSoundIds(),l=0;l<o.length;l++){var s=t._howls[n]._soundById(o[l]);s&&s._node&&(s._node.muted=e?true:s._muted);}return t},stop:function(){for(var e=this||r,t=0;t<e._howls.length;t++)e._howls[t].stop();return e},unload:function(){for(var e=this||r,t=e._howls.length-1;t>=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&typeof e.ctx.close<"u"&&(e.ctx.close(),e.ctx=null,A()),e},codecs:function(e){return (this||r)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||r;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if(typeof Audio<"u")try{var t=new Audio;typeof t.oncanplaythrough>"u"&&(e._canPlayEvent="canplay");}catch(n){e.noAudio=true;}else e.noAudio=true;try{var t=new Audio;t.muted&&(e.noAudio=true);}catch(n){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||r,t=null;try{t=typeof Audio<"u"?new Audio:null;}catch(y){return e}if(!t||typeof t.canPlayType!="function")return e;var n=t.canPlayType("audio/mpeg;").replace(/^no$/,""),o=e._navigator?e._navigator.userAgent:"",l=o.match(/OPR\/(\d+)/g),s=l&&parseInt(l[0].split("/")[1],10)<33,a=o.indexOf("Safari")!==-1&&o.indexOf("Chrome")===-1,f=o.match(/Version\/(.*?) /),m=a&&f&&parseInt(f[1],10)<15;return e._codecs={mp3:!!(!s&&(n||t.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!n,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!m&&t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!m&&t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||r;if(!(e._audioUnlocked||!e.ctx)){e._audioUnlocked=false,e.autoUnlock=false,!e._mobileUnloaded&&e.ctx.sampleRate!==44100&&(e._mobileUnloaded=true,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(;e._html5AudioPool.length<e.html5PoolSize;)try{var o=new Audio;o._unlocked=true,e._releaseHtml5Audio(o);}catch(y){e.noAudio=true;break}for(var l=0;l<e._howls.length;l++)if(!e._howls[l]._webAudio)for(var s=e._howls[l]._getSoundIds(),a=0;a<s.length;a++){var f=e._howls[l]._soundById(s[a]);f&&f._node&&!f._node._unlocked&&(f._node._unlocked=true,f._node.load());}e._autoResume();var m=e.ctx.createBufferSource();m.buffer=e._scratchBuffer,m.connect(e.ctx.destination),typeof m.start>"u"?m.noteOn(0):m.start(0),typeof e.ctx.resume=="function"&&e.ctx.resume(),m.onended=function(){m.disconnect(0),e._audioUnlocked=true,document.removeEventListener("touchstart",t,true),document.removeEventListener("touchend",t,true),document.removeEventListener("click",t,true),document.removeEventListener("keydown",t,true);for(var y=0;y<e._howls.length;y++)e._howls[y]._emit("unlock");};};return document.addEventListener("touchstart",t,true),document.addEventListener("touchend",t,true),document.addEventListener("click",t,true),document.addEventListener("keydown",t,true),e}},_obtainHtml5Audio:function(){var e=this||r;if(e._html5AudioPool.length)return e._html5AudioPool.pop();var t=new Audio().play();return t&&typeof Promise<"u"&&(t instanceof Promise||typeof t.then=="function")&&t.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.");}),new Audio},_releaseHtml5Audio:function(e){var t=this||r;return e._unlocked&&t._html5AudioPool.push(e),t},_autoSuspend:function(){var e=this;if(!(!e.autoSuspend||!e.ctx||typeof e.ctx.suspend>"u"||!r.usingWebAudio)){for(var t=0;t<e._howls.length;t++)if(e._howls[t]._webAudio){for(var n=0;n<e._howls[t]._sounds.length;n++)if(!e._howls[t]._sounds[n]._paused)return e}return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout(function(){if(e.autoSuspend){e._suspendTimer=null,e.state="suspending";var o=function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume());};e.ctx.suspend().then(o,o);}},3e4),e}},_autoResume:function(){var e=this;if(!(!e.ctx||typeof e.ctx.resume>"u"||!r.usingWebAudio))return e.state==="running"&&e.ctx.state!=="interrupted"&&e._suspendTimer?(clearTimeout(e._suspendTimer),e._suspendTimer=null):e.state==="suspended"||e.state==="running"&&e.ctx.state==="interrupted"?(e.ctx.resume().then(function(){e.state="running";for(var t=0;t<e._howls.length;t++)e._howls[t]._emit("resume");}),e._suspendTimer&&(clearTimeout(e._suspendTimer),e._suspendTimer=null)):e.state==="suspending"&&(e._resumeAfterSuspend=true),e}};var r=new g,i=function(e){var t=this;if(!e.src||e.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}t.init(e);};i.prototype={init:function(e){var t=this;return r.ctx||A(),t._autoplay=e.autoplay||false,t._format=typeof e.format!="string"?e.format:[e.format],t._html5=e.html5||false,t._muted=e.mute||false,t._loop=e.loop||false,t._pool=e.pool||5,t._preload=typeof e.preload=="boolean"||e.preload==="metadata"?e.preload:true,t._rate=e.rate||1,t._sprite=e.sprite||{},t._src=typeof e.src!="string"?e.src:[e.src],t._volume=e.volume!==void 0?e.volume:1,t._xhr={method:e.xhr&&e.xhr.method?e.xhr.method:"GET",headers:e.xhr&&e.xhr.headers?e.xhr.headers:null,withCredentials:e.xhr&&e.xhr.withCredentials?e.xhr.withCredentials:false},t._duration=0,t._state="unloaded",t._sounds=[],t._endTimers={},t._queue=[],t._playLock=false,t._onend=e.onend?[{fn:e.onend}]:[],t._onfade=e.onfade?[{fn:e.onfade}]:[],t._onload=e.onload?[{fn:e.onload}]:[],t._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],t._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],t._onpause=e.onpause?[{fn:e.onpause}]:[],t._onplay=e.onplay?[{fn:e.onplay}]:[],t._onstop=e.onstop?[{fn:e.onstop}]:[],t._onmute=e.onmute?[{fn:e.onmute}]:[],t._onvolume=e.onvolume?[{fn:e.onvolume}]:[],t._onrate=e.onrate?[{fn:e.onrate}]:[],t._onseek=e.onseek?[{fn:e.onseek}]:[],t._onunlock=e.onunlock?[{fn:e.onunlock}]:[],t._onresume=[],t._webAudio=r.usingWebAudio&&!t._html5,typeof r.ctx<"u"&&r.ctx&&r.autoUnlock&&r._unlockAudio(),r._howls.push(t),t._autoplay&&t._queue.push({event:"play",action:function(){t.play();}}),t._preload&&t._preload!=="none"&&t.load(),t},load:function(){var e=this,t=null;if(r.noAudio){e._emit("loaderror",null,"No audio support.");return}typeof e._src=="string"&&(e._src=[e._src]);for(var n=0;n<e._src.length;n++){var o,l;if(e._format&&e._format[n])o=e._format[n];else {if(l=e._src[n],typeof l!="string"){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}o=/^data:audio\/([^;,]+);/i.exec(l),o||(o=/\.([^.]+)$/.exec(l.split("?",1)[0])),o&&(o=o[1].toLowerCase());}if(o||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),o&&r.codecs(o)){t=e._src[n];break}}if(!t){e._emit("loaderror",null,"No codec support for selected audio sources.");return}return e._src=t,e._state="loading",window.location.protocol==="https:"&&t.slice(0,5)==="http:"&&(e._html5=true,e._webAudio=false),new u(e),e._webAudio&&d(e),e},play:function(e,t){var n=this,o=null;if(typeof e=="number")o=e,e=null;else {if(typeof e=="string"&&n._state==="loaded"&&!n._sprite[e])return null;if(typeof e>"u"&&(e="__default",!n._playLock)){for(var l=0,s=0;s<n._sounds.length;s++)n._sounds[s]._paused&&!n._sounds[s]._ended&&(l++,o=n._sounds[s]._id);l===1?e=null:o=null;}}var a=o?n._soundById(o):n._inactiveSound();if(!a)return null;if(o&&!e&&(e=a._sprite||"__default"),n._state!=="loaded"){a._sprite=e,a._ended=false;var f=a._id;return n._queue.push({event:"play",action:function(){n.play(f);}}),f}if(o&&!a._paused)return t||n._loadQueue("play"),a._id;n._webAudio&&r._autoResume();var m=Math.max(0,a._seek>0?a._seek:n._sprite[e][0]/1e3),y=Math.max(0,(n._sprite[e][0]+n._sprite[e][1])/1e3-m),w=y*1e3/Math.abs(a._rate),T=n._sprite[e][0]/1e3,S=(n._sprite[e][0]+n._sprite[e][1])/1e3;a._sprite=e,a._ended=false;var I=function(){a._paused=false,a._seek=m,a._start=T,a._stop=S,a._loop=!!(a._loop||n._sprite[e][2]);};if(m>=S){n._ended(a);return}var v=a._node;if(n._webAudio){var P=function(){n._playLock=false,I(),n._refreshBuffer(a);var x=a._muted||n._muted?0:a._volume;v.gain.setValueAtTime(x,r.ctx.currentTime),a._playStart=r.ctx.currentTime,typeof v.bufferSource.start>"u"?a._loop?v.bufferSource.noteGrainOn(0,m,86400):v.bufferSource.noteGrainOn(0,m,y):a._loop?v.bufferSource.start(0,m,86400):v.bufferSource.start(0,m,y),w!==1/0&&(n._endTimers[a._id]=setTimeout(n._ended.bind(n,a),w)),t||setTimeout(function(){n._emit("play",a._id),n._loadQueue();},0);};r.state==="running"&&r.ctx.state!=="interrupted"?P():(n._playLock=true,n.once("resume",P),n._clearTimer(a._id));}else {var M=function(){v.currentTime=m,v.muted=a._muted||n._muted||r._muted||v.muted,v.volume=a._volume*r.volume(),v.playbackRate=a._rate;try{var x=v.play();if(x&&typeof Promise<"u"&&(x instanceof Promise||typeof x.then=="function")?(n._playLock=true,I(),x.then(function(){n._playLock=false,v._unlocked=true,t?n._loadQueue():n._emit("play",a._id);}).catch(function(){n._playLock=false,n._emit("playerror",a._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),a._ended=true,a._paused=true;})):t||(n._playLock=false,I(),n._emit("play",a._id)),v.playbackRate=a._rate,v.paused){n._emit("playerror",a._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}e!=="__default"||a._loop?n._endTimers[a._id]=setTimeout(n._ended.bind(n,a),w):(n._endTimers[a._id]=function(){n._ended(a),v.removeEventListener("ended",n._endTimers[a._id],false);},v.addEventListener("ended",n._endTimers[a._id],false));}catch(D){n._emit("playerror",a._id,D);}};v.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(v.src=n._src,v.load());var G=window&&window.ejecta||!v.readyState&&r._navigator.isCocoonJS;if(v.readyState>=3||G)M();else {n._playLock=true,n._state="loading";var F=function(){n._state="loaded",M(),v.removeEventListener(r._canPlayEvent,F,false);};v.addEventListener(r._canPlayEvent,F,false),n._clearTimer(a._id);}}return a._id},pause:function(e){var t=this;if(t._state!=="loaded"||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e);}}),t;for(var n=t._getSoundIds(e),o=0;o<n.length;o++){t._clearTimer(n[o]);var l=t._soundById(n[o]);if(l&&!l._paused&&(l._seek=t.seek(n[o]),l._rateSeek=0,l._paused=true,t._stopFade(n[o]),l._node))if(t._webAudio){if(!l._node.bufferSource)continue;typeof l._node.bufferSource.stop>"u"?l._node.bufferSource.noteOff(0):l._node.bufferSource.stop(0),t._cleanBuffer(l._node);}else (!isNaN(l._node.duration)||l._node.duration===1/0)&&l._node.pause();arguments[1]||t._emit("pause",l?l._id:null);}return t},stop:function(e,t){var n=this;if(n._state!=="loaded"||n._playLock)return n._queue.push({event:"stop",action:function(){n.stop(e);}}),n;for(var o=n._getSoundIds(e),l=0;l<o.length;l++){n._clearTimer(o[l]);var s=n._soundById(o[l]);s&&(s._seek=s._start||0,s._rateSeek=0,s._paused=true,s._ended=true,n._stopFade(o[l]),s._node&&(n._webAudio?s._node.bufferSource&&(typeof s._node.bufferSource.stop>"u"?s._node.bufferSource.noteOff(0):s._node.bufferSource.stop(0),n._cleanBuffer(s._node)):(!isNaN(s._node.duration)||s._node.duration===1/0)&&(s._node.currentTime=s._start||0,s._node.pause(),s._node.duration===1/0&&n._clearSound(s._node))),t||n._emit("stop",s._id));}return n},mute:function(e,t){var n=this;if(n._state!=="loaded"||n._playLock)return n._queue.push({event:"mute",action:function(){n.mute(e,t);}}),n;if(typeof t>"u")if(typeof e=="boolean")n._muted=e;else return n._muted;for(var o=n._getSoundIds(t),l=0;l<o.length;l++){var s=n._soundById(o[l]);s&&(s._muted=e,s._interval&&n._stopFade(s._id),n._webAudio&&s._node?s._node.gain.setValueAtTime(e?0:s._volume,r.ctx.currentTime):s._node&&(s._node.muted=r._muted?true:e),n._emit("mute",s._id));}return n},volume:function(){var e=this,t=arguments,n,o;if(t.length===0)return e._volume;if(t.length===1||t.length===2&&typeof t[1]>"u"){var l=e._getSoundIds(),s=l.indexOf(t[0]);s>=0?o=parseInt(t[0],10):n=parseFloat(t[0]);}else t.length>=2&&(n=parseFloat(t[0]),o=parseInt(t[1],10));var a;if(typeof n<"u"&&n>=0&&n<=1){if(e._state!=="loaded"||e._playLock)return e._queue.push({event:"volume",action:function(){e.volume.apply(e,t);}}),e;typeof o>"u"&&(e._volume=n),o=e._getSoundIds(o);for(var f=0;f<o.length;f++)a=e._soundById(o[f]),a&&(a._volume=n,t[2]||e._stopFade(o[f]),e._webAudio&&a._node&&!a._muted?a._node.gain.setValueAtTime(n,r.ctx.currentTime):a._node&&!a._muted&&(a._node.volume=n*r.volume()),e._emit("volume",a._id));}else return a=o?e._soundById(o):e._sounds[0],a?a._volume:0;return e},fade:function(e,t,n,o){var l=this;if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"fade",action:function(){l.fade(e,t,n,o);}}),l;e=Math.min(Math.max(0,parseFloat(e)),1),t=Math.min(Math.max(0,parseFloat(t)),1),n=parseFloat(n),l.volume(e,o);for(var s=l._getSoundIds(o),a=0;a<s.length;a++){var f=l._soundById(s[a]);if(f){if(o||l._stopFade(s[a]),l._webAudio&&!f._muted){var m=r.ctx.currentTime,y=m+n/1e3;f._volume=e,f._node.gain.setValueAtTime(e,m),f._node.gain.linearRampToValueAtTime(t,y);}l._startFadeInterval(f,e,t,n,s[a],typeof o>"u");}}return l},_startFadeInterval:function(e,t,n,o,l,s){var a=this,f=t,m=n-t,y=Math.abs(m/.01),w=Math.max(4,y>0?o/y:o),T=Date.now();e._fadeTo=n,e._interval=setInterval(function(){var S=(Date.now()-T)/o;T=Date.now(),f+=m*S,f=Math.round(f*100)/100,m<0?f=Math.max(n,f):f=Math.min(n,f),a._webAudio?e._volume=f:a.volume(f,e._id,true),s&&(a._volume=f),(n<t&&f<=n||n>t&&f>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,a.volume(n,e._id),a._emit("fade",e._id));},w);},_stopFade:function(e){var t=this,n=t._soundById(e);return n&&n._interval&&(t._webAudio&&n._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(n._interval),n._interval=null,t.volume(n._fadeTo,e),n._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e=this,t=arguments,n,o,l;if(t.length===0)return e._loop;if(t.length===1)if(typeof t[0]=="boolean")n=t[0],e._loop=n;else return l=e._soundById(parseInt(t[0],10)),l?l._loop:false;else t.length===2&&(n=t[0],o=parseInt(t[1],10));for(var s=e._getSoundIds(o),a=0;a<s.length;a++)l=e._soundById(s[a]),l&&(l._loop=n,e._webAudio&&l._node&&l._node.bufferSource&&(l._node.bufferSource.loop=n,n&&(l._node.bufferSource.loopStart=l._start||0,l._node.bufferSource.loopEnd=l._stop,e.playing(s[a])&&(e.pause(s[a],true),e.play(s[a],true)))));return e},rate:function(){var e=this,t=arguments,n,o;if(t.length===0)o=e._sounds[0]._id;else if(t.length===1){var l=e._getSoundIds(),s=l.indexOf(t[0]);s>=0?o=parseInt(t[0],10):n=parseFloat(t[0]);}else t.length===2&&(n=parseFloat(t[0]),o=parseInt(t[1],10));var a;if(typeof n=="number"){if(e._state!=="loaded"||e._playLock)return e._queue.push({event:"rate",action:function(){e.rate.apply(e,t);}}),e;typeof o>"u"&&(e._rate=n),o=e._getSoundIds(o);for(var f=0;f<o.length;f++)if(a=e._soundById(o[f]),a){e.playing(o[f])&&(a._rateSeek=e.seek(o[f]),a._playStart=e._webAudio?r.ctx.currentTime:a._playStart),a._rate=n,e._webAudio&&a._node&&a._node.bufferSource?a._node.bufferSource.playbackRate.setValueAtTime(n,r.ctx.currentTime):a._node&&(a._node.playbackRate=n);var m=e.seek(o[f]),y=(e._sprite[a._sprite][0]+e._sprite[a._sprite][1])/1e3-m,w=y*1e3/Math.abs(a._rate);(e._endTimers[o[f]]||!a._paused)&&(e._clearTimer(o[f]),e._endTimers[o[f]]=setTimeout(e._ended.bind(e,a),w)),e._emit("rate",a._id);}}else return a=e._soundById(o),a?a._rate:e._rate;return e},seek:function(){var e=this,t=arguments,n,o;if(t.length===0)e._sounds.length&&(o=e._sounds[0]._id);else if(t.length===1){var l=e._getSoundIds(),s=l.indexOf(t[0]);s>=0?o=parseInt(t[0],10):e._sounds.length&&(o=e._sounds[0]._id,n=parseFloat(t[0]));}else t.length===2&&(n=parseFloat(t[0]),o=parseInt(t[1],10));if(typeof o>"u")return 0;if(typeof n=="number"&&(e._state!=="loaded"||e._playLock))return e._queue.push({event:"seek",action:function(){e.seek.apply(e,t);}}),e;var a=e._soundById(o);if(a)if(typeof n=="number"&&n>=0){var f=e.playing(o);f&&e.pause(o,true),a._seek=n,a._ended=false,e._clearTimer(o),!e._webAudio&&a._node&&!isNaN(a._node.duration)&&(a._node.currentTime=n);var m=function(){f&&e.play(o,true),e._emit("seek",o);};if(f&&!e._webAudio){var y=function(){e._playLock?setTimeout(y,0):m();};setTimeout(y,0);}else m();}else if(e._webAudio){var w=e.playing(o)?r.ctx.currentTime-a._playStart:0,T=a._rateSeek?a._rateSeek-a._seek:0;return a._seek+(T+w*Math.abs(a._rate))}else return a._node.currentTime;return e},playing:function(e){var t=this;if(typeof e=="number"){var n=t._soundById(e);return n?!n._paused:false}for(var o=0;o<t._sounds.length;o++)if(!t._sounds[o]._paused)return true;return false},duration:function(e){var t=this,n=t._duration,o=t._soundById(e);return o&&(n=t._sprite[o._sprite][1]/1e3),n},state:function(){return this._state},unload:function(){for(var e=this,t=e._sounds,n=0;n<t.length;n++)t[n]._paused||e.stop(t[n]._id),e._webAudio||(e._clearSound(t[n]._node),t[n]._node.removeEventListener("error",t[n]._errorFn,false),t[n]._node.removeEventListener(r._canPlayEvent,t[n]._loadFn,false),t[n]._node.removeEventListener("ended",t[n]._endFn,false),r._releaseHtml5Audio(t[n]._node)),delete t[n]._node,e._clearTimer(t[n]._id);var o=r._howls.indexOf(e);o>=0&&r._howls.splice(o,1);var l=true;for(n=0;n<r._howls.length;n++)if(r._howls[n]._src===e._src||e._src.indexOf(r._howls[n]._src)>=0){l=false;break}return c&&l&&delete c[e._src],r.noAudio=false,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,o){var l=this,s=l["_on"+e];return typeof t=="function"&&s.push(o?{id:n,fn:t,once:o}:{id:n,fn:t}),l},off:function(e,t,n){var o=this,l=o["_on"+e],s=0;if(typeof t=="number"&&(n=t,t=null),t||n)for(s=0;s<l.length;s++){var a=n===l[s].id;if(t===l[s].fn&&a||!t&&a){l.splice(s,1);break}}else if(e)o["_on"+e]=[];else {var f=Object.keys(o);for(s=0;s<f.length;s++)f[s].indexOf("_on")===0&&Array.isArray(o[f[s]])&&(o[f[s]]=[]);}return o},once:function(e,t,n){var o=this;return o.on(e,t,n,1),o},_emit:function(e,t,n){for(var o=this,l=o["_on"+e],s=l.length-1;s>=0;s--)(!l[s].id||l[s].id===t||e==="load")&&(setTimeout((function(a){a.call(this,t,n);}).bind(o,l[s].fn),0),l[s].once&&o.off(e,l[s].fn,l[s].id));return o._loadQueue(e),o},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action();}return t},_ended:function(e){var t=this,n=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(t._ended.bind(t,e),100),t;var o=!!(e._loop||t._sprite[n][2]);if(t._emit("end",e._id),!t._webAudio&&o&&t.stop(e._id,true).play(e._id),t._webAudio&&o){t._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=r.ctx.currentTime;var l=(e._stop-e._start)*1e3/Math.abs(e._rate);t._endTimers[e._id]=setTimeout(t._ended.bind(t,e),l);}return t._webAudio&&!o&&(e._paused=true,e._ended=true,e._seek=e._start||0,e._rateSeek=0,t._clearTimer(e._id),t._cleanBuffer(e._node),r._autoSuspend()),!t._webAudio&&!o&&t.stop(e._id,true),t},_clearTimer:function(e){var t=this;if(t._endTimers[e]){if(typeof t._endTimers[e]!="function")clearTimeout(t._endTimers[e]);else {var n=t._soundById(e);n&&n._node&&n._node.removeEventListener("ended",t._endTimers[e],false);}delete t._endTimers[e];}return t},_soundById:function(e){for(var t=this,n=0;n<t._sounds.length;n++)if(e===t._sounds[n]._id)return t._sounds[n];return null},_inactiveSound:function(){var e=this;e._drain();for(var t=0;t<e._sounds.length;t++)if(e._sounds[t]._ended)return e._sounds[t].reset();return new u(e)},_drain:function(){var e=this,t=e._pool,n=0,o=0;if(!(e._sounds.length<t)){for(o=0;o<e._sounds.length;o++)e._sounds[o]._ended&&n++;for(o=e._sounds.length-1;o>=0;o--){if(n<=t)return;e._sounds[o]._ended&&(e._webAudio&&e._sounds[o]._node&&e._sounds[o]._node.disconnect(0),e._sounds.splice(o,1),n--);}}},_getSoundIds:function(e){var t=this;if(typeof e>"u"){for(var n=[],o=0;o<t._sounds.length;o++)n.push(t._sounds[o]._id);return n}else return [e]},_refreshBuffer:function(e){var t=this;return e._node.bufferSource=r.ctx.createBufferSource(),e._node.bufferSource.buffer=c[t._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,r.ctx.currentTime),t},_cleanBuffer:function(e){var t=this,n=r._navigator&&r._navigator.vendor.indexOf("Apple")>=0;if(!e.bufferSource)return t;if(r._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),n))try{e.bufferSource.buffer=r._scratchBuffer;}catch(o){}return e.bufferSource=null,t},_clearSound:function(e){var t=/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent);t||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA");}};var u=function(e){this._parent=e,this.init();};u.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=true,e._ended=true,e._sprite="__default",e._id=++r._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,n=r._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),e._node.gain.setValueAtTime(n,r.ctx.currentTime),e._node.paused=true,e._node.connect(r.masterGain)):r.noAudio||(e._node=r._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,false),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(r._canPlayEvent,e._loadFn,false),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,false),e._node.src=t._src,e._node.preload=t._preload===true?"auto":t._preload,e._node.volume=n*r.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=true,e._ended=true,e._sprite="__default",e._id=++r._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,false);},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(e._node.duration*10)/10,Object.keys(t._sprite).length===0&&(t._sprite={__default:[0,t._duration*1e3]}),t._state!=="loaded"&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(r._canPlayEvent,e._loadFn,false);},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(e._node.duration*10)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=t._duration*1e3),t._ended(e)),e._node.removeEventListener("ended",e._endFn,false);}};var c={},d=function(e){var t=e._src;if(c[t]){e._duration=c[t].duration,_(e);return}if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),o=new Uint8Array(n.length),l=0;l<n.length;++l)o[l]=n.charCodeAt(l);p(o.buffer,e);}else {var s=new XMLHttpRequest;s.open(e._xhr.method,t,true),s.withCredentials=e._xhr.withCredentials,s.responseType="arraybuffer",e._xhr.headers&&Object.keys(e._xhr.headers).forEach(function(a){s.setRequestHeader(a,e._xhr.headers[a]);}),s.onload=function(){var a=(s.status+"")[0];if(a!=="0"&&a!=="2"&&a!=="3"){e._emit("loaderror",null,"Failed loading audio file with status: "+s.status+".");return}p(s.response,e);},s.onerror=function(){e._webAudio&&(e._html5=true,e._webAudio=false,e._sounds=[],delete c[t],e.load());},h(s);}},h=function(e){try{e.send();}catch(t){e.onerror();}},p=function(e,t){var n=function(){t._emit("loaderror",null,"Decoding audio data failed.");},o=function(l){l&&t._sounds.length>0?(c[t._src]=l,_(t,l)):n();};typeof Promise<"u"&&r.ctx.decodeAudioData.length===1?r.ctx.decodeAudioData(e).then(o).catch(n):r.ctx.decodeAudioData(e,o,n);},_=function(e,t){t&&!e._duration&&(e._duration=t.duration),Object.keys(e._sprite).length===0&&(e._sprite={__default:[0,e._duration*1e3]}),e._state!=="loaded"&&(e._state="loaded",e._emit("load"),e._loadQueue());},A=function(){if(r.usingWebAudio){try{typeof AudioContext<"u"?r.ctx=new AudioContext:typeof webkitAudioContext<"u"?r.ctx=new webkitAudioContext:r.usingWebAudio=false;}catch(l){r.usingWebAudio=false;}r.ctx||(r.usingWebAudio=false);var e=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),t=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),n=t?parseInt(t[1],10):null;if(e&&n&&n<9){var o=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!o&&(r.usingWebAudio=false);}r.usingWebAudio&&(r.masterGain=typeof r.ctx.createGain>"u"?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup();}};typeof define=="function"&&define.amd&&define([],function(){return {Howler:r,Howl:i}}),typeof k<"u"&&(k.Howler=r,k.Howl=i),typeof global<"u"?(global.HowlerGlobal=g,global.Howler=r,global.Howl=i,global.Sound=u):typeof window<"u"&&(window.HowlerGlobal=g,window.Howler=r,window.Howl=i,window.Sound=u);})();(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(r){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var u=i._howls.length-1;u>=0;u--)i._howls[u].stereo(r);return i},HowlerGlobal.prototype.pos=function(r,i,u){var c=this;if(!c.ctx||!c.ctx.listener)return c;if(i=typeof i!="number"?c._pos[1]:i,u=typeof u!="number"?c._pos[2]:u,typeof r=="number")c._pos=[r,i,u],typeof c.ctx.listener.positionX<"u"?(c.ctx.listener.positionX.setTargetAtTime(c._pos[0],Howler.ctx.currentTime,.1),c.ctx.listener.positionY.setTargetAtTime(c._pos[1],Howler.ctx.currentTime,.1),c.ctx.listener.positionZ.setTargetAtTime(c._pos[2],Howler.ctx.currentTime,.1)):c.ctx.listener.setPosition(c._pos[0],c._pos[1],c._pos[2]);else return c._pos;return c},HowlerGlobal.prototype.orientation=function(r,i,u,c,d,h){var p=this;if(!p.ctx||!p.ctx.listener)return p;var _=p._orientation;if(i=typeof i!="number"?_[1]:i,u=typeof u!="number"?_[2]:u,c=typeof c!="number"?_[3]:c,d=typeof d!="number"?_[4]:d,h=typeof h!="number"?_[5]:h,typeof r=="number")p._orientation=[r,i,u,c,d,h],typeof p.ctx.listener.forwardX<"u"?(p.ctx.listener.forwardX.setTargetAtTime(r,Howler.ctx.currentTime,.1),p.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),p.ctx.listener.forwardZ.setTargetAtTime(u,Howler.ctx.currentTime,.1),p.ctx.listener.upX.setTargetAtTime(c,Howler.ctx.currentTime,.1),p.ctx.listener.upY.setTargetAtTime(d,Howler.ctx.currentTime,.1),p.ctx.listener.upZ.setTargetAtTime(h,Howler.ctx.currentTime,.1)):p.ctx.listener.setOrientation(r,i,u,c,d,h);else return _;return p},Howl.prototype.init=function(r){return function(i){var u=this;return u._orientation=i.orientation||[1,0,0],u._stereo=i.stereo||null,u._pos=i.pos||null,u._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},u._onstereo=i.onstereo?[{fn:i.onstereo}]:[],u._onpos=i.onpos?[{fn:i.onpos}]:[],u._onorientation=i.onorientation?[{fn:i.onorientation}]:[],r.call(this,i)}}(Howl.prototype.init),Howl.prototype.stereo=function(r,i){var u=this;if(!u._webAudio)return u;if(u._state!=="loaded")return u._queue.push({event:"stereo",action:function(){u.stereo(r,i);}}),u;var c=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof r=="number")u._stereo=r,u._pos=[r,0,0];else return u._stereo;for(var d=u._getSoundIds(i),h=0;h<d.length;h++){var p=u._soundById(d[h]);if(p)if(typeof r=="number")p._stereo=r,p._pos=[r,0,0],p._node&&(p._pannerAttr.panningModel="equalpower",(!p._panner||!p._panner.pan)&&g(p,c),c==="spatial"?typeof p._panner.positionX<"u"?(p._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),p._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),p._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):p._panner.setPosition(r,0,0):p._panner.pan.setValueAtTime(r,Howler.ctx.currentTime)),u._emit("stereo",p._id);else return p._stereo}return u},Howl.prototype.pos=function(r,i,u,c){var d=this;if(!d._webAudio)return d;if(d._state!=="loaded")return d._queue.push({event:"pos",action:function(){d.pos(r,i,u,c);}}),d;if(i=typeof i!="number"?0:i,u=typeof u!="number"?-0.5:u,typeof c>"u")if(typeof r=="number")d._pos=[r,i,u];else return d._pos;for(var h=d._getSoundIds(c),p=0;p<h.length;p++){var _=d._soundById(h[p]);if(_)if(typeof r=="number")_._pos=[r,i,u],_._node&&((!_._panner||_._panner.pan)&&g(_,"spatial"),typeof _._panner.positionX<"u"?(_._panner.positionX.setValueAtTime(r,Howler.ctx.currentTime),_._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),_._panner.positionZ.setValueAtTime(u,Howler.ctx.currentTime)):_._panner.setPosition(r,i,u)),d._emit("pos",_._id);else return _._pos}return d},Howl.prototype.orientation=function(r,i,u,c){var d=this;if(!d._webAudio)return d;if(d._state!=="loaded")return d._queue.push({event:"orientation",action:function(){d.orientation(r,i,u,c);}}),d;if(i=typeof i!="number"?d._orientation[1]:i,u=typeof u!="number"?d._orientation[2]:u,typeof c>"u")if(typeof r=="number")d._orientation=[r,i,u];else return d._orientation;for(var h=d._getSoundIds(c),p=0;p<h.length;p++){var _=d._soundById(h[p]);if(_)if(typeof r=="number")_._orientation=[r,i,u],_._node&&(_._panner||(_._pos||(_._pos=d._pos||[0,0,-0.5]),g(_,"spatial")),typeof _._panner.orientationX<"u"?(_._panner.orientationX.setValueAtTime(r,Howler.ctx.currentTime),_._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),_._panner.orientationZ.setValueAtTime(u,Howler.ctx.currentTime)):_._panner.setOrientation(r,i,u)),d._emit("orientation",_._id);else return _._orientation}return d},Howl.prototype.pannerAttr=function(){var r=this,i=arguments,u,c,d;if(!r._webAudio)return r;if(i.length===0)return r._pannerAttr;if(i.length===1)if(typeof i[0]=="object")u=i[0],typeof c>"u"&&(u.pannerAttr||(u.pannerAttr={coneInnerAngle:u.coneInnerAngle,coneOuterAngle:u.coneOuterAngle,coneOuterGain:u.coneOuterGain,distanceModel:u.distanceModel,maxDistance:u.maxDistance,refDistance:u.refDistance,rolloffFactor:u.rolloffFactor,panningModel:u.panningModel}),r._pannerAttr={coneInnerAngle:typeof u.pannerAttr.coneInnerAngle<"u"?u.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:typeof u.pannerAttr.coneOuterAngle<"u"?u.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:typeof u.pannerAttr.coneOuterGain<"u"?u.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:typeof u.pannerAttr.distanceModel<"u"?u.pannerAttr.distanceModel:r._distanceModel,maxDistance:typeof u.pannerAttr.maxDistance<"u"?u.pannerAttr.maxDistance:r._maxDistance,refDistance:typeof u.pannerAttr.refDistance<"u"?u.pannerAttr.refDistance:r._refDistance,rolloffFactor:typeof u.pannerAttr.rolloffFactor<"u"?u.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:typeof u.pannerAttr.panningModel<"u"?u.pannerAttr.panningModel:r._panningModel});else return d=r._soundById(parseInt(i[0],10)),d?d._pannerAttr:r._pannerAttr;else i.length===2&&(u=i[0],c=parseInt(i[1],10));for(var h=r._getSoundIds(c),p=0;p<h.length;p++)if(d=r._soundById(h[p]),d){var _=d._pannerAttr;_={coneInnerAngle:typeof u.coneInnerAngle<"u"?u.coneInnerAngle:_.coneInnerAngle,coneOuterAngle:typeof u.coneOuterAngle<"u"?u.coneOuterAngle:_.coneOuterAngle,coneOuterGain:typeof u.coneOuterGain<"u"?u.coneOuterGain:_.coneOuterGain,distanceModel:typeof u.distanceModel<"u"?u.distanceModel:_.distanceModel,maxDistance:typeof u.maxDistance<"u"?u.maxDistance:_.maxDistance,refDistance:typeof u.refDistance<"u"?u.refDistance:_.refDistance,rolloffFactor:typeof u.rolloffFactor<"u"?u.rolloffFactor:_.rolloffFactor,panningModel:typeof u.panningModel<"u"?u.panningModel:_.panningModel};var A=d._panner;A||(d._pos||(d._pos=r._pos||[0,0,-0.5]),g(d,"spatial"),A=d._panner),A.coneInnerAngle=_.coneInnerAngle,A.coneOuterAngle=_.coneOuterAngle,A.coneOuterGain=_.coneOuterGain,A.distanceModel=_.distanceModel,A.maxDistance=_.maxDistance,A.refDistance=_.refDistance,A.rolloffFactor=_.rolloffFactor,A.panningModel=_.panningModel;}return r},Sound.prototype.init=function(r){return function(){var i=this,u=i._parent;i._orientation=u._orientation,i._stereo=u._stereo,i._pos=u._pos,i._pannerAttr=u._pannerAttr,r.call(this),i._stereo?u.stereo(i._stereo):i._pos&&u.pos(i._pos[0],i._pos[1],i._pos[2],i._id);}}(Sound.prototype.init),Sound.prototype.reset=function(r){return function(){var i=this,u=i._parent;return i._orientation=u._orientation,i._stereo=u._stereo,i._pos=u._pos,i._pannerAttr=u._pannerAttr,i._stereo?u.stereo(i._stereo):i._pos?u.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,u._refreshBuffer(i)),r.call(this)}}(Sound.prototype.reset);var g=function(r,i){i=i||"spatial",i==="spatial"?(r._panner=Howler.ctx.createPanner(),r._panner.coneInnerAngle=r._pannerAttr.coneInnerAngle,r._panner.coneOuterAngle=r._pannerAttr.coneOuterAngle,r._panner.coneOuterGain=r._pannerAttr.coneOuterGain,r._panner.distanceModel=r._pannerAttr.distanceModel,r._panner.maxDistance=r._pannerAttr.maxDistance,r._panner.refDistance=r._pannerAttr.refDistance,r._panner.rolloffFactor=r._pannerAttr.rolloffFactor,r._panner.panningModel=r._pannerAttr.panningModel,typeof r._panner.positionX<"u"?(r._panner.positionX.setValueAtTime(r._pos[0],Howler.ctx.currentTime),r._panner.positionY.setValueAtTime(r._pos[1],Howler.ctx.currentTime),r._panner.positionZ.setValueAtTime(r._pos[2],Howler.ctx.currentTime)):r._panner.setPosition(r._pos[0],r._pos[1],r._pos[2]),typeof r._panner.orientationX<"u"?(r._panner.orientationX.setValueAtTime(r._orientation[0],Howler.ctx.currentTime),r._panner.orientationY.setValueAtTime(r._orientation[1],Howler.ctx.currentTime),r._panner.orientationZ.setValueAtTime(r._orientation[2],Howler.ctx.currentTime)):r._panner.setOrientation(r._orientation[0],r._orientation[1],r._orientation[2])):(r._panner=Howler.ctx.createStereoPanner(),r._panner.pan.setValueAtTime(r._stereo,Howler.ctx.currentTime)),r._panner.connect(r._node),r._paused||r._parent.pause(r._id,true).play(r._id,true);};})();});var O=b$1(B(),1),H=new Map;H.set("default",()=>import('../assets/beepSound.js'));var b=class b{constructor(r){this.resource=null;this.resource=r;}static get defaultSound(){return b._defaultSound instanceof b||(b._defaultSound=new b("default")),b._defaultSound}toJSONObject(){return this.resource!==null?{resource:this.resource}:{}}async play(){var r;if(this.audio==null&&this.resource!=null)if(H.has(this.resource)){let i=await((r=H.get(this.resource))==null?void 0:r());i!=null&&i.beepSound&&(this.audio=new O.Howl({src:i.beepSound,html5:true}));}else this.audio=new O.Howl({src:this.resource,html5:true});this.audio!=null&&this.audio.play();}};b._defaultSound=null;var L=b;
2
+ export{L as a};