@jaak.ai/stamps 2.1.0-dev.4 → 2.1.0-dev.5
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/cjs/jaak-stamps.cjs.entry.js +3 -15
- package/dist/cjs/jaak-stamps.cjs.entry.js.map +1 -1
- package/dist/cjs/jaak-stamps.entry.cjs.js.map +1 -1
- package/dist/collection/components/my-component/my-component.js +3 -15
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/components/jaak-stamps.js +3 -15
- package/dist/components/jaak-stamps.js.map +1 -1
- package/dist/esm/jaak-stamps.entry.js +3 -15
- package/dist/esm/jaak-stamps.entry.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps-webcomponent.esm.js +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps.entry.esm.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/{p-091d609b.entry.js → p-c08802a9.entry.js} +2 -2
- package/dist/jaak-stamps-webcomponent/p-c08802a9.entry.js.map +1 -0
- package/package.json +1 -1
- package/dist/jaak-stamps-webcomponent/p-091d609b.entry.js.map +0 -1
|
@@ -1593,7 +1593,6 @@ const JaakStamps = class {
|
|
|
1593
1593
|
await this.detectionService.loadModel();
|
|
1594
1594
|
}
|
|
1595
1595
|
catch (modelError) {
|
|
1596
|
-
console.error('Error cargando modelo de detección:', modelError);
|
|
1597
1596
|
this.switchToManualModeWithError('Error al cargar modelo de detección');
|
|
1598
1597
|
throw modelError;
|
|
1599
1598
|
}
|
|
@@ -1602,7 +1601,6 @@ const JaakStamps = class {
|
|
|
1602
1601
|
await this.detectionService.loadClassificationModel();
|
|
1603
1602
|
}
|
|
1604
1603
|
catch (classificationError) {
|
|
1605
|
-
console.error('Error cargando modelo de clasificación:', classificationError);
|
|
1606
1604
|
this.switchToManualModeWithError('Error al cargar modelo de clasificación');
|
|
1607
1605
|
throw classificationError;
|
|
1608
1606
|
}
|
|
@@ -1726,7 +1724,6 @@ const JaakStamps = class {
|
|
|
1726
1724
|
await this.detectionService.loadModel();
|
|
1727
1725
|
}
|
|
1728
1726
|
catch (modelError) {
|
|
1729
|
-
console.error('Error cargando modelo de detección:', modelError);
|
|
1730
1727
|
this.switchToManualModeWithError('Error al cargar modelo de detección');
|
|
1731
1728
|
throw modelError;
|
|
1732
1729
|
}
|
|
@@ -1735,7 +1732,6 @@ const JaakStamps = class {
|
|
|
1735
1732
|
await this.detectionService.loadClassificationModel();
|
|
1736
1733
|
}
|
|
1737
1734
|
catch (classificationError) {
|
|
1738
|
-
console.error('Error cargando modelo de clasificación:', classificationError);
|
|
1739
1735
|
this.switchToManualModeWithError('Error al cargar modelo de clasificación');
|
|
1740
1736
|
throw classificationError;
|
|
1741
1737
|
}
|
|
@@ -1851,7 +1847,6 @@ const JaakStamps = class {
|
|
|
1851
1847
|
inputTensor = this.detectionService.preprocess(this.videoRef);
|
|
1852
1848
|
}
|
|
1853
1849
|
catch (preprocessError) {
|
|
1854
|
-
console.error('Error en preprocesamiento:', preprocessError);
|
|
1855
1850
|
this.switchToManualModeWithError('Error al procesar imagen');
|
|
1856
1851
|
return;
|
|
1857
1852
|
}
|
|
@@ -1861,7 +1856,6 @@ const JaakStamps = class {
|
|
|
1861
1856
|
inferenceTime = performance.now() - inferenceStartTime;
|
|
1862
1857
|
}
|
|
1863
1858
|
catch (inferenceError) {
|
|
1864
|
-
console.error('Error en inferencia ONNX:', inferenceError);
|
|
1865
1859
|
this.switchToManualModeWithError('Error en detección automática');
|
|
1866
1860
|
return;
|
|
1867
1861
|
}
|
|
@@ -1986,7 +1980,7 @@ const JaakStamps = class {
|
|
|
1986
1980
|
isCapturing: false
|
|
1987
1981
|
};
|
|
1988
1982
|
const cameraInfo = this.cameraInfoWithAutofocus;
|
|
1989
|
-
return (h("div", { key: '
|
|
1983
|
+
return (h("div", { key: '687a01ebb87f3c9e4424f4bcd355cd68c21366f0', class: "detector-container" }, h("div", { key: 'd4c9f1fbf653ea7764dcc7265f5f7180c99fe5e7', class: "video-container" }, h("video", { key: '37a159daaaa4682d8e14a1dcdef32225706e1f20', ref: el => this.videoRef = el, autoplay: true, muted: true, playsinline: true, class: this.shouldMirrorVideo ? 'mirror' : '', style: { display: captureState.isVideoActive ? 'block' : 'none' } }), h("div", { key: '74fe5c8612be7a8d904510c226d68a6860a0f67d', ref: el => this.detectionContainer = el, class: `detection-overlay ${this.shouldMirrorVideo ? 'mirror' : ''}` }, this.debug && this.detectionBoxes.map((box, index) => (h("div", { key: index, class: "detection-box", style: {
|
|
1990
1984
|
position: 'absolute',
|
|
1991
1985
|
left: `${box.x}px`,
|
|
1992
1986
|
top: `${box.y}px`,
|
|
@@ -1995,9 +1989,9 @@ const JaakStamps = class {
|
|
|
1995
1989
|
border: '2px solid #32406C',
|
|
1996
1990
|
pointerEvents: 'none',
|
|
1997
1991
|
boxSizing: 'border-box'
|
|
1998
|
-
} })))), this.isMaskReady && (h("div", { key: '
|
|
1992
|
+
} })))), this.isMaskReady && (h("div", { key: '4f2e282a8eb99947b1e67690ef236019e87ad87e', class: "overlay-mask" }, h("div", { key: '1d102684d59e5f7f5d6243f95e39ee0e1812032e', class: "card-outline" }, h("div", { key: '4ba0df1528de02cc037022948e425ffb13c49822', class: "side side-top" }), h("div", { key: '36bc3f2d39f61d39af2522ffe13b6df16c8bf00b', class: "side side-right" }), h("div", { key: '88d2402044de0309055c31fd98e596b88b1d51ce', class: "side side-bottom" }), h("div", { key: '72262621ee2c2b4824f3b313f27a5793fa4c123f', class: "side side-left" })), !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: 'df9320c0f5518c04b1504d355223730e6d686779', class: `guide-text ${this.showPerformanceMessage ? 'performance-warning-text' : ''}` }, this.getGuideText(captureState.step))), captureState.step === 'back' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: 'e86f6eec1ea7712fb8c94d1455dd9c0c7c01db21', class: "back-capture-section" }, h("div", { key: 'ad965847b25eeae92eb22c3d89b09e953fabb2d2', class: "back-capture-buttons" }, (!this.useDocumentDetector || this.performanceDegradedMode) && (h("button", { key: '3e57f0bf7600bc650e44f40e3c1fd13747885781', class: "capture-button primary-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: captureState.isCapturing }, captureState.isCapturing ? 'Capturando...' : 'Capturar Reverso')), h("button", { key: 'd598cd7778869b46b5c7ceafcb43c469b4b5c7e7', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button" }, this.enableBackDocumentTimer && this.backDocumentTimerRemaining > 0
|
|
1999
1993
|
? `Saltar reverso (${this.backDocumentTimerRemaining}s)`
|
|
2000
|
-
: 'Saltar reverso')))), captureState.isVideoActive && (h("div", { key: '
|
|
1994
|
+
: 'Saltar reverso')))), captureState.isVideoActive && (h("div", { key: 'b1508382d2b75584a19dade3f8e685a34ff2c3a3', class: "camera-controls" }, h("button", { key: '9c1f945b051f8e000f87fb3674ecfd386bdc2208', class: `camera-selector-button ${this.isSwitchingCamera ? 'loading' : ''}`, onClick: () => this.toggleCameraSelector(), type: "button", title: "Seleccionar c\u00E1mara", disabled: this.isSwitchingCamera }, this.isSwitchingCamera ? (h("div", { class: "button-spinner" })) : ('Cámaras')))), this.showCameraSelector && cameraInfo.availableCameras.length > 0 && (h("div", { key: '4adab3b896be86322be168db377cbacbcb3a7422', class: "camera-selector-dropdown" }, h("div", { key: 'a60e3f46cfe5997cf9b82d685a1574b7002c0071', class: "camera-selector-header" }, h("span", { key: '71e012a8a4953f584aeffc985040e434fadfb00b' }, "Seleccionar C\u00E1mara"), h("button", { key: '046ee4f6d81b34349ecad4e9de98f4d8653dad6b', class: "close-selector", onClick: () => this.toggleCameraSelector(), type: "button" }, "\u00D7")), h("div", { key: '539ad135914d9ceb3a6b9a2de2d9ae4ea7a996b3', class: "camera-list" }, cameraInfo.availableCameras.map((camera) => (h("button", { key: camera.id, class: `camera-option ${cameraInfo.selectedCameraId === camera.id ? 'selected' : ''}`, onClick: () => this.handleCameraSwitch(camera.id), type: "button" }, h("span", { class: "camera-label" }, camera.label || `Cámara ${cameraInfo.availableCameras.indexOf(camera) + 1}`, camera.hasAutofocus && (h("span", { class: "autofocus-icon", title: "Autofoco disponible" }, "\u29BF"))), cameraInfo.selectedCameraId === camera.id && (h("span", { class: "selected-indicator" }, "\u2713")))))), h("div", { key: '082d1cc259af3c1fc95b53da1e754382e874b837', class: "device-info" }, h("small", { key: 'dad398582ac7bfd31ee43704d47fd3036fc59d06' }, "Dispositivo: ", cameraInfo.deviceType)))), this.showManualCaptureButton && captureState.step === 'front' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '231ff3eb4672b4ac310419cccc8cd6d1caab9e14', class: "manual-capture-section" }, h("button", { key: 'fa2fcc4bfe63bf2ccdba2c2ad3c8c4b4a5aabbb5', class: "manual-capture-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: captureState.isCapturing }, captureState.isCapturing ? 'Capturando...' : 'Capturar Frente'))))), captureState.isCapturing && (h("div", { key: '39426754973f1a9e07b56399f344add21bf9b848', class: "capture-animation" })), captureState.showFlipAnimation && (h("div", { key: '307a7eb06b41a8baebe37ad26b1f5e4cf0a43ec1', class: "flip-animation" }, h("div", { key: '7070ad263e3894dc1488bb8a17f5bf23b7b757f0', class: "id-card-icon" }), h("div", { key: '81a0d8b6377b397bbeebe2e31800fe88f88593a0', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), captureState.showSuccessAnimation && (h("div", { key: '741e5043bd57a3e13e39fd897a64cd20a75dad2e', class: "success-animation" }, h("div", { key: '6269a51c0651e5f76490906e50eb111f6a88f267', class: "check-icon" }), h("div", { key: '1c90a9cf6c90bb10af90660c714b7ff1ed6acfa0', class: "success-text" }, "\u00A1Proceso completado!"))), h("div", { key: 'f6746c1fb15cc238846f047743a9d45b1d4a41f8', class: `component-status status-${this.currentStatus.type}` }, (this.currentStatus.type === 'loading' || this.currentStatus.type === 'initializing') && (h("div", { key: '00d198abdc90683e5f05a9fd9b54d44e55c16630', class: "status-spinner" })), h("div", { key: 'b0254dea36bae65692bfbd200dfb75eb5a3a50dc', class: "status-content" }, h("div", { key: 'e3e48ea04f40ddd7c66aa8eda3d341f24a9c3dc4', class: "status-message" }, this.currentStatus.message), this.currentStatus.description && (h("div", { key: 'd3f40ca5b72a661f9631145880fc6d1bba878961', class: "status-description" }, this.currentStatus.description)))), this.debug && (h("div", { key: 'eabe40809e744eb62b2ac76733952060988b675c', class: "performance-monitor" }, h("div", { key: '44e51257d4ba2c2153749cf14f3aebbf22ca02ec', class: "performance-expanded" }, h("div", { key: '493fc680db2d1e82068eadda3786fad57e8594cc', class: "metrics-row" }, h("div", { key: 'aaa734d066246c9364d51c04d41a0a84d0b7e216', class: "metric-compact" }, h("span", { key: 'f0b59f76e8aa1723a429289b7898d35f22ff86d4', class: "metric-label" }, "FPS"), h("span", { key: 'a562359df92cabe40f54b355ffa264f246e7ec8e', class: `metric-value ${this.performanceData.fps < 15 ? 'warning' : this.performanceData.fps < 10 ? 'danger' : 'good'}` }, this.performanceData.fps)), h("div", { key: '9adca77e934ee3cd07fb54a056132e305637848c', class: "metric-compact" }, h("span", { key: '65ec83dca0e74b42065962d2a2e4bae7515b9fc1', class: "metric-label" }, "MEM"), h("span", { key: '427fc6b5b538742d0987b0240f526616b910ae69', class: `metric-value ${this.performanceData.memoryUsage > 100 ? 'warning' : this.performanceData.memoryUsage > 200 ? 'danger' : 'good'}` }, this.performanceData.memoryUsage, "MB"))), h("div", { key: 'fc551d8ef39308980437b72b3fb4c0bdb2bfbf67', class: "metrics-row" }, h("div", { key: 'b88785c108e5586fecc8702f3e4da883ace00f15', class: "metric-compact" }, h("span", { key: '31db440861e6fd9c2ee36ccd242f1b7bb3d47f45', class: "metric-label" }, "INF"), h("span", { key: 'af45bbb41110a04ed3d22a9e112b8644dd7ec355', class: `metric-value ${this.performanceData.inferenceTime > 100 ? 'warning' : this.performanceData.inferenceTime > 200 ? 'danger' : 'good'}` }, this.performanceData.inferenceTime, "ms")), h("div", { key: 'deabe5ce0661557fabe4ccdde1af48beed564ad9', class: "metric-compact" }, h("span", { key: '072f9159e95b3f3226f07b879b377a3d34940825', class: "metric-label" }, "FRAME"), h("span", { key: '841de1ae8df76919c2b644c6ff813dd927b52013', class: `metric-value ${this.performanceData.frameProcessingTime > 50 ? 'warning' : this.performanceData.frameProcessingTime > 100 ? 'danger' : 'good'}` }, this.performanceData.frameProcessingTime, "ms"))), h("div", { key: '68c6c777db1430987f20536849a3ed9169ec794a', class: "metrics-row" }, h("div", { key: '736e361beaa88d268041ec55fd73db0ee405e1ae', class: "metric-compact" }, h("span", { key: 'bfa6c3aa54a96e5eab32dc4fa0227ca836142561', class: "metric-label" }, "DET"), h("span", { key: 'f9a2479c470779403bf1cbfd4f433f80e5fa34d8', class: "metric-value good" }, this.performanceData.successfulDetections, "/", this.performanceData.totalDetections)), h("div", { key: 'bfc1d7f8cbc7449a96e751b005a02bb112e63a86', class: "metric-compact" }, h("span", { key: '45a7171a72ac6ae9c29a4de3c7a260ae78681dc1', class: "metric-label" }, "RATE"), h("span", { key: '7419ace73d0302d662b3a6308f313be271049b5a', class: `metric-value ${this.performanceData.detectionRate < 30 ? 'danger' : this.performanceData.detectionRate < 60 ? 'warning' : 'good'}` }, this.performanceData.detectionRate, "%")))))), h("div", { key: '786544dff913bb4b1003e62d9ab35b3f29f4b497', class: "watermark" }, h("img", { key: 'e08c893afa8bad94d04b01ea4732044b1c9a2d6c', src: "https://storage.googleapis.com/jaak-static/commons/powered-by-jaak.png", alt: "Powered by Jaak" })))));
|
|
2001
1995
|
}
|
|
2002
1996
|
// Utility methods
|
|
2003
1997
|
updateDetectionBoxes(boxes) {
|
|
@@ -2195,7 +2189,6 @@ const JaakStamps = class {
|
|
|
2195
2189
|
}
|
|
2196
2190
|
}
|
|
2197
2191
|
catch (classifyError) {
|
|
2198
|
-
console.error('Error clasificando documento:', classifyError);
|
|
2199
2192
|
// No cambiar a manual aquí, solo registrar el error y continuar
|
|
2200
2193
|
}
|
|
2201
2194
|
}
|
|
@@ -2266,7 +2259,6 @@ const JaakStamps = class {
|
|
|
2266
2259
|
}
|
|
2267
2260
|
}
|
|
2268
2261
|
catch (classifyError) {
|
|
2269
|
-
console.error('Error clasificando documento:', classifyError);
|
|
2270
2262
|
// No cambiar a manual aquí, solo registrar el error y continuar
|
|
2271
2263
|
}
|
|
2272
2264
|
}
|
|
@@ -2325,7 +2317,6 @@ const JaakStamps = class {
|
|
|
2325
2317
|
}
|
|
2326
2318
|
// Método para cambiar a modo manual por errores de ONNX
|
|
2327
2319
|
switchToManualModeWithError(errorMessage) {
|
|
2328
|
-
console.error(`[ONNX Error] ${errorMessage}`);
|
|
2329
2320
|
// Solo cambiar si el detector está habilitado y no se ha cambiado ya
|
|
2330
2321
|
if (!this.useDocumentDetector || this.hasAutoSwitchedToManual) {
|
|
2331
2322
|
return;
|
|
@@ -2350,16 +2341,13 @@ const JaakStamps = class {
|
|
|
2350
2341
|
}
|
|
2351
2342
|
// Método para liberar recursos de ONNX cuando se cambia a modo manual
|
|
2352
2343
|
releaseOnnxResources() {
|
|
2353
|
-
console.log('[ONNX] Liberando recursos de modelos ONNX...');
|
|
2354
2344
|
try {
|
|
2355
2345
|
// Liberar recursos del servicio de detección
|
|
2356
2346
|
if (this.detectionService) {
|
|
2357
2347
|
this.detectionService.cleanup();
|
|
2358
|
-
console.log('[ONNX] Recursos de ONNX liberados exitosamente');
|
|
2359
2348
|
}
|
|
2360
2349
|
}
|
|
2361
2350
|
catch (error) {
|
|
2362
|
-
console.error('[ONNX] Error al liberar recursos:', error);
|
|
2363
2351
|
}
|
|
2364
2352
|
}
|
|
2365
2353
|
completeProcess(skippedBack = false) {
|