smartcomply-web-sdk 1.0.49 → 1.0.50
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.
|
@@ -3635,7 +3635,7 @@ var SmartComplySDK = (() => {
|
|
|
3635
3635
|
Pn(s2, 1, (i2.left + i2.right) / 2), Pn(s2, 2, (i2.top + i2.bottom) / 2), Pn(s2, 4, i2.right - i2.left), Pn(s2, 3, i2.bottom - i2.top);
|
|
3636
3636
|
} else Pn(s2, 1, 0.5), Pn(s2, 2, 0.5), Pn(s2, 4, 1), Pn(s2, 3, 1);
|
|
3637
3637
|
if (n2?.rotationDegrees) {
|
|
3638
|
-
if (n2?.rotationDegrees % 90 != 0) throw Error("Expected rotation to be a multiple of 90
|
|
3638
|
+
if (n2?.rotationDegrees % 90 != 0) throw Error("Expected rotation to be a multiple of 90°.");
|
|
3639
3639
|
if (Pn(s2, 5, -Math.PI * n2.rotationDegrees / 180), n2?.rotationDegrees % 180 != 0) {
|
|
3640
3640
|
const [t3, r3] = sa(e2);
|
|
3641
3641
|
n2 = Fn(s2, 3) * r3 / t3, i2 = Fn(s2, 4) * t3 / r3, Pn(s2, 4, n2), Pn(s2, 3, i2);
|
|
@@ -4564,22 +4564,22 @@ var SmartComplySDK = (() => {
|
|
|
4564
4564
|
|
|
4565
4565
|
// src/modules/liveness/LivenessUI.ts
|
|
4566
4566
|
var ICONS = {
|
|
4567
|
-
BLINK: "
|
|
4568
|
-
TURN_LEFT: "
|
|
4569
|
-
TURN_RIGHT: "
|
|
4570
|
-
TURN_HEAD: "
|
|
4571
|
-
OPEN_MOUTH: "
|
|
4567
|
+
BLINK: "👁",
|
|
4568
|
+
TURN_LEFT: "↔",
|
|
4569
|
+
TURN_RIGHT: "↔",
|
|
4570
|
+
TURN_HEAD: "↔",
|
|
4571
|
+
OPEN_MOUTH: "😮"
|
|
4572
4572
|
};
|
|
4573
4573
|
var ACTION_CUES = {
|
|
4574
|
-
BLINK: `<div style="font-size:52px;line-height:1;animation:sc-blink 1.2s ease-in-out infinite;"
|
|
4574
|
+
BLINK: `<div style="font-size:52px;line-height:1;animation:sc-blink 1.2s ease-in-out infinite;">👁️</div>
|
|
4575
4575
|
<div style="font-size:12px;font-weight:600;color:#fff;margin-top:6px;letter-spacing:0.5px;">BLINK YOUR EYES</div>`,
|
|
4576
|
-
TURN_LEFT: `<div style="font-size:52px;line-height:1;animation:sc-turn-head 1.4s ease-in-out infinite;"
|
|
4576
|
+
TURN_LEFT: `<div style="font-size:52px;line-height:1;animation:sc-turn-head 1.4s ease-in-out infinite;">↔️</div>
|
|
4577
4577
|
<div style="font-size:12px;font-weight:600;color:#fff;margin-top:6px;letter-spacing:0.5px;">TURN HEAD SIDEWAYS</div>`,
|
|
4578
|
-
TURN_RIGHT: `<div style="font-size:52px;line-height:1;animation:sc-turn-head 1.4s ease-in-out infinite;"
|
|
4578
|
+
TURN_RIGHT: `<div style="font-size:52px;line-height:1;animation:sc-turn-head 1.4s ease-in-out infinite;">↔️</div>
|
|
4579
4579
|
<div style="font-size:12px;font-weight:600;color:#fff;margin-top:6px;letter-spacing:0.5px;">TURN HEAD SIDEWAYS</div>`,
|
|
4580
|
-
TURN_HEAD: `<div style="font-size:52px;line-height:1;animation:sc-turn-head 1.4s ease-in-out infinite;"
|
|
4580
|
+
TURN_HEAD: `<div style="font-size:52px;line-height:1;animation:sc-turn-head 1.4s ease-in-out infinite;">↔️</div>
|
|
4581
4581
|
<div style="font-size:12px;font-weight:600;color:#fff;margin-top:6px;letter-spacing:0.5px;">TURN HEAD SIDE TO SIDE</div>`,
|
|
4582
|
-
OPEN_MOUTH: `<div style="font-size:52px;line-height:1;animation:sc-mouth 1.2s ease-in-out infinite;"
|
|
4582
|
+
OPEN_MOUTH: `<div style="font-size:52px;line-height:1;animation:sc-mouth 1.2s ease-in-out infinite;">😮</div>
|
|
4583
4583
|
<div style="font-size:12px;font-weight:600;color:#fff;margin-top:6px;letter-spacing:0.5px;">OPEN YOUR MOUTH</div>`
|
|
4584
4584
|
};
|
|
4585
4585
|
function injectLivenessKeyframes() {
|
|
@@ -4818,7 +4818,7 @@ var SmartComplySDK = (() => {
|
|
|
4818
4818
|
if (num) {
|
|
4819
4819
|
num.style.background = "#22c55e";
|
|
4820
4820
|
num.style.borderColor = "#22c55e";
|
|
4821
|
-
num.textContent = "
|
|
4821
|
+
num.textContent = "✓";
|
|
4822
4822
|
}
|
|
4823
4823
|
} else if (state.active) {
|
|
4824
4824
|
step.style.opacity = "1";
|
|
@@ -4886,10 +4886,10 @@ var SmartComplySDK = (() => {
|
|
|
4886
4886
|
<div style="width:72px;height:72px;border-radius:50%;margin:0 auto 16px;display:flex;align-items:center;justify-content:center;font-size:32px;
|
|
4887
4887
|
background:${ok ? "rgba(34,197,94,0.2)" : "rgba(239,68,68,0.2)"};
|
|
4888
4888
|
border:3px solid ${ok ? "#22c55e" : "#ef4444"};">
|
|
4889
|
-
${ok ? "
|
|
4889
|
+
${ok ? "✓" : "✕"}
|
|
4890
4890
|
</div>
|
|
4891
4891
|
<div style="font-size:17px;font-weight:700;margin-bottom:8px;">${ok ? "Verification submitted" : "Submission failed"}</div>
|
|
4892
|
-
<div style="font-size:12px;opacity:0.6;line-height:1.6;">${ok ? "Hold on while we wrap up
|
|
4892
|
+
<div style="font-size:12px;opacity:0.6;line-height:1.6;">${ok ? "Hold on while we wrap up…" : "Something went wrong. Please try again."}</div>
|
|
4893
4893
|
</div>`;
|
|
4894
4894
|
setTimeout(resolve, 1800);
|
|
4895
4895
|
});
|
|
@@ -4905,7 +4905,7 @@ var SmartComplySDK = (() => {
|
|
|
4905
4905
|
this.overlayEl.style.display = "flex";
|
|
4906
4906
|
this.overlayEl.innerHTML = `
|
|
4907
4907
|
<div style="text-align:center;color:#fff;animation:sc-pop-in 0.35s ease;padding:24px;">
|
|
4908
|
-
<div style="width:72px;height:72px;border-radius:50%;margin:0 auto 14px;display:flex;align-items:center;justify-content:center;font-size:32px;background:rgba(251,191,36,0.15);border:3px solid #fbbf24;"
|
|
4908
|
+
<div style="width:72px;height:72px;border-radius:50%;margin:0 auto 14px;display:flex;align-items:center;justify-content:center;font-size:32px;background:rgba(251,191,36,0.15);border:3px solid #fbbf24;">⏱</div>
|
|
4909
4909
|
<div style="font-size:17px;font-weight:700;margin-bottom:8px;">Time's Up</div>
|
|
4910
4910
|
<div style="font-size:12px;opacity:0.6;margin-bottom:18px;">You ran out of time. Please try again.</div>
|
|
4911
4911
|
<button id="sc-retry-btn" style="padding:11px 28px;border-radius:10px;background:#3b82f6;color:#fff;border:none;cursor:pointer;font-size:14px;font-weight:600;width:100%;max-width:180px;">Try Again</button>
|
|
@@ -4944,7 +4944,7 @@ var SmartComplySDK = (() => {
|
|
|
4944
4944
|
header.innerHTML = `<div style="color:#fff;font-size:16px;font-weight:700;margin-bottom:6px;">Scan Your ID Document</div><div style="color:rgba(255,255,255,0.6);font-size:12px;line-height:1.6;">Fit your document inside the frame.<br>Make sure all text and corners are visible.</div>`;
|
|
4945
4945
|
const bottomPanel = document.createElement("div");
|
|
4946
4946
|
bottomPanel.style.cssText = "position:absolute;bottom:0;left:0;right:0;background:linear-gradient(0deg,rgba(0,0,0,0.92) 0%,rgba(0,0,0,0.6) 70%,transparent 100%);padding:16px;";
|
|
4947
|
-
bottomPanel.innerHTML = `<div style="font-size:11px;color:rgba(255,255,255,0.4);text-align:center;margin-bottom:12px;"
|
|
4947
|
+
bottomPanel.innerHTML = `<div style="font-size:11px;color:rgba(255,255,255,0.4);text-align:center;margin-bottom:12px;">💡 Good lighting · No glare · All 4 corners visible</div><button id="sc-capture-doc-btn" style="width:100%;padding:12px;border-radius:12px;background:#3b82f6;color:#fff;border:none;cursor:pointer;font-size:15px;font-weight:700;margin-bottom:8px;">Capture Document</button><label style="width:100%;display:flex;align-items:center;justify-content:center;gap:6px;padding:9px;border-radius:12px;border:1.5px solid rgba(255,255,255,0.18);cursor:pointer;color:rgba(255,255,255,0.6);font-size:13px;font-weight:500;"><span>📁</span><span>Upload from gallery instead</span><input id="sc-upload-doc-input" type="file" accept="image/*" style="display:none;" /></label>`;
|
|
4948
4948
|
docRoot.appendChild(docVideo);
|
|
4949
4949
|
docRoot.appendChild(guideOverlay);
|
|
4950
4950
|
docRoot.appendChild(header);
|
|
@@ -5357,7 +5357,7 @@ var SmartComplySDK = (() => {
|
|
|
5357
5357
|
ui2.updateInstruction(getLabel(current));
|
|
5358
5358
|
}
|
|
5359
5359
|
} else {
|
|
5360
|
-
ui2.updateInstruction("All actions completed!
|
|
5360
|
+
ui2.updateInstruction("All actions completed! ✓");
|
|
5361
5361
|
}
|
|
5362
5362
|
if (actionDetector.allCompleted()) {
|
|
5363
5363
|
clearTimeout(timeout);
|
|
@@ -5389,7 +5389,7 @@ var SmartComplySDK = (() => {
|
|
|
5389
5389
|
});
|
|
5390
5390
|
});
|
|
5391
5391
|
}
|
|
5392
|
-
ui2.updateInstruction("Almost done
|
|
5392
|
+
ui2.updateInstruction("Almost done — hold still...");
|
|
5393
5393
|
await new Promise((r2) => setTimeout(r2, 800));
|
|
5394
5394
|
const autoshotBlob = await this.captureFrame(videoEl);
|
|
5395
5395
|
if (!autoshotBlob || autoshotBlob.size === 0) {
|
|
@@ -5908,7 +5908,7 @@ var SmartComplySDK = (() => {
|
|
|
5908
5908
|
const docLabel = this.getDocumentLabel(documentType);
|
|
5909
5909
|
const requiresBack = this.shouldCaptureBackSide(documentType);
|
|
5910
5910
|
const isCapturingFront = this.currentSide === "front";
|
|
5911
|
-
const sideLabel = requiresBack ? isCapturingFront ? "
|
|
5911
|
+
const sideLabel = requiresBack ? isCapturingFront ? " — Front side" : " — Back side" : "";
|
|
5912
5912
|
const headerRow = document.createElement("div");
|
|
5913
5913
|
headerRow.style.cssText = `
|
|
5914
5914
|
display:flex;align-items:center;gap:14px;
|
|
@@ -5929,7 +5929,7 @@ var SmartComplySDK = (() => {
|
|
|
5929
5929
|
titleEl.textContent = `Capture your ${docLabel}`;
|
|
5930
5930
|
const subEl = document.createElement("div");
|
|
5931
5931
|
subEl.style.cssText = `color:${theme.textSecondary};font-size:12px;margin-top:2px;`;
|
|
5932
|
-
subEl.textContent = requiresBack ? isCapturingFront ? "Step 1 of 2
|
|
5932
|
+
subEl.textContent = requiresBack ? isCapturingFront ? "Step 1 of 2 — front side" : "Step 2 of 2 — back side" : "Choose how to provide your document";
|
|
5933
5933
|
titleBlock.appendChild(titleEl);
|
|
5934
5934
|
titleBlock.appendChild(subEl);
|
|
5935
5935
|
headerRow.appendChild(iconBox);
|
|
@@ -5950,7 +5950,7 @@ var SmartComplySDK = (() => {
|
|
|
5950
5950
|
transition:all 0.15s ease;min-height:80px;
|
|
5951
5951
|
box-shadow:0 4px 14px ${theme.primary}30;
|
|
5952
5952
|
`;
|
|
5953
|
-
cameraBtn.innerHTML = `<span style="font-size:26px;"
|
|
5953
|
+
cameraBtn.innerHTML = `<span style="font-size:26px;">📷</span><span>Take Photo</span><span style="font-size:10px;opacity:0.8;font-weight:500;">Use camera</span>`;
|
|
5954
5954
|
cameraBtn.addEventListener("mouseenter", () => {
|
|
5955
5955
|
cameraBtn.style.opacity = "0.9";
|
|
5956
5956
|
cameraBtn.style.transform = "translateY(-1px)";
|
|
@@ -5972,7 +5972,7 @@ var SmartComplySDK = (() => {
|
|
|
5972
5972
|
font-size:13px;font-weight:600;font-family:inherit;
|
|
5973
5973
|
transition:all 0.15s ease;min-height:80px;
|
|
5974
5974
|
`;
|
|
5975
|
-
uploadBtn.innerHTML = `<span style="font-size:26px;"
|
|
5975
|
+
uploadBtn.innerHTML = `<span style="font-size:26px;">🖼️</span><span>From Gallery</span><span style="font-size:10px;color:${theme.textMuted || theme.textSecondary};font-weight:500;">Upload file</span>`;
|
|
5976
5976
|
uploadBtn.addEventListener("mouseenter", () => {
|
|
5977
5977
|
uploadBtn.style.borderColor = theme.primary;
|
|
5978
5978
|
uploadBtn.style.transform = "translateY(-1px)";
|
|
@@ -6006,7 +6006,7 @@ var SmartComplySDK = (() => {
|
|
|
6006
6006
|
tipItems.forEach((t2) => {
|
|
6007
6007
|
const row = document.createElement("div");
|
|
6008
6008
|
row.style.cssText = `display:flex;align-items:center;gap:5px;font-size:11px;color:${theme.textSecondary};`;
|
|
6009
|
-
row.innerHTML = `<span style="color:${theme.primary};font-weight:700;flex-shrink:0;"
|
|
6009
|
+
row.innerHTML = `<span style="color:${theme.primary};font-weight:700;flex-shrink:0;">✓</span><span>${t2}</span>`;
|
|
6010
6010
|
tipsGrid.appendChild(row);
|
|
6011
6011
|
});
|
|
6012
6012
|
tips.appendChild(tipsGrid);
|
|
@@ -6020,7 +6020,7 @@ var SmartComplySDK = (() => {
|
|
|
6020
6020
|
display:flex;align-items:center;gap:8px;
|
|
6021
6021
|
font-size:12px;color:${theme.textSecondary};line-height:1.5;
|
|
6022
6022
|
`;
|
|
6023
|
-
notice.innerHTML = `<span style="font-size:16px;flex-shrink:0;"
|
|
6023
|
+
notice.innerHTML = `<span style="font-size:16px;flex-shrink:0;">ℹ️</span><span>You'll capture both the <strong style="color:${theme.text}">front</strong> and <strong style="color:${theme.text}">back</strong> of this document.</span>`;
|
|
6024
6024
|
this.root.appendChild(notice);
|
|
6025
6025
|
}
|
|
6026
6026
|
const fileInput = document.createElement("input");
|
|
@@ -6046,10 +6046,10 @@ var SmartComplySDK = (() => {
|
|
|
6046
6046
|
/** Returns an appropriate emoji icon for the document type. */
|
|
6047
6047
|
_docIcon(documentType) {
|
|
6048
6048
|
const t2 = documentType.toLowerCase();
|
|
6049
|
-
if (t2.includes("passport")) return "
|
|
6050
|
-
if (t2.includes("driver") || t2.includes("licen")) return "
|
|
6051
|
-
if (t2.includes("voter") || t2.includes("pvc")) return "
|
|
6052
|
-
return "
|
|
6049
|
+
if (t2.includes("passport")) return "📘";
|
|
6050
|
+
if (t2.includes("driver") || t2.includes("licen")) return "🚗";
|
|
6051
|
+
if (t2.includes("voter") || t2.includes("pvc")) return "🗳️";
|
|
6052
|
+
return "🪪";
|
|
6053
6053
|
}
|
|
6054
6054
|
renderCameraView(container, theme, documentType) {
|
|
6055
6055
|
const wrapper = document.createElement("div");
|
|
@@ -6259,12 +6259,12 @@ var SmartComplySDK = (() => {
|
|
|
6259
6259
|
`;
|
|
6260
6260
|
const issueLine = document.createElement("div");
|
|
6261
6261
|
issueLine.style.cssText = "font-weight:700;color:#b8860b;";
|
|
6262
|
-
issueLine.textContent =
|
|
6262
|
+
issueLine.textContent = `⚠️ ${quality.message}`;
|
|
6263
6263
|
warn.appendChild(issueLine);
|
|
6264
6264
|
if (quality.recommendations.length > 0) {
|
|
6265
6265
|
const rec = document.createElement("div");
|
|
6266
6266
|
rec.style.cssText = "margin-top:4px;color:" + theme.textSecondary + ";";
|
|
6267
|
-
rec.textContent = quality.recommendations.join("
|
|
6267
|
+
rec.textContent = quality.recommendations.join(" · ");
|
|
6268
6268
|
warn.appendChild(rec);
|
|
6269
6269
|
}
|
|
6270
6270
|
this.root.appendChild(warn);
|
|
@@ -6280,7 +6280,7 @@ var SmartComplySDK = (() => {
|
|
|
6280
6280
|
this.root.innerHTML = "";
|
|
6281
6281
|
this.renderChoiceScreen(container, theme, documentType);
|
|
6282
6282
|
});
|
|
6283
|
-
const useBtn = this.createButton(qualityIsPoor ? "Use Anyway
|
|
6283
|
+
const useBtn = this.createButton(qualityIsPoor ? "Use Anyway ⚠" : "Use Photo ✓", theme, !qualityIsPoor);
|
|
6284
6284
|
useBtn.style.flex = "1";
|
|
6285
6285
|
useBtn.addEventListener("click", () => {
|
|
6286
6286
|
if (img._blobUrl) {
|
|
@@ -6426,7 +6426,7 @@ var SmartComplySDK = (() => {
|
|
|
6426
6426
|
position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
|
|
6427
6427
|
font-size:28px;animation:pulse 2s ease-in-out infinite;
|
|
6428
6428
|
`;
|
|
6429
|
-
centerIcon.textContent = "
|
|
6429
|
+
centerIcon.textContent = "📄";
|
|
6430
6430
|
spinnerContainer.appendChild(centerIcon);
|
|
6431
6431
|
this.root.appendChild(spinnerContainer);
|
|
6432
6432
|
const loadingText = document.createElement("div");
|
|
@@ -6461,7 +6461,7 @@ var SmartComplySDK = (() => {
|
|
|
6461
6461
|
color:#ff4444;font-size:14px;margin-top:16px;animation:shake 0.5s ease-in-out;
|
|
6462
6462
|
`;
|
|
6463
6463
|
errorContainer.innerHTML = `
|
|
6464
|
-
<span style="font-size:18px;"
|
|
6464
|
+
<span style="font-size:18px;">⚠️</span>
|
|
6465
6465
|
<span>${message}</span>
|
|
6466
6466
|
`;
|
|
6467
6467
|
if (!document.head.querySelector("style[data-shake-animation]")) {
|
|
@@ -6646,13 +6646,13 @@ var SmartComplySDK = (() => {
|
|
|
6646
6646
|
|
|
6647
6647
|
// src/flow/SmartComplyFlow.ts
|
|
6648
6648
|
var COUNTRY_LABELS = {
|
|
6649
|
-
nigeria: "
|
|
6650
|
-
global: "
|
|
6651
|
-
ghana: "
|
|
6652
|
-
kenya: "
|
|
6653
|
-
south_africa: "
|
|
6654
|
-
united_states: "
|
|
6655
|
-
united_kingdom: "
|
|
6649
|
+
nigeria: "🇳🇬 Nigeria",
|
|
6650
|
+
global: "🌠Other Countries",
|
|
6651
|
+
ghana: "🇬🇠Ghana",
|
|
6652
|
+
kenya: "🇰🇪 Kenya",
|
|
6653
|
+
south_africa: "🇿🇦 South Africa",
|
|
6654
|
+
united_states: "🇺🇸 United States",
|
|
6655
|
+
united_kingdom: "🇬🇧 United Kingdom"
|
|
6656
6656
|
};
|
|
6657
6657
|
function isUploadFieldType(type) {
|
|
6658
6658
|
return type === "upload" || type === "image" || type === "file";
|
|
@@ -6666,37 +6666,37 @@ var SmartComplySDK = (() => {
|
|
|
6666
6666
|
return t2.includes("voter") || t2.includes("driver") || t2.includes("license") || t2.includes("national id") || t2.includes("national id card");
|
|
6667
6667
|
};
|
|
6668
6668
|
if (u2.includes("BVN") || u2.includes("BANK VERIFICATION")) {
|
|
6669
|
-
return { icon: "
|
|
6669
|
+
return { icon: "ðŸ¦", desc: "Enter your 11-digit Bank Verification Number (BVN)", requiresBack: false };
|
|
6670
6670
|
}
|
|
6671
6671
|
if (u2.includes("NIN") || u2.includes("NATIONAL IDENTITY NUMBER")) {
|
|
6672
|
-
return { icon: "
|
|
6672
|
+
return { icon: "🆔", desc: "Enter your 11-digit National Identification Number (NIN)", requiresBack: false };
|
|
6673
6673
|
}
|
|
6674
6674
|
if (u2.includes("GHANA")) {
|
|
6675
|
-
if (isDocumentFlow) return { icon: "
|
|
6676
|
-
return { icon: "
|
|
6675
|
+
if (isDocumentFlow) return { icon: "🪪", desc: "Capture or upload your Ghana Card", requiresBack: true };
|
|
6676
|
+
return { icon: "🪪", desc: "Enter your Ghana Card number", requiresBack: false };
|
|
6677
6677
|
}
|
|
6678
6678
|
if (u2.includes("SSNIT"))
|
|
6679
|
-
return { icon: "
|
|
6679
|
+
return { icon: "ðŸ›ï¸", desc: "Enter your SSNIT number", requiresBack: false };
|
|
6680
6680
|
if (u2.includes("KENYA") || u2.includes("NATIONAL") && u2.includes("KENYA"))
|
|
6681
|
-
return { icon: "
|
|
6681
|
+
return { icon: "🆔", desc: "Enter your Kenya National ID number", requiresBack: false };
|
|
6682
6682
|
if (u2.includes("TIN") || u2.includes("TAX IDENTIFICATION"))
|
|
6683
|
-
return { icon: "
|
|
6683
|
+
return { icon: "🧾", desc: "Enter your Tax Identification Number (TIN)", requiresBack: false };
|
|
6684
6684
|
if (u2.includes("CAC") || u2.includes("CORPORATE AFFAIRS") || u2.includes("COMPANY"))
|
|
6685
|
-
return { icon: "
|
|
6685
|
+
return { icon: "ðŸ¢", desc: advanced ? "Enter RC number, company name & type" : "Enter your company registration number", requiresBack: false };
|
|
6686
6686
|
if (u2.includes("VOTER") || u2.includes("PVC")) {
|
|
6687
6687
|
const requiresBack = requiresBackSide(typeName);
|
|
6688
6688
|
return {
|
|
6689
|
-
icon: "
|
|
6689
|
+
icon: "🗳ï¸",
|
|
6690
6690
|
desc: isDocumentFlow ? `Capture or upload your voter's card${requiresBack ? " (front & back)" : ""}` : "Enter your voter ID number",
|
|
6691
6691
|
requiresBack: isDocumentFlow ? requiresBack : false
|
|
6692
6692
|
};
|
|
6693
6693
|
}
|
|
6694
6694
|
if (u2.includes("PASSPORT"))
|
|
6695
|
-
return { icon: "
|
|
6695
|
+
return { icon: "📘", desc: isDocumentFlow ? "Capture or upload your passport" : "Enter your passport number", requiresBack: false };
|
|
6696
6696
|
if (u2.includes("DRIVER") || u2.includes("LICENSE") || u2.includes("LICENCE")) {
|
|
6697
6697
|
const requiresBack = requiresBackSide(typeName);
|
|
6698
6698
|
return {
|
|
6699
|
-
icon: "
|
|
6699
|
+
icon: "🚗",
|
|
6700
6700
|
desc: isDocumentFlow ? `Capture or upload your driver's license${requiresBack ? " (front & back)" : ""}` : "Enter your driver's license number",
|
|
6701
6701
|
requiresBack: isDocumentFlow ? requiresBack : false
|
|
6702
6702
|
};
|
|
@@ -6704,15 +6704,15 @@ var SmartComplySDK = (() => {
|
|
|
6704
6704
|
if (u2.includes("NATIONAL ID") || u2.includes("NATIONAL") && u2.includes("CARD")) {
|
|
6705
6705
|
const requiresBack = requiresBackSide(typeName);
|
|
6706
6706
|
return {
|
|
6707
|
-
icon: "
|
|
6707
|
+
icon: "🪪",
|
|
6708
6708
|
desc: isDocumentFlow ? `Capture or upload your ID card${requiresBack ? " (front & back)" : ""}` : "Enter your National ID number",
|
|
6709
6709
|
requiresBack: isDocumentFlow ? requiresBack : false
|
|
6710
6710
|
};
|
|
6711
6711
|
}
|
|
6712
6712
|
if (u2.includes("LIVENESS") || u2.includes("FACE COMPARISON") || u2.includes("FACE MATCH"))
|
|
6713
|
-
return { icon: "
|
|
6713
|
+
return { icon: "🤳", desc: "We'll capture a short selfie video to verify you", requiresBack: false };
|
|
6714
6714
|
return {
|
|
6715
|
-
icon: isDocumentFlow ? "
|
|
6715
|
+
icon: isDocumentFlow ? "📄" : "🆔",
|
|
6716
6716
|
desc: isDocumentFlow ? "Capture or upload your document" : "Enter your ID number",
|
|
6717
6717
|
requiresBack: false
|
|
6718
6718
|
};
|
|
@@ -7124,7 +7124,7 @@ var SmartComplySDK = (() => {
|
|
|
7124
7124
|
display:flex;align-items:center;justify-content:center;
|
|
7125
7125
|
font-size:22px;
|
|
7126
7126
|
`;
|
|
7127
|
-
centre.textContent = "
|
|
7127
|
+
centre.textContent = "🛡️";
|
|
7128
7128
|
spinnerWrap.appendChild(ring);
|
|
7129
7129
|
spinnerWrap.appendChild(centre);
|
|
7130
7130
|
container.appendChild(spinnerWrap);
|
|
@@ -7151,7 +7151,7 @@ var SmartComplySDK = (() => {
|
|
|
7151
7151
|
background:linear-gradient(135deg,${this.theme.primary}22,${this.theme.primaryGlow});
|
|
7152
7152
|
border:1.5px solid ${this.theme.primary}33;
|
|
7153
7153
|
`;
|
|
7154
|
-
iconWrap.textContent = isDocFlow ? "
|
|
7154
|
+
iconWrap.textContent = isDocFlow ? "🪪" : "🛡ï¸";
|
|
7155
7155
|
topRow.appendChild(iconWrap);
|
|
7156
7156
|
const badge = document.createElement("div");
|
|
7157
7157
|
badge.style.cssText = `
|
|
@@ -7162,7 +7162,7 @@ var SmartComplySDK = (() => {
|
|
|
7162
7162
|
color:${this.theme.primary};
|
|
7163
7163
|
border:1px solid ${this.theme.primary}30;
|
|
7164
7164
|
`;
|
|
7165
|
-
badge.textContent = isDocFlow ? "
|
|
7165
|
+
badge.textContent = isDocFlow ? "📄 Document Verification" : "🔠Data Verification";
|
|
7166
7166
|
topRow.appendChild(badge);
|
|
7167
7167
|
container.appendChild(topRow);
|
|
7168
7168
|
const titleWrap = document.createElement("div");
|
|
@@ -7184,13 +7184,13 @@ var SmartComplySDK = (() => {
|
|
|
7184
7184
|
titleWrap.appendChild(desc);
|
|
7185
7185
|
container.appendChild(titleWrap);
|
|
7186
7186
|
const steps = isDocFlow ? [
|
|
7187
|
-
{ icon: "
|
|
7188
|
-
{ icon: "
|
|
7189
|
-
{ icon: "
|
|
7187
|
+
{ icon: "🪪", text: "Choose your document type", sub: "Passport, National ID, Driver License" },
|
|
7188
|
+
{ icon: "📷", text: "Scan your document", sub: "Upload or capture a photo of your ID" },
|
|
7189
|
+
{ icon: "🤳", text: "Face check", sub: "Quick selfie to confirm it's you" }
|
|
7190
7190
|
] : [
|
|
7191
|
-
{ icon: "
|
|
7192
|
-
{ icon: "
|
|
7193
|
-
{ icon: "
|
|
7191
|
+
{ icon: "🆔", text: "Choose your ID type", sub: "NIN, BVN, Voter's Card and more" },
|
|
7192
|
+
{ icon: "ðŸ“", text: "Enter your ID details", sub: "Exactly as shown on your ID" },
|
|
7193
|
+
{ icon: "🤳", text: "Face check", sub: "Quick selfie to confirm it's you" }
|
|
7194
7194
|
];
|
|
7195
7195
|
const stepsWrap = document.createElement("div");
|
|
7196
7196
|
stepsWrap.style.cssText = `
|
|
@@ -7230,7 +7230,7 @@ var SmartComplySDK = (() => {
|
|
|
7230
7230
|
stepsWrap.appendChild(row);
|
|
7231
7231
|
});
|
|
7232
7232
|
container.appendChild(stepsWrap);
|
|
7233
|
-
const btn = this.createPrimaryButton("Get Started
|
|
7233
|
+
const btn = this.createPrimaryButton("Get Started →");
|
|
7234
7234
|
btn.style.cssText += "margin-top:2px;";
|
|
7235
7235
|
btn.addEventListener("click", () => this.showStep("country"));
|
|
7236
7236
|
container.appendChild(btn);
|
|
@@ -7239,7 +7239,7 @@ var SmartComplySDK = (() => {
|
|
|
7239
7239
|
display:flex;align-items:center;gap:6px;
|
|
7240
7240
|
color:${this.theme.textMuted};font-size:10.5px;
|
|
7241
7241
|
`;
|
|
7242
|
-
trust.textContent = "
|
|
7242
|
+
trust.textContent = "🔒 End-to-end encrypted";
|
|
7243
7243
|
container.appendChild(trust);
|
|
7244
7244
|
}
|
|
7245
7245
|
// ── Country Select ──────────────────────────────────────────────
|
|
@@ -7292,7 +7292,7 @@ var SmartComplySDK = (() => {
|
|
|
7292
7292
|
const requiresBack = requiresBackFromBackend ?? info.requiresBack;
|
|
7293
7293
|
let subtitle2 = info.desc;
|
|
7294
7294
|
if (requiresBack && isThisDocFlow) {
|
|
7295
|
-
subtitle2 += "
|
|
7295
|
+
subtitle2 += " âš ï¸ Both sides required";
|
|
7296
7296
|
}
|
|
7297
7297
|
const displayName = typeName.replace(/\s*with\s+face\s*/gi, " ").replace(/\s*\(NIN\)\s*/gi, " ").replace(/\s*\(BVN\)\s*/gi, " ").replace(/\s{2,}/g, " ").trim();
|
|
7298
7298
|
const card = this.createOptionCard(
|
|
@@ -7355,13 +7355,13 @@ var SmartComplySDK = (() => {
|
|
|
7355
7355
|
{ match: "BVN", rule: { minLen: 11, maxLen: 11, numeric: true, hint: "BVN must be exactly 11 digits" } },
|
|
7356
7356
|
{ match: "NIN", rule: { minLen: 11, maxLen: 11, numeric: true, hint: "NIN must be exactly 11 digits" } },
|
|
7357
7357
|
{ match: "NATIONAL IDENTITY", rule: { minLen: 11, maxLen: 11, numeric: true, hint: "NIN must be exactly 11 digits" } },
|
|
7358
|
-
{ match: "PASSPORT", rule: { minLen: 6, maxLen: 20, alphanumeric: true, hint: "Passport number must be 6
|
|
7359
|
-
{ match: "DRIVER", rule: { minLen: 3, maxLen: 30, alphanumeric: true, hint: "Licence number must be 3
|
|
7360
|
-
{ match: "VOTER", rule: { minLen: 6, maxLen: 30, alphanumeric: true, hint: "Voter ID must be 6
|
|
7361
|
-
{ match: "GHANA", rule: { minLen: 8, maxLen: 20, alphanumeric: true, hint: "Ghana Card number must be 8
|
|
7362
|
-
{ match: "SSNIT", rule: { minLen: 7, maxLen: 15, alphanumeric: true, hint: "SSNIT number must be 7
|
|
7363
|
-
{ match: "TIN", rule: { minLen: 8, maxLen: 20, alphanumeric: true, hint: "TIN must be 8
|
|
7364
|
-
{ match: "KRA", rule: { minLen: 10, maxLen: 12, alphanumeric: true, hint: "KRA PIN must be 10
|
|
7358
|
+
{ match: "PASSPORT", rule: { minLen: 6, maxLen: 20, alphanumeric: true, hint: "Passport number must be 6–20 alphanumeric characters" } },
|
|
7359
|
+
{ match: "DRIVER", rule: { minLen: 3, maxLen: 30, alphanumeric: true, hint: "Licence number must be 3–30 alphanumeric characters" } },
|
|
7360
|
+
{ match: "VOTER", rule: { minLen: 6, maxLen: 30, alphanumeric: true, hint: "Voter ID must be 6–30 alphanumeric characters" } },
|
|
7361
|
+
{ match: "GHANA", rule: { minLen: 8, maxLen: 20, alphanumeric: true, hint: "Ghana Card number must be 8–20 alphanumeric characters" } },
|
|
7362
|
+
{ match: "SSNIT", rule: { minLen: 7, maxLen: 15, alphanumeric: true, hint: "SSNIT number must be 7–15 alphanumeric characters" } },
|
|
7363
|
+
{ match: "TIN", rule: { minLen: 8, maxLen: 20, alphanumeric: true, hint: "TIN must be 8–20 characters" } },
|
|
7364
|
+
{ match: "KRA", rule: { minLen: 10, maxLen: 12, alphanumeric: true, hint: "KRA PIN must be 10–12 characters" } }
|
|
7365
7365
|
];
|
|
7366
7366
|
function getFieldRule(label) {
|
|
7367
7367
|
const upper = label.toUpperCase();
|
|
@@ -7647,7 +7647,7 @@ var SmartComplySDK = (() => {
|
|
|
7647
7647
|
this._prewarmCamera();
|
|
7648
7648
|
const iconWrap = document.createElement("div");
|
|
7649
7649
|
iconWrap.style.cssText = `width:64px;height:64px;border-radius:50%;background:${this.theme.primary}15;border:2px solid ${this.theme.primary}30;display:flex;align-items:center;justify-content:center;font-size:28px;`;
|
|
7650
|
-
iconWrap.textContent = "
|
|
7650
|
+
iconWrap.textContent = "🛡ï¸";
|
|
7651
7651
|
container.appendChild(iconWrap);
|
|
7652
7652
|
const title = document.createElement("h2");
|
|
7653
7653
|
title.style.cssText = `color:${this.theme.text};font-size:18px;font-weight:700;margin:0;`;
|
|
@@ -7684,7 +7684,7 @@ var SmartComplySDK = (() => {
|
|
|
7684
7684
|
sub.textContent = "Your details have been confirmed. Please continue to the face check.";
|
|
7685
7685
|
container.appendChild(sub);
|
|
7686
7686
|
}
|
|
7687
|
-
const yesBtn = this.createPrimaryButton("Yes, that's me
|
|
7687
|
+
const yesBtn = this.createPrimaryButton("Yes, that's me — continue");
|
|
7688
7688
|
yesBtn.addEventListener("click", () => {
|
|
7689
7689
|
this._confirmRetries = 0;
|
|
7690
7690
|
this.showStep("liveness");
|
|
@@ -7711,7 +7711,7 @@ var SmartComplySDK = (() => {
|
|
|
7711
7711
|
this._prewarmCamera();
|
|
7712
7712
|
const iconWrap = document.createElement("div");
|
|
7713
7713
|
iconWrap.style.cssText = `width:64px;height:64px;border-radius:50%;background:${this.theme.primary}15;border:2px solid ${this.theme.primary}30;display:flex;align-items:center;justify-content:center;font-size:28px;`;
|
|
7714
|
-
iconWrap.textContent = "
|
|
7714
|
+
iconWrap.textContent = "📄";
|
|
7715
7715
|
container.appendChild(iconWrap);
|
|
7716
7716
|
const title = document.createElement("h2");
|
|
7717
7717
|
title.style.cssText = `color:${this.theme.text};font-size:18px;font-weight:700;margin:0;`;
|
|
@@ -7734,7 +7734,7 @@ var SmartComplySDK = (() => {
|
|
|
7734
7734
|
if (this._ocrExpirySoon && !this._ocrIsExpired) {
|
|
7735
7735
|
const warn = document.createElement("div");
|
|
7736
7736
|
warn.style.cssText = `width:100%;padding:10px 14px;border-radius:10px;background:${this.theme.warning}18;border:1px solid ${this.theme.warning}40;color:${this.theme.warning};font-size:12px;text-align:left;line-height:1.5;`;
|
|
7737
|
-
warn.textContent = "
|
|
7737
|
+
warn.textContent = "âš ï¸ Your document expires soon. Some services may not accept it, but you can still continue.";
|
|
7738
7738
|
container.appendChild(warn);
|
|
7739
7739
|
}
|
|
7740
7740
|
const card = document.createElement("div");
|
|
@@ -7797,18 +7797,18 @@ var SmartComplySDK = (() => {
|
|
|
7797
7797
|
ring.style.cssText = `position:absolute;inset:0;border-radius:50%;border:3px solid ${this.theme.border};border-top-color:${this.theme.primary};animation:sc-spin 0.9s linear infinite;`;
|
|
7798
7798
|
const centre = document.createElement("div");
|
|
7799
7799
|
centre.style.cssText = "position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:20px;";
|
|
7800
|
-
centre.textContent = "
|
|
7800
|
+
centre.textContent = "📄";
|
|
7801
7801
|
spinnerWrap.appendChild(ring);
|
|
7802
7802
|
spinnerWrap.appendChild(centre);
|
|
7803
7803
|
container.appendChild(spinnerWrap);
|
|
7804
7804
|
const statusEl = document.createElement("div");
|
|
7805
7805
|
statusEl.setAttribute("aria-live", "polite");
|
|
7806
7806
|
statusEl.style.cssText = `color:${this.theme.text};font-size:15px;font-weight:600;`;
|
|
7807
|
-
statusEl.textContent = "Reading your document
|
|
7807
|
+
statusEl.textContent = "Reading your document…";
|
|
7808
7808
|
container.appendChild(statusEl);
|
|
7809
7809
|
const subEl = document.createElement("div");
|
|
7810
7810
|
subEl.style.cssText = `color:${this.theme.textSecondary};font-size:12px;max-width:260px;line-height:1.5;`;
|
|
7811
|
-
subEl.textContent = "This usually takes 5
|
|
7811
|
+
subEl.textContent = "This usually takes 5–15 seconds. Please wait.";
|
|
7812
7812
|
container.appendChild(subEl);
|
|
7813
7813
|
if (!this.livenessEntryId) {
|
|
7814
7814
|
this.showErrorStep("Document upload failed. Please try again.");
|
|
@@ -7853,8 +7853,8 @@ var SmartComplySDK = (() => {
|
|
|
7853
7853
|
if (polls < MAX_POLLS && !this.isDestroyed) {
|
|
7854
7854
|
this._ocrPollTimer = setTimeout(poll, 2e3);
|
|
7855
7855
|
} else if (!this.isDestroyed) {
|
|
7856
|
-
statusEl.textContent = "Taking longer than usual
|
|
7857
|
-
subEl.textContent = "We'll continue
|
|
7856
|
+
statusEl.textContent = "Taking longer than usual…";
|
|
7857
|
+
subEl.textContent = "We'll continue — you can confirm your details on the next screen.";
|
|
7858
7858
|
this._ocrPollTimer = setTimeout(() => {
|
|
7859
7859
|
if (!this.isDestroyed) this.showStep("document_confirm");
|
|
7860
7860
|
}, 2e3);
|
|
@@ -7873,7 +7873,7 @@ var SmartComplySDK = (() => {
|
|
|
7873
7873
|
container.style.cssText += "display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:20px 0;";
|
|
7874
7874
|
const icon = document.createElement("div");
|
|
7875
7875
|
icon.style.cssText = `width:72px;height:72px;border-radius:50%;background:${this.theme.errorBg};border:3px solid ${this.theme.error};display:flex;align-items:center;justify-content:center;font-size:28px;`;
|
|
7876
|
-
icon.textContent = "
|
|
7876
|
+
icon.textContent = "📅";
|
|
7877
7877
|
container.appendChild(icon);
|
|
7878
7878
|
const t2 = document.createElement("h2");
|
|
7879
7879
|
t2.style.cssText = `color:${this.theme.text};font-size:18px;font-weight:700;margin:0;`;
|
|
@@ -7902,7 +7902,7 @@ var SmartComplySDK = (() => {
|
|
|
7902
7902
|
container.style.cssText += "display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:20px 0;";
|
|
7903
7903
|
const icon = document.createElement("div");
|
|
7904
7904
|
icon.style.cssText = `width:72px;height:72px;border-radius:50%;background:${this.theme.errorBg};border:3px solid ${this.theme.error};display:flex;align-items:center;justify-content:center;font-size:28px;`;
|
|
7905
|
-
icon.textContent = "
|
|
7905
|
+
icon.textContent = "ðŸ”";
|
|
7906
7906
|
container.appendChild(icon);
|
|
7907
7907
|
const t2 = document.createElement("h2");
|
|
7908
7908
|
t2.style.cssText = `color:${this.theme.text};font-size:18px;font-weight:700;margin:0;`;
|
|
@@ -7935,7 +7935,7 @@ var SmartComplySDK = (() => {
|
|
|
7935
7935
|
});
|
|
7936
7936
|
const iconWrap = document.createElement("div");
|
|
7937
7937
|
iconWrap.style.cssText = `width:80px;height:80px;border-radius:50%;background:${this.theme.successBg};border:3px solid ${this.theme.success};display:flex;align-items:center;justify-content:center;font-size:36px;font-weight:700;color:${this.theme.success};animation:sc-pop 0.4s ease;`;
|
|
7938
|
-
iconWrap.textContent = "
|
|
7938
|
+
iconWrap.textContent = "✓";
|
|
7939
7939
|
container.appendChild(iconWrap);
|
|
7940
7940
|
const title = document.createElement("h2");
|
|
7941
7941
|
title.style.cssText = `color:${this.theme.text};font-size:22px;font-weight:700;margin:0;`;
|
|
@@ -7948,7 +7948,7 @@ var SmartComplySDK = (() => {
|
|
|
7948
7948
|
container.appendChild(desc);
|
|
7949
7949
|
const info = document.createElement("div");
|
|
7950
7950
|
info.style.cssText = `color:${this.theme.textMuted};font-size:11px;display:flex;align-items:center;gap:4px;`;
|
|
7951
|
-
info.textContent = "
|
|
7951
|
+
info.textContent = "🔒 Your data is encrypted and secure";
|
|
7952
7952
|
container.appendChild(info);
|
|
7953
7953
|
const doneBtn = this.createPrimaryButton("Close");
|
|
7954
7954
|
doneBtn.addEventListener("click", () => {
|
|
@@ -7961,7 +7961,7 @@ var SmartComplySDK = (() => {
|
|
|
7961
7961
|
container.style.cssText += "display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:24px 0;";
|
|
7962
7962
|
const icon = document.createElement("div");
|
|
7963
7963
|
icon.style.cssText = `width:72px;height:72px;border-radius:50%;background:${this.theme.errorBg};border:3px solid ${this.theme.error};display:flex;align-items:center;justify-content:center;font-size:28px;`;
|
|
7964
|
-
icon.textContent = "
|
|
7964
|
+
icon.textContent = "âš ï¸";
|
|
7965
7965
|
container.appendChild(icon);
|
|
7966
7966
|
const t2 = document.createElement("h2");
|
|
7967
7967
|
t2.style.cssText = `color:${this.theme.text};font-size:18px;font-weight:700;margin:0;`;
|
|
@@ -8017,7 +8017,7 @@ var SmartComplySDK = (() => {
|
|
|
8017
8017
|
<div style="display:flex;flex-direction:column;align-items:center;gap:14px;padding:28px 20px;">
|
|
8018
8018
|
<div style="position:relative;width:52px;height:52px;">
|
|
8019
8019
|
<div style="position:absolute;inset:0;border-radius:50%;border:3px solid ${this.theme.border};border-top-color:${this.theme.primary};animation:sc-spin 0.8s linear infinite;"></div>
|
|
8020
|
-
<div style="position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:20px;"
|
|
8020
|
+
<div style="position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:20px;">ðŸ”</div>
|
|
8021
8021
|
</div>
|
|
8022
8022
|
<div style="color:${this.theme.text};font-size:14px;font-weight:600;">Scanning document...</div>
|
|
8023
8023
|
<div style="color:${this.theme.textSecondary};font-size:12px;text-align:center;max-width:200px;line-height:1.5;">Running OCR and verifying your identity</div>
|
|
@@ -8075,7 +8075,7 @@ var SmartComplySDK = (() => {
|
|
|
8075
8075
|
<div style="display:flex;flex-direction:column;align-items:center;gap:16px;padding:28px 20px;text-align:center;">
|
|
8076
8076
|
<div style="position:relative;width:52px;height:52px;">
|
|
8077
8077
|
<div style="position:absolute;inset:0;border-radius:50%;border:3px solid ${this.theme.border};border-top-color:${this.theme.primary};animation:sc-spin 0.8s linear infinite;"></div>
|
|
8078
|
-
<div style="position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:20px;"
|
|
8078
|
+
<div style="position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:20px;">🔄</div>
|
|
8079
8079
|
</div>
|
|
8080
8080
|
<div style="color:${this.theme.text};font-size:14px;font-weight:600;">Retrying...</div>
|
|
8081
8081
|
<div style="color:${this.theme.textSecondary};font-size:12px;max-width:240px;line-height:1.5;">Attempt ${retryCount} of ${maxRetries}</div>
|
|
@@ -8116,7 +8116,7 @@ var SmartComplySDK = (() => {
|
|
|
8116
8116
|
wrap.setAttribute("role", "alert");
|
|
8117
8117
|
const icon = document.createElement("div");
|
|
8118
8118
|
icon.style.cssText = `width:56px;height:56px;border-radius:50%;background:${this.theme.errorBg};border:3px solid ${this.theme.error};display:flex;align-items:center;justify-content:center;font-size:26px;`;
|
|
8119
|
-
icon.textContent = "
|
|
8119
|
+
icon.textContent = "ðŸ”";
|
|
8120
8120
|
wrap.appendChild(icon);
|
|
8121
8121
|
const titleEl = document.createElement("div");
|
|
8122
8122
|
titleEl.style.cssText = `color:${this.theme.text};font-size:14px;font-weight:700;`;
|
|
@@ -8216,7 +8216,7 @@ var SmartComplySDK = (() => {
|
|
|
8216
8216
|
const isDocQuality = /blurry|blur|quality|glare|dark|bright|lighting/i.test(message);
|
|
8217
8217
|
const isExpiredDoc = /document.*expired|expired.*document/i.test(message);
|
|
8218
8218
|
const isFaceMatch = /face.*match|selfie.*match|does not match/i.test(message);
|
|
8219
|
-
const errorIcon = isCameraErr ? "
|
|
8219
|
+
const errorIcon = isCameraErr ? "📷" : isNetworkErr ? "📡" : isAuthErr ? "â±" : isDocQuality ? "ðŸ”" : isExpiredDoc ? "📅" : isFaceMatch ? "🤳" : "✕";
|
|
8220
8220
|
const errorTitle = isCameraErr ? "Camera Access Required" : isNetworkErr ? "Connection Problem" : isAuthErr ? "Session Expired" : isDocQuality ? "Document Photo Unclear" : isExpiredDoc ? "Document Expired" : isFaceMatch ? "Face Match Failed" : "Verification Unsuccessful";
|
|
8221
8221
|
const userMessage = isCameraErr ? "Please allow camera access in your browser settings and try again." : isNetworkErr ? "Check your internet connection and try again." : isAuthErr ? "Your session has expired. Please start again." : isDocQuality ? _sanitizeUserMessage(message) || "Please retake your document photo in good lighting with no glare." : isExpiredDoc ? "The document you submitted has expired. Please use a valid, current ID." : isFaceMatch ? "Your selfie did not match the photo on your ID. Please ensure you are using your own valid document and face the camera directly." : _sanitizeUserMessage(message) || "We were unable to complete your verification. Please try again.";
|
|
8222
8222
|
const iconWrap = document.createElement("div");
|
|
@@ -8321,7 +8321,7 @@ var SmartComplySDK = (() => {
|
|
|
8321
8321
|
stepIndicator.appendChild(this.stepLabel);
|
|
8322
8322
|
header.appendChild(stepIndicator);
|
|
8323
8323
|
const closeBtn = document.createElement("button");
|
|
8324
|
-
closeBtn.innerHTML = "
|
|
8324
|
+
closeBtn.innerHTML = "✕";
|
|
8325
8325
|
closeBtn.setAttribute("aria-label", "Close identity verification");
|
|
8326
8326
|
closeBtn.style.cssText = `
|
|
8327
8327
|
width:32px;height:32px;border-radius:8px;flex-shrink:0;
|
|
@@ -8402,7 +8402,7 @@ var SmartComplySDK = (() => {
|
|
|
8402
8402
|
}
|
|
8403
8403
|
const arrow = document.createElement("span");
|
|
8404
8404
|
arrow.style.cssText = `color:${this.theme.textMuted};font-size:18px;flex-shrink:0;`;
|
|
8405
|
-
arrow.textContent = "
|
|
8405
|
+
arrow.textContent = "→";
|
|
8406
8406
|
card.appendChild(textWrap);
|
|
8407
8407
|
card.appendChild(arrow);
|
|
8408
8408
|
return card;
|
|
@@ -8474,7 +8474,7 @@ var SmartComplySDK = (() => {
|
|
|
8474
8474
|
if (this.currentStep === "loading" || this.currentStep === "welcome") {
|
|
8475
8475
|
this.stepLabel.textContent = "";
|
|
8476
8476
|
} else if (this.currentStep === "done" || this.currentStep === "result") {
|
|
8477
|
-
this.stepLabel.textContent = "Complete
|
|
8477
|
+
this.stepLabel.textContent = "Complete ✓";
|
|
8478
8478
|
} else if (stage2Steps.includes(this.currentStep)) {
|
|
8479
8479
|
this.stepLabel.textContent = "Stage 2 of 2: Face Check";
|
|
8480
8480
|
} else if (stage1Steps.includes(this.currentStep)) {
|
|
@@ -8588,20 +8588,20 @@ var SmartComplySDK = (() => {
|
|
|
8588
8588
|
/** Emit an informational message (debug mode only). */
|
|
8589
8589
|
info(message, ...args) {
|
|
8590
8590
|
if (!isDebugEnabled()) return;
|
|
8591
|
-
console.info(`${PREFIX}
|
|
8591
|
+
console.info(`${PREFIX} ℹ ${message}`, ...args);
|
|
8592
8592
|
},
|
|
8593
8593
|
/** Emit a warning (always visible). */
|
|
8594
8594
|
warn(message, ...args) {
|
|
8595
|
-
console.warn(`${PREFIX}
|
|
8595
|
+
console.warn(`${PREFIX} ⚠ ${message}`, ...args);
|
|
8596
8596
|
},
|
|
8597
8597
|
/** Emit an error (always visible). */
|
|
8598
8598
|
error(message, ...args) {
|
|
8599
|
-
console.error(`${PREFIX}
|
|
8599
|
+
console.error(`${PREFIX} ✖ ${message}`, ...args);
|
|
8600
8600
|
},
|
|
8601
8601
|
/** Emit a debug trace (debug mode only — lowest priority). */
|
|
8602
8602
|
debug(message, ...args) {
|
|
8603
8603
|
if (!isDebugEnabled()) return;
|
|
8604
|
-
console.debug(`${PREFIX}
|
|
8604
|
+
console.debug(`${PREFIX} ⬡ ${message}`, ...args);
|
|
8605
8605
|
},
|
|
8606
8606
|
/** Log a timed group of related messages (debug mode only). */
|
|
8607
8607
|
group(label, fn2) {
|
|
@@ -8759,7 +8759,7 @@ var SmartComplySDK = (() => {
|
|
|
8759
8759
|
}
|
|
8760
8760
|
};
|
|
8761
8761
|
xhr.onerror = async () => {
|
|
8762
|
-
SDKLogger.warn(`Upload to ${path} failed
|
|
8762
|
+
SDKLogger.warn(`Upload to ${path} failed — network error`, { retriesLeft });
|
|
8763
8763
|
if (retriesLeft > 0) {
|
|
8764
8764
|
await new Promise((r2) => setTimeout(r2, RETRY_DELAY_MS));
|
|
8765
8765
|
try {
|