vesant-sdk 2.0.0-dev.9578c07 → 2.0.0-dev.9a74cc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react.js +61 -19
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +61 -19
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -893,10 +893,10 @@ var Upload = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0i
|
|
|
893
893
|
// src/kyc/FaceCaptureModal.tsx
|
|
894
894
|
var MOBILE_UA = /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
|
|
895
895
|
var LIVENESS_MESSAGES = [
|
|
896
|
-
"
|
|
897
|
-
"
|
|
898
|
-
"
|
|
899
|
-
"
|
|
896
|
+
"Position your face inside the circle",
|
|
897
|
+
"Make sure your face is well lit",
|
|
898
|
+
"Remove glasses or hats if possible",
|
|
899
|
+
"Look straight at the camera, then tap Capture"
|
|
900
900
|
];
|
|
901
901
|
function headerSubtitle(stageKind) {
|
|
902
902
|
switch (stageKind) {
|
|
@@ -905,7 +905,7 @@ function headerSubtitle(stageKind) {
|
|
|
905
905
|
case "accepted":
|
|
906
906
|
return "All set";
|
|
907
907
|
case "declined":
|
|
908
|
-
return "Verification didn't match
|
|
908
|
+
return "Verification didn't match, try once more";
|
|
909
909
|
case "max_attempts":
|
|
910
910
|
return "We couldn't verify you";
|
|
911
911
|
default:
|
|
@@ -1011,6 +1011,15 @@ function FaceCaptureModal({
|
|
|
1011
1011
|
setStage({ kind: "submitting" });
|
|
1012
1012
|
let settled = false;
|
|
1013
1013
|
const ref = session.reference;
|
|
1014
|
+
const baselineAttempts = attempts;
|
|
1015
|
+
const isFreshPollResult = (r) => {
|
|
1016
|
+
if (r.status === "accepted") return true;
|
|
1017
|
+
if (r.status === "declined") {
|
|
1018
|
+
const derivedAttempts = maxAttempts - (r.data?.retries_remaining ?? 0);
|
|
1019
|
+
return derivedAttempts > baselineAttempts;
|
|
1020
|
+
}
|
|
1021
|
+
return false;
|
|
1022
|
+
};
|
|
1014
1023
|
try {
|
|
1015
1024
|
const postPromise = (async () => {
|
|
1016
1025
|
try {
|
|
@@ -1031,7 +1040,7 @@ function FaceCaptureModal({
|
|
|
1031
1040
|
if (settled || cancelledRef.current) return null;
|
|
1032
1041
|
try {
|
|
1033
1042
|
const r = await client.getReuseKycSessionStatus(ref);
|
|
1034
|
-
if (r
|
|
1043
|
+
if (isFreshPollResult(r)) return r;
|
|
1035
1044
|
} catch {
|
|
1036
1045
|
}
|
|
1037
1046
|
if (settled || cancelledRef.current) return null;
|
|
@@ -1182,6 +1191,7 @@ var keyframes = `
|
|
|
1182
1191
|
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
|
|
1183
1192
|
@keyframes zoomIn { from { transform: scale(.96); opacity: 0 } to { transform: scale(1); opacity: 1 } }
|
|
1184
1193
|
@keyframes spin { to { transform: rotate(360deg) } }
|
|
1194
|
+
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .5 } }
|
|
1185
1195
|
`;
|
|
1186
1196
|
var overlayStyle = {
|
|
1187
1197
|
position: "fixed",
|
|
@@ -1429,7 +1439,7 @@ function LiveCamera({ onCapture, onCancel, message }) {
|
|
|
1429
1439
|
autoPlay: true,
|
|
1430
1440
|
style: videoStyle
|
|
1431
1441
|
}
|
|
1432
|
-
), /* @__PURE__ */ React__default.default.createElement("div", { style:
|
|
1442
|
+
), /* @__PURE__ */ React__default.default.createElement("div", { style: faceOverlayContainerStyle, "aria-hidden": "true" }, /* @__PURE__ */ React__default.default.createElement("div", { style: faceRingWrapStyle }, /* @__PURE__ */ React__default.default.createElement("div", { style: faceDashedRingStyle }), /* @__PURE__ */ React__default.default.createElement("div", { style: faceCircleStyle }))), message && /* @__PURE__ */ React__default.default.createElement("div", { style: liveMessagePillContainerStyle }, /* @__PURE__ */ React__default.default.createElement("div", { style: liveMessagePillStyle }, /* @__PURE__ */ React__default.default.createElement("span", { style: liveMessagePillTextStyle }, message))), !ready && /* @__PURE__ */ React__default.default.createElement("div", { style: videoLoadingStyle }, "Starting camera\u2026")), /* @__PURE__ */ React__default.default.createElement("div", { style: buttonsContainerStyle }, /* @__PURE__ */ React__default.default.createElement(
|
|
1433
1443
|
"button",
|
|
1434
1444
|
{
|
|
1435
1445
|
style: ready ? primaryButtonStyle : { ...primaryButtonStyle, opacity: 0.5, cursor: "not-allowed" },
|
|
@@ -1455,13 +1465,32 @@ var videoStyle = {
|
|
|
1455
1465
|
transform: "scaleX(-1)"
|
|
1456
1466
|
// mirror so the preview matches the user's POV
|
|
1457
1467
|
};
|
|
1458
|
-
var
|
|
1468
|
+
var faceOverlayContainerStyle = {
|
|
1459
1469
|
position: "absolute",
|
|
1460
1470
|
inset: 0,
|
|
1461
1471
|
pointerEvents: "none",
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1472
|
+
display: "flex",
|
|
1473
|
+
alignItems: "center",
|
|
1474
|
+
justifyContent: "center"
|
|
1475
|
+
};
|
|
1476
|
+
var faceRingWrapStyle = {
|
|
1477
|
+
position: "relative",
|
|
1478
|
+
width: "72%",
|
|
1479
|
+
aspectRatio: "1 / 1"
|
|
1480
|
+
};
|
|
1481
|
+
var faceDashedRingStyle = {
|
|
1482
|
+
position: "absolute",
|
|
1483
|
+
inset: -6,
|
|
1484
|
+
borderRadius: "50%",
|
|
1485
|
+
border: "6px dashed rgba(255, 255, 255, 0.4)",
|
|
1486
|
+
animation: "spin 10s linear infinite"
|
|
1487
|
+
};
|
|
1488
|
+
var faceCircleStyle = {
|
|
1489
|
+
position: "absolute",
|
|
1490
|
+
inset: 0,
|
|
1491
|
+
borderRadius: "50%",
|
|
1492
|
+
border: "4px solid #00bc7d",
|
|
1493
|
+
boxShadow: "0 0 0 1000px rgba(0, 0, 0, 0.5)"
|
|
1465
1494
|
};
|
|
1466
1495
|
var videoLoadingStyle = {
|
|
1467
1496
|
position: "absolute",
|
|
@@ -1473,16 +1502,29 @@ var videoLoadingStyle = {
|
|
|
1473
1502
|
fontSize: 14,
|
|
1474
1503
|
fontWeight: 500
|
|
1475
1504
|
};
|
|
1476
|
-
var
|
|
1477
|
-
|
|
1505
|
+
var liveMessagePillContainerStyle = {
|
|
1506
|
+
position: "absolute",
|
|
1507
|
+
top: 12,
|
|
1508
|
+
left: "50%",
|
|
1509
|
+
transform: "translateX(-50%)",
|
|
1510
|
+
maxWidth: "84%",
|
|
1511
|
+
pointerEvents: "none"
|
|
1512
|
+
};
|
|
1513
|
+
var liveMessagePillStyle = {
|
|
1514
|
+
background: "rgba(0, 0, 0, 0.7)",
|
|
1515
|
+
backdropFilter: "blur(6px)",
|
|
1516
|
+
border: "1px solid rgba(255, 255, 255, 0.2)",
|
|
1517
|
+
borderRadius: 999,
|
|
1518
|
+
padding: "6px 12px",
|
|
1478
1519
|
textAlign: "center",
|
|
1479
|
-
|
|
1520
|
+
boxShadow: "0 10px 25px -5px rgba(0,0,0,.3)"
|
|
1521
|
+
};
|
|
1522
|
+
var liveMessagePillTextStyle = {
|
|
1523
|
+
margin: 0,
|
|
1524
|
+
fontSize: 12,
|
|
1480
1525
|
fontWeight: 500,
|
|
1481
|
-
color: "#
|
|
1482
|
-
|
|
1483
|
-
border: "1px solid rgba(0, 188, 125, 0.25)",
|
|
1484
|
-
borderRadius: 8,
|
|
1485
|
-
padding: "8px 12px"
|
|
1526
|
+
color: "#ffffff",
|
|
1527
|
+
animation: "pulse 2s ease-in-out infinite"
|
|
1486
1528
|
};
|
|
1487
1529
|
var FaceCaptureModal_default = FaceCaptureModal;
|
|
1488
1530
|
|