@scandit/web-datacapture-core 7.0.0 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/{Camera-Cxbduq94.d.ts → Camera-BJij9966.d.ts} +29 -5
- package/build/js/Camera.d.ts +1 -1
- package/build/js/Camera.js +1 -1
- package/build/js/CameraAccess.d.ts +1 -1
- package/build/js/CameraAccess.js +1 -1
- package/build/js/CameraRelated.d.ts +1 -1
- package/build/js/DataCaptureContext.d.ts +1 -1
- package/build/js/DataCaptureContext.js +1 -1
- package/build/js/DataCaptureContextRelated.d.ts +1 -1
- package/build/js/DataCaptureVersion.js +1 -1
- package/build/js/DataCaptureView.d.ts +1 -1
- package/build/js/DataCaptureView.js +1 -1
- package/build/js/Defaults.d.ts +1 -1
- package/build/js/Feedback.js +1 -1
- package/build/js/FrameData.d.ts +1 -1
- package/build/js/ImageFrameSource.d.ts +1 -1
- package/build/js/SingleImageUploader.d.ts +1 -1
- package/build/js/Vibration.js +1 -1
- package/build/js/browserHelper.d.ts +6 -0
- package/build/js/browserHelper.js +1 -1
- package/build/js/chunks/chunk-4DCTEQWR.js +3 -0
- package/build/js/chunks/{chunk-MM6VVG46.js → chunk-5TKCHVG2.js} +1 -1
- package/build/js/chunks/{chunk-PO2YU6JK.js → chunk-6O3B7VJJ.js} +1 -1
- package/build/js/chunks/chunk-ABRFVD7T.js +5 -0
- package/build/js/chunks/{chunk-SXOL25UA.js → chunk-BIGR7VVJ.js} +1 -1
- package/build/js/chunks/{chunk-KWL7KLMR.js → chunk-BOKAHIDO.js} +3 -3
- package/build/js/chunks/{chunk-IH7SHTFM.js → chunk-EHMSDFH7.js} +1 -1
- package/build/js/chunks/chunk-GANXTAAE.js +10 -0
- package/build/js/chunks/{chunk-UA3E3GGM.js → chunk-HNMM5VR6.js} +1 -1
- package/build/js/chunks/{chunk-4MKLNRV3.js → chunk-MOKCZFZV.js} +4 -4
- package/build/js/chunks/chunk-MU4VAJIM.js +6 -0
- package/build/js/chunks/chunk-MW5PTAU7.js +3 -0
- package/build/js/chunks/chunk-QHBIT2WY.js +3 -0
- package/build/js/chunks/chunk-SKRKDAFC.js +13 -0
- package/build/js/chunks/{chunk-YGNHN5OT.js → chunk-TCJPGGHY.js} +3 -3
- package/build/js/chunks/{chunk-XM4ZH4L3.js → chunk-TWBD6OC5.js} +3 -3
- package/build/js/chunks/{chunk-MOF3P7VK.js → chunk-ULRY4SXF.js} +2 -2
- package/build/js/chunks/chunk-VLCULU2N.js +17 -0
- package/build/js/chunks/{chunk-EQEB3JUS.js → chunk-Z6YXX4XZ.js} +1 -1
- package/build/js/chunks/{chunk-ERQILEGU.js → chunk-ZMMHJ5WH.js} +8 -8
- package/build/js/index.d.ts +2 -2
- package/build/js/index.js +14 -14
- package/build/js/private/CameraAccess.d.ts +1 -1
- package/build/js/private/CameraAccess.js +1 -1
- package/build/js/private/CameraManager.d.ts +1 -1
- package/build/js/private/CameraManager.js +1 -1
- package/build/js/private/CanvasDrawerWithMetrics.d.ts +1 -1
- package/build/js/private/CoreModuleLicenseTextProvider.d.ts +1 -1
- package/build/js/private/DataCaptureContextRelated.d.ts +1 -1
- package/build/js/private/FrameReaders/FrameReader.d.ts +1 -1
- package/build/js/private/FrameReaders/FrameReader.js +1 -1
- package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +1 -1
- package/build/js/private/FrameReaders/FrameReaderAbstract.js +1 -1
- package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +2 -5
- package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
- package/build/js/private/FrameReaders/WatermarkStack.js +1 -1
- package/build/js/private/FrameReaders/index.d.ts +1 -1
- package/build/js/private/FrameReaders/index.js +2 -2
- package/build/js/private/NormalizedConfigureOptions.d.ts +1 -1
- package/build/js/private/SingleImageUploaderView.js +1 -1
- package/build/js/private/ViewControls+related.js +1 -1
- package/build/js/private/ViewControls_related.d.ts +1 -1
- package/build/js/private/ViewsRegistry.d.ts +1 -1
- package/build/js/private/hybridDesktopPlatformHelpers.js +1 -1
- package/build/js/private/ui/atoms/Toast.d.ts +1 -1
- package/build/js/private/ui/molecules/HintPresenter.d.ts +1 -1
- package/build/js/private/ui/molecules/HintPresenter.js +1 -1
- package/build/js/sdk.d.ts +1 -1
- package/build/js/worker/WorkerMain.d.ts +1 -1
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/dataCapture.inlineWorker.d.ts +1 -1
- package/build/js/worker/dataCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.d.ts +1 -1
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/build/js/worker/dataCaptureLoader.d.ts +1 -1
- package/build/js/worker/dataCaptureLoader.js +1 -1
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +1 -1
- package/build/js/worker/index.d.ts +1 -1
- package/build/js/worker/index.js +3 -3
- package/package.json +1 -1
- package/build/js/chunks/chunk-3TNNUKVW.js +0 -5
- package/build/js/chunks/chunk-4FJRDG6T.js +0 -6
- package/build/js/chunks/chunk-76GU6PXK.js +0 -3
- package/build/js/chunks/chunk-DWX2KHSS.js +0 -3
- package/build/js/chunks/chunk-EK2IIDFY.js +0 -3
- package/build/js/chunks/chunk-HEBLZ3EE.js +0 -10
- package/build/js/chunks/chunk-YXQ44PG2.js +0 -17
- package/build/js/chunks/chunk-ZR62555L.js +0 -12
- package/build/js/chunks/{chunk-E2VUMNY4.js → chunk-2VQ6NTFF.js} +1 -1
- package/build/js/chunks/{chunk-46WJFV3I.js → chunk-W4O7BOCW.js} +1 -1
|
@@ -265,6 +265,10 @@ declare class CameraSettings implements Serializable<CameraSettingsJSON> {
|
|
|
265
265
|
toJSONObject(): CameraSettingsJSON & Record<string, any>;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
interface PoolCapacityOptions {
|
|
269
|
+
minPoolCapacity: number;
|
|
270
|
+
maxPoolCapacity: number;
|
|
271
|
+
}
|
|
268
272
|
declare abstract class FrameReaderAbstract {
|
|
269
273
|
colorType: ColorType;
|
|
270
274
|
protected readonly _contextWebGL: WebGLRenderingContext;
|
|
@@ -277,10 +281,7 @@ declare abstract class FrameReaderAbstract {
|
|
|
277
281
|
* eliminating the need to wait for the engine to finish before capturing the next frame.
|
|
278
282
|
*/
|
|
279
283
|
protected _framePool: Optional<WatermarkStack<Uint8ClampedArray>>;
|
|
280
|
-
constructor(contextWebGL: WebGLRenderingContext, options?:
|
|
281
|
-
maxPoolCapacity: number;
|
|
282
|
-
minPoolCapacity: number;
|
|
283
|
-
} | undefined);
|
|
284
|
+
constructor(contextWebGL: WebGLRenderingContext, options?: PoolCapacityOptions | undefined);
|
|
284
285
|
abstract readFromSource(source: TexImageSource): FrameCapture;
|
|
285
286
|
abstract setup(): void;
|
|
286
287
|
recycle(pixelsData: Uint8ClampedArray): void;
|
|
@@ -522,6 +523,7 @@ declare class DataCaptureLoader {
|
|
|
522
523
|
protected constructor(options: DataCaptureLoaderOptions);
|
|
523
524
|
get dataCaptureWorker(): DataCaptureWorker;
|
|
524
525
|
protected get name(): string;
|
|
526
|
+
protected get fixedWasmMemory(): number | null;
|
|
525
527
|
static create(options: DataCaptureLoaderOptions): Promise<DataCaptureLoader>;
|
|
526
528
|
load(): Promise<WorkerResponse<"loadLibrary">>;
|
|
527
529
|
/**
|
|
@@ -580,6 +582,7 @@ interface PrivateDataCaptureMode {
|
|
|
580
582
|
_context: Optional<DataCaptureContext$1>;
|
|
581
583
|
attachedToContext: (context: DataCaptureContext$1) => Promise<void>;
|
|
582
584
|
detachedFromContext: () => Promise<void>;
|
|
585
|
+
_synchronousFrameFlow?: boolean;
|
|
583
586
|
}
|
|
584
587
|
interface DataCaptureMode extends Serializable {
|
|
585
588
|
isEnabled(): boolean;
|
|
@@ -666,6 +669,14 @@ declare class DataCaptureContext$1 implements Serializable<DataCaptureContextJSO
|
|
|
666
669
|
private readonly delayedRegistration;
|
|
667
670
|
private readonly highEndBlurryRecognition;
|
|
668
671
|
private readonly _frameHandlers;
|
|
672
|
+
/**
|
|
673
|
+
* When synchronous, only one frame is processed at a time by the capture mode, the frame source will wait until the
|
|
674
|
+
* frame data is back to send the next frame.
|
|
675
|
+
*
|
|
676
|
+
* IdCapture uses the synchronous flow because BlinkID only processes one frame at a time.
|
|
677
|
+
* MatrixScan and other barcode modes usually use the asynchronous flow because they can use multi-threading.
|
|
678
|
+
*/
|
|
679
|
+
private _useSynchronousFrameFlow;
|
|
669
680
|
private constructor();
|
|
670
681
|
get frameSource(): FrameSource | null;
|
|
671
682
|
private get workerCommand();
|
|
@@ -716,6 +727,11 @@ declare class DataCaptureContext$1 implements Serializable<DataCaptureContextJSO
|
|
|
716
727
|
private subscribeToWorkerMessages;
|
|
717
728
|
private unsubscribeToWorkerMessages;
|
|
718
729
|
private hasEnabledMode;
|
|
730
|
+
/**
|
|
731
|
+
* Some capture modes process frames synchronously, like IdCapture. Other can process multiple frames
|
|
732
|
+
* in parallel, like MatrixScan. We inform the CameraManager how to process frames.
|
|
733
|
+
*/
|
|
734
|
+
private updateCameraFrameFlow;
|
|
719
735
|
private isFeatureSupported;
|
|
720
736
|
}
|
|
721
737
|
|
|
@@ -1288,6 +1304,7 @@ interface LoadLibraryParameters {
|
|
|
1288
1304
|
verifyResponseHash: boolean;
|
|
1289
1305
|
onProgress?: (info: ProgressInfo) => void;
|
|
1290
1306
|
referredOrigin?: string;
|
|
1307
|
+
fixedWasmMemory: number | null;
|
|
1291
1308
|
}
|
|
1292
1309
|
interface CreateContextParameters {
|
|
1293
1310
|
context: DataCaptureContextJSON;
|
|
@@ -1410,6 +1427,7 @@ declare class DataCaptureEngine<M extends Module> {
|
|
|
1410
1427
|
private setupDataDecoding;
|
|
1411
1428
|
private start;
|
|
1412
1429
|
private getWritableDataPath;
|
|
1430
|
+
private numOfMBToPages;
|
|
1413
1431
|
private setup;
|
|
1414
1432
|
}
|
|
1415
1433
|
|
|
@@ -1494,6 +1512,8 @@ declare class CameraManager {
|
|
|
1494
1512
|
private readonly videoTrackMuteListener;
|
|
1495
1513
|
private _canvas2dContext;
|
|
1496
1514
|
private _canvasWebGLContext;
|
|
1515
|
+
private _synchronousFrameHandling;
|
|
1516
|
+
private _frameReaderOptions;
|
|
1497
1517
|
private _glFrameReaders;
|
|
1498
1518
|
private _frameReaderType;
|
|
1499
1519
|
private _mediaStream?;
|
|
@@ -1522,6 +1542,7 @@ declare class CameraManager {
|
|
|
1522
1542
|
constructor();
|
|
1523
1543
|
get mediaStream(): MediaStream | undefined;
|
|
1524
1544
|
set mediaStream(stream: MediaStream | undefined);
|
|
1545
|
+
get synchronousFrameHandling(): boolean;
|
|
1525
1546
|
private get canvas2dContext();
|
|
1526
1547
|
private get canvasWebGLContext();
|
|
1527
1548
|
static instance(): CameraManager;
|
|
@@ -1569,7 +1590,10 @@ declare class CameraManager {
|
|
|
1569
1590
|
waitForCapabilities(): Promise<void>;
|
|
1570
1591
|
setFrameReaderType(type: ColorType): void;
|
|
1571
1592
|
allowPictureInPicture(allow: boolean): Promise<void>;
|
|
1593
|
+
setFrameHandling(synchronous: boolean): void;
|
|
1572
1594
|
private accessAutoselectedCamera;
|
|
1595
|
+
private getFrameReaderOptions;
|
|
1596
|
+
private getFrameReader;
|
|
1573
1597
|
private accessInitialCamera;
|
|
1574
1598
|
/**
|
|
1575
1599
|
* When a context has been created for a canvas, it is not possible to get another one from another type.
|
|
@@ -1697,4 +1721,4 @@ declare class Camera implements FrameSource, Serializable<CameraJSON> {
|
|
|
1697
1721
|
private isZoomAvailable;
|
|
1698
1722
|
}
|
|
1699
1723
|
|
|
1700
|
-
export { type ModuleHandler 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 FrameData as N, type PrivateLoadableFrameData as O, type PrivateChangeSet as P, convertToPublicFrameData as Q, type DataCaptureLoaderOptions as R, type PerformanceMetrics as S, TorchState as T, DataCaptureEngine as U, VideoResolution as V, type Module as W, type
|
|
1724
|
+
export { type ModuleHandler 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 FrameData as N, type PrivateLoadableFrameData as O, type PrivateChangeSet as P, convertToPublicFrameData as Q, type DataCaptureLoaderOptions as R, type PerformanceMetrics as S, TorchState as T, DataCaptureEngine as U, VideoResolution as V, type Module as W, type DataCaptureCallbackMessage as X, type GenericHint as Y, type AnyDataCaptureActionMessage as Z, type AugmentedWorker as _, type FrameSource as a, HintIcon as a$, type DataCaptureActionMessageKey as a0, type EngineWorkerResponse as a1, type ExtractCentaurusLicenseResponse as a2, type RequestFrameDataResponse as a3, type IsFeatureSupportedResponse as a4, type GetViewfinderInfo as a5, type GetOpenSourceSoftwareLicenseInfoResponse as a6, type WorkerResponse as a7, type LoadLibraryDataCaptureAction as a8, type CreateContextDataCaptureAction as a9, type OnFrameSkippedMessage as aA, type ShowToastMessage as aB, type HideToastMessage as aC, type ShowGuidanceMessage as aD, type HideGuidanceMessage as aE, type StartUpdateTimerMessage as aF, type StopUpdateTimerMessage as aG, type PayloadForCommand as aH, type DataCaptureWorker as aI, type EmscriptenClassHandle as aJ, type DataCaptureContext as aK, type DataCaptureImageBufferFrameSource as aL, type GestureListener as aM, type GestureRecognizer as aN, type DataCaptureView as aO, type JSONParseable as aP, type DataCaptureContextDeserializerResult as aQ, type DataCaptureContextDeserializer as aR, type CaptureModeDeserializerInstance as aS, type ModuleMirrorAxis as aT, type Vector as aU, type WasmFrameData as aV, HintFont as aW, HintTextAlignment as aX, HintWidth as aY, HintHeight as aZ, HintCornerStyle as a_, type SetFrameSourceDataCaptureAction as aa, type ProcessFrameDataCaptureAction as ab, type RequestFrameDataDataCaptureAction as ac, type DeleteFrameDataDataCaptureAction as ad, type VisibilityChangeAction as ae, type IsFeatureSupportedAction as af, type UpdateContextDataCaptureAction as ag, type DisposeDataCaptureAction as ah, type FlushAnalyticsDataCaptureAction as ai, type ReportCameraPropertiesDataCaptureAction as aj, type SetLogLevelDataCaptureAction as ak, type ExtractCentaurusLicenseDataCaptureAction as al, type OnTapAction as am, type HintPresenterV2updateAction as an, type GetViewfinderInfoAction as ao, type GetOpenSourceSoftwareLicenseInfoAction as ap, type DataCaptureCallbackMessageKeys as aq, type SuccessFeedbackWorkerMessage as ar, type ShowHintWorkerMessage as as, type UpdateHintWorkerMessage as at, type IsFeatureSupportedMessage as au, type HideHintWorkerMessage as av, type PerformanceMetricsReportMessage as aw, type DidTapTrackedBarcode as ax, type OnFrameProcessingStartedMessage as ay, type OnFrameProcessingFinishedMessage as az, FrameSourceState as b, HintAnchor as b0, type HintStyle as b1, GuidanceHintAnchor as b2, GuidanceHintStyle as b3, type GuidanceHint as b4, ToastHintStyle as b5, type ToastHint as b6, LicensedFeature as b7, type HintPresenterV2 as b8, type PlatformHintPresenter as b9, type LoadLibraryParameters as ba, type CreateContextParameters as bb, type UpdateContextParameters as bc, type SetFrameSourceParameters as bd, type ProcessFrameParameters as be, type ReportCameraPropertiesParameters as bf, type WorkerFunctions as bg, FrameReaderAbstract as bh, ColorType as bi, type PoolCapacityOptions as bj, type FrameCapture as bk, FrameReader as bl, CameraPosition$1 as bm, CameraResolutionConstraint$1 as bn, AspectRatio as bo, type DeviceCamera$1 as bp, CameraAccess$1 as bq, MeteringMode as br, CameraResolutionConstraint as bs, type ExtendedMediaTrackCapabilities as bt, type ExtendedMediaTrackConstraintSet as bu, type GUI as bv, CameraManagerEvent as bw, type CameraManagerEventParameters as bx, CameraManager as by, 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 };
|
package/build/js/Camera.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
export { g as Camera, e as CameraJSON, f as VideoFrameResolution } from './Camera-
|
|
2
|
+
export { g as Camera, e as CameraJSON, f as VideoFrameResolution } from './Camera-BJij9966.js';
|
|
3
3
|
import './private/Serializable.js';
|
|
4
4
|
import './private/FrameReaders/WatermarkStack.js';
|
|
5
5
|
import './tsHelper.js';
|
package/build/js/Camera.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as Camera } from './chunks/chunk-
|
|
1
|
+
export { a as Camera } from './chunks/chunk-MOKCZFZV.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
export { m as CameraAccess, n as DeviceCamera } from './Camera-
|
|
2
|
+
export { m as CameraAccess, n as DeviceCamera } from './Camera-BJij9966.js';
|
|
3
3
|
import './private/Serializable.js';
|
|
4
4
|
import './private/FrameReaders/WatermarkStack.js';
|
|
5
5
|
import './tsHelper.js';
|
package/build/js/CameraAccess.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as CameraAccess } from './chunks/chunk-
|
|
1
|
+
export { a as CameraAccess } from './chunks/chunk-5TKCHVG2.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-
|
|
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-BJij9966.js';
|
|
3
3
|
import './private/Serializable.js';
|
|
4
4
|
import './private/FrameReaders/WatermarkStack.js';
|
|
5
5
|
import './tsHelper.js';
|
|
@@ -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, P as PrivateChangeSet, s as PrivateDataCaptureComponent, w as PrivateDataCaptureContext, v as PrivateDataCaptureContextOptions, p as PrivateDataCaptureMode, A as PrivateFrameHandler, z as PrivateFrameHandlerResponse } from './Camera-
|
|
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, P as PrivateChangeSet, s as PrivateDataCaptureComponent, w as PrivateDataCaptureContext, v as PrivateDataCaptureContextOptions, p as PrivateDataCaptureMode, A as PrivateFrameHandler, z as PrivateFrameHandlerResponse } from './Camera-BJij9966.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-
|
|
1
|
+
export { a as DataCaptureContext } from './chunks/chunk-VLCULU2N.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-
|
|
2
|
+
export { H as ContextStatus, G as ContextStatusJSON, E as DataCaptureContextListener, I as PrivateMirrorAxis } from './Camera-BJij9966.js';
|
|
3
3
|
import './private/Serializable.js';
|
|
4
4
|
import './private/FrameReaders/WatermarkStack.js';
|
|
5
5
|
import './tsHelper.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as DataCaptureVersion } from './chunks/chunk-
|
|
1
|
+
export { a as DataCaptureVersion } from './chunks/chunk-4DCTEQWR.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-
|
|
3
|
+
export { J as DataCaptureOverlay, M as DataCaptureView, L as DataCaptureViewJSON, K as DataCaptureViewListener } from './Camera-BJij9966.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-
|
|
1
|
+
export { a as DataCaptureView } from './chunks/chunk-ZMMHJ5WH.js';
|
package/build/js/Defaults.d.ts
CHANGED
|
@@ -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-
|
|
3
|
+
import { V as VideoResolution, F as FocusGestureStrategy, C as CameraPosition } from './Camera-BJij9966.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';
|
package/build/js/Feedback.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as Feedback } from './chunks/chunk-
|
|
1
|
+
export { a as Feedback } from './chunks/chunk-6O3B7VJJ.js';
|
package/build/js/FrameData.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
export { N as FrameData, O as PrivateLoadableFrameData, Q as convertToPublicFrameData } from './Camera-
|
|
2
|
+
export { N as FrameData, O as PrivateLoadableFrameData, Q as convertToPublicFrameData } from './Camera-BJij9966.js';
|
|
3
3
|
import './private/Serializable.js';
|
|
4
4
|
import './private/FrameReaders/WatermarkStack.js';
|
|
5
5
|
import './tsHelper.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
import { a as FrameSource, b as FrameSourceState, c as FrameSourceListener } from './Camera-
|
|
2
|
+
import { a as FrameSource, b as FrameSourceState, c as FrameSourceListener } from './Camera-BJij9966.js';
|
|
3
3
|
import { Serializable } from './private/Serializable.js';
|
|
4
4
|
import './private/FrameReaders/WatermarkStack.js';
|
|
5
5
|
import './tsHelper.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-
|
|
2
|
+
import { d as FrameSourceJSON, b as FrameSourceState, a as FrameSource, c as FrameSourceListener } from './Camera-BJij9966.js';
|
|
3
3
|
import { SingleImageUploaderSettingsJSON, SingleImageUploaderSettings } from './SingleImageUploaderSettings.js';
|
|
4
4
|
import { Serializable } from './private/Serializable.js';
|
|
5
5
|
import './private/FrameReaders/WatermarkStack.js';
|
package/build/js/Vibration.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as Vibration } from './chunks/chunk-
|
|
1
|
+
export { a as Vibration } from './chunks/chunk-HNMM5VR6.js';
|
|
@@ -106,6 +106,12 @@ declare namespace BrowserHelper {
|
|
|
106
106
|
* @hidden
|
|
107
107
|
*/
|
|
108
108
|
export function isSupportedIOSVersion(): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Check if the browser is Safari.
|
|
111
|
+
* @returns Whether the browser is safari.
|
|
112
|
+
* @hidden
|
|
113
|
+
*/
|
|
114
|
+
export function isSafari(): boolean;
|
|
109
115
|
/**
|
|
110
116
|
* Check if the document is served by an iOS web view.
|
|
111
117
|
* @returns Whether the document is served by an iOS web view.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as BrowserHelper } from './chunks/chunk-
|
|
1
|
+
export { a as BrowserHelper } from './chunks/chunk-MU4VAJIM.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as a$1 } from './chunk-GSJH2EXJ.js';
|
|
2
|
-
import { a } from './chunk-
|
|
2
|
+
import { a } from './chunk-HNMM5VR6.js';
|
|
3
3
|
|
|
4
4
|
var o=class r{constructor(i,e){this._vibration=null;this._sound=null;this._vibration=i,this._sound=e;}static get defaultFeedback(){return new r(a.defaultVibration,a$1.defaultSound)}get vibration(){return this._vibration}get sound(){return this._sound}emit(){this.sound&&this.sound.play(),this.vibration&&this.vibration.vibrate();}toJSONObject(){let i={};return this.sound!==null&&(i.sound=this.sound.toJSONObject()),this.vibration!==null&&(i.vibration=this.vibration.toJSONObject()),i}};
|
|
5
5
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { a } from './chunk-XR65N6EG.js';
|
|
2
|
+
|
|
3
|
+
var n=class{constructor(e){this.overrideThreadsSupport="auto";this.overrideSimdSupport="auto";this.workerCommandId=1;this.workerTasks=new Map;this.workerListeners=[];var r,a;this.libraryLocation=e.libraryLocation,this.isPreloadEngine=(r=e.preloadEngine)!=null?r:!1,this.workerMessageListener=this.onWorkerMessage.bind(this),this.dataCaptureWorker.addEventListener("message",this.workerMessageListener),this.overrideThreadsSupport=e.overrideThreadsSupport,this.overrideSimdSupport=e.overrideSimdSupport,this.verifyResponseHash=e.verifyResponseHash,this.highEndBlurryRecognition=(a=e.highEndBlurryRecognition)!=null?a:!1,typeof e.loadProgressNotifier=="function"&&this.addWorkerListener(o=>{var i;o.type==="loadLibraryProgress"&&((i=e.loadProgressNotifier)==null||i.call(e,o.payload));});}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=(void 0)),this._dataCaptureWorker}get name(){return "CoreLoader"}get fixedWasmMemory(){return null}static async create(e){var a$1;let r=new this(e);return await r.workerCommand("setLogLevel",{level:(a$1=e.logLevel)!=null?a$1:a.Level.Debug}),await r.load(),r}async load(){var e;try{await this.workerCommand("loadLibrary",{libraryLocation:this.libraryLocation,locationPath:window.location.pathname,referredOrigin:window.location.origin,preloadEngine:this.isPreloadEngine,writableDataPathOverride:(e=localStorage.getItem("scanditWritableDataPathOverride"))!=null?e:void 0,overrideThreadsSupport:this.overrideThreadsSupport,overrideSimdSupport:this.overrideSimdSupport,verifyResponseHash:this.verifyResponseHash,fixedWasmMemory:this.fixedWasmMemory});}catch(r){if(r!=null&&typeof r=="object"&&typeof r.error=="string"&&r.error.includes("BlockedIndexedDB"))return await this.terminateDataCaptureWorker(!1),this.dataCaptureWorker.addEventListener("message",this.workerMessageListener),localStorage.setItem("scanditWritableDataPathOverride",`/scandit_sync_folder_${[...crypto.getRandomValues(new Uint32Array(2))].map(a=>a.toString(32)).join("")}`),this.load();throw r}}async workerCommand(e,r,a){return new Promise((o,i)=>{let t=this.workerCommandId++;this.workerTasks.set(t,{resolve:o,reject:i,command:e});let d={...r,command:e,id:t};this.dataCaptureWorker.postMessage(d,a);})}async terminateDataCaptureWorker(e=!0){var r,a;e&&await this.workerCommand("dispose",{}),(r=this._dataCaptureWorker)==null||r.removeEventListener("message",this.workerMessageListener),(a=this._dataCaptureWorker)==null||a.terminate(),this._dataCaptureWorker=void 0;}addWorkerListener(e){this.workerListeners.push(e);}removeWorkerListener(e){this.workerListeners.includes(e)&&this.workerListeners.splice(this.workerListeners.indexOf(e),1);}getOptions(){return {libraryLocation:this.libraryLocation,overrideThreadsSupport:this.overrideThreadsSupport,overrideSimdSupport:this.overrideSimdSupport,verifyResponseHash:this.verifyResponseHash}}onWorkerMessage(e){let r=e.data;if(r.type==="workerTaskId"&&typeof r.id=="number"){let{id:a,error:o,payload:i}=r,t=this.workerTasks.get(a);o==null?t==null||t.resolve(i):t==null||t.reject(r),this.workerTasks.delete(a);}else for(let a of this.workerListeners)a(r);}};
|
|
4
|
+
|
|
5
|
+
export { n as a };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as a$1 } from './chunk-GPJEB376.js';
|
|
2
2
|
import { a as a$2 } from './chunk-XR65N6EG.js';
|
|
3
3
|
import { a as a$3 } from './chunk-QCZSSQAQ.js';
|
|
4
|
-
import { a } from './chunk-
|
|
4
|
+
import { a } from './chunk-MU4VAJIM.js';
|
|
5
5
|
|
|
6
6
|
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={}));
|
|
7
7
|
|
|
@@ -3,12 +3,12 @@ import { c as c$1, a as a$6 } from './chunk-2WN7BGOB.js';
|
|
|
3
3
|
import { c } from './chunk-B5JOQVFY.js';
|
|
4
4
|
import { a as a$4 } from './chunk-34FEFSCI.js';
|
|
5
5
|
import { d } from './chunk-RQQK6Z5F.js';
|
|
6
|
-
import { a as a$2 } from './chunk-
|
|
6
|
+
import { a as a$2 } from './chunk-4DCTEQWR.js';
|
|
7
7
|
import { a as a$1 } from './chunk-O7TZTIHO.js';
|
|
8
8
|
import { a } from './chunk-XR65N6EG.js';
|
|
9
9
|
import { a as a$3 } from './chunk-QCZSSQAQ.js';
|
|
10
10
|
import { c as c$2, e } from './chunk-H4TH4342.js';
|
|
11
11
|
|
|
12
|
-
var C=class C{constructor(e,t){this.hintPresenterV2=null;this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10;this.redrawInterval=1e3/30;this.redrawRequests=[];this._isDrawLoopRunning=!1;this.frameDataPool=new Map;this.lastFrameCounter=-1;this.poorMansBenchmarkLogs=!1;this.writableDataPathPreload="/scandit_sync_folder_preload";this.writableDataPathStandard="/scandit_sync_folder";this.resourceFilesSubfolder="resources";this.performanceMetricsReporterTimer=void 0;this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0};this.gestureListener=null;this.webPlatformHintPresenter=null;this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),c(this.getWasmMetadata());}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0);}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return {frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var h,D,m,g,f;let t=this.getModeDeserializers(),r=c$1(location);(r==="localhost"||r==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(r+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,r,this.parentDomain,t,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let a=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(a==null){let i=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${i}`)}let s=a.getView();this.context=a.getContext(),a.delete();let n=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(i,l)=>{this.contextDidChangeStatus(JSON.parse(l.toJson()));},didStartObservingContext:()=>{this.didStartObservingContext();}}),p=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:i=>{},onObservationStopped:i=>{},onFrameProcessingStarted:(i,l)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"});},onFrameProcessingFinished:(i,l)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"});},onFrameSkipped:(i,l)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"});}}),b=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(i,l)=>{var M;(M=this.gestureListener)==null||M.delete(),this.gestureListener=i.clone();}});(h=this.gestureRecognizer)==null||h.delete(),this.gestureRecognizer=new b;let u=new n;this.context.addListener(u),u.delete();let c=new p;this.context.addFrameListener(c),c.delete(),this.setView(s),(D=this.view)==null||D.setGestureRecognizer(this.gestureRecognizer);let w=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:i=>{},showToast:i=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(i)});},hideToast:i=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(i)});},showGuidance:i=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(i)});},hideGuidance:i=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(i)});},startUpdateTimer:i=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:i}}});},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"});}});(m=this.hintPresenterV2)==null||m.delete(),(g=this.webPlatformHintPresenter)==null||g.delete(),this.webPlatformHintPresenter=new w,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(f=this.view)==null||f.setHintPresenterV2(this.hintPresenterV2);}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e));}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update();}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0;},1e3));}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}});}deleteFrameData(e){this.frameDataPool.delete(e);}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null;}flushAnalytics(){this.context.flushAnalytics();}extractCentaurusLicense(e){return {payload:{centaurus:{licenseKey:this.Module.LicenseUtils[C.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var s;if(this.context==null)return {payload:e,transferables:[e.data.buffer]};let t=e.data,r=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,a=this.Module.allocateUint8Array(t.byteLength);return this.Module.HEAPU8.set(t,a),(s=this.imageFrameSource)==null||s.outputFrame(a,e.width,e.height,r),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus);}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e);}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer]);}setFrameSource(e,t){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource);}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=s=>this.redrawRequests.length>0&&this.redrawRequests[0]<=s,r=s=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=s;)this.redrawRequests.shift();},a=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let s=performance.now();if(t(s)){r(s),e.draw();let n=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(n));}a();},this.redrawInterval);};a();}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(t==null){let a=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${a}`)}this.context.delete(),this.context=t.getContext();let r=t.getView();t.delete(),r!=null&&e.view!=null&&r.setViewSize(e.view.width,e.view.height,e.view.orientation),this.hintPresenterV2!=null&&(r==null||r.setHintPresenterV2(this.hintPresenterV2)),this.gestureRecognizer!=null&&(r==null||r.setGestureRecognizer(this.gestureRecognizer)),this.setView(r),a.log(a.Level.Debug,"context updated",e);}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics();}isFeatureSupported(e){return {payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return {payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return {payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_HASH:globalThis.SDC_WASM_CORE_MT_HASH:e?globalThis.SDC_WASM_CORE_SIMD_HASH:""}getWasmCoreFileName(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_FILE_NAME:globalThis.SDC_WASM_CORE_MT_FILE_NAME:e?globalThis.SDC_WASM_CORE_SIMD_FILE_NAME:""}getWasmMetadata(){return globalThis.WASM_METADATA}getWasmSideModuleFileName(){return ""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e});}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,r)=>t-r);}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${c$1(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e});}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"});}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])));}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new t;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0;}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(r,a){try{let s=JSON.parse(a),n=[];for(let p of s){let b=new TextDecoder(p.ianaName,{fatal:!0});n.push(b.decode(r.slice(p.startIndex,p.endIndex)));}return n.join("")}catch(s){return ""}}});e.setDataDecoding(new t);}start(e,t,r){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),typeof this.moduleHandler.get().PThread=="object"||r());}getWritableDataPath(e,t){return e?this.writableDataPathPreload:t!=null?(a.log(a.Level.Debug,`IndexedDB database name override in use to recover from blocked standard database: ${t}`),t):this.writableDataPathStandard}async setup({libraryLocation:e$1,locationPath:t,preloadEngine:r,writableDataPathOverride:a$7,overrideThreadsSupport:s,overrideSimdSupport:n,verifyResponseHash:p,referredOrigin:b}){var R;let u=!1,c=!1;this.writableDataPath=this.getWritableDataPath(r,a$7),this.resourcePath=`${e$1}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:w,reject:h,promise:D}=new a$1,m=a$2.sdkVersion();if(m==="")throw new a$3({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[g,f]=await Promise.all([c$2(),e()]);s!=="auto"&&(f=s==="on"),n!=="auto"&&(g=n==="on");let i=d(m,e$1,this.getWasmCoreFileName(g,f)),{jsURI:l,wasmURI:M}=i,T={instantiateWasm:(d,O)=>(a$6({importObject:d,wasmURI:M,expectedHash:this.getWasmCoreExpectedHash(g,f),verifyResponseHash:p,successCallback:O,progressCallback:this._loadProgressCallback,referredOrigin:b}),{})};return this.moduleHandler.set({mainScriptUrlOrBlob:l,canvas:(R=this.workerFunctions.getOffscreenCanvas())!=null?R:{getContext:()=>null},...T,dynamicLibraries:this.getWasmDynamicLibraries(M),locateFile:d=>e$1+d,noInitialRun:!0,preRun:[async()=>{try{await a$4({writableDataPathPreload:this.writableDataPathPreload,writableDataPath:this.writableDataPath,preloading:r});}catch(d){if(d.name==="BlockedIndexedDB"){h(d.toString());return}a.log(a.Level.Debug,"No IndexedDB support, some data will not be persisted:",d);}c=!0,this.start(c,u,w);}],onMainComplete:()=>{if([u,c].includes(!1)){a.log(a.Level.Warn,{runtimeLoaded:u,fileSystemSynced:c},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),h("onMainComplete has been called but runtime or file system was not ready.");return}w();},onRuntimeInitialized:()=>{u=!0,this.start(c,u,w);},print:d=>{a.log(a.Level.Info,d);}}),await a$5(l,m)||h(`Couldn't retrieve Scandit Data Capture library at ${l}, did you configure the path for it correctly?`),D}};C.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var k=C;
|
|
12
|
+
var C=class C{constructor(e,t){this.hintPresenterV2=null;this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10;this.redrawInterval=1e3/30;this.redrawRequests=[];this._isDrawLoopRunning=!1;this.frameDataPool=new Map;this.lastFrameCounter=-1;this.poorMansBenchmarkLogs=!1;this.writableDataPathPreload="/scandit_sync_folder_preload";this.writableDataPathStandard="/scandit_sync_folder";this.resourceFilesSubfolder="resources";this.performanceMetricsReporterTimer=void 0;this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0};this.gestureListener=null;this.webPlatformHintPresenter=null;this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),c(this.getWasmMetadata());}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0);}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return {frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var h,g,M,f,b;let t=this.getModeDeserializers(),r=c$1(location);(r==="localhost"||r==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(r+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,r,this.parentDomain,t,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let a=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(a==null){let s=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${s}`)}let i=a.getView();this.context=a.getContext(),a.delete();let o=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(s,p)=>{this.contextDidChangeStatus(JSON.parse(p.toJson()));},didStartObservingContext:()=>{this.didStartObservingContext();}}),u=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:s=>{},onObservationStopped:s=>{},onFrameProcessingStarted:(s,p)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"});},onFrameProcessingFinished:(s,p)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"});},onFrameSkipped:(s,p)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"});}}),w=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(s,p)=>{var D;(D=this.gestureListener)==null||D.delete(),this.gestureListener=s.clone();}});(h=this.gestureRecognizer)==null||h.delete(),this.gestureRecognizer=new w;let m=new o;this.context.addListener(m),m.delete();let d=new u;this.context.addFrameListener(d),d.delete(),this.setView(i),(g=this.view)==null||g.setGestureRecognizer(this.gestureRecognizer);let c=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:s=>{},showToast:s=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(s)});},hideToast:s=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(s)});},showGuidance:s=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(s)});},hideGuidance:s=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(s)});},startUpdateTimer:s=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:s}}});},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"});}});(M=this.hintPresenterV2)==null||M.delete(),(f=this.webPlatformHintPresenter)==null||f.delete(),this.webPlatformHintPresenter=new c,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(b=this.view)==null||b.setHintPresenterV2(this.hintPresenterV2);}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e));}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update();}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0;},1e3));}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}});}deleteFrameData(e){this.frameDataPool.delete(e);}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null;}flushAnalytics(){this.context.flushAnalytics();}extractCentaurusLicense(e){return {payload:{centaurus:{licenseKey:this.Module.LicenseUtils[C.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var i;if(this.context==null)return {payload:e,transferables:[e.data.buffer]};let t=e.data,r=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,a=this.Module.allocateUint8Array(t.byteLength);return this.Module.HEAPU8.set(t,a),(i=this.imageFrameSource)==null||i.outputFrame(a,e.width,e.height,r),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus);}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e);}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer]);}setFrameSource(e,t){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource);}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=i=>this.redrawRequests.length>0&&this.redrawRequests[0]<=i,r=i=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=i;)this.redrawRequests.shift();},a=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let i=performance.now();if(t(i)){r(i),e.draw();let o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o));}a();},this.redrawInterval);};a();}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(t==null){let a=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${a}`)}this.context.delete(),this.context=t.getContext();let r=t.getView();t.delete(),r!=null&&e.view!=null&&r.setViewSize(e.view.width,e.view.height,e.view.orientation),this.hintPresenterV2!=null&&(r==null||r.setHintPresenterV2(this.hintPresenterV2)),this.gestureRecognizer!=null&&(r==null||r.setGestureRecognizer(this.gestureRecognizer)),this.setView(r),a.log(a.Level.Debug,"context updated",e);}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics();}isFeatureSupported(e){return {payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return {payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return {payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_HASH:globalThis.SDC_WASM_CORE_MT_HASH:e?globalThis.SDC_WASM_CORE_SIMD_HASH:""}getWasmCoreFileName(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_FILE_NAME:globalThis.SDC_WASM_CORE_MT_FILE_NAME:e?globalThis.SDC_WASM_CORE_SIMD_FILE_NAME:""}getWasmMetadata(){return globalThis.WASM_METADATA}getWasmSideModuleFileName(){return ""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e});}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,r)=>t-r);}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${c$1(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e});}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"});}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])));}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new t;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0;}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(r,a){try{let i=JSON.parse(a),o=[];for(let u of i){let w=new TextDecoder(u.ianaName,{fatal:!0});o.push(w.decode(r.slice(u.startIndex,u.endIndex)));}return o.join("")}catch(i){return ""}}});e.setDataDecoding(new t);}start(e,t,r){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),typeof this.moduleHandler.get().PThread=="object"||r());}getWritableDataPath(e,t){return e?this.writableDataPathPreload:t!=null?(a.log(a.Level.Debug,`IndexedDB database name override in use to recover from blocked standard database: ${t}`),t):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e$1,locationPath:t,preloadEngine:r,writableDataPathOverride:a$7,overrideThreadsSupport:i,overrideSimdSupport:o,verifyResponseHash:u,referredOrigin:w,fixedWasmMemory:m}){var x;let d$1=!1,c=!1;this.writableDataPath=this.getWritableDataPath(r,a$7),this.resourcePath=`${e$1}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:h,reject:g,promise:M}=new a$1,f=a$2.sdkVersion();if(f==="")throw new a$3({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[b,s]=await Promise.all([c$2(),e()]);i!=="auto"&&(s=i==="on"),o!=="auto"&&(b=o==="on");let p=this.getWasmCoreFileName(b,s),D=d(f,e$1,p),{jsURI:R,wasmURI:S}=D,N={instantiateWasm:(l,H)=>(a$6({importObject:l,wasmURI:S,expectedHash:this.getWasmCoreExpectedHash(b,s),verifyResponseHash:u,successCallback:H,progressCallback:this._loadProgressCallback,referredOrigin:w}),{})},y=m===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(m),maximum:this.numOfMBToPages(m),shared:s});return y!==null&&a.log(a.Level.Debug,"Fixed wasmMemory set",y),this.moduleHandler.set({...y?{wasmMemory:y}:{},mainScriptUrlOrBlob:R,canvas:(x=this.workerFunctions.getOffscreenCanvas())!=null?x:{getContext:()=>null},...N,dynamicLibraries:this.getWasmDynamicLibraries(S),locateFile:l=>e$1+l,noInitialRun:!0,preRun:[async()=>{try{await a$4({writableDataPathPreload:this.writableDataPathPreload,writableDataPath:this.writableDataPath,preloading:r});}catch(l){if(l.name==="BlockedIndexedDB"){g(l.toString());return}a.log(a.Level.Debug,"No IndexedDB support, some data will not be persisted:",l);}c=!0,this.start(c,d$1,h);}],onMainComplete:()=>{if([d$1,c].includes(!1)){a.log(a.Level.Warn,{runtimeLoaded:d$1,fileSystemSynced:c},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),g("onMainComplete has been called but runtime or file system was not ready.");return}h();},onRuntimeInitialized:()=>{d$1=!0,this.start(c,d$1,h);},print:l=>{a.log(a.Level.Info,l);}}),await a$5(R,f)||g(`Couldn't retrieve Scandit Data Capture library at ${R}, did you configure the path for it correctly?`),M}};C.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var W=C;
|
|
13
13
|
|
|
14
|
-
export {
|
|
14
|
+
export { W as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a } from './chunk-
|
|
1
|
+
import { a } from './chunk-MU4VAJIM.js';
|
|
2
2
|
|
|
3
3
|
var p=[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108],s=[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57],c=[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94],t=String.fromCodePoint,n=t.apply(String,p);t.apply(String,s);t.apply(String,c);function l(){return globalThis.location.hostname==="localhost"||globalThis.location.hostname==="127.0.0.1"||globalThis.location.hostname===""}function r(o){let e=o;if(e!=null&&typeof e.getAppInfo=="function"&&typeof e.getKey=="function")return e}function m(){let{name:o=""}=a.getUserAgentInfo().getBrowser();return o==="Electron"&&typeof r(window[n])=="object"&&l()}async function y(){var o;return (o=r(window[n]))==null?void 0:o.getAppInfo()}async function A(o){var e;return (e=r(window[n]))==null?void 0:e.getKey(o)}
|
|
4
4
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a } from './chunk-BOKAHIDO.js';
|
|
2
|
+
import { a as a$4 } from './chunk-AIRWHLJH.js';
|
|
3
|
+
import { a as a$3 } from './chunk-FGO2SSRS.js';
|
|
4
|
+
import { a as a$1 } from './chunk-QCRFVRSS.js';
|
|
5
|
+
import { b } from './chunk-FTD535WI.js';
|
|
6
|
+
import { a as a$2 } from './chunk-XR65N6EG.js';
|
|
7
|
+
|
|
8
|
+
var h=class{constructor(a$2,e){this.onMessageListener=this.onMessage.bind(this);this.workerSelf=a$2,this.dataCaptureInstance=new a(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),a$1(a$2)&&this.listenToMessages();}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{a$2.log(a$2.Level.Error,a);}),this.workerSelf.addEventListener("messageerror",a=>{a$2.log(a$2.Level.Error,a);});}postMessage(a,e){this.workerSelf.postMessage(a,e!=null?e:[]);}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return a$3(a)&&"payload"in a}hasTransferables(a){return a$3(a)&&Array.isArray(a.transferables)}async respondWith(a,e,u){let r=null,t;try{t=u(),t instanceof Promise&&(t=await t);}catch(l){t=void 0,r=a$4(l);}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(t)?t.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(t)?t.transferables:[]);}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,preloadEngine:e.preloadEngine,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}));}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point);});}break}case"hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update();});}break}case"createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}));}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource));}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}));}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId));}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId);});}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e));}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics();});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e));}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{a$2.setLevel(e.level);});}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey));}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state);});}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature));}break}case"getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo());}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo());}break}default:return b(a.data),!1}return !0}};
|
|
9
|
+
|
|
10
|
+
export { h as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a } from './chunk-
|
|
1
|
+
import { a } from './chunk-MU4VAJIM.js';
|
|
2
2
|
import { d } from './chunk-UPUPKPEP.js';
|
|
3
3
|
|
|
4
4
|
var n=class e{constructor(t,o=d.Feedback.defaultVibrationPattern){this.type=t,this.pattern=o;let r=a.getSupportedVibrationMethod();r&&(this._vibrate=r.bind(navigator));}static get defaultVibration(){return new e("default")}static withPattern(t){return new e("default",t)}toJSONObject(){return {type:this.type}}vibrate(){var t;return (t=this._vibrate)==null?void 0:t.call(this,this.pattern)}};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as a$1 } from './chunk-
|
|
2
|
-
import { d } from './chunk-
|
|
1
|
+
import { a as a$1 } from './chunk-5TKCHVG2.js';
|
|
2
|
+
import { d } from './chunk-SKRKDAFC.js';
|
|
3
3
|
import { a } from './chunk-XR65N6EG.js';
|
|
4
|
-
import { a as a$2 } from './chunk-
|
|
4
|
+
import { a as a$2 } from './chunk-MU4VAJIM.js';
|
|
5
5
|
import { g as g$1 } from './chunk-W7LJM2QO.js';
|
|
6
6
|
import { d as d$1 } from './chunk-UPUPKPEP.js';
|
|
7
7
|
|
|
8
|
-
var g=class n{constructor(e){this.deviceId="";this.type="camera";this._currentState="off";this._settings=new g$1;this._desiredTorchState="off";this._desiredState="off";this.listeners=[];this._context=null;this.stateTransitionStrategyMap={off:{on:this.transitionFromStateOffToOn.bind(this),standby:this.transitionFromStateOffToStandby.bind(this)},on:{off:this.transitionFromStateOnToOff.bind(this),standby:this.transitionFromStateOnToStandby.bind(this)},standby:{off:this.transitionFromStateStandbyToOff.bind(this),on:this.transitionFromStateStandbyToOn.bind(this)}};this.cameraManager=e!=null?e:d.instance(),this.updateCanvasVideoImage=this.updateCanvasVideoImage.bind(this),this.captureAndSend=this.captureAndSend.bind(this);}static get default(){let e=new n;return e.position="worldFacing",e}get desiredState(){return this._desiredState}get settings(){return this._settings}get currentResolution(){var e;return (e=this._currentResolution)!=null?e:null}get context(){return this._context}set context(e){this._context=e,this._context&&this.currentState==="on"&&this.startSendingCapturesToWorker();}get currentState(){return this._currentState}static atPosition(e){if(d$1.Camera.availablePositions.includes(e)){let t=new n;return t.position=e,t}return a.log(a.Level.Warn,`invalid CameraPosition: "${e}"`),null}static fromDeviceCamera(e){let t=n.atPosition(e.position);return t.deviceId=e.deviceId,t.label=e.label,t}async switchToDesiredState(e){var t,i;return this.currentTransitionStrategyPromise&&await this.currentTransitionStrategyPromise,this.currentTransitionStrategyPromise=(i=(t=this.stateTransitionStrategyMap[this.currentState])==null?void 0:t[e])==null?void 0:i.call(t).catch(r=>{if(r instanceof DOMException&&r.message==="The associated Track is in an invalid state"){a.log(a.Level.Warn,r);return}throw r}),this.currentTransitionStrategyPromise}getDesiredTorchState(){return this._desiredTorchState}async setDesiredTorchState(e){this._desiredTorchState=e,await this.cameraManager.setTorchEnabled(this._desiredTorchState==="on"),await this.notifyContext({type:"torchState",newValue:this._desiredTorchState});}async isTorchAvailable(){return this.cameraManager.isTorchAvailable()}addListener(e){e!=null&&(this.listeners.includes(e)||this.listeners.push(e));}removeListener(e){e!=null&&this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async applySettings(e){var i;this._settings=new g$1(e);let t=this.settings.getProperty("grayScaleFrameReader");if(this.cameraManager.setFrameReaderType(t===!0?"GRAYSCALE":"RGBA"),this.currentState==="on"||this.currentState==="standby"){let r=this.cameraManager.activeCameraSettings;(r==null?void 0:r.preferredResolution)!==this.settings.preferredResolution&&(await this.cameraManager.applyCameraSettings(this.settings),(i=this.cameraManager.activeCamera)!=null&&i.currentResolution&&(this._currentResolution={width:this.cameraManager.activeCamera.currentResolution.width,height:this.cameraManager.activeCamera.currentResolution.height})),await this.cameraManager.setZoom(this.settings.zoomFactor);let o=this.settings.getProperty("minFrameRate"),c=this.settings.getProperty("maxFrameRate");(o!=null||c!=null)&&await this.cameraManager.setFrameRate({min:o,max:c});let m=this.settings.getProperty("manualLensPosition");m!=null&&await this.cameraManager.setFocus(m);let u=this.settings.getProperty("exposureTargetBias"),d=this.settings.getProperty("exposureDuration");(u!=null||d!=null)&&await this.cameraManager.setExposure({compensation:u,time:d});}return this.notifyContext({type:"cameraSettings",newValue:this.settings})}toJSONObject(){return {type:this.type,position:this.position,settings:this.settings.toJSONObject(),desiredState:this.desiredState,desiredTorchState:this._desiredTorchState}}getMirrorImageEnabled(){var e;return (e=this._desiredMirrorImageEnabled)!=null?e:this.cameraManager.isMirrorImageEnabled()}async setMirrorImageEnabled(e){this._desiredMirrorImageEnabled=e,this.cameraManager.setMirrorImageEnabled(e,!0),this.context&&await this.context.setFrameSource(this);}getCurrentState(){return this._currentState}async setCurrentState(e){if(e!==this._currentState){this._currentState=e,this.notifyListeners();try{await this.notifyContext({type:"frameSourceState",newValue:e}),e==="on"&&this.startSendingCapturesToWorker();}catch(t){a.log(a.Level.Warn,"Error while notifying context about new state of Camera");}}}async setupCamera(){if(this.cameraManager.setSelectedCameraSettings(this.settings),this.deviceId==="")this.cameraManager.setSelectedCamera(),this.cameraManager.setInitialCameraPosition(this.position);else {let t=(await a$1.getCameras()).find(i=>i.deviceId===this.deviceId);t&&(this.cameraManager.setInitialCameraPosition(t.position),this.cameraManager.setSelectedCamera(t));}await this.cameraManager.setupCameras(),typeof this._desiredMirrorImageEnabled=="boolean"?this.cameraManager.setMirrorImageEnabled(this._desiredMirrorImageEnabled,!0):this.cameraManager.setMirrorImageEnabled(this.cameraManager.isMirrorImageEnabled(),!1),this.context&&await this.context.setFrameSource(this),this.cameraManager.activeCamera&&(this.label=this.cameraManager.activeCamera.label,this.position=this.cameraManager.activeCamera.position,this.deviceId=this.cameraManager.activeCamera.deviceId,this._currentResolution=this.cameraManager.activeCamera.currentResolution);}async notifyContext(e){if(this.context)return this.context.update([e])}notifyListeners(){for(let e of this.listeners)e.didChangeState&&e.didChangeState(this,this.currentState);}updateCanvasVideoImage(){this.currentState==="on"&&this.context&&(this.cameraManager.updateCanvasVideoImage(),this._lastCanvasVideoPreviewAnimationFrame=this.cameraManager.requestVideoFrame(this.updateCanvasVideoImage));}async captureAndSend(){if(this.currentState!=="on"||!this.context)return;if(!this.context.hasEnabledMode()){this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);return}let e=null;try{e=this.cameraManager.captureImage();}catch(t){a.log(a.Level.Warn,t.message);}finally{e!=null
|
|
8
|
+
var g=class n{constructor(e){this.deviceId="";this.type="camera";this._currentState="off";this._settings=new g$1;this._desiredTorchState="off";this._desiredState="off";this.listeners=[];this._context=null;this.stateTransitionStrategyMap={off:{on:this.transitionFromStateOffToOn.bind(this),standby:this.transitionFromStateOffToStandby.bind(this)},on:{off:this.transitionFromStateOnToOff.bind(this),standby:this.transitionFromStateOnToStandby.bind(this)},standby:{off:this.transitionFromStateStandbyToOff.bind(this),on:this.transitionFromStateStandbyToOn.bind(this)}};this.cameraManager=e!=null?e:d.instance(),this.updateCanvasVideoImage=this.updateCanvasVideoImage.bind(this),this.captureAndSend=this.captureAndSend.bind(this);}static get default(){let e=new n;return e.position="worldFacing",e}get desiredState(){return this._desiredState}get settings(){return this._settings}get currentResolution(){var e;return (e=this._currentResolution)!=null?e:null}get context(){return this._context}set context(e){this._context=e,this._context&&this.currentState==="on"&&this.startSendingCapturesToWorker();}get currentState(){return this._currentState}static atPosition(e){if(d$1.Camera.availablePositions.includes(e)){let t=new n;return t.position=e,t}return a.log(a.Level.Warn,`invalid CameraPosition: "${e}"`),null}static fromDeviceCamera(e){let t=n.atPosition(e.position);return t.deviceId=e.deviceId,t.label=e.label,t}async switchToDesiredState(e){var t,i;return this.currentTransitionStrategyPromise&&await this.currentTransitionStrategyPromise,this.currentTransitionStrategyPromise=(i=(t=this.stateTransitionStrategyMap[this.currentState])==null?void 0:t[e])==null?void 0:i.call(t).catch(r=>{if(r instanceof DOMException&&r.message==="The associated Track is in an invalid state"){a.log(a.Level.Warn,r);return}throw r}),this.currentTransitionStrategyPromise}getDesiredTorchState(){return this._desiredTorchState}async setDesiredTorchState(e){this._desiredTorchState=e,await this.cameraManager.setTorchEnabled(this._desiredTorchState==="on"),await this.notifyContext({type:"torchState",newValue:this._desiredTorchState});}async isTorchAvailable(){return this.cameraManager.isTorchAvailable()}addListener(e){e!=null&&(this.listeners.includes(e)||this.listeners.push(e));}removeListener(e){e!=null&&this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async applySettings(e){var i;this._settings=new g$1(e);let t=this.settings.getProperty("grayScaleFrameReader");if(this.cameraManager.setFrameReaderType(t===!0?"GRAYSCALE":"RGBA"),this.currentState==="on"||this.currentState==="standby"){let r=this.cameraManager.activeCameraSettings;(r==null?void 0:r.preferredResolution)!==this.settings.preferredResolution&&(await this.cameraManager.applyCameraSettings(this.settings),(i=this.cameraManager.activeCamera)!=null&&i.currentResolution&&(this._currentResolution={width:this.cameraManager.activeCamera.currentResolution.width,height:this.cameraManager.activeCamera.currentResolution.height})),await this.cameraManager.setZoom(this.settings.zoomFactor);let o=this.settings.getProperty("minFrameRate"),c=this.settings.getProperty("maxFrameRate");(o!=null||c!=null)&&await this.cameraManager.setFrameRate({min:o,max:c});let m=this.settings.getProperty("manualLensPosition");m!=null&&await this.cameraManager.setFocus(m);let u=this.settings.getProperty("exposureTargetBias"),d=this.settings.getProperty("exposureDuration");(u!=null||d!=null)&&await this.cameraManager.setExposure({compensation:u,time:d});}return this.notifyContext({type:"cameraSettings",newValue:this.settings})}toJSONObject(){return {type:this.type,position:this.position,settings:this.settings.toJSONObject(),desiredState:this.desiredState,desiredTorchState:this._desiredTorchState}}getMirrorImageEnabled(){var e;return (e=this._desiredMirrorImageEnabled)!=null?e:this.cameraManager.isMirrorImageEnabled()}async setMirrorImageEnabled(e){this._desiredMirrorImageEnabled=e,this.cameraManager.setMirrorImageEnabled(e,!0),this.context&&await this.context.setFrameSource(this);}getCurrentState(){return this._currentState}async setCurrentState(e){if(e!==this._currentState){this._currentState=e,this.notifyListeners();try{await this.notifyContext({type:"frameSourceState",newValue:e}),e==="on"&&this.startSendingCapturesToWorker();}catch(t){a.log(a.Level.Warn,"Error while notifying context about new state of Camera");}}}async setupCamera(){if(this.cameraManager.setSelectedCameraSettings(this.settings),this.deviceId==="")this.cameraManager.setSelectedCamera(),this.cameraManager.setInitialCameraPosition(this.position);else {let t=(await a$1.getCameras()).find(i=>i.deviceId===this.deviceId);t&&(this.cameraManager.setInitialCameraPosition(t.position),this.cameraManager.setSelectedCamera(t));}await this.cameraManager.setupCameras(),typeof this._desiredMirrorImageEnabled=="boolean"?this.cameraManager.setMirrorImageEnabled(this._desiredMirrorImageEnabled,!0):this.cameraManager.setMirrorImageEnabled(this.cameraManager.isMirrorImageEnabled(),!1),this.context&&await this.context.setFrameSource(this),this.cameraManager.activeCamera&&(this.label=this.cameraManager.activeCamera.label,this.position=this.cameraManager.activeCamera.position,this.deviceId=this.cameraManager.activeCamera.deviceId,this._currentResolution=this.cameraManager.activeCamera.currentResolution);}async notifyContext(e){if(this.context)return this.context.update([e])}notifyListeners(){for(let e of this.listeners)e.didChangeState&&e.didChangeState(this,this.currentState);}updateCanvasVideoImage(){this.currentState==="on"&&this.context&&(this.cameraManager.updateCanvasVideoImage(),this._lastCanvasVideoPreviewAnimationFrame=this.cameraManager.requestVideoFrame(this.updateCanvasVideoImage));}async captureAndSend(){if(this.currentState!=="on"||!this.context)return;if(!this.context.hasEnabledMode()){this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);return}let e=null;try{e=this.cameraManager.captureImage();}catch(t){a.log(a.Level.Warn,t.message);}finally{if(e!=null)if(this.cameraManager.synchronousFrameHandling){let t=await this.context.sendFrameToProcessor(e);this.cameraManager.recycle(t.data);}else this.context.sendFrameToProcessor(e).then(t=>(this.cameraManager.recycle(t.data),null)).catch(t=>{a.warn("error while recycling uint8array",t);});this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);}}startSendingCapturesToWorker(){this.stopSendingCapturesToWorker(),this.captureAndSend();}stopSendingCapturesToWorker(){this._lastCanvasVideoPreviewAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCanvasVideoPreviewAnimationFrame),this._lastCaptureRequestAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCaptureRequestAnimationFrame);}async transitionFromStateOffToOn(){if(!(this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp")){this._desiredState="on",await this.setCurrentState("starting");try{await this.setupCamera(),await this.setCurrentState("on");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}}}async transitionFromStateOffToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "On".'),await this.transitionFromStateOffToOn();return}this._desiredState="standby",await this.setCurrentState("bootingUp");try{await this.setupCamera(),this.cameraManager.pauseStream(),await this.setCurrentState("standby");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateOnToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("stopping"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateOnToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "Off".'),await this.transitionFromStateOnToOff();return}this._desiredState="standby",await this.setCurrentState("goingToSleep"),this.cameraManager.pauseStream(),await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateStandbyToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("shuttingDown"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateStandbyToOn(){this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp"||(this._desiredState="on",await this.setCurrentState("wakingUp"),this.cameraManager.resumeStream(),await this.setCurrentState("on"));}async isAndroidWebView(){return this._isAndroidWebView==null&&(this._isAndroidWebView=await a$2.isAndroidWebView()),this._isAndroidWebView}isZoomAvailable(){var e;return ((e=this.cameraManager.mediaTrackCapabilities)==null?void 0:e.zoom)!=null}};
|
|
9
9
|
|
|
10
10
|
export { g as a };
|