@jaak.ai/stamps 2.2.0-dev.5 → 2.2.0-dev.9

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.
@@ -186,6 +186,10 @@ export class JaakStamps {
186
186
  this.detectionService = this.serviceContainer.getDetectionService();
187
187
  this.tracingService = this.serviceContainer.getTracingService();
188
188
  this.metricsService = this.serviceContainer.getMetricsService();
189
+ // Set the custom trace ID if provided via prop
190
+ if (this.tracingService && this.traceId) {
191
+ this.tracingService.setSessionTraceId(this.traceId);
192
+ }
189
193
  // Record component initialization
190
194
  if (this.tracingService) {
191
195
  const span = this.tracingService.startSpan('component.initialize', {
@@ -1129,7 +1133,7 @@ export class JaakStamps {
1129
1133
  isCapturing: false
1130
1134
  };
1131
1135
  const cameraInfo = this.cameraInfoWithAutofocus;
1132
- return (h("div", { key: '69b36b10f1a790caa352acd5e149fe012ddebd3d', class: "detector-container" }, !this.licenseValid && this.licenseError && (h("div", { key: 'b96d8b52f6bb366b1d6239922a95b100befa5735', class: "license-error-container" }, h("div", { key: '58fb20b1acae97631c35730ed395acf9fa583df2', class: "license-error-card" }, h("svg", { key: 'f2726621e000bad3c62b1106778bb50e32ece973', class: "license-error-icon", width: "64", height: "64", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '18a51f219cdc93f717867f61502c55b35d250532', 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" }), h("path", { key: '0f157178a69c10590dd55f55c2223fdef31c2569', d: "M12 8V12", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), h("circle", { key: '0352746bef8e2e5a6be0c3868406005aae574a71', cx: "12", cy: "16", r: "0.5", fill: "currentColor", stroke: "currentColor", "stroke-width": "1" })), h("h2", { key: 'c63de740aa94503f1cf5e1cd1b366b11bc3253b3', class: "license-error-title" }, "Licencia Requerida"), h("p", { key: 'e36cefd08b510fc38f326de557ffc16425a0b324', class: "license-error-message" }, this.licenseError), h("p", { key: 'c77c6545b5186f7fb77a414120d3f6f5ba4a45f0', class: "license-error-help" }, "Contacte a soporte: ", h("a", { key: 'bef70b41a7ec454bed38c4162ce3cafc02c81071', href: "mailto:support@jaak.ai" }, "support@jaak.ai")), h("div", { key: '7fd679252453474021494c8dac3ec44da60b40eb', class: "license-error-footer" }, "JAAK Stamps")))), this.licenseValid && (h("div", { key: '369edcb3d7fcaa18059ae89f340f5e65bd0f0785', class: "video-container" }, h("video", { key: '88a67cf2451ebd53cb4fa709d34d11c7fa98cfc9', ref: el => this.videoRef = el, autoplay: true, muted: true, playsinline: true, class: this.shouldMirrorVideo ? 'mirror' : '', style: { display: captureState.isVideoActive ? 'block' : 'none' } }), h("div", { key: 'd309664c7a9e64f33dd45e0925f27768483b6795', 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: {
1136
+ return (h("div", { key: 'a52b452a7aef6574a5e4b74a88c7bd3f9d45fd15', class: "detector-container" }, !this.licenseValid && this.licenseError && (h("div", { key: '18a99579e0b74ceb2cf1c4c3e21a864d2ec7d944', class: "license-error-container" }, h("div", { key: '3431722f4f47824c172a5b6f3a2ad9bd3bf377f2', class: "license-error-card" }, h("svg", { key: 'bf3854de3ba865a58c5c91cfd7a85d3d725be0df', class: "license-error-icon", width: "64", height: "64", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '209e3a2a22333ec90e102a7156eb644b529f47c7', 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" }), h("path", { key: '7b0dc1cd29a9055e552885b23f4537c19932556d', d: "M12 8V12", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), h("circle", { key: '8ea686ebfb31a5744303f313fd104c03c02a5472', cx: "12", cy: "16", r: "0.5", fill: "currentColor", stroke: "currentColor", "stroke-width": "1" })), h("h2", { key: '7e0ec3ec23b80176cbec9c706999746d62486f3c', class: "license-error-title" }, "Licencia Requerida"), h("p", { key: '261a91e2c20feb09319dc4f319fb79611cc36a46', class: "license-error-message" }, this.licenseError), h("p", { key: '2e3cc8da0f4a8ebfd52db469b0f0900514d1d7f8', class: "license-error-help" }, "Contacte a soporte: ", h("a", { key: '283eea87e2f69dce1ea7376e3a63fed780633499', href: "mailto:support@jaak.ai" }, "support@jaak.ai")), h("div", { key: 'b4227ed25a4fb4d953c753671d27ac8c931a435f', class: "license-error-footer" }, "JAAK Stamps")))), this.licenseValid && (h("div", { key: 'cb33431cf6992f6e7466273406f729c42c1cbcdb', class: "video-container" }, h("video", { key: 'b44befd61ad616fd36fe1e98fd089a2443bc65b6', ref: el => this.videoRef = el, autoplay: true, muted: true, playsinline: true, class: this.shouldMirrorVideo ? 'mirror' : '', style: { display: captureState.isVideoActive ? 'block' : 'none' } }), h("div", { key: '8cee95ddab5f771a87d43fa434a3ba0c241d2f3e', 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: {
1133
1137
  position: 'absolute',
1134
1138
  left: `${box.x}px`,
1135
1139
  top: `${box.y}px`,
@@ -1138,9 +1142,9 @@ export class JaakStamps {
1138
1142
  border: '2px solid #32406C',
1139
1143
  pointerEvents: 'none',
1140
1144
  boxSizing: 'border-box'
1141
- } })))), this.isMaskReady && (h("div", { key: 'fbfc808e22ec640ddd9e34d52fab476d7a9becc1', class: "overlay-mask" }, h("div", { key: '40846a04d852bbcc2ac6c4a0ca356adae1c67765', class: "card-outline" }, h("div", { key: '452fe1786b67d0f9194e5d03ad2aaee08868a5fd', class: "side side-top" }), h("div", { key: 'a462c388ea55cd022b9616571f0012bd5eb380d4', class: "side side-right" }), h("div", { key: 'bfa2232443e23f2e72f009c62f7a866b9ff1b084', class: "side side-bottom" }), h("div", { key: '581746eca6fde6340d78e8ab48d6e21d17e7dfd3', class: "side side-left" })), !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '8e57ac550ea3718322ba954682f93239acbabc78', class: `guide-text ${this.showPerformanceMessage ? 'performance-warning-text' : ''}` }, this.getGuideText(captureState.step))), captureState.step === 'back' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '81cfab68789796d901afadc895d28f398e8c15cf', class: "back-capture-section" }, h("div", { key: 'd80455bd916c2d7ac47eb0ce3c62b0e5efbe4dff', class: "back-capture-buttons" }, (!this.useDocumentDetector || this.performanceDegradedMode || this.showManualCaptureButton) && (h("button", { key: 'c6d427cb32ecfb1ff40150d39f1d8ad7565f7156', class: "capture-button primary-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-back' && (h("span", { key: 'cb57aec75ff91f2887fa258bd79b8efb98614d13', class: "button-spinner" })), "Capturar Reverso")), h("button", { key: 'c76f356a34fcbc790ebe2d900ed61cc4a6a02e28', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'skip-back' && (h("span", { key: 'd8fe69623902a5f41587f630552ef28a352733c6', class: "button-spinner" })), this.enableBackDocumentTimer && this.backDocumentTimerRemaining > 0
1145
+ } })))), this.isMaskReady && (h("div", { key: '00a749ad234294695d9a292911b41fdacafd219a', class: "overlay-mask" }, h("div", { key: 'e344df8a709fca5225985ccc9f8def75ddbd393c', class: "card-outline" }, h("div", { key: '2dcae9e414f2b7131397d49a3d5ecabfc7cd5eb8', class: "side side-top" }), h("div", { key: '48ac3f06fa4a2c83741df378719911f682811caa', class: "side side-right" }), h("div", { key: '238a3269b2a12d528e8a1889d3109ee319c7fd88', class: "side side-bottom" }), h("div", { key: 'b02eec6c102d7e9fb03ef24dfce7c75e081ff1c4', class: "side side-left" })), !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '15588129ca8027a6ec1c81d70001142986966826', class: `guide-text ${this.showPerformanceMessage ? 'performance-warning-text' : ''}` }, this.getGuideText(captureState.step))), captureState.step === 'back' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: 'f15fd9bddc20c54afcca7be79c3cf2f9ee2b74f7', class: "back-capture-section" }, h("div", { key: 'e3284e1301840a9555857fa879de9f4ca91dc21b', class: "back-capture-buttons" }, (!this.useDocumentDetector || this.performanceDegradedMode || this.showManualCaptureButton) && (h("button", { key: '8508d13e117deb3b223308497b1db976643b86f2', class: "capture-button primary-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-back' && (h("span", { key: '99bd464541d9ee8589bc11e937c5ad6bca9d95c8', class: "button-spinner" })), "Capturar Reverso")), h("button", { key: '3de5f0a142f9dfdfe4578c0fcbe004bb5fe94c56', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'skip-back' && (h("span", { key: '268ce949bf5155b3729298f23eea0d7ec15b3590', class: "button-spinner" })), this.enableBackDocumentTimer && this.backDocumentTimerRemaining > 0
1142
1146
  ? `Saltar reverso (${this.backDocumentTimerRemaining}s)`
1143
- : 'Saltar reverso')))), captureState.isVideoActive && (h("div", { key: '08f4037c20b4dfed59553a7f29474940f5f3eb49', class: "camera-controls" }, h("button", { key: 'e873835d5d6587b19eb5e61e0073e4992fe115b6', 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: '8fca7e29f868570bb99dd2d09ca7da807656dad0', class: "camera-selector-dropdown" }, h("div", { key: 'abfac31042d3b362c094a297429e0272dabb2511', class: "camera-selector-header" }, h("span", { key: 'ffcd0e3c262aa86c431617568c1070548d88f38a' }, "Seleccionar C\u00E1mara"), h("button", { key: '8351be02ccbfa818cab352a37a29d2cd5bfd53ef', class: "close-selector", onClick: () => this.toggleCameraSelector(), type: "button" }, "\u00D7")), h("div", { key: 'b42d7a5855ec2f76bc105f7b03369b3d4c950762', 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: 'cf3ca9fe1d626320ad2653a3db44cd86e998bcdf', class: "device-info" }, h("small", { key: '9b908dc6e759f1a5311b068dba10428ebd22cdc3' }, "Dispositivo: ", cameraInfo.deviceType)))), this.showManualCaptureButton && captureState.step === 'front' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '9aa48412eaac0b2adf19f1defb3bc835ab031d9f', class: "manual-capture-section" }, h("button", { key: '1828e293ae4e544b00d0dd17a86401ff0436de37', class: "manual-capture-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-front' && (h("span", { key: 'bbea1d654f80e537ff6616920fb6a2cb410e55f0', class: "button-spinner" })), "Capturar Frente"))))), captureState.isCapturing && (h("div", { key: '532f72395868ecf58bef350aed4da4e4fc0fa13c', class: "capture-animation" })), captureState.showFlipAnimation && (h("div", { key: '555cbc7504660b722f23389899956cf979a27e6c', class: "flip-animation" }, h("div", { key: 'e5de939b02cfb65697c70f265492f1f30f75c771', class: "id-card-icon" }), h("div", { key: '35867c2fbdf463d5b28f0bd3a58313d0d6f15e7b', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), captureState.showSuccessAnimation && (h("div", { key: '4a96d077e993012ed333384219ba27d5a68787ea', class: "success-animation" }, h("div", { key: '836809412d0674a0061aadaaa7c712a22f8770da', class: "check-icon" }), h("div", { key: 'd541dbdfa548760b196dd09dc44c3d1a6af8093c', class: "success-text" }, "\u00A1Proceso completado!"))), h("div", { key: '89a9d99fbeedff1bbcf723ba13d551c3290150fe', class: `component-status status-${this.currentStatus.type}` }, (this.currentStatus.type === 'loading' || this.currentStatus.type === 'initializing') && (h("div", { key: 'f100984baef7602ea40cea9bb74b4c84fd1f6ed9', class: "status-spinner" })), h("div", { key: 'ad4161c71f438174117e306e5084bfdff3d18dce', class: "status-content" }, h("div", { key: '26310245b58f331075dd344a6497e90631d5d78c', class: "status-message" }, this.currentStatus.message), this.currentStatus.description && (h("div", { key: 'f739148b45f7d43a3015cca3de8efc8b71d3d5e4', class: "status-description" }, this.currentStatus.description)))), this.debug && (h("div", { key: '0397b96391dff4f0662c913068a62c714df168bf', class: "performance-monitor" }, h("div", { key: 'da3c3638b3c048a425bf691b29755762ad40aa5c', class: "performance-expanded" }, h("div", { key: '467f5e2dc207cfd9fd31cef24d434452b3247c5f', class: "metrics-row" }, h("div", { key: 'e620d9017402317e09ec554bf933a4f5a5d0b0de', class: "metric-compact" }, h("span", { key: '8d21fa081bbf3ec7ad54f553b60b0a64ae41fb01', class: "metric-label" }, "FPS"), h("span", { key: '8e99113c7b93c128d7e390900a63f16c5b9483c0', class: `metric-value ${this.performanceData.fps < 15 ? 'warning' : this.performanceData.fps < 10 ? 'danger' : 'good'}` }, this.performanceData.fps)), h("div", { key: '67927ff90810b0c4d6717d520ad50142d5d6c0dd', class: "metric-compact" }, h("span", { key: '4810964d65c18248f01aff90dca36d732b80a05c', class: "metric-label" }, "MEM"), h("span", { key: 'e82ff493a2bc1d3baf60c1f638154e9208d0991f', class: `metric-value ${this.performanceData.memoryUsage > 100 ? 'warning' : this.performanceData.memoryUsage > 200 ? 'danger' : 'good'}` }, this.performanceData.memoryUsage, "MB"))), h("div", { key: '6ef07b3f3dc4c3d991f4bbae34e902a9efc1a359', class: "metrics-row" }, h("div", { key: 'b5eed3b30cb99d4d088a05494cda2eff0ba393cc', class: "metric-compact" }, h("span", { key: '52749839a61316b90f424b0920f4c82c6683dd29', class: "metric-label" }, "INF"), h("span", { key: '8509cf19af19b6ac2efc7ab68ac46d9d053c5464', class: `metric-value ${this.performanceData.inferenceTime > 100 ? 'warning' : this.performanceData.inferenceTime > 200 ? 'danger' : 'good'}` }, this.performanceData.inferenceTime, "ms")), h("div", { key: '34a8540d0840056a525a7afc35ca956943b527af', class: "metric-compact" }, h("span", { key: 'bdc2d8cd180b92ee7b84c8372aba5c2f33289669', class: "metric-label" }, "FRAME"), h("span", { key: '481a0735a5b7258fecdc1bab65a4d4018cc0e7b9', class: `metric-value ${this.performanceData.frameProcessingTime > 50 ? 'warning' : this.performanceData.frameProcessingTime > 100 ? 'danger' : 'good'}` }, this.performanceData.frameProcessingTime, "ms"))), h("div", { key: '7b5aa0a6fe97970f09db23103f7f0301fd98c4f8', class: "metrics-row" }, h("div", { key: '1c691159409e021176557904a1ceec05abc329e1', class: "metric-compact" }, h("span", { key: '5ab6c25d80548aa4e63c79ecf88d2386393ae707', class: "metric-label" }, "DET"), h("span", { key: '7641532633bc764d4dc209ba7e1827a2f3f59338', class: "metric-value good" }, this.performanceData.successfulDetections, "/", this.performanceData.totalDetections)), h("div", { key: 'feee52f464eeb965eeadfd944a65e94600591ed5', class: "metric-compact" }, h("span", { key: 'c7962650a7bf1bc86f8c733eb01d5eeb9e08d37e', class: "metric-label" }, "RATE"), h("span", { key: '337529444c8e7bacb47d686d0be33721a066eebe', class: `metric-value ${this.performanceData.detectionRate < 30 ? 'danger' : this.performanceData.detectionRate < 60 ? 'warning' : 'good'}` }, this.performanceData.detectionRate, "%")))))), h("div", { key: '49717c49e5316bfe10690733c5bf07eb0475a3e2', class: "watermark" }, h("img", { key: 'f86ff4364196627bb3f169e5ee1c14696126cd68', src: "https://storage.googleapis.com/jaak-static/commons/powered-by-jaak.png", alt: "Powered by Jaak" }))))));
1147
+ : 'Saltar reverso')))), captureState.isVideoActive && (h("div", { key: 'bb5c00ad882c303d8a2b6ddc79c9d5b27ff9824e', class: "camera-controls" }, h("button", { key: '7d231b550b58a8336f125a1a7fe7235c8bb3d7dd', 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: '95d1e0d0937f7ef821ff3ad167cd42e25fd1c87f', class: "camera-selector-dropdown" }, h("div", { key: 'e42219e5895c82f40c559c27c4f80f3145fc0a0e', class: "camera-selector-header" }, h("span", { key: '544a6fb2e08211ab6c44b0bfb281124bee318fae' }, "Seleccionar C\u00E1mara"), h("button", { key: '7c4a71243278491ee7dbcc7ab2564bc7e92f5da3', class: "close-selector", onClick: () => this.toggleCameraSelector(), type: "button" }, "\u00D7")), h("div", { key: 'c9d24e0bd906d20370214fdfd24ae91abfda98e1', 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: '8c2e1d2ed02bc55c84f3f726e5be577686d0f32d', class: "device-info" }, h("small", { key: '142410a86e4f819b96ffc9573816994351588a3e' }, "Dispositivo: ", cameraInfo.deviceType)))), this.showManualCaptureButton && captureState.step === 'front' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '48c33b2d6c8c80d18fba6e5f454faaa24c28fbd9', class: "manual-capture-section" }, h("button", { key: 'e3d5bfe9ef8b8f16bf669b66bce4e7a500113798', class: "manual-capture-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-front' && (h("span", { key: 'f50640fe4308c765011e6ed175528920228df5e7', class: "button-spinner" })), "Capturar Frente"))))), captureState.isCapturing && (h("div", { key: '080ab315293fa1fe5b1d97aa2511a2ffe2b013f4', class: "capture-animation" })), captureState.showFlipAnimation && (h("div", { key: 'b062c546af50b799bb1fb7dda07b3ffa601c4bac', class: "flip-animation" }, h("div", { key: 'f7162dc31673c7db1d8e03a658a722a3d323b28e', class: "id-card-icon" }), h("div", { key: 'd950952b480342d80d37df5c48031d72be4ac01a', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), captureState.showSuccessAnimation && (h("div", { key: 'bd576fd28065aa712e42636c5fd0e3566d26cc25', class: "success-animation" }, h("div", { key: '6ca5c24510df790bd1c955c5e2936909c4767560', class: "check-icon" }), h("div", { key: '3420164eacddbe1a9aa0a181528ba0be7683af56', class: "success-text" }, "\u00A1Proceso completado!"))), h("div", { key: '8ec2b295b233e7bb8ab0cc1c183adedd4e3c7e04', class: `component-status status-${this.currentStatus.type}` }, (this.currentStatus.type === 'loading' || this.currentStatus.type === 'initializing') && (h("div", { key: '97c8e7e6219984673ebc631da111c17bf72a83cb', class: "status-spinner" })), h("div", { key: '7ca06c48f295892ff77eceff6245891ef7d9dd5e', class: "status-content" }, h("div", { key: '08056c7ec8fd66d23e0b6714c08aeccc092cf46a', class: "status-message" }, this.currentStatus.message), this.currentStatus.description && (h("div", { key: '1e32ca14de53cc2f105822ed5a58e691918b307b', class: "status-description" }, this.currentStatus.description)))), this.debug && (h("div", { key: 'c25022d9aadd37ead9ae7d1cf7c7d916cdeb9cc1', class: "performance-monitor" }, h("div", { key: 'f0f99c7e820532432ba64726ef0c2aeabeb3309f', class: "performance-expanded" }, h("div", { key: 'e839e90c9cb0f33068ac3311e41914aa52610149', class: "metrics-row" }, h("div", { key: '9f74f4877a048e63f542f2df54f569f79d6f8bd0', class: "metric-compact" }, h("span", { key: '21ec7255706d6fb2cfec035c4be92295ee0216b6', class: "metric-label" }, "FPS"), h("span", { key: 'c8be17f3dc752304bf6b7fd9746f11783f7ff6ca', class: `metric-value ${this.performanceData.fps < 15 ? 'warning' : this.performanceData.fps < 10 ? 'danger' : 'good'}` }, this.performanceData.fps)), h("div", { key: '79187257ea30ead7fb41534a94272a3a855e050b', class: "metric-compact" }, h("span", { key: 'cc53dc282c1fe4234217207c2085fa2be06a5458', class: "metric-label" }, "MEM"), h("span", { key: '032002ff63b3a2349b34833668fed8d6337e2063', class: `metric-value ${this.performanceData.memoryUsage > 100 ? 'warning' : this.performanceData.memoryUsage > 200 ? 'danger' : 'good'}` }, this.performanceData.memoryUsage, "MB"))), h("div", { key: 'e628febd5bbfb9f593e029b10827635ddd0344fb', class: "metrics-row" }, h("div", { key: 'b2fe558bab709ff6b6781648b13ebc66238f3298', class: "metric-compact" }, h("span", { key: 'd7d816aff11503657781f8ebe9cb5f0f07c7279e', class: "metric-label" }, "INF"), h("span", { key: '3d735d092b5b39d0e96f4ac59b3bf2acde739fab', class: `metric-value ${this.performanceData.inferenceTime > 100 ? 'warning' : this.performanceData.inferenceTime > 200 ? 'danger' : 'good'}` }, this.performanceData.inferenceTime, "ms")), h("div", { key: '9a83fd4fe43e8a3760aaea1f134c3101b8757681', class: "metric-compact" }, h("span", { key: '8136ab82b50230537f19cd58ed2da0956d291287', class: "metric-label" }, "FRAME"), h("span", { key: '6221cc10edff8c4b0e4034a3734deb548416a3e6', class: `metric-value ${this.performanceData.frameProcessingTime > 50 ? 'warning' : this.performanceData.frameProcessingTime > 100 ? 'danger' : 'good'}` }, this.performanceData.frameProcessingTime, "ms"))), h("div", { key: 'a31bad44d5c2c5fd5417ed82589c0f103bba1d32', class: "metrics-row" }, h("div", { key: '1441d11e0d83b3b44dfa963e415c3074691eb4f2', class: "metric-compact" }, h("span", { key: '9fe5643129aa7a842f75644b6f71b1ff80993f1b', class: "metric-label" }, "DET"), h("span", { key: '0604065a3867e71a745bfb4e804c7e96048cb70e', class: "metric-value good" }, this.performanceData.successfulDetections, "/", this.performanceData.totalDetections)), h("div", { key: 'daff0fede819f2b59a4ddb83560dc53f6151c2c9', class: "metric-compact" }, h("span", { key: '75a55c4a4e36b98af3620866ec6f7842b9ef81f7', class: "metric-label" }, "RATE"), h("span", { key: '61776c3fd4c3200d5e18cc28d917c538b282625a', class: `metric-value ${this.performanceData.detectionRate < 30 ? 'danger' : this.performanceData.detectionRate < 60 ? 'warning' : 'good'}` }, this.performanceData.detectionRate, "%")))))), h("div", { key: '4092c684ee3a148ec40e266fd16a718f2c2f2f52', class: "watermark" }, h("img", { key: 'd7bae6157d22675f8b71dbf1afdf345374398c82', src: "https://storage.googleapis.com/jaak-static/commons/powered-by-jaak.png", alt: "Powered by Jaak" }))))));
1144
1148
  }
1145
1149
  // Utility methods
1146
1150
  updateDetectionBoxes(boxes) {
@@ -1648,7 +1652,7 @@ export class JaakStamps {
1648
1652
  catch (error) {
1649
1653
  }
1650
1654
  }
1651
- completeProcess(skippedBack = false) {
1655
+ async completeProcess(skippedBack = false) {
1652
1656
  this.stateManager.updateCaptureState({
1653
1657
  step: 'completed',
1654
1658
  showSuccessAnimation: true
@@ -1663,6 +1667,15 @@ export class JaakStamps {
1663
1667
  ...capturedImages,
1664
1668
  timestamp: new Date().toISOString()
1665
1669
  };
1670
+ // Flush all traces to collector before emitting capture completed
1671
+ if (this.tracingService) {
1672
+ try {
1673
+ await this.tracingService.flush();
1674
+ }
1675
+ catch (error) {
1676
+ console.error('[my-component] Failed to flush traces:', error);
1677
+ }
1678
+ }
1666
1679
  this.captureCompleted.emit(finalImages);
1667
1680
  setTimeout(() => {
1668
1681
  this.stateManager.updateCaptureState({ showSuccessAnimation: false });