@zaptcha/widget 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/zaptcha-widget.js +12 -24
- package/package.json +1 -1
package/dist/zaptcha-widget.js
CHANGED
|
@@ -637,39 +637,27 @@ class ZeroCaptcha extends HTMLElement {
|
|
|
637
637
|
// ── Worker messages ──────────────────────────────────────────────────────
|
|
638
638
|
|
|
639
639
|
_onWorkerMsg(msg) {
|
|
640
|
-
console.debug("[zaptcha] worker msg:", msg.type, msg.type === "fail" ? msg.reason : "");
|
|
641
640
|
switch (msg.type) {
|
|
642
|
-
case "ready":
|
|
643
|
-
console.debug("[zaptcha] WASM ready ✓");
|
|
644
|
-
break;
|
|
645
|
-
|
|
646
641
|
case "progress":
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
index: msg.index, nonce: msg.nonce, total: msg.total,
|
|
653
|
-
pct: Math.round(((msg.index ?? 0) + 1) / (msg.total ?? 1) * 100),
|
|
654
|
-
},
|
|
655
|
-
}));
|
|
642
|
+
console.debug("[zaptcha] progress:", {
|
|
643
|
+
index: msg.index,
|
|
644
|
+
nonce: msg.nonce,
|
|
645
|
+
total: msg.total,
|
|
646
|
+
});
|
|
656
647
|
break;
|
|
657
|
-
|
|
648
|
+
|
|
658
649
|
case "success":
|
|
659
|
-
|
|
660
|
-
this._applyState();
|
|
661
|
-
this.dispatchEvent(new CustomEvent("zaptcha-success", {
|
|
662
|
-
bubbles: true, composed: true,
|
|
663
|
-
detail: { token: msg.token },
|
|
664
|
-
}));
|
|
650
|
+
console.debug("[zaptcha] success");
|
|
665
651
|
break;
|
|
666
|
-
|
|
652
|
+
|
|
667
653
|
case "fail":
|
|
668
|
-
|
|
654
|
+
console.debug("[zaptcha] fail:", msg.reason);
|
|
669
655
|
break;
|
|
656
|
+
|
|
657
|
+
default:
|
|
658
|
+
console.debug("[zaptcha] unknown:", msg);
|
|
670
659
|
}
|
|
671
660
|
}
|
|
672
|
-
|
|
673
661
|
// ── Events ───────────────────────────────────────────────────────────────
|
|
674
662
|
|
|
675
663
|
_bindEvents() {
|