@jaak.ai/stamps 2.5.2 → 2.5.3

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.
@@ -19649,28 +19649,73 @@ const JaakStamps = class {
19649
19649
  }
19650
19650
  }
19651
19651
  async initializeVideoStream(stream) {
19652
- if (this.videoRef) {
19653
- this.videoRef.srcObject = stream;
19654
- this.videoStream = stream;
19655
- const isRear = this.cameraService.isRearCamera(stream);
19656
- this.shouldMirrorVideo = !isRear;
19657
- return new Promise((resolve) => {
19658
- this.videoRef.onloadedmetadata = async () => {
19659
- await this.videoRef.play();
19660
- this.stateManager.updateCaptureState({ isVideoActive: true });
19661
- // Recalculate mask dimensions when new camera stream loads
19662
- if (this.detectionContainer) {
19663
- const container = this.detectionContainer.parentElement;
19664
- const rect = container.getBoundingClientRect();
19665
- this.updateMaskDimensions(rect);
19666
- }
19667
- resolve();
19668
- };
19669
- });
19670
- }
19671
- else {
19652
+ if (!this.videoRef) {
19672
19653
  throw new Error('Video element not available');
19673
19654
  }
19655
+ this.videoRef.srcObject = stream;
19656
+ this.videoStream = stream;
19657
+ const isRear = this.cameraService.isRearCamera(stream);
19658
+ this.shouldMirrorVideo = !isRear;
19659
+ const LOAD_METADATA_TIMEOUT_MS = 10000;
19660
+ const finalizeStreamInitialization = async () => {
19661
+ try {
19662
+ await this.videoRef.play();
19663
+ }
19664
+ catch (playError) {
19665
+ console.error('[jaak-stamps] video.play() failed (likely autoplay policy):', playError);
19666
+ throw playError;
19667
+ }
19668
+ this.stateManager.updateCaptureState({ isVideoActive: true });
19669
+ if (this.detectionContainer) {
19670
+ const container = this.detectionContainer.parentElement;
19671
+ const rect = container.getBoundingClientRect();
19672
+ this.updateMaskDimensions(rect);
19673
+ }
19674
+ };
19675
+ // If metadata is already available (readyState >= HAVE_METADATA = 1),
19676
+ // the 'loadedmetadata' event will not fire again. Handle both cases.
19677
+ if (this.videoRef.readyState >= 1) {
19678
+ if (this.debug) {
19679
+ console.log('[JAAK-DEBUG] Video metadata already available (readyState:', this.videoRef.readyState, '), skipping event wait');
19680
+ }
19681
+ await finalizeStreamInitialization();
19682
+ return;
19683
+ }
19684
+ return new Promise((resolve, reject) => {
19685
+ let settled = false;
19686
+ const timeoutId = setTimeout(() => {
19687
+ if (settled)
19688
+ return;
19689
+ settled = true;
19690
+ this.videoRef.onloadedmetadata = null;
19691
+ this.videoRef.onerror = null;
19692
+ reject(new Error(`Video metadata load timeout after ${LOAD_METADATA_TIMEOUT_MS}ms`));
19693
+ }, LOAD_METADATA_TIMEOUT_MS);
19694
+ this.videoRef.onloadedmetadata = async () => {
19695
+ if (settled)
19696
+ return;
19697
+ settled = true;
19698
+ clearTimeout(timeoutId);
19699
+ this.videoRef.onloadedmetadata = null;
19700
+ this.videoRef.onerror = null;
19701
+ try {
19702
+ await finalizeStreamInitialization();
19703
+ resolve();
19704
+ }
19705
+ catch (err) {
19706
+ reject(err);
19707
+ }
19708
+ };
19709
+ this.videoRef.onerror = (event) => {
19710
+ if (settled)
19711
+ return;
19712
+ settled = true;
19713
+ clearTimeout(timeoutId);
19714
+ this.videoRef.onloadedmetadata = null;
19715
+ this.videoRef.onerror = null;
19716
+ reject(new Error(`Video element error: ${event}`));
19717
+ };
19718
+ });
19674
19719
  }
19675
19720
  async detectFrame() {
19676
19721
  try {
@@ -19892,7 +19937,7 @@ const JaakStamps = class {
19892
19937
  isCapturing: false
19893
19938
  };
19894
19939
  const cameraInfo = this.cameraInfoWithAutofocus;
19895
- return (index.h("div", { key: '688ceafa324ab0d67de00440e6381710f3785f5a', class: "detector-container" }, !this.licenseValid && this.licenseError && (index.h("div", { key: 'f4eb75c9da36ce781535c477be56b16d7270dcf6', class: "license-error-container" }, index.h("div", { key: '712e3b2e048f22d62890ad8ca6db458a8400f87b', class: "license-error-card" }, index.h("svg", { key: 'e1e86cc112c183729b537e8b94b9f9409c4f7969', class: "license-error-icon", width: "64", height: "64", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '4f8376df61e8ad8105d84b767c663c24fcfb47af', d: "M12 22C12 22 20 18 20 12V5L12 2L4 5V12C4 18 12 22 12 22Z", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { key: '45ca99e068518901a5d332cfdcb25b774b8e4159', d: "M12 8V12", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), index.h("circle", { key: '5f9561c5b3b1ca6bf8a9c0daeb92594f25e144ba', cx: "12", cy: "16", r: "0.5", fill: "currentColor", stroke: "currentColor", "stroke-width": "1" })), index.h("h2", { key: 'da86ee4ac849d76c4bbe19f135e5f8e0793a22f6', class: "license-error-title" }, "Licencia Requerida"), index.h("p", { key: 'ca3bc193e7145e2b68c82b56d92f6a07a4986469', class: "license-error-message" }, this.licenseError), index.h("p", { key: 'd802523e06804557a8df11c78de70317056db746', class: "license-error-help" }, "Contacte a soporte: ", index.h("a", { key: '9ace3ca5c198b95899a3128af4da3a46a7038421', href: "mailto:support@jaak.ai" }, "support@jaak.ai")), index.h("div", { key: '07f7de4b3c21a0c30f39126e8afd73da323c42e5', class: "license-error-footer" }, "JAAK Stamps")))), this.licenseValid && (index.h("div", { key: '2ef7e0747e644563b358667a328b0859e969ced2', class: "video-container" }, index.h("video", { key: 'fd4c30c9faa0029b145453a54dd1e4e72c99decc', 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: '08ae5cc6d6a643a33251cd03bb16e2e298ff8ea2', 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: {
19940
+ return (index.h("div", { key: 'd9e8fef8a096429937860396347148e6bdd06340', class: "detector-container" }, !this.licenseValid && this.licenseError && (index.h("div", { key: '7eb2f885adab60a4b8b1667bf0a362510d537794', class: "license-error-container" }, index.h("div", { key: 'af1079677131e33d5cc7698d4da03b2ba012c4bf', class: "license-error-card" }, index.h("svg", { key: 'f968e7c76c710dd8a4b6b407a026346d524740fe', class: "license-error-icon", width: "64", height: "64", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '39f44307ef8a1ef1fb786dc925fb753f647aa94c', d: "M12 22C12 22 20 18 20 12V5L12 2L4 5V12C4 18 12 22 12 22Z", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { key: '64fe021fadc616f46e69b35a7950ad503f55028a', d: "M12 8V12", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), index.h("circle", { key: 'aa86c48652cce218d24f78f49c0f32f8485184ca', cx: "12", cy: "16", r: "0.5", fill: "currentColor", stroke: "currentColor", "stroke-width": "1" })), index.h("h2", { key: 'b49877aa248f90ef207cc26a294f3f7f4f5f8e03', class: "license-error-title" }, "Licencia Requerida"), index.h("p", { key: 'fe929456590ae3ee78804613072df9c873732f99', class: "license-error-message" }, this.licenseError), index.h("p", { key: '1177a85cdd98a3dfd120043ce58256a33095d720', class: "license-error-help" }, "Contacte a soporte: ", index.h("a", { key: 'd5fe21ac8932ab88907e59775d459597cbd3b51f', href: "mailto:support@jaak.ai" }, "support@jaak.ai")), index.h("div", { key: '3b764654f555dae41581f5d855548b8f3382e0f2', class: "license-error-footer" }, "JAAK Stamps")))), this.licenseValid && (index.h("div", { key: '4051657a840db456841fdea943409f75c4c72985', class: "video-container" }, index.h("video", { key: 'aa7fb4da7f721a511f4e8bbd9d2727ff2a3c350f', 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: 'a9f5839bd5f7543f5e3e37701c95c3528d233161', 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: {
19896
19941
  position: 'absolute',
19897
19942
  left: `${box.x}px`,
19898
19943
  top: `${box.y}px`,
@@ -19901,9 +19946,9 @@ const JaakStamps = class {
19901
19946
  border: '2px solid #32406C',
19902
19947
  pointerEvents: 'none',
19903
19948
  boxSizing: 'border-box'
19904
- } })))), this.isMaskReady && (index.h("div", { key: '8aed3362a1cba7d4f013221d0f03b74dcf481c9f', class: "overlay-mask" }, index.h("div", { key: 'f0436ced815a8a5bf640d3b475c6b3214af042ec', class: "card-outline" }, index.h("div", { key: 'e72e65b5824d791fcc129af00d00f0c11a4ef547', class: "side side-top" }), index.h("div", { key: '0f6a64d0b63d528b71268d5f8a0d7b462441c3b9', class: "side side-right" }), index.h("div", { key: 'a855aaeb78ed7b493390f04583fca9fd3f70e26e', class: "side side-bottom" }), index.h("div", { key: '6b1e6ac88329a096cf22c4f28e61db8cd06e9bbc', class: "side side-left" })), !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: 'b3e66d548cb1ab9d602105f72d8e1bcfec54d33e', class: `guide-text ${this.showPerformanceMessage ? 'performance-warning-text' : ''}` }, this.getGuideText(captureState.step))), captureState.step === 'back' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: 'b27c8a1c3e4d3639d27a64e931f436ec8b67063b', class: "back-capture-section" }, index.h("div", { key: 'a16554331fc9eee781839b959a4c3b8835896b93', class: "back-capture-buttons" }, (!this.useDocumentDetector || this.performanceDegradedMode || this.showManualCaptureButton) && (index.h("button", { key: '32d16a0f2d01dc62566af7996d222f3427002af5', class: "capture-button primary-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-back' && (index.h("span", { key: 'c58a90f250a0106774383fd7fdf64f3c2bddc31b', class: "button-spinner" })), "Capturar Reverso")), index.h("button", { key: '4e71900b8792f7ea4f46964b1effa59e8c7c4a1e', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'skip-back' && (index.h("span", { key: '3fc8bfaf8434457c004fa3176fc8d8d51f12ca2d', class: "button-spinner" })), this.enableBackDocumentTimer && this.backDocumentTimerRemaining > 0
19949
+ } })))), this.isMaskReady && (index.h("div", { key: 'ad737b47a608ba2d6e43a8c41aee15ea00012966', class: "overlay-mask" }, index.h("div", { key: '70c5b2591dd75742eae22e444eab4d4368fc659d', class: "card-outline" }, index.h("div", { key: '0962f587354f4b300f6f6a1f5b9652441c3aeb5c', class: "side side-top" }), index.h("div", { key: '955d5346898f560e1e3fc854c4c339074613116c', class: "side side-right" }), index.h("div", { key: '0388ccc214b045e392c07e6e8fffe2c8d67d3582', class: "side side-bottom" }), index.h("div", { key: '718600bfad1eff4298628402190ffb34b7988afa', class: "side side-left" })), !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: '70603563d303912248bf60e1d39e06d78b3adbaf', class: `guide-text ${this.showPerformanceMessage ? 'performance-warning-text' : ''}` }, this.getGuideText(captureState.step))), captureState.step === 'back' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: 'a3639b10d52b29da6f0490356f7cdae789d62f88', class: "back-capture-section" }, index.h("div", { key: 'dd430526d6e096396d10367fd216b1c6568ce19b', class: "back-capture-buttons" }, (!this.useDocumentDetector || this.performanceDegradedMode || this.showManualCaptureButton) && (index.h("button", { key: '04b0afd7e6adc890287749add773910445ff5255', class: "capture-button primary-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-back' && (index.h("span", { key: '69022991921cbc04ab20dee2148bb95d5dd371f8', class: "button-spinner" })), "Capturar Reverso")), index.h("button", { key: 'dd698341642e875e8f252746db747ca77b2f37b0', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'skip-back' && (index.h("span", { key: 'c33706bf76eeb1ca401ea3df042e858e23d3a929', class: "button-spinner" })), this.enableBackDocumentTimer && this.backDocumentTimerRemaining > 0
19905
19950
  ? `Saltar reverso (${this.backDocumentTimerRemaining}s)`
19906
- : 'Saltar reverso')))), captureState.isVideoActive && (index.h("div", { key: '9d2bd5f8e2d20758d9ff87b230639a67d8fdae41', class: "camera-controls" }, index.h("button", { key: '487ff8e5151bde715dd00bd7688b31ba623b4c7f', 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: 'eeee411b06c3715613cbb6cf0e93d255fcac1ea6', class: "camera-selector-dropdown" }, index.h("div", { key: '5a4995c2b7951a19575735c8e768b283798f8280', class: "camera-selector-header" }, index.h("span", { key: '4b6d72d4b56671ce8c3936ccb15a6aaa27ce220c' }, "Seleccionar C\u00E1mara"), index.h("button", { key: 'a7caae51ff55e5494cc55bacf5d261a8282a550b', class: "close-selector", onClick: () => this.toggleCameraSelector(), type: "button" }, "\u00D7")), index.h("div", { key: 'c59e0105c938c60106c2764bb2793633115fdfe5', 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: '1b421328878d79031cf5565f2189e72ef5969fb7', class: "device-info" }, index.h("small", { key: '8eff3bcd2295ee817b164a53f9142d301c0b04f6' }, "Dispositivo: ", cameraInfo.deviceType)))), this.showManualCaptureButton && captureState.step === 'front' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: 'b655bc09a9054682f7a7d7b1bd169a11efac3c45', class: "manual-capture-section" }, index.h("button", { key: '73650786a96abb2e3883eb411d95aef4fb00821d', class: "manual-capture-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-front' && (index.h("span", { key: '9af39330393a1dc56dc7adf66d8d2000820ccc3d', class: "button-spinner" })), "Capturar Frente"))))), captureState.isCapturing && (index.h("div", { key: '619bdc1df901e2321842e9f51765e5f74939d043', class: "capture-animation" })), captureState.showFlipAnimation && (index.h("div", { key: 'f91616b49f53df94e19c440b04d9334111d059bb', class: "flip-animation" }, index.h("div", { key: 'da522b17c21022a12f8af69f82aac44d52bbaa71', class: "id-card-icon" }), index.h("div", { key: '29440e74bf938c11e2f743badf7f2144a986fd8a', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), captureState.showSuccessAnimation && (index.h("div", { key: '181817d898e4c2430338884b71f7ab96356972ae', class: "success-animation" }, index.h("div", { key: '6cb28526b5b9f5aac12d8328552c96233eeb4a0c', class: "check-icon" }), index.h("div", { key: '20c9a81338d6752448e4bca4c608faa3070fb64a', class: "success-text" }, "\u00A1Proceso completado!"))), index.h("div", { key: '549a6374d9491e212fd2d9fa4d240c6a348652ad', class: `component-status status-${this.currentStatus.type}` }, (this.currentStatus.type === 'loading' || this.currentStatus.type === 'initializing') && (index.h("div", { key: '7b077a21197447095a349fd625ca08eca2a9094c', class: "status-spinner" })), index.h("div", { key: 'fcff47edbac15b6cb5323efc946b7fa177b65658', class: "status-content" }, index.h("div", { key: 'a3dcdd467791c078cda33b8c75577c4cf7bb6468', class: "status-message" }, this.currentStatus.message), this.currentStatus.description && (index.h("div", { key: '4d7dd231afeeffb4dbab8a2833fdf79726326ff3', class: "status-description" }, this.currentStatus.description)))), this.debug && (index.h("div", { key: '854702ca658986c6600abf612a687ad83488f6a0', class: "performance-monitor" }, index.h("div", { key: '19bd29ac89585dafa0dde90699099b6111e6bb3b', class: "performance-expanded" }, index.h("div", { key: '08760ca40d44165994ca40b077bef0b1becec629', class: "metrics-row" }, index.h("div", { key: '5d7cc885bfd45e2d9e48f89e94faad5716870a93', class: "metric-compact" }, index.h("span", { key: '4a0040ebb932f3d9b4b167b7e91abac925644815', class: "metric-label" }, "FPS"), index.h("span", { key: '31335bb6758ffb49a267d6eea55f3dab74d3fb20', class: `metric-value ${this.performanceData.fps < 15 ? 'warning' : this.performanceData.fps < 10 ? 'danger' : 'good'}` }, this.performanceData.fps)), index.h("div", { key: 'c5ddca6673a720ccef6e1ffd431916840eb66f48', class: "metric-compact" }, index.h("span", { key: 'badf1f2858dfbf1faa4da3f575a7ba7aed19c190', class: "metric-label" }, "MEM"), index.h("span", { key: '206bf0afefeb7e4f8aec02667c8bb3b91eca2fd6', class: `metric-value ${this.performanceData.memoryUsage > 100 ? 'warning' : this.performanceData.memoryUsage > 200 ? 'danger' : 'good'}` }, this.performanceData.memoryUsage, "MB"))), index.h("div", { key: '0e12d3c961f7d4a24b860775702c735b046dfbb9', class: "metrics-row" }, index.h("div", { key: '23c16b7d5b55e2657aeef65d09968ab3279a7866', class: "metric-compact" }, index.h("span", { key: 'ad5f68534e549bf368e8da8857bb3eda707badcd', class: "metric-label" }, "INF"), index.h("span", { key: 'f53ed6bd2454f98b4a765f1af65e696ce82eea03', class: `metric-value ${this.performanceData.inferenceTime > 100 ? 'warning' : this.performanceData.inferenceTime > 200 ? 'danger' : 'good'}` }, this.performanceData.inferenceTime, "ms")), index.h("div", { key: 'bbc9ac7dbe4bb335547cc1a9ee5101c27ab80e71', class: "metric-compact" }, index.h("span", { key: '8392c0a514a4dc25b60a5843ce9563031a9245d0', class: "metric-label" }, "FRAME"), index.h("span", { key: 'd3aaca5da2db9e31f5f58d09ef9460eca5cc331c', class: `metric-value ${this.performanceData.frameProcessingTime > 50 ? 'warning' : this.performanceData.frameProcessingTime > 100 ? 'danger' : 'good'}` }, this.performanceData.frameProcessingTime, "ms"))), index.h("div", { key: 'f294351ea0a26d7309441f68eca0c6fcc048d30e', class: "metrics-row" }, index.h("div", { key: '97c2f2854b2b799e47ace3449130c7e3952bb673', class: "metric-compact" }, index.h("span", { key: '17a9e44716640663162a7eafb3bd6471adb62d37', class: "metric-label" }, "DET"), index.h("span", { key: 'd301a6decf7c25e43aaea9828be7864866fd6cae', class: "metric-value good" }, this.performanceData.successfulDetections, "/", this.performanceData.totalDetections)), index.h("div", { key: '51d3ca5308396f8e712204c366ea0c4622122dad', class: "metric-compact" }, index.h("span", { key: '064c7fe006d64de181d9fd707c74ebee11b78519', class: "metric-label" }, "RATE"), index.h("span", { key: '467e9a5b59051d172134ceab926b69c172338826', class: `metric-value ${this.performanceData.detectionRate < 30 ? 'danger' : this.performanceData.detectionRate < 60 ? 'warning' : 'good'}` }, this.performanceData.detectionRate, "%")))))), index.h("div", { key: 'ca4f45de99c4e305f872368b1a26983f4e22a368', class: "watermark" }, index.h("img", { key: 'b3854686a8b5eb959b5516100d4c792d2899db91', src: "https://static.jaak.ai/commons/powered-by-jaak.png", alt: "Powered by Jaak" }))))));
19951
+ : 'Saltar reverso')))), captureState.isVideoActive && (index.h("div", { key: 'f9c95646d564518b75d7511ef69049e82760c687', class: "camera-controls" }, index.h("button", { key: 'ff21667ee09360e13e0b7fa190eb58d4e9ab2955', 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: '1f5d7ced9311037a22402797075862c66b541201', class: "camera-selector-dropdown" }, index.h("div", { key: '38ccad6dfb46613519efac337a68ad8ed68ca585', class: "camera-selector-header" }, index.h("span", { key: 'efd67097b98bf82455703888a0294bba18084b58' }, "Seleccionar C\u00E1mara"), index.h("button", { key: 'efea962578d1ff9f4dc76e40f98b6763ab32fabd', class: "close-selector", onClick: () => this.toggleCameraSelector(), type: "button" }, "\u00D7")), index.h("div", { key: 'dc7fcc35ea20505547b9980f0793aab21635815f', 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: '450b9819604b9490c17759eb53468832abdf239c', class: "device-info" }, index.h("small", { key: '9423cb4f0f6eb767b9a9bf86412dcc74c40e3c9b' }, "Dispositivo: ", cameraInfo.deviceType)))), this.showManualCaptureButton && captureState.step === 'front' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: 'fc02b6ac27b7d239d07ea5df46136b5941a09020', class: "manual-capture-section" }, index.h("button", { key: '0e8bc7d6b2c44b66f62083bb9682880109ce1b50', class: "manual-capture-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-front' && (index.h("span", { key: 'd4067363057c004774322ae6ac4c6aac8ac4c1a7', class: "button-spinner" })), "Capturar Frente"))))), captureState.isCapturing && (index.h("div", { key: '79a88a6cf21fb0d8c2883c44fe181dc34773dae6', class: "capture-animation" })), captureState.showFlipAnimation && (index.h("div", { key: '2e8f2d1441ea6ae7e62d6cb22fb8afb25308ae5b', class: "flip-animation" }, index.h("div", { key: '449282679041e4ad1b1f48e26185b1ab1ab3be60', class: "id-card-icon" }), index.h("div", { key: 'eac0b9728eefcde854ddb1675811f91ee3161176', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), captureState.showSuccessAnimation && (index.h("div", { key: '521094652be1010ebb740ef3278649bc0077fbfa', class: "success-animation" }, index.h("div", { key: 'e9b425d4c039f7267ecb7e3005506f07706f9054', class: "check-icon" }), index.h("div", { key: '4859b32d3219e325afa326651f21ce3663d9c0b8', class: "success-text" }, "\u00A1Proceso completado!"))), index.h("div", { key: '8fff23c16b531dda94a087a3ef3fe4ef0b6a51e4', class: `component-status status-${this.currentStatus.type}` }, (this.currentStatus.type === 'loading' || this.currentStatus.type === 'initializing') && (index.h("div", { key: 'e7139e242d3be20012efe25d808990fc9631492f', class: "status-spinner" })), index.h("div", { key: '935075ef8c1a7321e445578cdf918471e0f6e01c', class: "status-content" }, index.h("div", { key: '0f4910657f11df16d6cec635fdeb3864888ed55c', class: "status-message" }, this.currentStatus.message), this.currentStatus.description && (index.h("div", { key: 'c362a69bed2503ecb4456b183876a5ea0645cc71', class: "status-description" }, this.currentStatus.description)))), this.debug && (index.h("div", { key: '04d2a4d664742ca110f562fa599b118fa5e7a282', class: "performance-monitor" }, index.h("div", { key: '30c37005f87500d487e23cb87dd66973ce30bcfa', class: "performance-expanded" }, index.h("div", { key: '647c87a140f7ea8b39348402e0355b3b15ac9616', class: "metrics-row" }, index.h("div", { key: '99f886b025473adcd69b42aca61f7aa8158d13cf', class: "metric-compact" }, index.h("span", { key: '69215c74430c502fa51402e1fcf46d31b89b34f2', class: "metric-label" }, "FPS"), index.h("span", { key: '27283246a143119a4a8f0e63a8ee335f76868c46', class: `metric-value ${this.performanceData.fps < 15 ? 'warning' : this.performanceData.fps < 10 ? 'danger' : 'good'}` }, this.performanceData.fps)), index.h("div", { key: '6843f5f79d3e54643c6515e509364b4fa3fc032f', class: "metric-compact" }, index.h("span", { key: '20e83d94bf0a76e89a47b3d682e5c5c27ee94792', class: "metric-label" }, "MEM"), index.h("span", { key: '68922415fd8ba5ebf797f52026ecd0cf2abf861e', class: `metric-value ${this.performanceData.memoryUsage > 100 ? 'warning' : this.performanceData.memoryUsage > 200 ? 'danger' : 'good'}` }, this.performanceData.memoryUsage, "MB"))), index.h("div", { key: 'be6bb0a65bfc5bd16d6948f347756732918f80d1', class: "metrics-row" }, index.h("div", { key: 'c07a3723b79743697230a11267a6b2c8a847a86b', class: "metric-compact" }, index.h("span", { key: '2f2c75418ed31ba22f80112f6c02bdc32a1bc7e3', class: "metric-label" }, "INF"), index.h("span", { key: '788aa1a4220f0150c5ce77127d75be64104591c1', class: `metric-value ${this.performanceData.inferenceTime > 100 ? 'warning' : this.performanceData.inferenceTime > 200 ? 'danger' : 'good'}` }, this.performanceData.inferenceTime, "ms")), index.h("div", { key: '23bdf32e7ee8533c3327b271bd0cec93551f7c8e', class: "metric-compact" }, index.h("span", { key: '1d63525671ef0e99072d472f6bbe45919694ca98', class: "metric-label" }, "FRAME"), index.h("span", { key: '834f075061da75860a481142defddcd3973a2641', class: `metric-value ${this.performanceData.frameProcessingTime > 50 ? 'warning' : this.performanceData.frameProcessingTime > 100 ? 'danger' : 'good'}` }, this.performanceData.frameProcessingTime, "ms"))), index.h("div", { key: '2767844f849c3a8217dce6d44180b5db604284d9', class: "metrics-row" }, index.h("div", { key: '78e4ae2297c867c7036186bb9871800b57e6cd50', class: "metric-compact" }, index.h("span", { key: '9fd42d1a4c18ead68ee81bc72dddb98dcd09952c', class: "metric-label" }, "DET"), index.h("span", { key: '0e3c0bbf718b21c3c20ae2e68c6f1e8f5dea0624', class: "metric-value good" }, this.performanceData.successfulDetections, "/", this.performanceData.totalDetections)), index.h("div", { key: '41be4df95b8745706e9b98d28cefb758e9e6b65f', class: "metric-compact" }, index.h("span", { key: '520b7e3d4841c0865c3643c5db33f0a762e550e7', class: "metric-label" }, "RATE"), index.h("span", { key: 'fe56fdd018002bce4e0efc5059cbc6562edee17f', class: `metric-value ${this.performanceData.detectionRate < 30 ? 'danger' : this.performanceData.detectionRate < 60 ? 'warning' : 'good'}` }, this.performanceData.detectionRate, "%")))))), index.h("div", { key: '3c7b83cf7bfd1f42198edd1029f03b7c68f7766f', class: "watermark" }, index.h("img", { key: '5684517b58bafeffdbe6533c4dcc3ef36bec0b6c', src: "https://static.jaak.ai/commons/powered-by-jaak.png", alt: "Powered by Jaak" }))))));
19907
19952
  }
19908
19953
  // Utility methods
19909
19954
  updateDetectionBoxes(boxes) {