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