@jaak.ai/stamps 2.0.0-beta.1 → 2.0.0-beta.2
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/README.md +73 -18
- package/dist/cjs/jaak-stamps-webcomponent.cjs.js +1 -1
- package/dist/cjs/jaak-stamps.cjs.entry.js +159 -24
- package/dist/cjs/jaak-stamps.cjs.entry.js.map +1 -1
- package/dist/cjs/jaak-stamps.entry.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/my-component/my-component.js +219 -24
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/components/jaak-stamps.js +162 -24
- package/dist/components/jaak-stamps.js.map +1 -1
- package/dist/esm/jaak-stamps-webcomponent.js +1 -1
- package/dist/esm/jaak-stamps.entry.js +159 -24
- package/dist/esm/jaak-stamps.entry.js.map +1 -1
- package/dist/esm/loader.js +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-f1172b06.entry.js +2 -0
- package/dist/jaak-stamps-webcomponent/p-f1172b06.entry.js.map +1 -0
- package/dist/types/components/my-component/my-component.d.ts +12 -0
- package/dist/types/components.d.ts +24 -0
- package/package.json +1 -1
- package/dist/jaak-stamps-webcomponent/p-dd6cc14e.entry.js +0 -2
- package/dist/jaak-stamps-webcomponent/p-dd6cc14e.entry.js.map +0 -1
|
@@ -3,6 +3,9 @@ export class JaakStamps {
|
|
|
3
3
|
el;
|
|
4
4
|
debug = false;
|
|
5
5
|
alignmentTolerance = 10; // Tolerancia en píxeles para considerar un lado alineado (escalado para 320x320)
|
|
6
|
+
maskSize = 90; // Porcentaje del video que ocupará la máscara (default 90%)
|
|
7
|
+
cropMargin = 0; // Margen en píxeles para el recorte del documento (default 0)
|
|
8
|
+
useDocumentClassification = false; // Habilita la clasificación automática de documentos para determinar si solicitar reverso
|
|
6
9
|
captureCompleted;
|
|
7
10
|
isReady;
|
|
8
11
|
isVideoActive = false;
|
|
@@ -36,6 +39,8 @@ export class JaakStamps {
|
|
|
36
39
|
animationId;
|
|
37
40
|
hasScreenshotTaken = false;
|
|
38
41
|
lastDetectedBox;
|
|
42
|
+
mobileNetSession;
|
|
43
|
+
mobileNetClassMap;
|
|
39
44
|
// Performance optimization properties
|
|
40
45
|
frameSkipCounter = 0;
|
|
41
46
|
FRAME_SKIP = 2; // Process every 3rd frame (reduces CPU by ~66%)
|
|
@@ -48,7 +53,9 @@ export class JaakStamps {
|
|
|
48
53
|
preprocessCtx;
|
|
49
54
|
captureCanvas;
|
|
50
55
|
captureCtx;
|
|
51
|
-
MODEL_PATH = "https://storage.googleapis.com/jaak-static/web/component/stamps/
|
|
56
|
+
MODEL_PATH = "https://storage.googleapis.com/jaak-static/web/component/stamps/ddmyp-v1.onnx";
|
|
57
|
+
MOBILENET_MODEL_PATH = "https://storage.googleapis.com/jaak-static/web/component/stamps/cdmmp-v1.onnx";
|
|
58
|
+
MOBILENET_CLASSES_PATH = "https://storage.googleapis.com/jaak-static/web/component/stamps/cdmmp-v1.json";
|
|
52
59
|
INPUT_SIZE = 320;
|
|
53
60
|
CONFIDENCE_THRESHOLD = 0.6;
|
|
54
61
|
// ISO/IEC 7810 ID-1 standard dimensions (85.60mm x 53.98mm)
|
|
@@ -58,6 +65,18 @@ export class JaakStamps {
|
|
|
58
65
|
console.log(...args);
|
|
59
66
|
}
|
|
60
67
|
}
|
|
68
|
+
validateMaskSize() {
|
|
69
|
+
if (this.maskSize < 50 || this.maskSize > 100) {
|
|
70
|
+
console.warn(`maskSize debe estar entre 50 y 100. Valor actual: ${this.maskSize}. Usando valor por defecto: 90`);
|
|
71
|
+
this.maskSize = 90;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
validateCropMargin() {
|
|
75
|
+
if (this.cropMargin < 0 || this.cropMargin > 100) {
|
|
76
|
+
console.warn(`cropMargin debe estar entre 0 y 100. Valor actual: ${this.cropMargin}. Usando valor por defecto: 0`);
|
|
77
|
+
this.cropMargin = 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
61
80
|
emitReadyEvent() {
|
|
62
81
|
const isDocumentReady = !!window.ort && this.isModelPreloaded;
|
|
63
82
|
this.isReady.emit(isDocumentReady);
|
|
@@ -71,6 +90,8 @@ export class JaakStamps {
|
|
|
71
90
|
return settings.facingMode === 'environment';
|
|
72
91
|
}
|
|
73
92
|
async componentDidLoad() {
|
|
93
|
+
this.validateMaskSize();
|
|
94
|
+
this.validateCropMargin();
|
|
74
95
|
if (!window.ort) {
|
|
75
96
|
const script = document.createElement('script');
|
|
76
97
|
script.src = 'https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.min.js';
|
|
@@ -138,14 +159,15 @@ export class JaakStamps {
|
|
|
138
159
|
// Calculate what would be the max width if limited by video height
|
|
139
160
|
const maxWidthByHeight = displayedVideoHeight * this.ID1_ASPECT_RATIO;
|
|
140
161
|
let maskWidthInVideo, maskHeightInVideo;
|
|
162
|
+
const sizeRatio = this.maskSize / 100;
|
|
141
163
|
if (maxWidthByHeight <= displayedVideoWidth) {
|
|
142
164
|
// Video height is the limiting factor
|
|
143
|
-
maskHeightInVideo = displayedVideoHeight *
|
|
165
|
+
maskHeightInVideo = displayedVideoHeight * sizeRatio;
|
|
144
166
|
maskWidthInVideo = maskHeightInVideo * this.ID1_ASPECT_RATIO;
|
|
145
167
|
}
|
|
146
168
|
else {
|
|
147
169
|
// Video width is the limiting factor
|
|
148
|
-
maskWidthInVideo = displayedVideoWidth *
|
|
170
|
+
maskWidthInVideo = displayedVideoWidth * sizeRatio;
|
|
149
171
|
maskHeightInVideo = maskWidthInVideo / this.ID1_ASPECT_RATIO;
|
|
150
172
|
}
|
|
151
173
|
// Convert to percentages of the container
|
|
@@ -239,25 +261,29 @@ export class JaakStamps {
|
|
|
239
261
|
}
|
|
240
262
|
try {
|
|
241
263
|
this.isLoading = true;
|
|
242
|
-
this.statusMessage = "Precargando
|
|
264
|
+
this.statusMessage = "Precargando modelos...";
|
|
243
265
|
this.statusColor = "#007bff";
|
|
244
266
|
const modelPath = this.MODEL_PATH;
|
|
245
|
-
this.debugLog('🤖 Preloading model:', modelPath);
|
|
267
|
+
this.debugLog('🤖 Preloading detection model:', modelPath);
|
|
246
268
|
// Configure ONNX Runtime with device-specific optimizations
|
|
247
269
|
const sessionOptions = this.getSessionOptions();
|
|
248
270
|
this.session = await window.ort.InferenceSession.create(modelPath, sessionOptions);
|
|
271
|
+
// Preload MobileNet model and classes only if classification is enabled
|
|
272
|
+
if (this.useDocumentClassification) {
|
|
273
|
+
await this.loadMobileNetModel();
|
|
274
|
+
}
|
|
249
275
|
this.isModelPreloaded = true;
|
|
250
276
|
this.isLoading = false;
|
|
251
|
-
this.statusMessage = "
|
|
277
|
+
this.statusMessage = "Modelos precargados. Listo para comenzar detección";
|
|
252
278
|
this.statusColor = "#28a745";
|
|
253
279
|
this.emitReadyEvent();
|
|
254
|
-
this.debugLog('✅
|
|
255
|
-
return { success: true, message: '
|
|
280
|
+
this.debugLog('✅ Models preloaded successfully');
|
|
281
|
+
return { success: true, message: 'Models preloaded successfully' };
|
|
256
282
|
}
|
|
257
283
|
catch (error) {
|
|
258
|
-
this.debugLog('❌ Error preloading
|
|
284
|
+
this.debugLog('❌ Error preloading models:', error);
|
|
259
285
|
this.isLoading = false;
|
|
260
|
-
this.statusMessage = "Error al precargar
|
|
286
|
+
this.statusMessage = "Error al precargar los modelos";
|
|
261
287
|
this.statusColor = "#ff6b6b";
|
|
262
288
|
return { success: false, error: error.message };
|
|
263
289
|
}
|
|
@@ -267,6 +293,80 @@ export class JaakStamps {
|
|
|
267
293
|
this.completeProcess(true);
|
|
268
294
|
}
|
|
269
295
|
}
|
|
296
|
+
async loadMobileNetModel() {
|
|
297
|
+
try {
|
|
298
|
+
this.debugLog('🤖 Loading MobileNet model...');
|
|
299
|
+
// Load class map
|
|
300
|
+
const classResponse = await fetch(this.MOBILENET_CLASSES_PATH);
|
|
301
|
+
if (!classResponse.ok) {
|
|
302
|
+
throw new Error(`Failed to load class map: ${this.MOBILENET_CLASSES_PATH}`);
|
|
303
|
+
}
|
|
304
|
+
this.mobileNetClassMap = await classResponse.json();
|
|
305
|
+
this.debugLog('📋 MobileNet classes loaded:', this.mobileNetClassMap);
|
|
306
|
+
// Load model
|
|
307
|
+
const sessionOptions = this.getSessionOptions();
|
|
308
|
+
this.mobileNetSession = await window.ort.InferenceSession.create(this.MOBILENET_MODEL_PATH, sessionOptions);
|
|
309
|
+
this.debugLog('✅ MobileNet model loaded successfully');
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
this.debugLog('❌ Error loading MobileNet model:', error);
|
|
313
|
+
throw error;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
preprocessMobileNet(canvas) {
|
|
317
|
+
// Create a temporary canvas for MobileNet preprocessing (224x224)
|
|
318
|
+
const tempCanvas = document.createElement('canvas');
|
|
319
|
+
tempCanvas.width = 224;
|
|
320
|
+
tempCanvas.height = 224;
|
|
321
|
+
const tempCtx = tempCanvas.getContext('2d');
|
|
322
|
+
// Draw the cropped image onto the 224x224 canvas
|
|
323
|
+
tempCtx.drawImage(canvas, 0, 0, 224, 224);
|
|
324
|
+
// Get image data and preprocess for MobileNet
|
|
325
|
+
const imageData = tempCtx.getImageData(0, 0, 224, 224);
|
|
326
|
+
const data = imageData.data;
|
|
327
|
+
const hw = 224 * 224;
|
|
328
|
+
const arr = new Float32Array(3 * hw);
|
|
329
|
+
// Normalize pixels: (pixel/255 - 0.5) / 0.5 = (pixel - 127.5) / 127.5
|
|
330
|
+
for (let i = 0; i < hw; i++) {
|
|
331
|
+
arr[i] = (data[i * 4 + 0] / 255 - 0.5) / 0.5; // R
|
|
332
|
+
arr[hw + i] = (data[i * 4 + 1] / 255 - 0.5) / 0.5; // G
|
|
333
|
+
arr[2 * hw + i] = (data[i * 4 + 2] / 255 - 0.5) / 0.5; // B
|
|
334
|
+
}
|
|
335
|
+
return new window.ort.Tensor('float32', arr, [1, 3, 224, 224]);
|
|
336
|
+
}
|
|
337
|
+
async classifyDocument(canvas) {
|
|
338
|
+
if (!this.mobileNetSession || !this.mobileNetClassMap) {
|
|
339
|
+
this.debugLog('⚠️ MobileNet model not loaded');
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
try {
|
|
343
|
+
this.debugLog('🔍 Classifying document...');
|
|
344
|
+
// Preprocess image for MobileNet
|
|
345
|
+
const inputTensor = this.preprocessMobileNet(canvas);
|
|
346
|
+
// Run inference
|
|
347
|
+
const feeds = { input: inputTensor };
|
|
348
|
+
const results = await this.mobileNetSession.run(feeds);
|
|
349
|
+
const output = results[Object.keys(results)[0]].data;
|
|
350
|
+
// Find the class with highest confidence
|
|
351
|
+
const maxIdx = output.reduce((bestIdx, val, idx, arr) => val > arr[bestIdx] ? idx : bestIdx, 0);
|
|
352
|
+
const confidence = output[maxIdx];
|
|
353
|
+
const className = this.mobileNetClassMap[maxIdx.toString()] || "unknown";
|
|
354
|
+
this.debugLog('📄 Document classification result:', {
|
|
355
|
+
class: className,
|
|
356
|
+
confidence: confidence.toFixed(3),
|
|
357
|
+
classIndex: maxIdx
|
|
358
|
+
});
|
|
359
|
+
return {
|
|
360
|
+
class: className,
|
|
361
|
+
confidence: confidence,
|
|
362
|
+
classIndex: maxIdx
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
catch (error) {
|
|
366
|
+
this.debugLog('❌ Error classifying document:', error);
|
|
367
|
+
return null;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
270
370
|
cleanup() {
|
|
271
371
|
if (this.animationId) {
|
|
272
372
|
cancelAnimationFrame(this.animationId);
|
|
@@ -294,11 +394,16 @@ export class JaakStamps {
|
|
|
294
394
|
this.captureCtx = undefined;
|
|
295
395
|
this.captureCanvas = undefined;
|
|
296
396
|
}
|
|
297
|
-
// Disposed ONNX
|
|
397
|
+
// Disposed ONNX sessions
|
|
298
398
|
if (this.session) {
|
|
299
399
|
this.session.release?.();
|
|
300
400
|
this.session = undefined;
|
|
301
401
|
}
|
|
402
|
+
if (this.mobileNetSession) {
|
|
403
|
+
this.mobileNetSession.release?.();
|
|
404
|
+
this.mobileNetSession = undefined;
|
|
405
|
+
}
|
|
406
|
+
this.mobileNetClassMap = undefined;
|
|
302
407
|
this.isModelPreloaded = false;
|
|
303
408
|
this.debugLog('🧹 Canvas pool cleaned up');
|
|
304
409
|
}
|
|
@@ -429,18 +534,22 @@ export class JaakStamps {
|
|
|
429
534
|
// Check if model is already preloaded
|
|
430
535
|
if (!this.session) {
|
|
431
536
|
this.isLoading = true;
|
|
432
|
-
this.statusMessage = "Cargando
|
|
537
|
+
this.statusMessage = "Cargando modelos...";
|
|
433
538
|
this.statusColor = "#007bff";
|
|
434
539
|
const modelPath = this.MODEL_PATH;
|
|
435
|
-
this.debugLog('🤖 Loading model:', modelPath);
|
|
540
|
+
this.debugLog('🤖 Loading detection model:', modelPath);
|
|
436
541
|
const sessionOptions = this.getSessionOptions();
|
|
437
542
|
this.session = await window.ort.InferenceSession.create(modelPath, sessionOptions);
|
|
543
|
+
// Load MobileNet model if classification is enabled and not already loaded
|
|
544
|
+
if (this.useDocumentClassification && !this.mobileNetSession) {
|
|
545
|
+
await this.loadMobileNetModel();
|
|
546
|
+
}
|
|
438
547
|
this.isModelPreloaded = true;
|
|
439
548
|
this.emitReadyEvent();
|
|
440
549
|
}
|
|
441
550
|
else {
|
|
442
|
-
this.debugLog('🚀 Using preloaded
|
|
443
|
-
this.statusMessage = "Usando
|
|
551
|
+
this.debugLog('🚀 Using preloaded models');
|
|
552
|
+
this.statusMessage = "Usando modelos precargados...";
|
|
444
553
|
this.statusColor = "#007bff";
|
|
445
554
|
}
|
|
446
555
|
this.statusMessage = "Configurando cámara...";
|
|
@@ -583,14 +692,15 @@ export class JaakStamps {
|
|
|
583
692
|
// Calculate mask dimensions using the same logic as updateMaskDimensions
|
|
584
693
|
const maxWidthByHeight = displayedVideoHeight * this.ID1_ASPECT_RATIO;
|
|
585
694
|
let visualMaskWidth, visualMaskHeight;
|
|
695
|
+
const sizeRatio = this.maskSize / 100;
|
|
586
696
|
if (maxWidthByHeight <= displayedVideoWidth) {
|
|
587
697
|
// Video height is the limiting factor
|
|
588
|
-
visualMaskHeight = displayedVideoHeight *
|
|
698
|
+
visualMaskHeight = displayedVideoHeight * sizeRatio;
|
|
589
699
|
visualMaskWidth = visualMaskHeight * this.ID1_ASPECT_RATIO;
|
|
590
700
|
}
|
|
591
701
|
else {
|
|
592
702
|
// Video width is the limiting factor
|
|
593
|
-
visualMaskWidth = displayedVideoWidth *
|
|
703
|
+
visualMaskWidth = displayedVideoWidth * sizeRatio;
|
|
594
704
|
visualMaskHeight = visualMaskWidth / this.ID1_ASPECT_RATIO;
|
|
595
705
|
}
|
|
596
706
|
// Now map these visual mask dimensions to the distorted model space
|
|
@@ -658,7 +768,9 @@ export class JaakStamps {
|
|
|
658
768
|
corners?.forEach(corner => corner.classList.add('perfect-match'));
|
|
659
769
|
if (!this.hasScreenshotTaken) {
|
|
660
770
|
this.lastDetectedBox = bestBox;
|
|
661
|
-
this.takeScreenshot()
|
|
771
|
+
this.takeScreenshot().catch(error => {
|
|
772
|
+
this.debugLog('❌ Error taking screenshot:', error);
|
|
773
|
+
});
|
|
662
774
|
this.hasScreenshotTaken = true;
|
|
663
775
|
// Reset para permitir segunda captura
|
|
664
776
|
setTimeout(() => {
|
|
@@ -741,7 +853,7 @@ export class JaakStamps {
|
|
|
741
853
|
ctx.strokeRect(x, y, w, h);
|
|
742
854
|
});
|
|
743
855
|
}
|
|
744
|
-
takeScreenshot() {
|
|
856
|
+
async takeScreenshot() {
|
|
745
857
|
if (!this.videoRef || !this.lastDetectedBox)
|
|
746
858
|
return;
|
|
747
859
|
// Activar animación
|
|
@@ -757,10 +869,10 @@ export class JaakStamps {
|
|
|
757
869
|
// Calcular las coordenadas de recorte basadas en la detección
|
|
758
870
|
const scaleX = this.videoRef.videoWidth / this.INPUT_SIZE;
|
|
759
871
|
const scaleY = this.videoRef.videoHeight / this.INPUT_SIZE;
|
|
760
|
-
const cropX = Math.max(0, this.lastDetectedBox.x * scaleX);
|
|
761
|
-
const cropY = Math.max(0, this.lastDetectedBox.y * scaleY);
|
|
762
|
-
const cropWidth = Math.min(this.lastDetectedBox.w * scaleX, this.videoRef.videoWidth - cropX);
|
|
763
|
-
const cropHeight = Math.min(this.lastDetectedBox.h * scaleY, this.videoRef.videoHeight - cropY);
|
|
872
|
+
const cropX = Math.max(0, (this.lastDetectedBox.x * scaleX) - this.cropMargin);
|
|
873
|
+
const cropY = Math.max(0, (this.lastDetectedBox.y * scaleY) - this.cropMargin);
|
|
874
|
+
const cropWidth = Math.min((this.lastDetectedBox.w * scaleX) + (2 * this.cropMargin), this.videoRef.videoWidth - cropX);
|
|
875
|
+
const cropHeight = Math.min((this.lastDetectedBox.h * scaleY) + (2 * this.cropMargin), this.videoRef.videoHeight - cropY);
|
|
764
876
|
// OPTIMIZATION: Create temporary canvas only for cropped version
|
|
765
877
|
// (We reuse main capture canvas for full frame)
|
|
766
878
|
const croppedCanvas = document.createElement('canvas');
|
|
@@ -775,6 +887,29 @@ export class JaakStamps {
|
|
|
775
887
|
// Captura del frente usando canvas reutilizado
|
|
776
888
|
this.capturedFullFrame = this.captureCanvas.toDataURL('image/png');
|
|
777
889
|
this.capturedCroppedId = croppedCanvas.toDataURL('image/png');
|
|
890
|
+
// Check if document classification is enabled
|
|
891
|
+
if (this.useDocumentClassification) {
|
|
892
|
+
// Load MobileNet model if not loaded yet (lazy loading)
|
|
893
|
+
if (!this.mobileNetSession) {
|
|
894
|
+
try {
|
|
895
|
+
await this.loadMobileNetModel();
|
|
896
|
+
}
|
|
897
|
+
catch (error) {
|
|
898
|
+
this.debugLog('⚠️ Failed to load classification model, continuing without classification:', error);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
// Classify the cropped document if model is available
|
|
902
|
+
if (this.mobileNetSession) {
|
|
903
|
+
const classification = await this.classifyDocument(croppedCanvas);
|
|
904
|
+
if (classification && classification.class === 'passport') {
|
|
905
|
+
// If it's a passport, skip back capture since passports don't have a back side
|
|
906
|
+
this.debugLog('📄 Passport detected - skipping back capture');
|
|
907
|
+
this.completeProcess(true);
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
// For other IDs, continue with normal flow (back capture)
|
|
778
913
|
this.captureStep = 'back';
|
|
779
914
|
this.statusMessage = "Voltee la identificación y muestre la parte trasera";
|
|
780
915
|
this.statusColor = "#007bff";
|
|
@@ -904,7 +1039,7 @@ export class JaakStamps {
|
|
|
904
1039
|
this.cleanup();
|
|
905
1040
|
}
|
|
906
1041
|
render() {
|
|
907
|
-
return (h("div", { key: '
|
|
1042
|
+
return (h("div", { key: '42591479495df221b101555198a23288d7d765b0', class: "detector-container" }, h("div", { key: '2b9ab48572aa2fb5542b8a8dc1b70a0f2a6eca89', class: "video-container" }, h("video", { key: 'b9e84f2eb67fa6f7f158e19b90871a1eebee624b', ref: el => this.videoRef = el, autoplay: true, muted: true, playsinline: true, class: this.shouldMirrorVideo ? 'mirror' : '', style: { display: this.isVideoActive ? 'block' : 'none' } }), h("canvas", { key: 'a82fc4826e220e696799b07b3510456f174a6628', ref: el => this.canvasRef = el, class: this.shouldMirrorVideo ? 'mirror' : '' }), this.isMaskReady && (h("div", { key: '9b3b838f99030e3dfa760fa0dd7c89ff24f26ed9', class: "overlay-mask" }, h("div", { key: 'f6a3b1ac2f12c1fb081f6b5eb853e627040396f4', class: "card-outline" }, h("div", { key: '6626259249ac5e0fd6ba665ab802af1ac2f9fc17', class: "side side-top" }), h("div", { key: '7a3195c96b2406b40b122f4267c2a251614cdede', class: "side side-right" }), h("div", { key: 'ece78305cfb083ada1d44de1d7d5226730879cc3', class: "side side-bottom" }), h("div", { key: '107468c583bbb01dd46c36c096e49be8e0b574ba', class: "side side-left" }), h("div", { key: 'c590f13b80c5e37c0ac0c68cfc2e2904b4345ebc', class: "corner corner-tl" }), h("div", { key: 'ab1e5aab179068ad1bc7b58ef3628d9618a877a8', class: "corner corner-tr" }), h("div", { key: '3a1db6cf1105bd3a2dfe7d4b998e79f6e40625ec', class: "corner corner-bl" }), h("div", { key: '5f9bc4e4557e5539335894160dccbaa2a6d6ac2d', class: "corner corner-br" }), !this.showFlipAnimation && !this.showSuccessAnimation && (h("div", { key: '8226d6721b0ae800f935e978a93113bd3b99656a', class: "guide-text" }, this.statusMessage))), this.captureStep === 'back' && !this.showFlipAnimation && !this.showSuccessAnimation && (h("button", { key: '16cec7ca4a80ba0db1ace768826da17063eddb3e', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button" }, "Saltar reverso")))), this.isCapturing && (h("div", { key: 'bfdca0059eb50d37a77e8e43ef963ba7ed953edf', class: "capture-animation" })), this.showFlipAnimation && (h("div", { key: 'a1ad4b4f884d7d9f6090f148ddd6df19250073dd', class: "flip-animation" }, h("div", { key: 'e159ce385824dc049a6e9409d3747105c6f0a08e', class: "id-card-icon" }), h("div", { key: '6fcff650a3c7fdb16f8d327750e06055b9a93d0d', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), this.showSuccessAnimation && (h("div", { key: 'c4b76ecb19c65969676e5156689c2c0b1c9a584e', class: "success-animation" }, h("div", { key: '12203a8fe7ee878089b3dda1d1142cde5489eed0', class: "check-icon" }), h("div", { key: 'a2d41c8944873d33106994b8d56c3ee1ee1ae9fc', class: "success-text" }, "\u00A1Proceso completado!"))), this.isLoading && (h("div", { key: 'a155cd999fa40c35fa7b391cde7c1026edb250a7', class: "loading-overlay" }, h("div", { key: 'ccba76c5d4a472158c28bc564ba95bd65829b58d', class: "loading-spinner" }), h("div", { key: '23168f9bdcf4e993539288ff5703acaed13bb16a', class: "loading-text" }, this.statusMessage))), h("div", { key: '0107b82ad19726c1bab131e17892a46b04e08cfd', class: "watermark" }, h("img", { key: 'ad8831a6f77fa61805f22e3a27f5c5619ac1cc0e', src: "https://storage.googleapis.com/jaak-static/commons/powered-by-jaak.png", alt: "Powered by Jaak" })))));
|
|
908
1043
|
}
|
|
909
1044
|
static get is() { return "jaak-stamps"; }
|
|
910
1045
|
static get encapsulation() { return "shadow"; }
|
|
@@ -959,6 +1094,66 @@ export class JaakStamps {
|
|
|
959
1094
|
"setter": false,
|
|
960
1095
|
"reflect": false,
|
|
961
1096
|
"defaultValue": "10"
|
|
1097
|
+
},
|
|
1098
|
+
"maskSize": {
|
|
1099
|
+
"type": "number",
|
|
1100
|
+
"attribute": "mask-size",
|
|
1101
|
+
"mutable": false,
|
|
1102
|
+
"complexType": {
|
|
1103
|
+
"original": "number",
|
|
1104
|
+
"resolved": "number",
|
|
1105
|
+
"references": {}
|
|
1106
|
+
},
|
|
1107
|
+
"required": false,
|
|
1108
|
+
"optional": false,
|
|
1109
|
+
"docs": {
|
|
1110
|
+
"tags": [],
|
|
1111
|
+
"text": ""
|
|
1112
|
+
},
|
|
1113
|
+
"getter": false,
|
|
1114
|
+
"setter": false,
|
|
1115
|
+
"reflect": false,
|
|
1116
|
+
"defaultValue": "90"
|
|
1117
|
+
},
|
|
1118
|
+
"cropMargin": {
|
|
1119
|
+
"type": "number",
|
|
1120
|
+
"attribute": "crop-margin",
|
|
1121
|
+
"mutable": false,
|
|
1122
|
+
"complexType": {
|
|
1123
|
+
"original": "number",
|
|
1124
|
+
"resolved": "number",
|
|
1125
|
+
"references": {}
|
|
1126
|
+
},
|
|
1127
|
+
"required": false,
|
|
1128
|
+
"optional": false,
|
|
1129
|
+
"docs": {
|
|
1130
|
+
"tags": [],
|
|
1131
|
+
"text": ""
|
|
1132
|
+
},
|
|
1133
|
+
"getter": false,
|
|
1134
|
+
"setter": false,
|
|
1135
|
+
"reflect": false,
|
|
1136
|
+
"defaultValue": "0"
|
|
1137
|
+
},
|
|
1138
|
+
"useDocumentClassification": {
|
|
1139
|
+
"type": "boolean",
|
|
1140
|
+
"attribute": "use-document-classification",
|
|
1141
|
+
"mutable": false,
|
|
1142
|
+
"complexType": {
|
|
1143
|
+
"original": "boolean",
|
|
1144
|
+
"resolved": "boolean",
|
|
1145
|
+
"references": {}
|
|
1146
|
+
},
|
|
1147
|
+
"required": false,
|
|
1148
|
+
"optional": false,
|
|
1149
|
+
"docs": {
|
|
1150
|
+
"tags": [],
|
|
1151
|
+
"text": ""
|
|
1152
|
+
},
|
|
1153
|
+
"getter": false,
|
|
1154
|
+
"setter": false,
|
|
1155
|
+
"reflect": false,
|
|
1156
|
+
"defaultValue": "false"
|
|
962
1157
|
}
|
|
963
1158
|
};
|
|
964
1159
|
}
|