idmission-web-sdk 2.3.225 → 2.3.226

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CapabilityProbing.d.ts","sourceRoot":"","sources":["../../../src/lib/models/CapabilityProbing.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAA;AAEpD,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAA;AAM9E,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAA;AAIhD,KAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAA;CACjC,CAAA;AAED,KAAK,iBAAiB,GAAG;IAIvB,iBAAiB,EAAE,UAAU,CAAA;IAC7B,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IAGvB,iBAAiB,EAAE,MAAM,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAA;CAC7D,CAAA;AAED,eAAO,MAAM,8BAA8B,uGAC2D,CAAA;AACtG,eAAO,MAAM,8BAA8B,qEACyB,CAAA;AAuBpE,eAAO,IAAI,iBAAiB,EAAE,iBAAkD,CAAA;AAEhF,wBAAgB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAElF;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,oBAAoB,CAAC,UAAU,CAAC,GACzC,IAAI,CAEN;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,CAEtE;AAKD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAyCvD;AAK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,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyDjF;AAwCD,wBAAgB,yBAAyB,SAGxC"}
@@ -41,13 +41,15 @@ export type FaceDetectionPrediction = {
41
41
  variance?: number;
42
42
  samplePoints?: SamplePoint[];
43
43
  };
44
- export declare function loadFaceDetector(modelAssetPath?: string): Promise<void>;
44
+ export type FaceDetectionRuntime = 'mediapipe' | 'litert';
45
+ export declare function loadFaceDetector(modelAssetPath?: string, runtime?: FaceDetectionRuntime): Promise<void>;
45
46
  export declare function closeFaceDetector(): void;
46
- export declare function useLoadFaceDetector({ onModelError, modelLoadTimeoutMs, videoRef, modelAssetPath, }: {
47
+ export declare function useLoadFaceDetector({ onModelError, modelLoadTimeoutMs, videoRef, modelAssetPath, runtime, }: {
47
48
  onModelError?: (error: Error) => void;
48
49
  modelLoadTimeoutMs?: number;
49
50
  videoRef: MutableRefObject<HTMLVideoElement | null>;
50
51
  modelAssetPath?: string;
52
+ runtime?: FaceDetectionRuntime;
51
53
  }): {
52
54
  ready: boolean;
53
55
  modelLoadState: ModelLoadState;
@@ -58,9 +60,9 @@ export declare function useLoadFaceDetector({ onModelError, modelLoadTimeoutMs,
58
60
  export declare let lastFaceDetectionAt: number;
59
61
  export declare let lastFaceDetectionTime: number;
60
62
  export declare function setLastFaceDetectionAt(time: number): void;
61
- export declare function makeFaceDetectorPrediction(imageData: Frame): {
63
+ export declare function makeFaceDetectorPrediction(imageData: Frame): Promise<{
62
64
  faces: Face[];
63
- } | null;
65
+ } | null>;
64
66
  export declare function makeFacePredictionWithDocumentDetector(frame: HTMLCanvasElement): Promise<{
65
67
  faces: Face[];
66
68
  } | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"FaceDetection.d.ts","sourceRoot":"","sources":["../../../src/lib/models/FaceDetection.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAgC,MAAM,OAAO,CAAA;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM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M,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,6BAA6B,CAAC,EAAE,MAAM,CAAA;IACtC,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAA;CAC7B,GAAG,uBAAuB,CA6H1B"}
@@ -1,9 +1,11 @@
1
- export declare const preloadModels: ({ documentDetectionModel, focusModel, faceDetectionModel, faceLandmarkerModel, barcodeReadabilityModel, }: {
1
+ import { RuntimeName } from './CapabilityProbing';
2
+ export declare const preloadModels: ({ documentDetectionModel, focusModel, faceDetectionModel, faceLandmarkerModel, barcodeReadabilityModel, runtime, }: {
2
3
  documentDetectionModel?: string | boolean;
3
4
  focusModel?: string | boolean;
4
5
  faceDetectionModel?: boolean;
5
6
  faceLandmarkerModel?: boolean;
6
7
  barcodeReadabilityModel?: boolean;
8
+ runtime?: RuntimeName;
7
9
  }) => Promise<void>;
8
10
  export type PreloadProgress = {
9
11
  loaded: number;
@@ -19,12 +21,12 @@ export declare const progressByUseCase: {
19
21
  barcodeReadability: PreloadProgress;
20
22
  };
21
23
  export declare function preloadDependency(url: string, hash: string): Promise<unknown>;
22
- export declare const preloadDocumentDetectorDependencies: () => Promise<void>;
23
- export declare const preloadFocusModelDependencies: () => Promise<void>;
24
- export declare const preloadFaceDetectorDependencies: () => Promise<void>;
25
- export declare const preloadFaceLandmarkerDependencies: () => Promise<void>;
26
- export declare const preloadBarcodeReadabilityModelDependencies: () => Promise<void>;
27
- export declare function preloadModelDependencies(model: 'documentDetector' | 'focus' | 'faceDetection' | 'faceLandmarker' | 'barcodeReadability'): Promise<void>;
24
+ export declare const preloadDocumentDetectorDependencies: (runtime?: RuntimeName) => Promise<void>;
25
+ export declare const preloadFocusModelDependencies: (runtime?: RuntimeName) => Promise<void>;
26
+ export declare const preloadFaceDetectorDependencies: (runtime?: RuntimeName) => Promise<void>;
27
+ export declare const preloadFaceLandmarkerDependencies: (runtime?: RuntimeName) => Promise<void>;
28
+ export declare const preloadBarcodeReadabilityModelDependencies: (runtime?: RuntimeName) => Promise<void>;
29
+ export declare function preloadModelDependencies(model: 'documentDetector' | 'focus' | 'faceDetection' | 'faceLandmarker' | 'barcodeReadability', runtime?: RuntimeName): Promise<void>;
28
30
  export declare function progressToPercentage(progress: PreloadProgress): number;
29
31
  export declare function sumUpProgressForDependencies(dependencies: string[]): PreloadProgress;
30
32
  //# sourceMappingURL=preloadModels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preloadModels.d.ts","sourceRoot":"","sources":["../../../src/lib/models/preloadModels.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,GAAU,2GAMjC;IACD,sBAAsB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAG5B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAClC,KAAG,OAAO,CAAC,IAAI,CAqCf,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAKD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAExE;AACD,eAAO,MAAM,iBAAiB,EAAE;IAC9B,aAAa,EAAE,eAAe,CAAA;IAC9B,gBAAgB,EAAE,eAAe,CAAA;IACjC,KAAK,EAAE,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;AAKD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAExE;AACD,eAAO,MAAM,iBAAiB,EAAE;IAC9B,aAAa,EAAE,eAAe,CAAA;IAC9B,gBAAgB,EAAE,eAAe,CAAA;IACjC,KAAK,EAAE,eAAe,CAAA;IACtB,aAAa,EAAE,eAAe,CAAA;IAC9B,cAAc,EAAE,eAAe,CAAA;IAC/B,kBAAkB,EAAE,eAAe,CAAA;CAQpC,CAAA;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oBAqChE;AAuBD,eAAO,MAAM,mCAAmC,GAC9C,UAAS,WAAyB,kBACsB,CAAA;AAC1D,eAAO,MAAM,6BAA6B,GACxC,UAAS,WAAyB,kBACW,CAAA;AAC/C,eAAO,MAAM,+BAA+B,GAC1C,UAAS,WAAyB,kBACmB,CAAA;AACvD,eAAO,MAAM,iCAAiC,GAC5C,UAAS,WAAyB,kBACoB,CAAA;AACxD,eAAO,MAAM,0CAA0C,GACrD,UAAS,WAAyB,kBACwB,CAAA;AAE5D,wBAAsB,wBAAwB,CAC5C,KAAK,EACD,kBAAkB,GAClB,OAAO,GACP,eAAe,GACf,gBAAgB,GAChB,oBAAoB,EACxB,OAAO,GAAE,WAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CA+Df;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,eAAe,UAI7D;AAED,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,MAAM,EAAE,GACrB,eAAe,CAWjB"}
@@ -0,0 +1,3 @@
1
+ import { ResolvedAccelerator } from './runtime';
2
+ export declare function verifyLiteRtDelegate(accelerator: ResolvedAccelerator, modelAssetPath: string): Promise<void>;
3
+ //# sourceMappingURL=CapabilityProbe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CapabilityProbe.d.ts","sourceRoot":"","sources":["../../../../../src/lib/models/providers/litert/CapabilityProbe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAa,MAAM,WAAW,CAAA;AAQ1D,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,mBAAmB,EAChC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAiCf"}
@@ -0,0 +1,11 @@
1
+ import { Frame } from '../../../utils/getFrameDimensions';
2
+ import type { Face } from '../../FaceDetection';
3
+ export type LoadOptions = {
4
+ modelAssetPath: string;
5
+ };
6
+ export declare function load({ modelAssetPath }: LoadOptions): Promise<void>;
7
+ export declare function predict(imageData: Frame): Promise<{
8
+ faces: Face[];
9
+ } | null>;
10
+ export declare function close(): void;
11
+ //# sourceMappingURL=FaceDetection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FaceDetection.d.ts","sourceRoot":"","sources":["../../../../../src/lib/models/providers/litert/FaceDetection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAA;AACzD,OAAO,KAAK,EAAE,IAAI,EAAgB,MAAM,qBAAqB,CAAA;AAiC7D,MAAM,MAAM,WAAW,GAAG;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpD,wBAAsB,IAAI,CAAC,EAAE,cAAc,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA2CzE;AAED,wBAAsB,OAAO,CAC3B,SAAS,EAAE,KAAK,GACf,OAAO,CAAC;IAAE,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,GAAG,IAAI,CAAC,CAqCnC;AAED,wBAAgB,KAAK,IAAI,IAAI,CAI5B"}
@@ -0,0 +1,30 @@
1
+ export declare const BLAZEFACE_INPUT_SIZE = 128;
2
+ export declare const NUM_KEYPOINTS = 6;
3
+ export type Detection = {
4
+ xMin: number;
5
+ yMin: number;
6
+ xMax: number;
7
+ yMax: number;
8
+ keypoints: {
9
+ x: number;
10
+ y: number;
11
+ }[];
12
+ score: number;
13
+ };
14
+ export declare function getAnchors(): Float32Array;
15
+ export declare const NUM_ANCHORS = 896;
16
+ export type PreprocessResult = {
17
+ data: Float32Array;
18
+ scaleX: number;
19
+ scaleY: number;
20
+ padX: number;
21
+ padY: number;
22
+ };
23
+ export declare function preprocessVideo(video: HTMLVideoElement): PreprocessResult;
24
+ export type DecodeOptions = {
25
+ scoreThreshold?: number;
26
+ preprocess: PreprocessResult;
27
+ };
28
+ export declare function decodeDetections(regressors: Float32Array, classifiers: Float32Array, options: DecodeOptions): Detection[];
29
+ export declare function nonMaxSuppression(detections: Detection[], iouThreshold?: number): Detection[];
30
+ //# sourceMappingURL=blazeFacePrePost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blazeFacePrePost.d.ts","sourceRoot":"","sources":["../../../../../src/lib/models/providers/litert/blazeFacePrePost.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,aAAa,IAAI,CAAC;AAG/B,MAAM,MAAM,SAAS,GAAG;IAEtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,wBAAgB,UAAU,IAAI,YAAY,CAGzC;AAED,eAAO,MAAM,WAAW,MAAM,CAAC;AAkB/B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,YAAY,CAAC;IAInB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAKF,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAoCzE;AAQD,MAAM,MAAM,aAAa,GAAG;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AAKF,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,YAAY,EACxB,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,aAAa,GACrB,SAAS,EAAE,CA6Cb;AAoBD,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,EAAE,EACvB,YAAY,GAAE,MAAY,GACzB,SAAS,EAAE,CAmBb"}
@@ -0,0 +1,23 @@
1
+ import type { Detection } from "./blazeFacePrePost";
2
+ export declare const FACE_MESH_INPUT_SIZE = 192;
3
+ export declare const NUM_FACE_LANDMARKS = 468;
4
+ export type FaceMeshPreprocessResult = {
5
+ data: Float32Array;
6
+ roiX: number;
7
+ roiY: number;
8
+ roiSize: number;
9
+ };
10
+ export declare function preprocessFaceROI(video: HTMLVideoElement, detection: Detection): FaceMeshPreprocessResult;
11
+ export type FaceLandmark = {
12
+ x: number;
13
+ y: number;
14
+ z: number;
15
+ };
16
+ export type DecodeFaceLandmarksOptions = {
17
+ preprocess: FaceMeshPreprocessResult;
18
+ videoWidth: number;
19
+ videoHeight: number;
20
+ };
21
+ export declare function decodeFaceLandmarks(raw: Float32Array, options: DecodeFaceLandmarksOptions): FaceLandmark[];
22
+ export declare function decodeFacePresence(raw: Float32Array): number;
23
+ //# sourceMappingURL=faceMeshPrePost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"faceMeshPrePost.d.ts","sourceRoot":"","sources":["../../../../../src/lib/models/providers/litert/faceMeshPrePost.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAmBtC,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,YAAY,CAAC;IAGnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,gBAAgB,EACvB,SAAS,EAAE,SAAS,GACnB,wBAAwB,CAsD1B;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,wBAAwB,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,0BAA0B,GAClC,YAAY,EAAE,CAiBhB;AASD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAE5D"}
@@ -0,0 +1,14 @@
1
+ import { CompiledModel } from '@litertjs/core';
2
+ export declare const LITERT_WASM_DIR = "https://cdn.jsdelivr.net/npm/@litertjs/core@2.5.0/wasm/";
3
+ export declare function ensureLiteRtLoaded(): Promise<void>;
4
+ export type AcceleratorChoice = 'webgpu' | 'wasm' | 'auto';
5
+ export type ResolvedAccelerator = 'webgpu' | 'wasm';
6
+ export declare function resolveAccelerator(choice: AcceleratorChoice): ResolvedAccelerator;
7
+ export type LoadModelResult = {
8
+ model: CompiledModel;
9
+ resolvedAccelerator: ResolvedAccelerator;
10
+ loadMs: number;
11
+ };
12
+ export type ModelSource = string | URL | Uint8Array;
13
+ export declare function loadModel(source: ModelSource, choice: AcceleratorChoice): Promise<LoadModelResult>;
14
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/lib/models/providers/litert/runtime.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,aAAa,EAId,MAAM,gBAAgB,CAAA;AAGvB,eAAO,MAAM,eAAe,4DAAwE,CAAA;AAIpG,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAalD;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;AAC1D,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEnD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,iBAAiB,GACxB,mBAAmB,CAGrB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,aAAa,CAAA;IACpB,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,GAAG,GAAG,UAAU,CAAA;AAInD,wBAAsB,SAAS,CAC7B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,eAAe,CAAC,CAW1B"}
@@ -17,6 +17,7 @@ var shallow = require('zustand/react/shallow');
17
17
  var cn = require('clsx');
18
18
  var SignatureCanvas = require('react-signature-canvas');
19
19
  var tasksVision = require('@mediapipe/tasks-vision');
20
+ var core = require('@litertjs/core');
20
21
 
21
22
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
22
23
 
@@ -235,7 +236,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
235
236
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
236
237
  };
237
238
 
238
- var webSdkVersion = '2.3.225';
239
+ var webSdkVersion = '2.3.226';
239
240
 
240
241
  function getPlatform() {
241
242
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -3306,22 +3307,34 @@ function probeDelegateForRuntime(runtime) {
3306
3307
  }
3307
3308
  function verifyDelegate(runtime, delegate) {
3308
3309
  return __awaiter(this, void 0, void 0, function () {
3309
- var modelAssetPath, preloadVisionRuntime, verifyMediaPipeDelegate, exhaustive;
3310
+ var modelAssetPath, preloadVisionRuntime, verifyMediaPipeDelegate, verifyLiteRtDelegate, accelerator, exhaustive;
3310
3311
  return __generator(this, function (_a) {
3311
3312
  switch (_a.label) {
3312
3313
  case 0:
3313
3314
  modelAssetPath = "".concat(defaultImageSegmenterModelPath, "?_=").concat(tinyModelCacheKey);
3315
+ if (!(runtime === 'mediapipe')) return [3 /*break*/, 4];
3314
3316
  return [4 /*yield*/, Promise.resolve().then(function () { return VisionRuntime; })];
3315
3317
  case 1:
3316
3318
  preloadVisionRuntime = _a.sent().preloadVisionRuntime;
3317
3319
  return [4 /*yield*/, preloadVisionRuntime()];
3318
3320
  case 2:
3319
3321
  _a.sent();
3320
- return [4 /*yield*/, Promise.resolve().then(function () { return CapabilityProbe; })];
3322
+ return [4 /*yield*/, Promise.resolve().then(function () { return CapabilityProbe$1; })];
3321
3323
  case 3:
3322
3324
  verifyMediaPipeDelegate = _a.sent().verifyMediaPipeDelegate;
3323
3325
  return [2 /*return*/, verifyMediaPipeDelegate(delegate, modelAssetPath)];
3324
3326
  case 4:
3327
+ if (!(runtime === 'litert')) return [3 /*break*/, 6];
3328
+ return [4 /*yield*/, Promise.resolve().then(function () { return CapabilityProbe; })
3329
+ // Map SDK delegate names to LiteRT accelerator names. delegate is already
3330
+ // narrowed to 'GPU' | 'CPU' by the caller; we treat 'CPU' as the WASM
3331
+ // backend.
3332
+ ];
3333
+ case 5:
3334
+ verifyLiteRtDelegate = _a.sent().verifyLiteRtDelegate;
3335
+ accelerator = delegate === 'GPU' ? 'webgpu' : 'wasm';
3336
+ return [2 /*return*/, verifyLiteRtDelegate(accelerator, modelAssetPath)];
3337
+ case 6:
3325
3338
  exhaustive = runtime;
3326
3339
  throw new Error("Unknown runtime: ".concat(exhaustive));
3327
3340
  }
@@ -3368,7 +3381,7 @@ var defaultModelPaths = {
3368
3381
 
3369
3382
  var preloadModels = function preloadModels(_a) {
3370
3383
  return __awaiter(void 0, [_a], void 0, function (_b) {
3371
- var needsMediaPipe, preloadTasks;
3384
+ var litertOnly, needsMediaPipe, preloadTasks;
3372
3385
  var _c = _b.documentDetectionModel,
3373
3386
  documentDetectionModel = _c === void 0 ? true : _c,
3374
3387
  _d = _b.focusModel,
@@ -3378,47 +3391,63 @@ var preloadModels = function preloadModels(_a) {
3378
3391
  _f = _b.faceLandmarkerModel,
3379
3392
  faceLandmarkerModel = _f === void 0 ? false : _f,
3380
3393
  _g = _b.barcodeReadabilityModel,
3381
- barcodeReadabilityModel = _g === void 0 ? true : _g;
3382
- return __generator(this, function (_h) {
3383
- switch (_h.label) {
3394
+ barcodeReadabilityModel = _g === void 0 ? true : _g,
3395
+ _h = _b.runtime,
3396
+ runtime = _h === void 0 ? 'mediapipe' : _h;
3397
+ return __generator(this, function (_j) {
3398
+ switch (_j.label) {
3384
3399
  case 0:
3385
3400
  // Network probe is runtime-agnostic. The delegate probe is per-runtime;
3386
- // every model preloaded by this function is currently MediaPipe-backed,
3387
- // so probe MP only when at least one such model is in the config. If a
3388
- // future caller passes only LiteRT-backed models, MP will not be probed.
3401
+ // skip the MP probe entirely when the consumer is in LiteRT-only mode and
3402
+ // is only preloading face detection.
3389
3403
  return [4 /*yield*/, probeNetworkSpeed()];
3390
3404
  case 1:
3391
3405
  // Network probe is runtime-agnostic. The delegate probe is per-runtime;
3392
- // every model preloaded by this function is currently MediaPipe-backed,
3393
- // so probe MP only when at least one such model is in the config. If a
3394
- // future caller passes only LiteRT-backed models, MP will not be probed.
3395
- _h.sent();
3396
- needsMediaPipe = !!documentDetectionModel || !!focusModel || !!faceDetectionModel || !!faceLandmarkerModel || !!barcodeReadabilityModel;
3397
- if (!needsMediaPipe) return [3 /*break*/, 3];
3398
- return [4 /*yield*/, probeDelegateForRuntime('mediapipe')];
3406
+ // skip the MP probe entirely when the consumer is in LiteRT-only mode and
3407
+ // is only preloading face detection.
3408
+ _j.sent();
3409
+ litertOnly = runtime === 'litert' && !documentDetectionModel && !focusModel && !faceLandmarkerModel && !barcodeReadabilityModel;
3410
+ if (!litertOnly) return [3 /*break*/, 4];
3411
+ if (!faceDetectionModel) return [3 /*break*/, 3];
3412
+ return [4 /*yield*/, probeDelegateForRuntime('litert')];
3399
3413
  case 2:
3400
- _h.sent();
3401
- _h.label = 3;
3414
+ _j.sent();
3415
+ _j.label = 3;
3402
3416
  case 3:
3417
+ return [3 /*break*/, 8];
3418
+ case 4:
3419
+ needsMediaPipe = !!documentDetectionModel || !!focusModel || !!faceDetectionModel && runtime === 'mediapipe' || !!faceLandmarkerModel || !!barcodeReadabilityModel;
3420
+ if (!needsMediaPipe) return [3 /*break*/, 6];
3421
+ return [4 /*yield*/, probeDelegateForRuntime('mediapipe')];
3422
+ case 5:
3423
+ _j.sent();
3424
+ _j.label = 6;
3425
+ case 6:
3426
+ if (!(faceDetectionModel && runtime === 'litert')) return [3 /*break*/, 8];
3427
+ return [4 /*yield*/, probeDelegateForRuntime('litert')];
3428
+ case 7:
3429
+ _j.sent();
3430
+ _j.label = 8;
3431
+ case 8:
3403
3432
  preloadTasks = [];
3404
3433
  if (documentDetectionModel) {
3405
- preloadTasks.push(preloadDocumentDetectorDependencies);
3434
+ preloadTasks.push(preloadDocumentDetectorDependencies('mediapipe'));
3406
3435
  }
3407
3436
  if (focusModel) {
3408
- preloadTasks.push(preloadFocusModelDependencies);
3437
+ preloadTasks.push(preloadFocusModelDependencies('mediapipe'));
3409
3438
  }
3410
3439
  if (faceDetectionModel) {
3411
- preloadTasks.push(preloadFaceDetectorDependencies);
3440
+ preloadTasks.push(preloadFaceDetectorDependencies(runtime));
3412
3441
  }
3413
3442
  if (faceLandmarkerModel) {
3414
- preloadTasks.push(preloadFaceLandmarkerDependencies);
3443
+ preloadTasks.push(preloadFaceLandmarkerDependencies('mediapipe'));
3415
3444
  }
3416
3445
  if (barcodeReadabilityModel) {
3417
- preloadTasks.push(preloadBarcodeReadabilityModelDependencies);
3446
+ preloadTasks.push(preloadBarcodeReadabilityModelDependencies('mediapipe'));
3418
3447
  }
3419
3448
  return [4 /*yield*/, Promise.all(preloadTasks)];
3420
- case 4:
3421
- _h.sent();
3449
+ case 9:
3450
+ _j.sent();
3422
3451
  return [2 /*return*/];
3423
3452
  }
3424
3453
  });
@@ -3536,24 +3565,42 @@ var modelsPreloading = {
3536
3565
  faceLandmarker: false,
3537
3566
  barcodeReadability: false
3538
3567
  };
3539
- var preloadDocumentDetectorDependencies = function preloadDocumentDetectorDependencies() {
3540
- return preloadModelDependencies('documentDetector');
3568
+ var preloadDocumentDetectorDependencies = function preloadDocumentDetectorDependencies(runtime) {
3569
+ if (runtime === void 0) {
3570
+ runtime = 'mediapipe';
3571
+ }
3572
+ return preloadModelDependencies('documentDetector', runtime);
3541
3573
  };
3542
- var preloadFocusModelDependencies = function preloadFocusModelDependencies() {
3543
- return preloadModelDependencies('focus');
3574
+ var preloadFocusModelDependencies = function preloadFocusModelDependencies(runtime) {
3575
+ if (runtime === void 0) {
3576
+ runtime = 'mediapipe';
3577
+ }
3578
+ return preloadModelDependencies('focus', runtime);
3544
3579
  };
3545
- var preloadFaceDetectorDependencies = function preloadFaceDetectorDependencies() {
3546
- return preloadModelDependencies('faceDetection');
3580
+ var preloadFaceDetectorDependencies = function preloadFaceDetectorDependencies(runtime) {
3581
+ if (runtime === void 0) {
3582
+ runtime = 'mediapipe';
3583
+ }
3584
+ return preloadModelDependencies('faceDetection', runtime);
3547
3585
  };
3548
- var preloadFaceLandmarkerDependencies = function preloadFaceLandmarkerDependencies() {
3549
- return preloadModelDependencies('faceLandmarker');
3586
+ var preloadFaceLandmarkerDependencies = function preloadFaceLandmarkerDependencies(runtime) {
3587
+ if (runtime === void 0) {
3588
+ runtime = 'mediapipe';
3589
+ }
3590
+ return preloadModelDependencies('faceLandmarker', runtime);
3550
3591
  };
3551
- var preloadBarcodeReadabilityModelDependencies = function preloadBarcodeReadabilityModelDependencies() {
3552
- return preloadModelDependencies('barcodeReadability');
3592
+ var preloadBarcodeReadabilityModelDependencies = function preloadBarcodeReadabilityModelDependencies(runtime) {
3593
+ if (runtime === void 0) {
3594
+ runtime = 'mediapipe';
3595
+ }
3596
+ return preloadModelDependencies('barcodeReadability', runtime);
3553
3597
  };
3554
- function preloadModelDependencies(model) {
3555
- return __awaiter(this, void 0, void 0, function () {
3598
+ function preloadModelDependencies(model_1) {
3599
+ return __awaiter(this, arguments, void 0, function (model, runtime) {
3556
3600
  var dependencies_1, handleModelDownloadProgress;
3601
+ if (runtime === void 0) {
3602
+ runtime = 'mediapipe';
3603
+ }
3557
3604
  return __generator(this, function (_a) {
3558
3605
  switch (_a.label) {
3559
3606
  case 0:
@@ -3569,19 +3616,17 @@ function preloadModelDependencies(model) {
3569
3616
  _a.label = 1;
3570
3617
  case 1:
3571
3618
  _a.trys.push([1,, 8, 9]);
3572
- // All five models in this function are MediaPipe-backed; probe MP's
3573
- // delegate to surface NONE before we waste bandwidth downloading bytes
3574
- // for a model the device can't run.
3619
+ // Probe the runtime that will actually run this model so we surface
3620
+ // NONE before wasting bandwidth on bytes the device can't run.
3575
3621
  return [4 /*yield*/, probeNetworkSpeed()];
3576
3622
  case 2:
3577
- // All five models in this function are MediaPipe-backed; probe MP's
3578
- // delegate to surface NONE before we waste bandwidth downloading bytes
3579
- // for a model the device can't run.
3623
+ // Probe the runtime that will actually run this model so we surface
3624
+ // NONE before wasting bandwidth on bytes the device can't run.
3580
3625
  _a.sent();
3581
- return [4 /*yield*/, probeDelegateForRuntime('mediapipe')];
3626
+ return [4 /*yield*/, probeDelegateForRuntime(runtime)];
3582
3627
  case 3:
3583
3628
  _a.sent();
3584
- if (getDelegate('mediapipe') === 'NONE') {
3629
+ if (getDelegate(runtime) === 'NONE') {
3585
3630
  throw new Error("No available delegate for ".concat(model, " model."));
3586
3631
  }
3587
3632
  dependencies_1 = [{
@@ -25698,11 +25743,135 @@ function verifyMediaPipeDelegate(delegate, modelAssetPath) {
25698
25743
  });
25699
25744
  }
25700
25745
 
25701
- var CapabilityProbe = /*#__PURE__*/Object.freeze({
25746
+ var CapabilityProbe$1 = /*#__PURE__*/Object.freeze({
25702
25747
  __proto__: null,
25703
25748
  verifyMediaPipeDelegate: verifyMediaPipeDelegate
25704
25749
  });
25705
25750
 
25751
+ // Thin wrapper around @litertjs/core for the LiteRT-backed providers.
25752
+ //
25753
+ // `loadLiteRt` initializes the global LiteRT WASM module (one-time per page).
25754
+ // Subsequent model loads share the global instance. The WASM files are served
25755
+ // from jsDelivr today; production usage will bundle them locally via the SDK
25756
+ // asset pipeline once the LiteRT path goes from opt-in to default.
25757
+ var LITERT_VERSION = '2.5.0';
25758
+ var LITERT_WASM_DIR = "https://cdn.jsdelivr.net/npm/@litertjs/core@".concat(LITERT_VERSION, "/wasm/");
25759
+ var runtimePromise = null;
25760
+ function ensureLiteRtLoaded() {
25761
+ if (!runtimePromise) {
25762
+ runtimePromise = core.loadLiteRt(LITERT_WASM_DIR).then(function () {
25763
+ return undefined;
25764
+ }, function (err) {
25765
+ // Clear the cache on rejection so the next caller gets a fresh attempt
25766
+ // instead of the stuck rejection.
25767
+ runtimePromise = null;
25768
+ throw err;
25769
+ });
25770
+ }
25771
+ return runtimePromise;
25772
+ }
25773
+ function resolveAccelerator(choice) {
25774
+ if (choice === 'auto') return core.isWebGPUSupported() ? 'webgpu' : 'wasm';
25775
+ return choice;
25776
+ }
25777
+ // Load and compile a .tflite. Accepts either a URL (LiteRT fetches) or a
25778
+ // Uint8Array (SRI-validated bytes from preloadDependency). Caller decides.
25779
+ function loadModel(source, choice) {
25780
+ return __awaiter(this, void 0, void 0, function () {
25781
+ var resolvedAccelerator, t0, model, loadMs;
25782
+ return __generator(this, function (_a) {
25783
+ switch (_a.label) {
25784
+ case 0:
25785
+ return [4 /*yield*/, ensureLiteRtLoaded()];
25786
+ case 1:
25787
+ _a.sent();
25788
+ resolvedAccelerator = resolveAccelerator(choice);
25789
+ t0 = performance.now();
25790
+ return [4 /*yield*/, core.loadAndCompile(source, {
25791
+ accelerator: resolvedAccelerator
25792
+ })];
25793
+ case 2:
25794
+ model = _a.sent();
25795
+ loadMs = performance.now() - t0;
25796
+ return [2 /*return*/, {
25797
+ model: model,
25798
+ resolvedAccelerator: resolvedAccelerator,
25799
+ loadMs: loadMs
25800
+ }];
25801
+ }
25802
+ });
25803
+ });
25804
+ }
25805
+
25806
+ // Verify a given LiteRT accelerator (webgpu or wasm) can actually run a
25807
+ // .tflite in this browser. Compiles the supplied model and runs it once
25808
+ // against a zero-filled input matching its declared shape, letting any
25809
+ // thrown error propagate up so the caller can fall back. Mirrors the
25810
+ // shape of verifyMediaPipeDelegate but speaks LiteRT-native terms
25811
+ // (webgpu/wasm) rather than the SDK delegate names (GPU/CPU).
25812
+ function verifyLiteRtDelegate(accelerator, modelAssetPath) {
25813
+ return __awaiter(this, void 0, void 0, function () {
25814
+ var model, inputTensor, outputTensors, inputs, input, elementCount, shape, _i, outputTensors_1, t;
25815
+ return __generator(this, function (_a) {
25816
+ switch (_a.label) {
25817
+ case 0:
25818
+ return [4 /*yield*/, loadModel(modelAssetPath, accelerator)];
25819
+ case 1:
25820
+ model = _a.sent().model;
25821
+ inputTensor = null;
25822
+ outputTensors = null;
25823
+ _a.label = 2;
25824
+ case 2:
25825
+ _a.trys.push([2,, 6, 7]);
25826
+ inputs = model.getInputDetails();
25827
+ if (inputs.length === 0) {
25828
+ throw new Error('LiteRT probe: model has no inputs');
25829
+ }
25830
+ input = inputs[0];
25831
+ elementCount = Array.from(input.shape).reduce(function (acc, n) {
25832
+ return acc * n;
25833
+ }, 1);
25834
+ shape = Array.from(input.shape);
25835
+ if (input.dtype === 'float32') {
25836
+ inputTensor = core.Tensor.fromTypedArray(new Float32Array(elementCount), shape);
25837
+ } else if (input.dtype === 'int32') {
25838
+ inputTensor = core.Tensor.fromTypedArray(new Int32Array(elementCount), shape);
25839
+ } else {
25840
+ inputTensor = core.Tensor.fromTypedArray(new Uint8Array(elementCount), shape);
25841
+ }
25842
+ return [4 /*yield*/, model.run(inputTensor)
25843
+ // Touch the first output's data so any lazy GPU→CPU readback errors
25844
+ // surface here rather than later.
25845
+ ];
25846
+ case 3:
25847
+ outputTensors = _a.sent();
25848
+ if (!(outputTensors.length > 0)) return [3 /*break*/, 5];
25849
+ return [4 /*yield*/, outputTensors[0].data()];
25850
+ case 4:
25851
+ _a.sent();
25852
+ _a.label = 5;
25853
+ case 5:
25854
+ return [3 /*break*/, 7];
25855
+ case 6:
25856
+ inputTensor === null || inputTensor === void 0 ? void 0 : inputTensor["delete"]();
25857
+ if (outputTensors) for (_i = 0, outputTensors_1 = outputTensors; _i < outputTensors_1.length; _i++) {
25858
+ t = outputTensors_1[_i];
25859
+ t["delete"]();
25860
+ }
25861
+ model["delete"]();
25862
+ return [7 /*endfinally*/];
25863
+ case 7:
25864
+ return [2 /*return*/];
25865
+ }
25866
+ });
25867
+ });
25868
+ }
25869
+
25870
+ var CapabilityProbe = /*#__PURE__*/Object.freeze({
25871
+ __proto__: null,
25872
+ verifyLiteRtDelegate: verifyLiteRtDelegate
25873
+ });
25874
+
25706
25875
  var RUNTIME$3 = 'mediapipe';
25707
25876
  var detector = null;
25708
25877
  var detectorSettings = null;