@incodetech/core 0.0.0-dev-20260610-8787196e → 0.0.0-dev-20260610-e5b4c4d5
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/dist/{OpenViduRecordingProvider-BtAVDH2Y.esm.js → OpenViduRecordingProvider-O4GjBseO.esm.js} +1 -1
- package/dist/StreamCanvasCapture-ImiDQdVA.esm.js +118 -0
- package/dist/StreamCanvasCapture-yyl20qd9.d.ts +152 -0
- package/dist/{addressSearch-DPmseXCM.esm.js → addressSearch-rHF9QriL.esm.js} +4 -4
- package/dist/{ae-signature-lqjX_h2U.esm.js → ae-signature-CQjOxLrv.esm.js} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/ae-signature.esm.js +7 -7
- package/dist/antifraud.d.ts +3 -3
- package/dist/antifraud.esm.js +6 -6
- package/dist/{antifraudManager-DaUfoGLZ.esm.js → antifraudManager-CZDCQli0.esm.js} +3 -3
- package/dist/{antifraudManager-Bbgl_P0Y.d.ts → antifraudManager-CznnhyvD.d.ts} +2 -2
- package/dist/{antifraudStateMachine-DmhL7cti.esm.js → antifraudStateMachine-Bp7yS1LV.esm.js} +3 -3
- package/dist/authentication.d.ts +13 -12
- package/dist/authentication.esm.js +27 -25
- package/dist/{authenticationManager-DIN4eL_6.esm.js → authenticationManager-C3-IUymg.esm.js} +6 -6
- package/dist/{authenticationManager-ozJVUfiA.d.ts → authenticationManager-CIVY80H9.d.ts} +2 -2
- package/dist/{authenticationStateMachine-DzrcG7XX.esm.js → authenticationStateMachine-3HbNfPoL.esm.js} +8 -8
- package/dist/{backCameraStream-BtCwSIuT.esm.js → backCameraStream-D7Wo4Nbx.esm.js} +3 -3
- package/dist/{browserSimulation-CHpyEI-W.esm.js → browserSimulation-B1dWiXp7.esm.js} +2 -2
- package/dist/camera.d.ts +1 -1
- package/dist/camera.esm.js +4 -4
- package/dist/canvas-SKcRBxsk.esm.js +230 -0
- package/dist/consent.d.ts +3 -3
- package/dist/consent.esm.js +6 -6
- package/dist/{consentManager-CHV12fjQ.d.ts → consentManager-66SjOJ7U.d.ts} +52 -52
- package/dist/{consentManager-D0NGejCx.esm.js → consentManager-DOufCKTj.esm.js} +3 -3
- package/dist/{consentStateMachine-CUOuuC7d.esm.js → consentStateMachine-CUVp1kKY.esm.js} +3 -3
- package/dist/cpf-ocr.d.ts +3 -3
- package/dist/cpf-ocr.esm.js +6 -6
- package/dist/{cpfOcrManager-9ciXe_XT.esm.js → cpfOcrManager-Bm5OlZSa.esm.js} +5 -5
- package/dist/{cpfOcrManager-BR_dJaKV.d.ts → cpfOcrManager-DVSJov4W.d.ts} +22 -22
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/cross-document-data-match.esm.js +5 -5
- package/dist/curp-validation.d.ts +7 -7
- package/dist/curp-validation.esm.js +6 -6
- package/dist/{curpValidationManager-BJDxY7JH.esm.js → curpValidationManager-CMXS-tjU.esm.js} +3 -3
- package/dist/{curpValidationManager-VE0Ndj36.d.ts → curpValidationManager-DIFa6O03.d.ts} +3 -3
- package/dist/{curpValidationStateMachine-BBUREbWY.esm.js → curpValidationStateMachine-CD-npCgV.esm.js} +3 -3
- package/dist/custom-fields.d.ts +2 -2
- package/dist/custom-fields.esm.js +5 -5
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/custom-watchlist.esm.js +5 -5
- package/dist/{customWatchlistStateMachine-qfxMGhCV.esm.js → customWatchlistStateMachine-CF4ETN-z.esm.js} +3 -3
- package/dist/{deepsightLoader-OlmqoVtS.esm.js → deepsightLoader-CTf5NdIB.esm.js} +13 -12
- package/dist/{deepsightService-CeXd7dhh.d.ts → deepsightService-B7ShOkWL.d.ts} +2 -152
- package/dist/{deepsightService-Dh9EiWze.esm.js → deepsightService-Da56SkD4.esm.js} +8 -236
- package/dist/device.esm.js +4 -4
- package/dist/document-capture.d.ts +235 -235
- package/dist/document-capture.esm.js +13 -13
- package/dist/document-upload.d.ts +53 -53
- package/dist/document-upload.esm.js +8 -8
- package/dist/{documentCaptureStateMachine-JqM4pyfY.esm.js → documentCaptureStateMachine-CV1dzgbn.esm.js} +7 -7
- package/dist/dynamic-forms.d.ts +2 -2
- package/dist/dynamic-forms.esm.js +5 -5
- package/dist/ekyb.d.ts +6 -6
- package/dist/ekyb.esm.js +16 -16
- package/dist/{ekybStateMachine-C0DLJplY.esm.js → ekybStateMachine-DWm7C2qW.esm.js} +5 -5
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +8 -8
- package/dist/{ekycStateMachine-B5brX021.esm.js → ekycStateMachine-CRiViUGB.esm.js} +5 -5
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/electronic-signature.esm.js +6 -6
- package/dist/{electronicSignatureManager-BY6tiZPR.esm.js → electronicSignatureManager-DECEJ9hm.esm.js} +5 -5
- package/dist/email.d.ts +4 -4
- package/dist/email.esm.js +8 -8
- package/dist/{emailManager-DRUHedQg.esm.js → emailManager-DAIwweQa.esm.js} +4 -4
- package/dist/{emailManager-VP0mIGdj.d.ts → emailManager-lAzDoQOs.d.ts} +3 -3
- package/dist/{emailStateMachine-CZgKn7a1.esm.js → emailStateMachine-C-ltLrvi.esm.js} +5 -5
- package/dist/{endpoints-BPHddOTi.esm.js → endpoints-zEf_JIJU.esm.js} +2 -1
- package/dist/{events-Bsw1l0pH.esm.js → events-Dvvriq9l.esm.js} +3 -2
- package/dist/events.d.ts +1 -0
- package/dist/events.esm.js +2 -2
- package/dist/extensibility.d.ts +26 -25
- package/dist/extensibility.esm.js +56 -54
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +5 -5
- package/dist/{faceCaptureManagerFactory-BTsmDJ06.d.ts → faceCaptureManagerFactory-C_hRHx8a.d.ts} +9 -8
- package/dist/{faceCaptureManagerFactory-DKE4-MLG.esm.js → faceCaptureManagerFactory-kqbUqtrr.esm.js} +4 -4
- package/dist/{faceCaptureSetup-0XUJwf3G.esm.js → faceCaptureSetup-CoZCFG0w.esm.js} +7 -6
- package/dist/{faceMatchStateMachine-i3qgZ176.esm.js → faceMatchStateMachine-CN81-J0s.esm.js} +3 -3
- package/dist/field-comparison.d.ts +3 -3
- package/dist/field-comparison.esm.js +5 -5
- package/dist/{fieldComparisonManager-Bfb3-iwn.esm.js → fieldComparisonManager-Bnuq1mA0.esm.js} +4 -4
- package/dist/{fieldComparisonManager-DAP7RbND.d.ts → fieldComparisonManager-Bu5TaSr3.d.ts} +2 -2
- package/dist/fiscal-qr.d.ts +59 -0
- package/dist/fiscal-qr.esm.js +323 -0
- package/dist/flow-events.d.ts +6 -6
- package/dist/flow.d.ts +12 -12
- package/dist/flow.esm.js +16 -16
- package/dist/{flowCompletionService-DFV8vmO3.esm.js → flowCompletionService-DHpnjBvp.esm.js} +3 -3
- package/dist/{flowServices-DhaF-fP3.esm.js → flowServices-BykryjdA.esm.js} +4 -4
- package/dist/geolocation.d.ts +2 -2
- package/dist/geolocation.esm.js +6 -6
- package/dist/{geolocationStateMachine-DCG_hQkW.esm.js → geolocationStateMachine-D6yBlOQ_.esm.js} +4 -4
- package/dist/{getDeviceClass-cJ-TvND7.esm.js → getDeviceClass-C8Do2qYu.esm.js} +1 -1
- package/dist/government-validation.d.ts +3 -3
- package/dist/government-validation.esm.js +7 -7
- package/dist/{governmentValidationStateMachine-KY_Eu5b-.esm.js → governmentValidationStateMachine-M-iiovMY.esm.js} +5 -5
- package/dist/home.d.ts +15 -15
- package/dist/home.esm.js +3 -3
- package/dist/http-Cai3IoLS.esm.js +0 -0
- package/dist/http.esm.js +2 -1
- package/dist/id-ocr.d.ts +54 -54
- package/dist/id-ocr.esm.js +6 -6
- package/dist/id-verification.d.ts +27 -27
- package/dist/id-verification.esm.js +5 -5
- package/dist/id.d.ts +12 -11
- package/dist/id.esm.js +31 -29
- package/dist/{idCaptureManager-BXkPnZIc.d.ts → idCaptureManager-D-QYESvF.d.ts} +8 -7
- package/dist/{idCaptureManager-CWG0Qgeq.esm.js → idCaptureManager-mQGmxqf1.esm.js} +5 -5
- package/dist/{idCaptureStateMachine-Dqfxbea3.esm.js → idCaptureStateMachine-DXeLlQa_.esm.js} +19 -18
- package/dist/{idOcrStateMachine-DVjkIw10.esm.js → idOcrStateMachine-Cj2uN_q_.esm.js} +5 -5
- package/dist/{idVerificationStateMachine-B_F3G-v-.esm.js → idVerificationStateMachine-DVrl68dQ.esm.js} +3 -3
- package/dist/identity-reuse.d.ts +3 -3
- package/dist/identity-reuse.esm.js +6 -6
- package/dist/{identityReuseManager-CNcsh-xr.esm.js → identityReuseManager-DHYlQW3K.esm.js} +3 -3
- package/dist/{identityReuseManager-DVZLgcfm.d.ts → identityReuseManager-DYb7I3jf.d.ts} +36 -36
- package/dist/{identityReuseStateMachine-BrbaZto8.esm.js → identityReuseStateMachine-Dyfa7yzx.esm.js} +3 -3
- package/dist/{index-B1ijI7RD.d.ts → index-B2RUw1Th.d.ts} +169 -169
- package/dist/{index-C3KOkxmU.d.ts → index-B5hPA0Bg.d.ts} +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +12 -12
- package/dist/{invokeOnCaptureCallback-Bty7q0sC.esm.js → invokeOnCaptureCallback-ygByVdnn.esm.js} +1 -1
- package/dist/{lib-DmGBvFHu.esm.js → lib-BY67lgbq.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +7 -7
- package/dist/mandatory-consent.esm.js +6 -6
- package/dist/{mandatoryConsentManager-BUpEBczR.esm.js → mandatoryConsentManager-BTqe3YNU.esm.js} +3 -3
- package/dist/{mandatoryConsentManager-DwmDNt6y.d.ts → mandatoryConsentManager-DBc5NyKN.d.ts} +55 -55
- package/dist/{mandatoryConsentStateMachine-B6hfQFw1.esm.js → mandatoryConsentStateMachine-4yzCCY4e.esm.js} +3 -3
- package/dist/openviduLazy-B8L--0oe.esm.js +3 -0
- package/dist/{openviduLazy-6AQum7Ca.esm.js → openviduLazy-Dh14JNJc.esm.js} +2 -2
- package/dist/{permissionGuards-DUKOJ-Mt.esm.js → permissionGuards-C1ispV96.esm.js} +1 -1
- package/dist/{permissionServices-BjXAT5OT.esm.js → permissionServices-CG3bMSfG.esm.js} +3 -3
- package/dist/phone.d.ts +4 -4
- package/dist/phone.esm.js +8 -8
- package/dist/{phoneManager-Ddl_CeNb.esm.js → phoneManager-B44MT4ro.esm.js} +4 -4
- package/dist/{phoneManager-BgoX1fvQ.d.ts → phoneManager-fPmIBYQK.d.ts} +3 -3
- package/dist/{phoneStateMachine-CrjW4JrA.esm.js → phoneStateMachine-CMht9LLp.esm.js} +5 -5
- package/dist/{qe-signature-C8uvV_-H.esm.js → qe-signature-DCz2roEC.esm.js} +1 -1
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +7 -7
- package/dist/{recordingService-DCUipzC7.esm.js → recordingService-DwPmv6FZ.esm.js} +16 -131
- package/dist/redirect-to-mobile.d.ts +3 -3
- package/dist/redirect-to-mobile.esm.js +7 -7
- package/dist/{redirectToMobileManager-CQxCClRy.esm.js → redirectToMobileManager-BAzevDYW.esm.js} +4 -4
- package/dist/{redirectToMobileManager-xOasdN0s.d.ts → redirectToMobileManager-BNe3IzC_.d.ts} +2 -2
- package/dist/{redirectToMobileStateMachine-DHqdmBzc.esm.js → redirectToMobileStateMachine-BmwxrN1h.esm.js} +4 -4
- package/dist/{runChildModule-B1uVG8D-.esm.js → runChildModule-CuoHZ1cx.esm.js} +3 -3
- package/dist/selfie.d.ts +13 -12
- package/dist/selfie.esm.js +28 -26
- package/dist/{selfieManager-CeTXxT2U.d.ts → selfieManager-dUbKRzOh.d.ts} +2 -2
- package/dist/{selfieManager-DpFMP4Rk.esm.js → selfieManager-zH9pAVXE.esm.js} +6 -6
- package/dist/{selfieStateMachine-DCHihi8J.esm.js → selfieStateMachine-Dr5sCDgI.esm.js} +4 -4
- package/dist/{session-Ds1d84mn.esm.js → session-BEtpaQ6D.esm.js} +3 -3
- package/dist/session.d.ts +5 -5
- package/dist/session.esm.js +12 -12
- package/dist/{sessionInitializer-Be88b4WX.esm.js → sessionInitializer-D0Ei5Ol7.esm.js} +7 -7
- package/dist/{setup-BtLWJPSp.d.ts → setup-BbkprdVv.d.ts} +1 -1
- package/dist/{setup-BgxDnUDw.esm.js → setup-DotVj7UA.esm.js} +7 -7
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +5 -5
- package/dist/{signatureStateMachine-CY1u1o6J.esm.js → signatureStateMachine-CpcyA7CM.esm.js} +4 -4
- package/dist/{stats-AwLva7-C.esm.js → stats-SU3Linba.esm.js} +2 -2
- package/dist/stats.esm.js +3 -3
- package/dist/trust-graph.d.ts +3 -3
- package/dist/trust-graph.esm.js +3 -3
- package/dist/{types-BmZR-K77.d.ts → types-Bj9hdFjU.d.ts} +1 -1
- package/dist/{types-DJsgKeW0.d.ts → types-DOUhndhT.d.ts} +2 -2
- package/dist/{types-BI-jIO73.d.ts → types-NuT8ftBV.d.ts} +1 -1
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +12 -12
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +5 -5
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +5 -5
- package/dist/{watchlistForBusinessStateMachine-CGRko-GU.esm.js → watchlistForBusinessStateMachine-DsEq8xwX.esm.js} +3 -3
- package/dist/{watchlistStateMachine-CWVTWVJY.esm.js → watchlistStateMachine-CREpVW-C.esm.js} +3 -3
- package/dist/workflow.d.ts +97 -97
- package/dist/workflow.esm.js +60 -58
- package/package.json +9 -1
- package/dist/openviduLazy-Dge_R911.esm.js +0 -3
- /package/dist/{Actor-Ds20AUDY.d.ts → Actor-Y0_Fj-KL.d.ts} +0 -0
- /package/dist/{BrowserStorageProvider-BrJver0U.esm.js → BrowserStorageProvider-BpJM-gIl.esm.js} +0 -0
- /package/dist/{BrowserTimerProvider-BESs49g_.esm.js → BrowserTimerProvider-DhNc_x02.esm.js} +0 -0
- /package/dist/{ITimerCapability-gIlcIrAX.esm.js → ITimerCapability-CB0I1Uf2.esm.js} +0 -0
- /package/dist/{IpifyProvider-BQKB2PR-.esm.js → IpifyProvider-D4LWD15E.esm.js} +0 -0
- /package/dist/{Manager-Dh6pC-6V.d.ts → Manager-BHn8wH8K.d.ts} +0 -0
- /package/dist/{MotionSensorProvider-D1JWpMLJ.esm.js → MotionSensorProvider-Bx7Mpzt0.esm.js} +0 -0
- /package/dist/{StateMachine-CENvPkCx.d.ts → StateMachine-BC_nGvrc.d.ts} +0 -0
- /package/dist/{WasmUtilProvider-CeyOvhU2.esm.js → WasmUtilProvider-CiEN7Gjn.esm.js} +0 -0
- /package/dist/{api-YxPMtty2.esm.js → api-CESGtpbH.esm.js} +0 -0
- /package/dist/{apiError-76Dulrw9.esm.js → apiError-B-j-gyDx.esm.js} +0 -0
- /package/dist/{camera-P7dse339.esm.js → camera-DJWm3V4g.esm.js} +0 -0
- /package/dist/{camera-D7qYpKeG.d.ts → camera-SRBpPq2X.d.ts} +0 -0
- /package/dist/{chunk-wtC55c3P.esm.js → chunk-CMUKZ2uL.esm.js} +0 -0
- /package/dist/{cpf-COPPtEoQ.esm.js → cpf-BRzggV8G.esm.js} +0 -0
- /package/dist/{dateUtils-CibceEoG.esm.js → dateUtils-AksLQmgV.esm.js} +0 -0
- /package/dist/{flowCompletionService-DOHFSAJ2.d.ts → flowCompletionService-BdR2cGgB.d.ts} +0 -0
- /package/dist/{getBrowser-CMJJeBF8.esm.js → getBrowser-C8DP7oTB.esm.js} +0 -0
- /package/dist/{getDeviceClass-C5yT6K2e.esm.js → getDeviceClass-C0olyNFS.esm.js} +0 -0
- /package/dist/{otp-lOELtCck.esm.js → otp-CGMdUzBC.esm.js} +0 -0
- /package/dist/{otp-Ci7E_eNt.d.ts → otp-DF5A0sFx.d.ts} +0 -0
- /package/dist/{platform-D871crJL.esm.js → platform-SKvEfCBh.esm.js} +0 -0
- /package/dist/{types-CRp-Maxh.esm.js → types-DsnEVMhr.esm.js} +0 -0
- /package/dist/{types-Cojkwi9p.d.ts → types-DvGZI7BF.d.ts} +0 -0
- /package/dist/{types-DI4L4PFE.d.ts → types-ya0LN_MX.d.ts} +0 -0
- /package/dist/{warmup-Bx2GXY3L.d.ts → warmup-Dg8Lh-50.d.ts} +0 -0
- /package/dist/{xstate.esm-CWoFJOio.esm.js → xstate.esm-C9wncMQa.esm.js} +0 -0
|
@@ -1,239 +1,11 @@
|
|
|
1
|
-
import { t as api } from "./api-
|
|
2
|
-
import { t as addDeviceStats } from "./stats-
|
|
3
|
-
import { n as getThumbmarkId, r as getParsedUserAgent, t as isBrowserSimulation } from "./browserSimulation-
|
|
4
|
-
import { t as getUserAgent } from "./getBrowser-
|
|
5
|
-
import { i as stopCameraStream, r as requestCameraAccess } from "./camera-
|
|
6
|
-
import { t as
|
|
1
|
+
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
+
import { t as addDeviceStats } from "./stats-SU3Linba.esm.js";
|
|
3
|
+
import { n as getThumbmarkId, r as getParsedUserAgent, t as isBrowserSimulation } from "./browserSimulation-B1dWiXp7.esm.js";
|
|
4
|
+
import { t as getUserAgent } from "./getBrowser-C8DP7oTB.esm.js";
|
|
5
|
+
import { i as stopCameraStream, r as requestCameraAccess } from "./camera-DJWm3V4g.esm.js";
|
|
6
|
+
import { t as IncodeCanvas } from "./canvas-SKcRBxsk.esm.js";
|
|
7
|
+
import { t as getDeviceInfo } from "./getDeviceClass-C0olyNFS.esm.js";
|
|
7
8
|
|
|
8
|
-
//#region ../infra/src/media/canvas.ts
|
|
9
|
-
/**
|
|
10
|
-
* Class representing a canvas element for image capture and manipulation.
|
|
11
|
-
*/
|
|
12
|
-
var IncodeCanvas = class IncodeCanvas {
|
|
13
|
-
/**
|
|
14
|
-
* Creates an {@link IncodeCanvas} from a raw {@link ImageData} frame.
|
|
15
|
-
* @param imageData - Frame pixels in RGBA format
|
|
16
|
-
* @returns An {@link IncodeCanvas} containing the provided pixels
|
|
17
|
-
*/
|
|
18
|
-
static fromImageData(imageData) {
|
|
19
|
-
const canvas = document.createElement("canvas");
|
|
20
|
-
canvas.width = imageData.width;
|
|
21
|
-
canvas.height = imageData.height;
|
|
22
|
-
const context = canvas.getContext("2d", { willReadFrequently: true });
|
|
23
|
-
if (!context) return new IncodeCanvas(canvas);
|
|
24
|
-
if ("putImageData" in context) context.putImageData(imageData, 0, 0);
|
|
25
|
-
return new IncodeCanvas(canvas);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Create a new canvas element.
|
|
29
|
-
* @param canvas_ - The canvas element to clone.
|
|
30
|
-
*/
|
|
31
|
-
constructor(canvas_) {
|
|
32
|
-
this.base64Image = null;
|
|
33
|
-
this.blobData = null;
|
|
34
|
-
this.canvas = document.createElement("canvas");
|
|
35
|
-
this.canvas.width = canvas_.width;
|
|
36
|
-
this.canvas.height = canvas_.height;
|
|
37
|
-
const context = this.canvas.getContext("2d");
|
|
38
|
-
if (context) context.drawImage(canvas_, 0, 0);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Check if the current canvas is valid.
|
|
42
|
-
*/
|
|
43
|
-
checkCanvas() {
|
|
44
|
-
return this.canvas && this.canvas.width > 1 && this.canvas.height > 1;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Disposes of resources, including revoking object URLs to prevent memory leaks.
|
|
48
|
-
*/
|
|
49
|
-
dispose() {
|
|
50
|
-
if (this.blobData?.url) {
|
|
51
|
-
URL.revokeObjectURL(this.blobData.url);
|
|
52
|
-
this.blobData = null;
|
|
53
|
-
}
|
|
54
|
-
this.base64Image = null;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Release the data stored by IncodeCanvas.
|
|
58
|
-
*/
|
|
59
|
-
release() {
|
|
60
|
-
if (!this.checkCanvas()) return;
|
|
61
|
-
this.canvas.width = 1;
|
|
62
|
-
this.canvas.height = 1;
|
|
63
|
-
this.canvas.getContext("2d")?.clearRect(0, 0, 1, 1);
|
|
64
|
-
this.base64Image = null;
|
|
65
|
-
if (this.blobData?.url) URL.revokeObjectURL(this.blobData.url);
|
|
66
|
-
this.blobData = null;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Revokes the object URL if one exists, preventing memory leaks.
|
|
70
|
-
* Use this when you no longer need the preview image URL.
|
|
71
|
-
*/
|
|
72
|
-
revokeObjectURL() {
|
|
73
|
-
if (this.blobData?.url) {
|
|
74
|
-
URL.revokeObjectURL(this.blobData.url);
|
|
75
|
-
this.blobData = {
|
|
76
|
-
...this.blobData,
|
|
77
|
-
url: ""
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Get the width of the canvas.
|
|
83
|
-
*/
|
|
84
|
-
width() {
|
|
85
|
-
if (!this.checkCanvas()) return null;
|
|
86
|
-
return this.canvas.width;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Get the height of the canvas.
|
|
90
|
-
*/
|
|
91
|
-
height() {
|
|
92
|
-
if (!this.checkCanvas()) return null;
|
|
93
|
-
return this.canvas.height;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Set the width of the canvas.
|
|
97
|
-
*/
|
|
98
|
-
setWidth(width) {
|
|
99
|
-
if (!this.checkCanvas()) return;
|
|
100
|
-
this.canvas.width = width;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Set the height of the canvas.
|
|
104
|
-
*/
|
|
105
|
-
setHeight(height) {
|
|
106
|
-
if (!this.checkCanvas()) return;
|
|
107
|
-
this.canvas.height = height;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Clone the current canvas.
|
|
111
|
-
*/
|
|
112
|
-
clone() {
|
|
113
|
-
if (!this.checkCanvas()) return null;
|
|
114
|
-
const cloned = new IncodeCanvas(this.canvas);
|
|
115
|
-
cloned.setBase64Image(this.base64Image);
|
|
116
|
-
return cloned;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Deep clone the current IncodeCanvas including blob data.
|
|
120
|
-
*/
|
|
121
|
-
async deepClone() {
|
|
122
|
-
const cloned = this.clone();
|
|
123
|
-
if (!cloned) return null;
|
|
124
|
-
if (this.blobData) await cloned.setBlobData(this.blobData);
|
|
125
|
-
return cloned;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Returns the drawing context on the canvas.
|
|
129
|
-
*/
|
|
130
|
-
getContext(contextId, contextAttributes) {
|
|
131
|
-
if (!this.checkCanvas()) return null;
|
|
132
|
-
const context = this.canvas.getContext(contextId, contextAttributes);
|
|
133
|
-
return context instanceof CanvasRenderingContext2D ? context : null;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Retrieves the image data from the canvas.
|
|
137
|
-
*/
|
|
138
|
-
getImageData() {
|
|
139
|
-
if (!this.checkCanvas()) return null;
|
|
140
|
-
const context = this.canvas.getContext("2d", { willReadFrequently: true });
|
|
141
|
-
if (!context) return null;
|
|
142
|
-
return context.getImageData(0, 0, this.canvas.width, this.canvas.height);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Updates the base64 representation of the current canvas image.
|
|
146
|
-
*/
|
|
147
|
-
updateBase64Image(jpegQuality = 1) {
|
|
148
|
-
if (!this.checkCanvas()) return;
|
|
149
|
-
this.base64Image = this.canvas.toDataURL("image/jpeg", jpegQuality);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Converts the current canvas element to a base64 string.
|
|
153
|
-
*/
|
|
154
|
-
getBase64Image(jpegQuality = 1, includeDataURLPrefix = false) {
|
|
155
|
-
if (!this.checkCanvas()) return null;
|
|
156
|
-
if (this.base64Image === null) this.updateBase64Image(jpegQuality);
|
|
157
|
-
const base64Image = this.base64Image;
|
|
158
|
-
if (base64Image === null) return null;
|
|
159
|
-
if (includeDataURLPrefix) return base64Image;
|
|
160
|
-
const commaIndex = base64Image.indexOf(",");
|
|
161
|
-
if (commaIndex === -1) return base64Image;
|
|
162
|
-
return base64Image.slice(commaIndex + 1);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Sets the base64 representation of the current canvas image.
|
|
166
|
-
*/
|
|
167
|
-
setBase64Image(base64Image) {
|
|
168
|
-
this.base64Image = base64Image;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Updates the Blob representation of the current canvas image.
|
|
172
|
-
*/
|
|
173
|
-
updateBlob(jpegQuality = 1, includeDataURLPrefix = false) {
|
|
174
|
-
if (!this.checkCanvas()) return;
|
|
175
|
-
if (this.base64Image === null) this.updateBase64Image(jpegQuality);
|
|
176
|
-
const base64 = this.getBase64Image(jpegQuality, includeDataURLPrefix);
|
|
177
|
-
if (base64) this.blobData = IncodeCanvas.base64ToBlob(base64);
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Converts a base64 string to a Blob and creates a URL for it.
|
|
181
|
-
*/
|
|
182
|
-
static base64ToBlob(base64) {
|
|
183
|
-
try {
|
|
184
|
-
const binary = atob(base64);
|
|
185
|
-
const array = [];
|
|
186
|
-
for (let i = 0; i < binary.length; i++) array.push(binary.charCodeAt(i));
|
|
187
|
-
const blob = new Blob([new Uint8Array(array)]);
|
|
188
|
-
return {
|
|
189
|
-
blob,
|
|
190
|
-
url: URL.createObjectURL(blob)
|
|
191
|
-
};
|
|
192
|
-
} catch (error) {
|
|
193
|
-
console.error("Failed to convert base64 string to Blob:", error);
|
|
194
|
-
}
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Retrieves the Blob data and its URL from the current canvas.
|
|
199
|
-
*/
|
|
200
|
-
getBlobData(jpegQuality = 1, includeDataURLPrefix = false) {
|
|
201
|
-
if (!this.checkCanvas()) return null;
|
|
202
|
-
if (this.blobData === null) this.updateBlob(jpegQuality, includeDataURLPrefix);
|
|
203
|
-
return this.blobData;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Sets the Blob data of the current canvas image.
|
|
207
|
-
*/
|
|
208
|
-
async setBlobData(blobData) {
|
|
209
|
-
const blobDataArrayBuffer = await blobData.blob.arrayBuffer();
|
|
210
|
-
this.blobData = {
|
|
211
|
-
blob: new Blob([blobDataArrayBuffer], { type: blobData.blob.type }),
|
|
212
|
-
url: blobData.url
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Returns a resized canvas according to video element size.
|
|
217
|
-
*/
|
|
218
|
-
getResizedCanvas(videoElementWidth, videoElementHeight) {
|
|
219
|
-
if (!this.checkCanvas()) return null;
|
|
220
|
-
const cameraOffsetX = Math.abs(videoElementWidth - window.innerWidth);
|
|
221
|
-
const resized = new IncodeCanvas(document.createElement("canvas"));
|
|
222
|
-
const canvasHeight = this.height();
|
|
223
|
-
if (!canvasHeight) return null;
|
|
224
|
-
const ratio = canvasHeight / videoElementHeight;
|
|
225
|
-
const newWidth = window.innerWidth;
|
|
226
|
-
const newHeight = window.innerHeight;
|
|
227
|
-
resized.setWidth(newWidth);
|
|
228
|
-
resized.setHeight(newHeight);
|
|
229
|
-
const context = resized.getContext("2d");
|
|
230
|
-
if (!context) return null;
|
|
231
|
-
context.drawImage(this.canvas, ratio * cameraOffsetX / 2, 0, ratio * newWidth, ratio * newHeight, 0, 0, newWidth, newHeight);
|
|
232
|
-
return resized;
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
//#endregion
|
|
237
9
|
//#region ../infra/src/media/video.ts
|
|
238
10
|
/**
|
|
239
11
|
* Creates a hidden video element for a stream and appends it to document.body.
|
|
@@ -499,4 +271,4 @@ function createDeepsightService(config) {
|
|
|
499
271
|
}
|
|
500
272
|
|
|
501
273
|
//#endregion
|
|
502
|
-
export {
|
|
274
|
+
export { createDeepsightService as t };
|
package/dist/device.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as isIPad } from "./platform-
|
|
2
|
-
import { t as getUserAgent } from "./getBrowser-
|
|
3
|
-
import "./getDeviceClass-
|
|
4
|
-
import { t as getDeviceClass } from "./getDeviceClass-
|
|
1
|
+
import { i as isIPad } from "./platform-SKvEfCBh.esm.js";
|
|
2
|
+
import { t as getUserAgent } from "./getBrowser-C8DP7oTB.esm.js";
|
|
3
|
+
import "./getDeviceClass-C0olyNFS.esm.js";
|
|
4
|
+
import { t as getDeviceClass } from "./getDeviceClass-C8Do2qYu.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/internal/device/getBrowser.ts
|
|
7
7
|
function getBrowser() {
|