diff --git a/dist/altcha.js b/dist/altcha.js index 2668066..59c9948 100644 --- a/dist/altcha.js +++ b/dist/altcha.js @@ -92,14 +92,14 @@ function Jt(n) { function L(n, e) { n.appendChild(e); } -function Qt(n, e, t) { - const i = $t(n); +function $t(n, e, t) { + const i = Qt(n); if (!i.getElementById(e)) { const o = Z("style"); o.id = e, o.textContent = t, qt(i, o); } } -function $t(n) { +function Qt(n) { if (!n) return document; const e = n.getRootNode ? n.getRootNode() : n.ownerDocument; return e && /** @type {ShadowRoot} */ @@ -124,13 +124,13 @@ function Y(n) { function Z(n) { return document.createElement(n); } -function $(n) { +function Q(n) { return document.createElementNS("http://www.w3.org/2000/svg", n); } function en(n) { return document.createTextNode(n); } -function Q() { +function $() { return en(" "); } function Le(n, e, t, i) { @@ -341,6 +341,10 @@ typeof HTMLElement == "function" && (wt = class extends HTMLElement { const o = this.$$l_u.get(t); o && (o(), this.$$l_u.delete(t)); } + if (this.$$l[e]) { + const o = this.$$l[e].indexOf(t); + o >= 0 && this.$$l[e].splice(o, 1); + } } async connectedCallback() { if (this.$$cn = !0, !this.$$c) { @@ -644,13 +648,13 @@ async function Cn(n, e = "", t = 1e6, i = 0) { } var m = /* @__PURE__ */ ((n) => (n.ERROR = "error", n.VERIFIED = "verified", n.VERIFYING = "verifying", n.UNVERIFIED = "unverified", n.EXPIRED = "expired", n))(m || {}); function In(n) { - Qt(n, "svelte-ddsc3z", '.altcha.svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left}.altcha.svelte-ddsc3z.svelte-ddsc3z:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow.svelte-ddsc3z{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z:not([data-state=unverified]){display:block}.altcha-anchor-arrow.svelte-ddsc3z.svelte-ddsc3z{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main.svelte-ddsc3z.svelte-ddsc3z{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-ddsc3z.svelte-ddsc3z{flex-grow:1}.altcha-label.svelte-ddsc3z label.svelte-ddsc3z{cursor:pointer}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z{color:currentColor;opacity:0.3}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-error.svelte-ddsc3z.svelte-ddsc3z{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-footer.svelte-ddsc3z>.svelte-ddsc3z:first-child{flex-grow:1}.altcha-footer.svelte-ddsc3z a{color:currentColor}.altcha-checkbox.svelte-ddsc3z.svelte-ddsc3z{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-ddsc3z input.svelte-ddsc3z{width:18px;height:18px;margin:0}.altcha-hidden.svelte-ddsc3z.svelte-ddsc3z{display:none}.altcha-spinner.svelte-ddsc3z.svelte-ddsc3z{animation:svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-ddsc3z-altcha-spinner{100%{transform:rotate(360deg)}}'); + $t(n, "svelte-ddsc3z", '.altcha.svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left}.altcha.svelte-ddsc3z.svelte-ddsc3z:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow.svelte-ddsc3z{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z:not([data-state=unverified]){display:block}.altcha-anchor-arrow.svelte-ddsc3z.svelte-ddsc3z{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main.svelte-ddsc3z.svelte-ddsc3z{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-ddsc3z.svelte-ddsc3z{flex-grow:1}.altcha-label.svelte-ddsc3z label.svelte-ddsc3z{cursor:pointer}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z{color:currentColor;opacity:0.3}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-error.svelte-ddsc3z.svelte-ddsc3z{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-footer.svelte-ddsc3z>.svelte-ddsc3z:first-child{flex-grow:1}.altcha-footer.svelte-ddsc3z a{color:currentColor}.altcha-checkbox.svelte-ddsc3z.svelte-ddsc3z{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-ddsc3z input.svelte-ddsc3z{width:18px;height:18px;margin:0}.altcha-hidden.svelte-ddsc3z.svelte-ddsc3z{display:none}.altcha-spinner.svelte-ddsc3z.svelte-ddsc3z{animation:svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-ddsc3z-altcha-spinner{100%{transform:rotate(360deg)}}'); } function lt(n) { let e, t, i; return { c() { - e = $("svg"), t = $("path"), i = $("path"), a(t, "d", "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"), a(t, "fill", "currentColor"), a(t, "opacity", ".25"), a(i, "d", "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"), a(i, "fill", "currentColor"), a(i, "class", "altcha-spinner svelte-ddsc3z"), a(e, "width", "24"), a(e, "height", "24"), a(e, "viewBox", "0 0 24 24"), a(e, "xmlns", "http://www.w3.org/2000/svg"); + e = Q("svg"), t = Q("path"), i = Q("path"), a(t, "d", "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"), a(t, "fill", "currentColor"), a(t, "opacity", ".25"), a(i, "d", "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"), a(i, "fill", "currentColor"), a(i, "class", "altcha-spinner svelte-ddsc3z"), a(e, "width", "24"), a(e, "height", "24"), a(e, "viewBox", "0 0 24 24"), a(e, "xmlns", "http://www.w3.org/2000/svg"); }, m(o, l) { X(o, e, l), L(e, t), L(e, i); @@ -714,7 +718,7 @@ function zn(n) { ), i, o; return { c() { - e = Z("span"), i = Q(), o = Z("input"), a(o, "type", "hidden"), a( + e = Z("span"), i = $(), o = Z("input"), a(o, "type", "hidden"), a( o, "name", /*name*/ @@ -747,7 +751,7 @@ function st(n) { let e, t, i, o, l, s, d; return { c() { - e = Z("div"), t = Z("a"), i = $("svg"), o = $("path"), l = $("path"), s = $("path"), a(o, "d", "M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"), a(o, "fill", "currentColor"), a(l, "d", "M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"), a(l, "fill", "currentColor"), a(s, "d", "M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"), a(s, "fill", "currentColor"), a(i, "width", "22"), a(i, "height", "22"), a(i, "viewBox", "0 0 20 20"), a(i, "fill", "none"), a(i, "xmlns", "http://www.w3.org/2000/svg"), a(t, "href", xt), a(t, "target", "_blank"), a(t, "class", "altcha-logo svelte-ddsc3z"), a(t, "aria-label", d = /*_strings*/ + e = Z("div"), t = Z("a"), i = Q("svg"), o = Q("path"), l = Q("path"), s = Q("path"), a(o, "d", "M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"), a(o, "fill", "currentColor"), a(l, "d", "M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"), a(l, "fill", "currentColor"), a(s, "d", "M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"), a(s, "fill", "currentColor"), a(i, "width", "22"), a(i, "height", "22"), a(i, "viewBox", "0 0 20 20"), a(i, "fill", "none"), a(i, "xmlns", "http://www.w3.org/2000/svg"), a(t, "href", xt), a(t, "target", "_blank"), a(t, "class", "altcha-logo svelte-ddsc3z"), a(t, "aria-label", d = /*_strings*/ n[11].ariaLinkLabel); }, m(h, f) { @@ -774,7 +778,7 @@ function ct(n) { let s = l(n), d = s(n); return { c() { - e = Z("div"), t = $("svg"), i = $("path"), o = Q(), d.c(), a(i, "stroke-linecap", "round"), a(i, "stroke-linejoin", "round"), a(i, "d", "M6 18L18 6M6 6l12 12"), a(t, "width", "14"), a(t, "height", "14"), a(t, "xmlns", "http://www.w3.org/2000/svg"), a(t, "fill", "none"), a(t, "viewBox", "0 0 24 24"), a(t, "stroke-width", "1.5"), a(t, "stroke", "currentColor"), a(e, "class", "altcha-error svelte-ddsc3z"); + e = Z("div"), t = Q("svg"), i = Q("path"), o = $(), d.c(), a(i, "stroke-linecap", "round"), a(i, "stroke-linejoin", "round"), a(i, "d", "M6 18L18 6M6 6l12 12"), a(t, "width", "14"), a(t, "height", "14"), a(t, "xmlns", "http://www.w3.org/2000/svg"), a(t, "fill", "none"), a(t, "viewBox", "0 0 24 24"), a(t, "stroke-width", "1.5"), a(t, "stroke", "currentColor"), a(e, "class", "altcha-error svelte-ddsc3z"); }, m(h, f) { X(h, e, f), L(e, t), L(t, i), L(e, o), d.m(e, null); @@ -934,7 +938,7 @@ function Tn(n) { ); return { c() { - G && G.c(), e = Q(), t = Z("div"), i = Z("div"), A && A.c(), o = Q(), l = Z("div"), s = Z("input"), f = Q(), C = Z("div"), H.c(), b = Q(), x && x.c(), M = Q(), T && T.c(), D = Q(), z && z.c(), j = Q(), _ && _.c(), a(s, "type", "checkbox"), a(s, "id", d = /*name*/ + G && G.c(), e = $(), t = Z("div"), i = Z("div"), A && A.c(), o = $(), l = Z("div"), s = Z("input"), f = $(), C = Z("div"), H.c(), b = $(), x && x.c(), M = $(), T && T.c(), D = $(), z && z.c(), j = $(), _ && _.c(), a(s, "type", "checkbox"), a(s, "id", d = /*name*/ n[4] + "_checkbox"), s.required = h = /*auto*/ n[0] !== "onsubmit" && (!/*floating*/ n[1] || /*auto*/ @@ -1057,7 +1061,7 @@ function Zn(n, e, t) { ln(() => { Et(), v && (v.removeEventListener("submit", Fe), v.removeEventListener("reset", De), v.removeEventListener("focusin", Xe), v = null), B && (clearTimeout(B), B = null), document.removeEventListener("click", He), document.removeEventListener("scroll", Ye), window.removeEventListener("resize", Pe); }), on(() => { - k("mounted", "1.0.0"), k("workers", le), Nt(), k("plugins", te.length ? te.map((r) => r.constructor.pluginName).join(", ") : "none"), y && k("using test mode"), S && ke(S), f !== void 0 && k("auto", f), N !== void 0 && We(N), v = E.closest("form"), v && (v.addEventListener("submit", Fe, { capture: !0 }), v.addEventListener("reset", De), f === "onfocus" && v.addEventListener("focusin", Xe)), f === "onload" && (x ? ge() : ne()), i && (G || A) && k("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."), requestAnimationFrame(() => { + k("mounted", "1.0.1"), k("workers", le), Nt(), k("plugins", te.length ? te.map((r) => r.constructor.pluginName).join(", ") : "none"), y && k("using test mode"), S && ke(S), f !== void 0 && k("auto", f), N !== void 0 && We(N), v = E.closest("form"), v && (v.addEventListener("submit", Fe, { capture: !0 }), v.addEventListener("reset", De), f === "onfocus" && v.addEventListener("focusin", Xe)), f === "onload" && (x ? ge() : ne()), i && (G || A) && k("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."), requestAnimationFrame(() => { de("load"); }); }); @@ -1177,8 +1181,8 @@ function Zn(n, e, t) { log: k, reset: me, solve: Ke, - setState: $e, - setFloatingAnchor: Qe, + setState: Qe, + setFloatingAnchor: $e, verify: ne })); } @@ -1371,10 +1375,10 @@ function Zn(n, e, t) { function me(r = m.UNVERIFIED, c = null) { B && (clearTimeout(B), B = null), t(8, re = !1), t(5, he = c), t(6, oe = null), t(7, R = r); } - function Qe(r) { + function $e(r) { se = r; } - function $e(r, c = null) { + function Qe(r, c = null) { t(7, R = r), t(5, he = c); } async function ne() { @@ -1470,8 +1474,8 @@ function Zn(n, e, t) { Vt, Je, me, - Qe, $e, + Qe, ne, l, h, diff --git a/dist/altcha.umd.cjs b/dist/altcha.umd.cjs index 077180a..1bfc7b6 100644 --- a/dist/altcha.umd.cjs +++ b/dist/altcha.umd.cjs @@ -1,2 +1,2 @@ -(function(D,F){typeof exports=="object"&&typeof module<"u"?F(exports):typeof define=="function"&&define.amd?define(["exports"],F):(D=typeof globalThis<"u"?globalThis:D||self,F(D.altcha={}))})(this,function(D){"use strict";var Vn=Object.defineProperty;var Gn=(D,F,ce)=>F in D?Vn(D,F,{enumerable:!0,configurable:!0,writable:!0,value:ce}):D[F]=ce;var K=(D,F,ce)=>Gn(D,typeof F!="symbol"?F+"":F,ce);const F="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGY9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIHAoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiB3KGUsdCxyKXtyZXR1cm4gcChhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChyLnRvVXBwZXJDYXNlKCksZi5lbmNvZGUoZSt0KSkpfWZ1bmN0aW9uIGIoZSx0LHI9IlNIQS0yNTYiLG49MWU2LHM9MCl7Y29uc3Qgbz1uZXcgQWJvcnRDb250cm9sbGVyLGE9RGF0ZS5ub3coKTtyZXR1cm57cHJvbWlzZTooYXN5bmMoKT0+e2ZvcihsZXQgYz1zO2M8PW47Yys9MSl7aWYoby5zaWduYWwuYWJvcnRlZClyZXR1cm4gbnVsbDtpZihhd2FpdCB3KHQsYyxyKT09PWUpcmV0dXJue251bWJlcjpjLHRvb2s6RGF0ZS5ub3coKS1hfX1yZXR1cm4gbnVsbH0pKCksY29udHJvbGxlcjpvfX1mdW5jdGlvbiBoKGUpe2NvbnN0IHQ9YXRvYihlKSxyPW5ldyBVaW50OEFycmF5KHQubGVuZ3RoKTtmb3IobGV0IG49MDtuPHQubGVuZ3RoO24rKylyW25dPXQuY2hhckNvZGVBdChuKTtyZXR1cm4gcn1mdW5jdGlvbiBnKGUsdD0xMil7Y29uc3Qgcj1uZXcgVWludDhBcnJheSh0KTtmb3IobGV0IG49MDtuPHQ7bisrKXJbbl09ZSUyNTYsZT1NYXRoLmZsb29yKGUvMjU2KTtyZXR1cm4gcn1hc3luYyBmdW5jdGlvbiBtKGUsdD0iIixyPTFlNixuPTApe2NvbnN0IHM9IkFFUy1HQ00iLG89bmV3IEFib3J0Q29udHJvbGxlcixhPURhdGUubm93KCksbD1hc3luYygpPT57Zm9yKGxldCB1PW47dTw9cjt1Kz0xKXtpZihvLnNpZ25hbC5hYm9ydGVkfHwhY3x8IXkpcmV0dXJuIG51bGw7dHJ5e2NvbnN0IGQ9YXdhaXQgY3J5cHRvLnN1YnRsZS5kZWNyeXB0KHtuYW1lOnMsaXY6Zyh1KX0sYyx5KTtpZihkKXJldHVybntjbGVhclRleHQ6bmV3IFRleHREZWNvZGVyKCkuZGVjb2RlKGQpLHRvb2s6RGF0ZS5ub3coKS1hfX1jYXRjaHt9fXJldHVybiBudWxsfTtsZXQgYz1udWxsLHk9bnVsbDt0cnl7eT1oKGUpO2NvbnN0IHU9YXdhaXQgY3J5cHRvLnN1YnRsZS5kaWdlc3QoIlNIQS0yNTYiLGYuZW5jb2RlKHQpKTtjPWF3YWl0IGNyeXB0by5zdWJ0bGUuaW1wb3J0S2V5KCJyYXciLHUscywhMSxbImRlY3J5cHQiXSl9Y2F0Y2h7cmV0dXJue3Byb21pc2U6UHJvbWlzZS5yZWplY3QoKSxjb250cm9sbGVyOm99fXJldHVybntwcm9taXNlOmwoKSxjb250cm9sbGVyOm99fWxldCBpO29ubWVzc2FnZT1hc3luYyBlPT57Y29uc3R7dHlwZTp0LHBheWxvYWQ6cixzdGFydDpuLG1heDpzfT1lLmRhdGE7bGV0IG89bnVsbDtpZih0PT09ImFib3J0IilpPT1udWxsfHxpLmFib3J0KCksaT12b2lkIDA7ZWxzZSBpZih0PT09IndvcmsiKXtpZigib2JmdXNjYXRlZCJpbiByKXtjb25zdHtrZXk6YSxvYmZ1c2NhdGVkOmx9PXJ8fHt9O289YXdhaXQgbShsLGEscyxuKX1lbHNle2NvbnN0e2FsZ29yaXRobTphLGNoYWxsZW5nZTpsLHNhbHQ6Y309cnx8e307bz1iKGwsYyxhLHMsbil9aT1vLmNvbnRyb2xsZXIsby5wcm9taXNlLnRoZW4oYT0+e3NlbGYucG9zdE1lc3NhZ2UoYSYmey4uLmEsd29ya2VyOiEwfSl9KX19fSkoKTsK",ce=n=>Uint8Array.from(atob(n),e=>e.charCodeAt(0)),Ge=typeof self<"u"&&self.Blob&&new Blob([ce(F)],{type:"text/javascript;charset=utf-8"});function It(n){let e;try{if(e=Ge&&(self.URL||self.webkitURL).createObjectURL(Ge),!e)throw"";const t=new Worker(e,{name:n==null?void 0:n.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+F,{name:n==null?void 0:n.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}function Ee(){}function Lt(n,e){for(const t in e)n[t]=e[t];return n}function He(n){return n()}function Ye(){return Object.create(null)}function ge(n){n.forEach(He)}function Xe(n){return typeof n=="function"}function Nt(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}function zt(n){return Object.keys(n).length===0}function St(n,e,t,i){if(n){const o=Fe(n,e,t,i);return n[0](o)}}function Fe(n,e,t,i){return n[1]&&i?Lt(t.ctx.slice(),n[1](i(e))):t.ctx}function Tt(n,e,t,i){if(n[2]&&i){const o=n[2](i(t));if(e.dirty===void 0)return o;if(typeof o=="object"){const l=[],s=Math.max(e.dirty.length,o.length);for(let d=0;d32){const e=[],t=n.ctx.length/32;for(let i=0;in.removeEventListener(e,t,i)}function a(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xt(n){return Array.from(n.childNodes)}function je(n,e,t){n.classList.toggle(e,!!t)}function Ft(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function jt(n){const e={};return n.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}let me;function be(n){me=n}function Se(){if(!me)throw new Error("Function called outside component initialization");return me}function Dt(n){Se().$$.on_mount.push(n)}function Pt(n){Se().$$.on_destroy.push(n)}function Wt(){const n=Se();return(e,t,{cancelable:i=!1}={})=>{const o=n.$$.callbacks[e];if(o){const l=Ft(e,t,{cancelable:i});return o.slice().forEach(s=>{s.call(n,l)}),!l.defaultPrevented}return!0}}const ae=[],Re=[];let fe=[];const De=[],Pe=Promise.resolve();let Te=!1;function We(){Te||(Te=!0,Pe.then(w))}function Mt(){return We(),Pe}function Ae(n){fe.push(n)}const Ze=new Set;let ue=0;function w(){if(ue!==0)return;const n=me;do{try{for(;uen.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),fe=e}const Ce=new Set;let Bt;function Me(n,e){n&&n.i&&(Ce.delete(n),n.i(e))}function Ot(n,e,t,i){if(n&&n.o){if(Ce.has(n))return;Ce.add(n),Bt.c.push(()=>{Ce.delete(n)}),n.o(e)}}function Jt(n,e,t){const{fragment:i,after_update:o}=n.$$;i&&i.m(e,t),Ae(()=>{const l=n.$$.on_mount.map(He).filter(Xe);n.$$.on_destroy?n.$$.on_destroy.push(...l):ge(l),n.$$.on_mount=[]}),o.forEach(Ae)}function Qt(n,e){const t=n.$$;t.fragment!==null&&(Kt(t.after_update),ge(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function $t(n,e){n.$$.dirty[0]===-1&&(ae.push(n),We(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const W=P.length?P[0]:O;return f.ctx&&o(f.ctx[b],f.ctx[b]=W)&&(!f.skip_bound&&f.bound[b]&&f.bound[b](W),I&&$t(n,b)),O}):[],f.update(),I=!0,ge(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const b=Xt(e.target);f.fragment&&f.fragment.l(b),b.forEach(H)}else f.fragment&&f.fragment.c();e.intro&&Me(n.$$.fragment),Jt(n,e.target,e.anchor),w()}be(h)}let Ue;typeof HTMLElement=="function"&&(Ue=class extends HTMLElement{constructor(e,t,i){super();K(this,"$$ctor");K(this,"$$s");K(this,"$$c");K(this,"$$cn",!1);K(this,"$$d",{});K(this,"$$r",!1);K(this,"$$p_d",{});K(this,"$$l",{});K(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,i&&this.attachShadow({mode:"open"})}addEventListener(e,t,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const o=this.$$c.$on(e,t);this.$$l_u.set(t,o)}super.addEventListener(e,t,i)}removeEventListener(e,t,i){if(super.removeEventListener(e,t,i),this.$$c){const o=this.$$l_u.get(t);o&&(o(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(l){return()=>{let s;return{c:function(){s=S("slot"),l!=="default"&&a(s,"name",l)},m:function(f,I){X(f,s,I)},d:function(f){f&&H(s)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},i=jt(this);for(const l of this.$$s)l in i&&(t[l]=[e(l)]);for(const l of this.attributes){const s=this.$$g_p(l.name);s in this.$$d||(this.$$d[s]=Ie(s,l.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});const o=()=>{this.$$r=!0;for(const l in this.$$p_d)if(this.$$d[l]=this.$$c.$$.ctx[this.$$c.$$.props[l]],this.$$p_d[l].reflect){const s=Ie(l,this.$$d[l],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,s)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(const l in this.$$l)for(const s of this.$$l[l]){const d=this.$$c.$on(l,s);this.$$l_u.set(s,d)}this.$$l={}}}attributeChangedCallback(e,t,i){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ie(e,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ie(n,e,t,i){var l;const o=(l=t[n])==null?void 0:l.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!t[n])return e;if(i==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function en(n,e,t,i,o,l){let s=class extends Ue{constructor(){super(n,t,o),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map(d=>(e[d].attribute||d).toLowerCase())}};return Object.keys(e).forEach(d=>{Object.defineProperty(s.prototype,d,{get(){return this.$$c&&d in this.$$c?this.$$c[d]:this.$$d[d]},set(h){var f;h=Ie(d,h,e),this.$$d[d]=h,(f=this.$$c)==null||f.$set({[d]:h})}})}),i.forEach(d=>{Object.defineProperty(s.prototype,d,{get(){var h;return(h=this.$$c)==null?void 0:h[d]}})}),n.element=s,s}class tn{constructor(){K(this,"$$");K(this,"$$set")}$destroy(){Qt(this,1),this.$destroy=Ee}$on(e,t){if(!Xe(t))return Ee;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const o=i.indexOf(t);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!zt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const nn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(nn);const Ke=new TextEncoder;function rn(n){return[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,"0")).join("")}async function on(n,e="SHA-256",t=1e5){const i=Date.now().toString(16);n||(n=Math.round(Math.random()*t));const o=await Be(i,n,e);return{algorithm:e,challenge:o,salt:i,signature:""}}async function Be(n,e,t){return rn(await crypto.subtle.digest(t.toUpperCase(),Ke.encode(n+e)))}function ln(n,e,t="SHA-256",i=1e6,o=0){const l=new AbortController,s=Date.now();return{promise:(async()=>{for(let h=o;h<=i;h+=1){if(l.signal.aborted)return null;if(await Be(e,h,t)===n)return{number:h,took:Date.now()-s}}return null})(),controller:l}}function sn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function cn(n){const e=atob(n),t=new Uint8Array(e.length);for(let i=0;i{for(let I=i;I<=t;I+=1){if(l.signal.aborted||!h||!f)return null;try{const b=await crypto.subtle.decrypt({name:o,iv:an(I)},h,f);if(b)return{clearText:new TextDecoder().decode(b),took:Date.now()-s}}catch{}}return null};let h=null,f=null;try{f=cn(n);const I=await crypto.subtle.digest("SHA-256",Ke.encode(e));h=await crypto.subtle.importKey("raw",I,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:d(),controller:l}}var g=(n=>(n.ERROR="error",n.VERIFIED="verified",n.VERIFYING="verifying",n.UNVERIFIED="unverified",n.EXPIRED="expired",n))(g||{});function un(n){Vt(n,"svelte-ddsc3z",'.altcha.svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left}.altcha.svelte-ddsc3z.svelte-ddsc3z:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow.svelte-ddsc3z{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z:not([data-state=unverified]){display:block}.altcha-anchor-arrow.svelte-ddsc3z.svelte-ddsc3z{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main.svelte-ddsc3z.svelte-ddsc3z{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-ddsc3z.svelte-ddsc3z{flex-grow:1}.altcha-label.svelte-ddsc3z label.svelte-ddsc3z{cursor:pointer}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z{color:currentColor;opacity:0.3}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-error.svelte-ddsc3z.svelte-ddsc3z{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-footer.svelte-ddsc3z>.svelte-ddsc3z:first-child{flex-grow:1}.altcha-footer.svelte-ddsc3z a{color:currentColor}.altcha-checkbox.svelte-ddsc3z.svelte-ddsc3z{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-ddsc3z input.svelte-ddsc3z{width:18px;height:18px;margin:0}.altcha-hidden.svelte-ddsc3z.svelte-ddsc3z{display:none}.altcha-spinner.svelte-ddsc3z.svelte-ddsc3z{animation:svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-ddsc3z-altcha-spinner{100%{transform:rotate(360deg)}}')}function Oe(n){let e,t,i;return{c(){e=Q("svg"),t=Q("path"),i=Q("path"),a(t,"d","M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"),a(t,"fill","currentColor"),a(t,"opacity",".25"),a(i,"d","M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"),a(i,"fill","currentColor"),a(i,"class","altcha-spinner svelte-ddsc3z"),a(e,"width","24"),a(e,"height","24"),a(e,"viewBox","0 0 24 24"),a(e,"xmlns","http://www.w3.org/2000/svg")},m(o,l){X(o,e,l),C(e,t),C(e,i)},d(o){o&&H(e)}}}function dn(n){let e,t=n[11].label+"",i;return{c(){e=S("label"),a(e,"for",i=n[4]+"_checkbox"),a(e,"class","svelte-ddsc3z")},m(o,l){X(o,e,l),e.innerHTML=t},p(o,l){l[0]&2048&&t!==(t=o[11].label+"")&&(e.innerHTML=t),l[0]&16&&i!==(i=o[4]+"_checkbox")&&a(e,"for",i)},d(o){o&&H(e)}}}function hn(n){let e,t=n[11].verifying+"";return{c(){e=S("span")},m(i,o){X(i,e,o),e.innerHTML=t},p(i,o){o[0]&2048&&t!==(t=i[11].verifying+"")&&(e.innerHTML=t)},d(i){i&&H(e)}}}function gn(n){let e,t=n[11].verified+"",i,o;return{c(){e=S("span"),i=$(),o=S("input"),a(o,"type","hidden"),a(o,"name",n[4]),o.value=n[6]},m(l,s){X(l,e,s),e.innerHTML=t,X(l,i,s),X(l,o,s)},p(l,s){s[0]&2048&&t!==(t=l[11].verified+"")&&(e.innerHTML=t),s[0]&16&&a(o,"name",l[4]),s[0]&64&&(o.value=l[6])},d(l){l&&(H(e),H(i),H(o))}}}function Je(n){let e,t,i,o,l,s,d;return{c(){e=S("div"),t=S("a"),i=Q("svg"),o=Q("path"),l=Q("path"),s=Q("path"),a(o,"d","M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"),a(o,"fill","currentColor"),a(l,"d","M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"),a(l,"fill","currentColor"),a(s,"d","M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"),a(s,"fill","currentColor"),a(i,"width","22"),a(i,"height","22"),a(i,"viewBox","0 0 20 20"),a(i,"fill","none"),a(i,"xmlns","http://www.w3.org/2000/svg"),a(t,"href",tt),a(t,"target","_blank"),a(t,"class","altcha-logo svelte-ddsc3z"),a(t,"aria-label",d=n[11].ariaLinkLabel)},m(h,f){X(h,e,f),C(e,t),C(t,i),C(i,o),C(i,l),C(i,s)},p(h,f){f[0]&2048&&d!==(d=h[11].ariaLinkLabel)&&a(t,"aria-label",d)},d(h){h&&H(e)}}}function Qe(n){let e,t,i,o;function l(h,f){return h[7]===g.EXPIRED?bn:mn}let s=l(n),d=s(n);return{c(){e=S("div"),t=Q("svg"),i=Q("path"),o=$(),d.c(),a(i,"stroke-linecap","round"),a(i,"stroke-linejoin","round"),a(i,"d","M6 18L18 6M6 6l12 12"),a(t,"width","14"),a(t,"height","14"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(t,"fill","none"),a(t,"viewBox","0 0 24 24"),a(t,"stroke-width","1.5"),a(t,"stroke","currentColor"),a(e,"class","altcha-error svelte-ddsc3z")},m(h,f){X(h,e,f),C(e,t),C(t,i),C(e,o),d.m(e,null)},p(h,f){s===(s=l(h))&&d?d.p(h,f):(d.d(1),d=s(h),d&&(d.c(),d.m(e,null)))},d(h){h&&H(e),d.d()}}}function mn(n){let e,t=n[11].error+"";return{c(){e=S("div"),a(e,"title",n[5])},m(i,o){X(i,e,o),e.innerHTML=t},p(i,o){o[0]&2048&&t!==(t=i[11].error+"")&&(e.innerHTML=t),o[0]&32&&a(e,"title",i[5])},d(i){i&&H(e)}}}function bn(n){let e,t=n[11].expired+"";return{c(){e=S("div"),a(e,"title",n[5])},m(i,o){X(i,e,o),e.innerHTML=t},p(i,o){o[0]&2048&&t!==(t=i[11].expired+"")&&(e.innerHTML=t),o[0]&32&&a(e,"title",i[5])},d(i){i&&H(e)}}}function $e(n){let e,t,i=n[11].footer+"";return{c(){e=S("div"),t=S("div"),a(t,"class","svelte-ddsc3z"),a(e,"class","altcha-footer svelte-ddsc3z")},m(o,l){X(o,e,l),C(e,t),t.innerHTML=i},p(o,l){l[0]&2048&&i!==(i=o[11].footer+"")&&(t.innerHTML=i)},d(o){o&&H(e)}}}function qe(n){let e;return{c(){e=S("div"),a(e,"class","altcha-anchor-arrow svelte-ddsc3z")},m(t,i){X(t,e,i),n[48](e)},p:Ee,d(t){t&&H(e),n[48](null)}}}function yn(n){let e,t,i,o,l,s,d,h,f,I,b,O,P,W,T,N,q;const ee=n[46].default,G=St(ee,n,n[45],null);let A=n[7]===g.VERIFYING&&Oe();function te(u,y){return u[7]===g.VERIFIED?gn:u[7]===g.VERIFYING?hn:dn}let B=te(n),Y=B(n),x=(n[3]!==!0||n[12])&&Je(n),Z=(n[5]||n[7]===g.EXPIRED)&&Qe(n),z=n[11].footer&&(n[2]!==!0||n[12])&&$e(n),_=n[1]&&qe(n);return{c(){G&&G.c(),e=$(),t=S("div"),i=S("div"),A&&A.c(),o=$(),l=S("div"),s=S("input"),f=$(),I=S("div"),Y.c(),b=$(),x&&x.c(),O=$(),Z&&Z.c(),P=$(),z&&z.c(),W=$(),_&&_.c(),a(s,"type","checkbox"),a(s,"id",d=n[4]+"_checkbox"),s.required=h=n[0]!=="onsubmit"&&(!n[1]||n[0]!=="off"),a(s,"class","svelte-ddsc3z"),a(l,"class","altcha-checkbox svelte-ddsc3z"),je(l,"altcha-hidden",n[7]===g.VERIFYING),a(I,"class","altcha-label svelte-ddsc3z"),a(i,"class","altcha-main svelte-ddsc3z"),a(t,"class","altcha svelte-ddsc3z"),a(t,"data-state",n[7]),a(t,"data-floating",n[1])},m(u,y){G&&G.m(u,y),X(u,e,y),X(u,t,y),C(t,i),A&&A.m(i,null),C(i,o),C(i,l),C(l,s),s.checked=n[8],C(i,f),C(i,I),Y.m(I,null),C(i,b),x&&x.m(i,null),C(t,O),Z&&Z.m(t,null),C(t,P),z&&z.m(t,null),C(t,W),_&&_.m(t,null),n[49](t),T=!0,N||(q=[ze(s,"change",n[47]),ze(s,"change",n[13]),ze(s,"invalid",n[14])],N=!0)},p(u,y){G&&G.p&&(!T||y[1]&16384)&&At(G,ee,u,u[45],T?Tt(ee,u[45],y,null):Zt(u[45]),null),u[7]===g.VERIFYING?A||(A=Oe(),A.c(),A.m(i,o)):A&&(A.d(1),A=null),(!T||y[0]&16&&d!==(d=u[4]+"_checkbox"))&&a(s,"id",d),(!T||y[0]&3&&h!==(h=u[0]!=="onsubmit"&&(!u[1]||u[0]!=="off")))&&(s.required=h),y[0]&256&&(s.checked=u[8]),(!T||y[0]&128)&&je(l,"altcha-hidden",u[7]===g.VERIFYING),B===(B=te(u))&&Y?Y.p(u,y):(Y.d(1),Y=B(u),Y&&(Y.c(),Y.m(I,null))),u[3]!==!0||u[12]?x?x.p(u,y):(x=Je(u),x.c(),x.m(i,null)):x&&(x.d(1),x=null),u[5]||u[7]===g.EXPIRED?Z?Z.p(u,y):(Z=Qe(u),Z.c(),Z.m(t,P)):Z&&(Z.d(1),Z=null),u[11].footer&&(u[2]!==!0||u[12])?z?z.p(u,y):(z=$e(u),z.c(),z.m(t,W)):z&&(z.d(1),z=null),u[1]?_?_.p(u,y):(_=qe(u),_.c(),_.m(t,null)):_&&(_.d(1),_=null),(!T||y[0]&128)&&a(t,"data-state",u[7]),(!T||y[0]&2)&&a(t,"data-floating",u[1])},i(u){T||(Me(G,u),T=!0)},o(u){Ot(G,u),T=!1},d(u){u&&(H(e),H(t)),G&&G.d(u),A&&A.d(),Y.d(),x&&x.d(),Z&&Z.d(),z&&z.d(),_&&_.d(),n[49](null),N=!1,ge(q)}}}const et="Visit Altcha.org",tt="https://altcha.org/";function nt(n){return JSON.parse(n)}function vn(n,e,t){var Et,Rt;let i,o,l,s,{$$slots:d={},$$scope:h}=e,{auto:f=void 0}=e,{blockspam:I=void 0}=e,{challengeurl:b=void 0}=e,{challengejson:O=void 0}=e,{debug:P=!1}=e,{delay:W=0}=e,{expire:T=void 0}=e,{floating:N=void 0}=e,{floatinganchor:q=void 0}=e,{floatingoffset:ee=void 0}=e,{hidefooter:G=!1}=e,{hidelogo:A=!1}=e,{name:te="altcha"}=e,{maxnumber:B=1e6}=e,{mockerror:Y=!1}=e,{obfuscated:x=void 0}=e,{plugins:Z=void 0}=e,{refetchonexpire:z=!0}=e,{spamfilter:_=!1}=e,{strings:u=void 0}=e,{test:y=!1}=e,{verifyurl:ne=void 0}=e,{workers:de=Math.min(16,navigator.hardwareConcurrency||8)}=e,{workerurl:ye=void 0}=e;const ve=Wt(),it=["SHA-256","SHA-384","SHA-512"],ot=(Rt=(Et=document.documentElement.lang)==null?void 0:Et.split("-"))==null?void 0:Rt[0];let oe=!1,E,le=null,he=null,v=null,pe=null,J=null,se=null,re=[],R=g.UNVERIFIED;Pt(()=>{pn(),v&&(v.removeEventListener("submit",ut),v.removeEventListener("reset",dt),v.removeEventListener("focusin",ft),v=null),J&&(clearTimeout(J),J=null),document.removeEventListener("click",ct),document.removeEventListener("scroll",at),window.removeEventListener("resize",gt)}),Dt(()=>{k("mounted","1.0.0"),k("workers",de),En(),k("plugins",re.length?re.map(r=>r.constructor.pluginName).join(", "):"none"),y&&k("using test mode"),T&&Ne(T),f!==void 0&&k("auto",f),N!==void 0&&mt(N),v=E.closest("form"),v&&(v.addEventListener("submit",ut,{capture:!0}),v.addEventListener("reset",dt),f==="onfocus"&&v.addEventListener("focusin",ft)),f==="onload"&&(x?we():ie()),i&&(G||A)&&k("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{ve("load")})});function lt(r,c){return btoa(JSON.stringify({algorithm:r.algorithm,challenge:r.challenge,number:c.number,salt:r.salt,signature:r.signature,test:y?!0:void 0,took:c.took}))}function pn(){for(const r of re)r.destroy()}function st(){b&&z&&R===g.VERIFIED?ie():_e(g.EXPIRED,s.expired)}async function wn(){var r;if(Y)throw k("mocking error"),new Error("Mocked error.");if(o)return k("using provided json data"),o;if(y)return k("generating test challenge",{test:y}),on(typeof y!="boolean"?+y:void 0);{if(!b&&v){const p=v.getAttribute("action");p!=null&&p.includes("/form/")&&t(15,b=p+"/altcha")}if(!b)throw new Error("Attribute challengeurl not set.");k("fetching challenge from",b);const c=await fetch(b,{headers:_?{"x-altcha-spam-filter":"1"}:{}});if(c.status!==200)throw new Error(`Server responded with ${c.status}.`);const m=c.headers.get("Expires"),L=c.headers.get("X-Altcha-Config"),M=await c.json(),j=new URLSearchParams((r=M.salt.split("?"))==null?void 0:r[1]),V=j.get("expires")||j.get("expire");if(V){const p=new Date(+V*1e3),U=isNaN(p.getTime())?0:p.getTime()-Date.now();U>0&&Ne(U)}if(L)try{const p=JSON.parse(L);p&&typeof p=="object"&&(p.verifyurl&&(p.verifyurl=new URL(p.verifyurl,new URL(b)).toString()),vt(p))}catch(p){k("unable to configure from X-Altcha-Config",p)}if(!T&&(m!=null&&m.length)){const p=Date.parse(m);if(p){const U=p-Date.now();U>0&&Ne(U)}}return M}}function _n(r){var m;const c=v==null?void 0:v.querySelector(typeof r=="string"?`input[name="${r}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=c==null?void 0:c.value)==null?void 0:m.slice(c.value.indexOf("@")))||void 0}function kn(){return _==="ipAddress"?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:typeof _=="object"?_:{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0}}function xn(r){return[...(v==null?void 0:v.querySelectorAll(r!=null&&r.length?r.map(m=>`input[name="${m}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((m,L)=>{const M=L.name,j=L.value;return M&&j&&(m[M]=/\n/.test(j)?j.replace(new RegExp("(?F in D?Vn(D,F,{enumerable:!0,configurable:!0,writable:!0,value:ce}):D[F]=ce;var K=(D,F,ce)=>Gn(D,typeof F!="symbol"?F+"":F,ce);const F="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGY9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIHAoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiB3KGUsdCxyKXtyZXR1cm4gcChhd2FpdCBjcnlwdG8uc3VidGxlLmRpZ2VzdChyLnRvVXBwZXJDYXNlKCksZi5lbmNvZGUoZSt0KSkpfWZ1bmN0aW9uIGIoZSx0LHI9IlNIQS0yNTYiLG49MWU2LHM9MCl7Y29uc3Qgbz1uZXcgQWJvcnRDb250cm9sbGVyLGE9RGF0ZS5ub3coKTtyZXR1cm57cHJvbWlzZTooYXN5bmMoKT0+e2ZvcihsZXQgYz1zO2M8PW47Yys9MSl7aWYoby5zaWduYWwuYWJvcnRlZClyZXR1cm4gbnVsbDtpZihhd2FpdCB3KHQsYyxyKT09PWUpcmV0dXJue251bWJlcjpjLHRvb2s6RGF0ZS5ub3coKS1hfX1yZXR1cm4gbnVsbH0pKCksY29udHJvbGxlcjpvfX1mdW5jdGlvbiBoKGUpe2NvbnN0IHQ9YXRvYihlKSxyPW5ldyBVaW50OEFycmF5KHQubGVuZ3RoKTtmb3IobGV0IG49MDtuPHQubGVuZ3RoO24rKylyW25dPXQuY2hhckNvZGVBdChuKTtyZXR1cm4gcn1mdW5jdGlvbiBnKGUsdD0xMil7Y29uc3Qgcj1uZXcgVWludDhBcnJheSh0KTtmb3IobGV0IG49MDtuPHQ7bisrKXJbbl09ZSUyNTYsZT1NYXRoLmZsb29yKGUvMjU2KTtyZXR1cm4gcn1hc3luYyBmdW5jdGlvbiBtKGUsdD0iIixyPTFlNixuPTApe2NvbnN0IHM9IkFFUy1HQ00iLG89bmV3IEFib3J0Q29udHJvbGxlcixhPURhdGUubm93KCksbD1hc3luYygpPT57Zm9yKGxldCB1PW47dTw9cjt1Kz0xKXtpZihvLnNpZ25hbC5hYm9ydGVkfHwhY3x8IXkpcmV0dXJuIG51bGw7dHJ5e2NvbnN0IGQ9YXdhaXQgY3J5cHRvLnN1YnRsZS5kZWNyeXB0KHtuYW1lOnMsaXY6Zyh1KX0sYyx5KTtpZihkKXJldHVybntjbGVhclRleHQ6bmV3IFRleHREZWNvZGVyKCkuZGVjb2RlKGQpLHRvb2s6RGF0ZS5ub3coKS1hfX1jYXRjaHt9fXJldHVybiBudWxsfTtsZXQgYz1udWxsLHk9bnVsbDt0cnl7eT1oKGUpO2NvbnN0IHU9YXdhaXQgY3J5cHRvLnN1YnRsZS5kaWdlc3QoIlNIQS0yNTYiLGYuZW5jb2RlKHQpKTtjPWF3YWl0IGNyeXB0by5zdWJ0bGUuaW1wb3J0S2V5KCJyYXciLHUscywhMSxbImRlY3J5cHQiXSl9Y2F0Y2h7cmV0dXJue3Byb21pc2U6UHJvbWlzZS5yZWplY3QoKSxjb250cm9sbGVyOm99fXJldHVybntwcm9taXNlOmwoKSxjb250cm9sbGVyOm99fWxldCBpO29ubWVzc2FnZT1hc3luYyBlPT57Y29uc3R7dHlwZTp0LHBheWxvYWQ6cixzdGFydDpuLG1heDpzfT1lLmRhdGE7bGV0IG89bnVsbDtpZih0PT09ImFib3J0IilpPT1udWxsfHxpLmFib3J0KCksaT12b2lkIDA7ZWxzZSBpZih0PT09IndvcmsiKXtpZigib2JmdXNjYXRlZCJpbiByKXtjb25zdHtrZXk6YSxvYmZ1c2NhdGVkOmx9PXJ8fHt9O289YXdhaXQgbShsLGEscyxuKX1lbHNle2NvbnN0e2FsZ29yaXRobTphLGNoYWxsZW5nZTpsLHNhbHQ6Y309cnx8e307bz1iKGwsYyxhLHMsbil9aT1vLmNvbnRyb2xsZXIsby5wcm9taXNlLnRoZW4oYT0+e3NlbGYucG9zdE1lc3NhZ2UoYSYmey4uLmEsd29ya2VyOiEwfSl9KX19fSkoKTsK",ce=n=>Uint8Array.from(atob(n),e=>e.charCodeAt(0)),Ge=typeof self<"u"&&self.Blob&&new Blob([ce(F)],{type:"text/javascript;charset=utf-8"});function It(n){let e;try{if(e=Ge&&(self.URL||self.webkitURL).createObjectURL(Ge),!e)throw"";const t=new Worker(e,{name:n==null?void 0:n.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+F,{name:n==null?void 0:n.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}function Ee(){}function Lt(n,e){for(const t in e)n[t]=e[t];return n}function He(n){return n()}function Ye(){return Object.create(null)}function ge(n){n.forEach(He)}function Xe(n){return typeof n=="function"}function Nt(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}function zt(n){return Object.keys(n).length===0}function St(n,e,t,i){if(n){const o=Fe(n,e,t,i);return n[0](o)}}function Fe(n,e,t,i){return n[1]&&i?Lt(t.ctx.slice(),n[1](i(e))):t.ctx}function Tt(n,e,t,i){if(n[2]&&i){const o=n[2](i(t));if(e.dirty===void 0)return o;if(typeof o=="object"){const l=[],s=Math.max(e.dirty.length,o.length);for(let d=0;d32){const e=[],t=n.ctx.length/32;for(let i=0;in.removeEventListener(e,t,i)}function a(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xt(n){return Array.from(n.childNodes)}function je(n,e,t){n.classList.toggle(e,!!t)}function Ft(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function jt(n){const e={};return n.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}let me;function be(n){me=n}function Se(){if(!me)throw new Error("Function called outside component initialization");return me}function Dt(n){Se().$$.on_mount.push(n)}function Pt(n){Se().$$.on_destroy.push(n)}function Wt(){const n=Se();return(e,t,{cancelable:i=!1}={})=>{const o=n.$$.callbacks[e];if(o){const l=Ft(e,t,{cancelable:i});return o.slice().forEach(s=>{s.call(n,l)}),!l.defaultPrevented}return!0}}const ae=[],Re=[];let fe=[];const De=[],Pe=Promise.resolve();let Te=!1;function We(){Te||(Te=!0,Pe.then(w))}function Mt(){return We(),Pe}function Ae(n){fe.push(n)}const Ze=new Set;let ue=0;function w(){if(ue!==0)return;const n=me;do{try{for(;uen.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),fe=e}const Ce=new Set;let Bt;function Me(n,e){n&&n.i&&(Ce.delete(n),n.i(e))}function Ot(n,e,t,i){if(n&&n.o){if(Ce.has(n))return;Ce.add(n),Bt.c.push(()=>{Ce.delete(n)}),n.o(e)}}function Jt(n,e,t){const{fragment:i,after_update:o}=n.$$;i&&i.m(e,t),Ae(()=>{const l=n.$$.on_mount.map(He).filter(Xe);n.$$.on_destroy?n.$$.on_destroy.push(...l):ge(l),n.$$.on_mount=[]}),o.forEach(Ae)}function $t(n,e){const t=n.$$;t.fragment!==null&&(Kt(t.after_update),ge(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Qt(n,e){n.$$.dirty[0]===-1&&(ae.push(n),We(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const W=P.length?P[0]:O;return f.ctx&&o(f.ctx[b],f.ctx[b]=W)&&(!f.skip_bound&&f.bound[b]&&f.bound[b](W),I&&Qt(n,b)),O}):[],f.update(),I=!0,ge(f.before_update),f.fragment=i?i(f.ctx):!1,e.target){if(e.hydrate){const b=Xt(e.target);f.fragment&&f.fragment.l(b),b.forEach(H)}else f.fragment&&f.fragment.c();e.intro&&Me(n.$$.fragment),Jt(n,e.target,e.anchor),w()}be(h)}let Ue;typeof HTMLElement=="function"&&(Ue=class extends HTMLElement{constructor(e,t,i){super();K(this,"$$ctor");K(this,"$$s");K(this,"$$c");K(this,"$$cn",!1);K(this,"$$d",{});K(this,"$$r",!1);K(this,"$$p_d",{});K(this,"$$l",{});K(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,i&&this.attachShadow({mode:"open"})}addEventListener(e,t,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const o=this.$$c.$on(e,t);this.$$l_u.set(t,o)}super.addEventListener(e,t,i)}removeEventListener(e,t,i){if(super.removeEventListener(e,t,i),this.$$c){const o=this.$$l_u.get(t);o&&(o(),this.$$l_u.delete(t))}if(this.$$l[e]){const o=this.$$l[e].indexOf(t);o>=0&&this.$$l[e].splice(o,1)}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(l){return()=>{let s;return{c:function(){s=S("slot"),l!=="default"&&a(s,"name",l)},m:function(f,I){X(f,s,I)},d:function(f){f&&H(s)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},i=jt(this);for(const l of this.$$s)l in i&&(t[l]=[e(l)]);for(const l of this.attributes){const s=this.$$g_p(l.name);s in this.$$d||(this.$$d[s]=Ie(s,l.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});const o=()=>{this.$$r=!0;for(const l in this.$$p_d)if(this.$$d[l]=this.$$c.$$.ctx[this.$$c.$$.props[l]],this.$$p_d[l].reflect){const s=Ie(l,this.$$d[l],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,s)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(const l in this.$$l)for(const s of this.$$l[l]){const d=this.$$c.$on(l,s);this.$$l_u.set(s,d)}this.$$l={}}}attributeChangedCallback(e,t,i){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ie(e,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ie(n,e,t,i){var l;const o=(l=t[n])==null?void 0:l.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!t[n])return e;if(i==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function en(n,e,t,i,o,l){let s=class extends Ue{constructor(){super(n,t,o),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map(d=>(e[d].attribute||d).toLowerCase())}};return Object.keys(e).forEach(d=>{Object.defineProperty(s.prototype,d,{get(){return this.$$c&&d in this.$$c?this.$$c[d]:this.$$d[d]},set(h){var f;h=Ie(d,h,e),this.$$d[d]=h,(f=this.$$c)==null||f.$set({[d]:h})}})}),i.forEach(d=>{Object.defineProperty(s.prototype,d,{get(){var h;return(h=this.$$c)==null?void 0:h[d]}})}),n.element=s,s}class tn{constructor(){K(this,"$$");K(this,"$$set")}$destroy(){$t(this,1),this.$destroy=Ee}$on(e,t){if(!Xe(t))return Ee;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const o=i.indexOf(t);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!zt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const nn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(nn);const Ke=new TextEncoder;function rn(n){return[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,"0")).join("")}async function on(n,e="SHA-256",t=1e5){const i=Date.now().toString(16);n||(n=Math.round(Math.random()*t));const o=await Be(i,n,e);return{algorithm:e,challenge:o,salt:i,signature:""}}async function Be(n,e,t){return rn(await crypto.subtle.digest(t.toUpperCase(),Ke.encode(n+e)))}function ln(n,e,t="SHA-256",i=1e6,o=0){const l=new AbortController,s=Date.now();return{promise:(async()=>{for(let h=o;h<=i;h+=1){if(l.signal.aborted)return null;if(await Be(e,h,t)===n)return{number:h,took:Date.now()-s}}return null})(),controller:l}}function sn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function cn(n){const e=atob(n),t=new Uint8Array(e.length);for(let i=0;i{for(let I=i;I<=t;I+=1){if(l.signal.aborted||!h||!f)return null;try{const b=await crypto.subtle.decrypt({name:o,iv:an(I)},h,f);if(b)return{clearText:new TextDecoder().decode(b),took:Date.now()-s}}catch{}}return null};let h=null,f=null;try{f=cn(n);const I=await crypto.subtle.digest("SHA-256",Ke.encode(e));h=await crypto.subtle.importKey("raw",I,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:d(),controller:l}}var g=(n=>(n.ERROR="error",n.VERIFIED="verified",n.VERIFYING="verifying",n.UNVERIFIED="unverified",n.EXPIRED="expired",n))(g||{});function un(n){Vt(n,"svelte-ddsc3z",'.altcha.svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left}.altcha.svelte-ddsc3z.svelte-ddsc3z:focus-within{border-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z{background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow.svelte-ddsc3z{border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto}.altcha[data-floating=bottom].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-bottom-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating=top].svelte-ddsc3z.svelte-ddsc3z:focus-within::after{border-top-color:var(--altcha-color-border-focus, currentColor)}.altcha[data-floating].svelte-ddsc3z.svelte-ddsc3z:not([data-state=unverified]){display:block}.altcha-anchor-arrow.svelte-ddsc3z.svelte-ddsc3z{border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:"";height:0;left:12px;position:absolute;top:-12px;width:0}.altcha-main.svelte-ddsc3z.svelte-ddsc3z{align-items:center;display:flex;gap:0.4rem;padding:0.7rem}.altcha-label.svelte-ddsc3z.svelte-ddsc3z{flex-grow:1}.altcha-label.svelte-ddsc3z label.svelte-ddsc3z{cursor:pointer}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z{color:currentColor;opacity:0.3}.altcha-logo.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-error.svelte-ddsc3z.svelte-ddsc3z{color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z{align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right}.altcha-footer.svelte-ddsc3z.svelte-ddsc3z:hover{opacity:1}.altcha-footer.svelte-ddsc3z>.svelte-ddsc3z:first-child{flex-grow:1}.altcha-footer.svelte-ddsc3z a{color:currentColor}.altcha-checkbox.svelte-ddsc3z.svelte-ddsc3z{display:flex;align-items:center;height:24px;width:24px}.altcha-checkbox.svelte-ddsc3z input.svelte-ddsc3z{width:18px;height:18px;margin:0}.altcha-hidden.svelte-ddsc3z.svelte-ddsc3z{display:none}.altcha-spinner.svelte-ddsc3z.svelte-ddsc3z{animation:svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center}@keyframes svelte-ddsc3z-altcha-spinner{100%{transform:rotate(360deg)}}')}function Oe(n){let e,t,i;return{c(){e=$("svg"),t=$("path"),i=$("path"),a(t,"d","M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"),a(t,"fill","currentColor"),a(t,"opacity",".25"),a(i,"d","M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"),a(i,"fill","currentColor"),a(i,"class","altcha-spinner svelte-ddsc3z"),a(e,"width","24"),a(e,"height","24"),a(e,"viewBox","0 0 24 24"),a(e,"xmlns","http://www.w3.org/2000/svg")},m(o,l){X(o,e,l),C(e,t),C(e,i)},d(o){o&&H(e)}}}function dn(n){let e,t=n[11].label+"",i;return{c(){e=S("label"),a(e,"for",i=n[4]+"_checkbox"),a(e,"class","svelte-ddsc3z")},m(o,l){X(o,e,l),e.innerHTML=t},p(o,l){l[0]&2048&&t!==(t=o[11].label+"")&&(e.innerHTML=t),l[0]&16&&i!==(i=o[4]+"_checkbox")&&a(e,"for",i)},d(o){o&&H(e)}}}function hn(n){let e,t=n[11].verifying+"";return{c(){e=S("span")},m(i,o){X(i,e,o),e.innerHTML=t},p(i,o){o[0]&2048&&t!==(t=i[11].verifying+"")&&(e.innerHTML=t)},d(i){i&&H(e)}}}function gn(n){let e,t=n[11].verified+"",i,o;return{c(){e=S("span"),i=Q(),o=S("input"),a(o,"type","hidden"),a(o,"name",n[4]),o.value=n[6]},m(l,s){X(l,e,s),e.innerHTML=t,X(l,i,s),X(l,o,s)},p(l,s){s[0]&2048&&t!==(t=l[11].verified+"")&&(e.innerHTML=t),s[0]&16&&a(o,"name",l[4]),s[0]&64&&(o.value=l[6])},d(l){l&&(H(e),H(i),H(o))}}}function Je(n){let e,t,i,o,l,s,d;return{c(){e=S("div"),t=S("a"),i=$("svg"),o=$("path"),l=$("path"),s=$("path"),a(o,"d","M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"),a(o,"fill","currentColor"),a(l,"d","M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"),a(l,"fill","currentColor"),a(s,"d","M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"),a(s,"fill","currentColor"),a(i,"width","22"),a(i,"height","22"),a(i,"viewBox","0 0 20 20"),a(i,"fill","none"),a(i,"xmlns","http://www.w3.org/2000/svg"),a(t,"href",tt),a(t,"target","_blank"),a(t,"class","altcha-logo svelte-ddsc3z"),a(t,"aria-label",d=n[11].ariaLinkLabel)},m(h,f){X(h,e,f),C(e,t),C(t,i),C(i,o),C(i,l),C(i,s)},p(h,f){f[0]&2048&&d!==(d=h[11].ariaLinkLabel)&&a(t,"aria-label",d)},d(h){h&&H(e)}}}function $e(n){let e,t,i,o;function l(h,f){return h[7]===g.EXPIRED?bn:mn}let s=l(n),d=s(n);return{c(){e=S("div"),t=$("svg"),i=$("path"),o=Q(),d.c(),a(i,"stroke-linecap","round"),a(i,"stroke-linejoin","round"),a(i,"d","M6 18L18 6M6 6l12 12"),a(t,"width","14"),a(t,"height","14"),a(t,"xmlns","http://www.w3.org/2000/svg"),a(t,"fill","none"),a(t,"viewBox","0 0 24 24"),a(t,"stroke-width","1.5"),a(t,"stroke","currentColor"),a(e,"class","altcha-error svelte-ddsc3z")},m(h,f){X(h,e,f),C(e,t),C(t,i),C(e,o),d.m(e,null)},p(h,f){s===(s=l(h))&&d?d.p(h,f):(d.d(1),d=s(h),d&&(d.c(),d.m(e,null)))},d(h){h&&H(e),d.d()}}}function mn(n){let e,t=n[11].error+"";return{c(){e=S("div"),a(e,"title",n[5])},m(i,o){X(i,e,o),e.innerHTML=t},p(i,o){o[0]&2048&&t!==(t=i[11].error+"")&&(e.innerHTML=t),o[0]&32&&a(e,"title",i[5])},d(i){i&&H(e)}}}function bn(n){let e,t=n[11].expired+"";return{c(){e=S("div"),a(e,"title",n[5])},m(i,o){X(i,e,o),e.innerHTML=t},p(i,o){o[0]&2048&&t!==(t=i[11].expired+"")&&(e.innerHTML=t),o[0]&32&&a(e,"title",i[5])},d(i){i&&H(e)}}}function Qe(n){let e,t,i=n[11].footer+"";return{c(){e=S("div"),t=S("div"),a(t,"class","svelte-ddsc3z"),a(e,"class","altcha-footer svelte-ddsc3z")},m(o,l){X(o,e,l),C(e,t),t.innerHTML=i},p(o,l){l[0]&2048&&i!==(i=o[11].footer+"")&&(t.innerHTML=i)},d(o){o&&H(e)}}}function qe(n){let e;return{c(){e=S("div"),a(e,"class","altcha-anchor-arrow svelte-ddsc3z")},m(t,i){X(t,e,i),n[48](e)},p:Ee,d(t){t&&H(e),n[48](null)}}}function yn(n){let e,t,i,o,l,s,d,h,f,I,b,O,P,W,T,N,q;const ee=n[46].default,G=St(ee,n,n[45],null);let A=n[7]===g.VERIFYING&&Oe();function te(u,y){return u[7]===g.VERIFIED?gn:u[7]===g.VERIFYING?hn:dn}let B=te(n),Y=B(n),x=(n[3]!==!0||n[12])&&Je(n),Z=(n[5]||n[7]===g.EXPIRED)&&$e(n),z=n[11].footer&&(n[2]!==!0||n[12])&&Qe(n),_=n[1]&&qe(n);return{c(){G&&G.c(),e=Q(),t=S("div"),i=S("div"),A&&A.c(),o=Q(),l=S("div"),s=S("input"),f=Q(),I=S("div"),Y.c(),b=Q(),x&&x.c(),O=Q(),Z&&Z.c(),P=Q(),z&&z.c(),W=Q(),_&&_.c(),a(s,"type","checkbox"),a(s,"id",d=n[4]+"_checkbox"),s.required=h=n[0]!=="onsubmit"&&(!n[1]||n[0]!=="off"),a(s,"class","svelte-ddsc3z"),a(l,"class","altcha-checkbox svelte-ddsc3z"),je(l,"altcha-hidden",n[7]===g.VERIFYING),a(I,"class","altcha-label svelte-ddsc3z"),a(i,"class","altcha-main svelte-ddsc3z"),a(t,"class","altcha svelte-ddsc3z"),a(t,"data-state",n[7]),a(t,"data-floating",n[1])},m(u,y){G&&G.m(u,y),X(u,e,y),X(u,t,y),C(t,i),A&&A.m(i,null),C(i,o),C(i,l),C(l,s),s.checked=n[8],C(i,f),C(i,I),Y.m(I,null),C(i,b),x&&x.m(i,null),C(t,O),Z&&Z.m(t,null),C(t,P),z&&z.m(t,null),C(t,W),_&&_.m(t,null),n[49](t),T=!0,N||(q=[ze(s,"change",n[47]),ze(s,"change",n[13]),ze(s,"invalid",n[14])],N=!0)},p(u,y){G&&G.p&&(!T||y[1]&16384)&&At(G,ee,u,u[45],T?Tt(ee,u[45],y,null):Zt(u[45]),null),u[7]===g.VERIFYING?A||(A=Oe(),A.c(),A.m(i,o)):A&&(A.d(1),A=null),(!T||y[0]&16&&d!==(d=u[4]+"_checkbox"))&&a(s,"id",d),(!T||y[0]&3&&h!==(h=u[0]!=="onsubmit"&&(!u[1]||u[0]!=="off")))&&(s.required=h),y[0]&256&&(s.checked=u[8]),(!T||y[0]&128)&&je(l,"altcha-hidden",u[7]===g.VERIFYING),B===(B=te(u))&&Y?Y.p(u,y):(Y.d(1),Y=B(u),Y&&(Y.c(),Y.m(I,null))),u[3]!==!0||u[12]?x?x.p(u,y):(x=Je(u),x.c(),x.m(i,null)):x&&(x.d(1),x=null),u[5]||u[7]===g.EXPIRED?Z?Z.p(u,y):(Z=$e(u),Z.c(),Z.m(t,P)):Z&&(Z.d(1),Z=null),u[11].footer&&(u[2]!==!0||u[12])?z?z.p(u,y):(z=Qe(u),z.c(),z.m(t,W)):z&&(z.d(1),z=null),u[1]?_?_.p(u,y):(_=qe(u),_.c(),_.m(t,null)):_&&(_.d(1),_=null),(!T||y[0]&128)&&a(t,"data-state",u[7]),(!T||y[0]&2)&&a(t,"data-floating",u[1])},i(u){T||(Me(G,u),T=!0)},o(u){Ot(G,u),T=!1},d(u){u&&(H(e),H(t)),G&&G.d(u),A&&A.d(),Y.d(),x&&x.d(),Z&&Z.d(),z&&z.d(),_&&_.d(),n[49](null),N=!1,ge(q)}}}const et="Visit Altcha.org",tt="https://altcha.org/";function nt(n){return JSON.parse(n)}function vn(n,e,t){var Et,Rt;let i,o,l,s,{$$slots:d={},$$scope:h}=e,{auto:f=void 0}=e,{blockspam:I=void 0}=e,{challengeurl:b=void 0}=e,{challengejson:O=void 0}=e,{debug:P=!1}=e,{delay:W=0}=e,{expire:T=void 0}=e,{floating:N=void 0}=e,{floatinganchor:q=void 0}=e,{floatingoffset:ee=void 0}=e,{hidefooter:G=!1}=e,{hidelogo:A=!1}=e,{name:te="altcha"}=e,{maxnumber:B=1e6}=e,{mockerror:Y=!1}=e,{obfuscated:x=void 0}=e,{plugins:Z=void 0}=e,{refetchonexpire:z=!0}=e,{spamfilter:_=!1}=e,{strings:u=void 0}=e,{test:y=!1}=e,{verifyurl:ne=void 0}=e,{workers:de=Math.min(16,navigator.hardwareConcurrency||8)}=e,{workerurl:ye=void 0}=e;const ve=Wt(),it=["SHA-256","SHA-384","SHA-512"],ot=(Rt=(Et=document.documentElement.lang)==null?void 0:Et.split("-"))==null?void 0:Rt[0];let oe=!1,E,le=null,he=null,v=null,pe=null,J=null,se=null,re=[],R=g.UNVERIFIED;Pt(()=>{pn(),v&&(v.removeEventListener("submit",ut),v.removeEventListener("reset",dt),v.removeEventListener("focusin",ft),v=null),J&&(clearTimeout(J),J=null),document.removeEventListener("click",ct),document.removeEventListener("scroll",at),window.removeEventListener("resize",gt)}),Dt(()=>{k("mounted","1.0.1"),k("workers",de),En(),k("plugins",re.length?re.map(r=>r.constructor.pluginName).join(", "):"none"),y&&k("using test mode"),T&&Ne(T),f!==void 0&&k("auto",f),N!==void 0&&mt(N),v=E.closest("form"),v&&(v.addEventListener("submit",ut,{capture:!0}),v.addEventListener("reset",dt),f==="onfocus"&&v.addEventListener("focusin",ft)),f==="onload"&&(x?we():ie()),i&&(G||A)&&k("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{ve("load")})});function lt(r,c){return btoa(JSON.stringify({algorithm:r.algorithm,challenge:r.challenge,number:c.number,salt:r.salt,signature:r.signature,test:y?!0:void 0,took:c.took}))}function pn(){for(const r of re)r.destroy()}function st(){b&&z&&R===g.VERIFIED?ie():_e(g.EXPIRED,s.expired)}async function wn(){var r;if(Y)throw k("mocking error"),new Error("Mocked error.");if(o)return k("using provided json data"),o;if(y)return k("generating test challenge",{test:y}),on(typeof y!="boolean"?+y:void 0);{if(!b&&v){const p=v.getAttribute("action");p!=null&&p.includes("/form/")&&t(15,b=p+"/altcha")}if(!b)throw new Error("Attribute challengeurl not set.");k("fetching challenge from",b);const c=await fetch(b,{headers:_?{"x-altcha-spam-filter":"1"}:{}});if(c.status!==200)throw new Error(`Server responded with ${c.status}.`);const m=c.headers.get("Expires"),L=c.headers.get("X-Altcha-Config"),M=await c.json(),j=new URLSearchParams((r=M.salt.split("?"))==null?void 0:r[1]),V=j.get("expires")||j.get("expire");if(V){const p=new Date(+V*1e3),U=isNaN(p.getTime())?0:p.getTime()-Date.now();U>0&&Ne(U)}if(L)try{const p=JSON.parse(L);p&&typeof p=="object"&&(p.verifyurl&&(p.verifyurl=new URL(p.verifyurl,new URL(b)).toString()),vt(p))}catch(p){k("unable to configure from X-Altcha-Config",p)}if(!T&&(m!=null&&m.length)){const p=Date.parse(m);if(p){const U=p-Date.now();U>0&&Ne(U)}}return M}}function _n(r){var m;const c=v==null?void 0:v.querySelector(typeof r=="string"?`input[name="${r}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=c==null?void 0:c.value)==null?void 0:m.slice(c.value.indexOf("@")))||void 0}function kn(){return _==="ipAddress"?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:typeof _=="object"?_:{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0}}function xn(r){return[...(v==null?void 0:v.querySelectorAll(r!=null&&r.length?r.map(m=>`input[name="${m}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((m,L)=>{const M=L.name,j=L.value;return M&&j&&(m[M]=/\n/.test(j)?j.replace(new RegExp("(?c instanceof Error))&&console[r[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${te}]`,...r)}function Rn(){[g.UNVERIFIED,g.ERROR,g.EXPIRED].includes(R)?_&&(v==null?void 0:v.reportValidity())===!1?t(8,oe=!1):x?we():ie():t(8,oe=!0)}function ct(r){const c=r.target;N&&c&&!E.contains(c)&&(R===g.VERIFIED||f==="off"&&R===g.UNVERIFIED)&&t(9,E.style.display="none",E)}function at(){N&&R!==g.UNVERIFIED&&Le()}function Cn(r){for(const c of re)typeof c.onErrorChange=="function"&&c.onErrorChange(pe)}function ft(r){R===g.UNVERIFIED&&ie()}function ut(r){v&&f==="onsubmit"?R===g.UNVERIFIED?(r.preventDefault(),r.stopPropagation(),ie().then(()=>{v==null||v.requestSubmit()})):R!==g.VERIFIED&&(r.preventDefault(),r.stopPropagation(),R===g.VERIFYING&&ht()):v&&N&&f==="off"&&R===g.UNVERIFIED&&(r.preventDefault(),r.stopPropagation(),t(9,E.style.display="block",E),Le())}function dt(){_e()}function ht(){R===g.VERIFYING&&s.waitAlert&&alert(s.waitAlert)}function In(r){for(const c of re)typeof c.onStateChange=="function"&&c.onStateChange(R);N&&R!==g.UNVERIFIED&&requestAnimationFrame(()=>{Le()}),t(8,oe=R===g.VERIFIED)}function gt(){N&&Le()}function Le(r=20){if(E)if(he||(he=(q?document.querySelector(q):v==null?void 0:v.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||v),he){const c=parseInt(ee,10)||12,m=he.getBoundingClientRect(),L=E.getBoundingClientRect(),M=document.documentElement.clientHeight,j=document.documentElement.clientWidth,V=N==="auto"?m.bottom+L.height+c+r>M:N==="top",p=Math.max(r,Math.min(j-r-L.width,m.left+m.width/2-L.width/2));if(V?t(9,E.style.top=`${m.top-(L.height+c)}px`,E):t(9,E.style.top=`${m.bottom+c}px`,E),t(9,E.style.left=`${p}px`,E),E.setAttribute("data-floating",V?"top":"bottom"),le){const U=le.getBoundingClientRect();t(10,le.style.left=m.left-p+m.width/2-U.width/2+"px",le)}}else k("unable to find floating anchor element")}async function Ln(r){if(!ne)throw new Error("Attribute verifyurl not set.");k("requesting server verification from",ne);const c={payload:r};if(_){const{blockedCountries:M,classifier:j,disableRules:V,email:p,expectedLanguages:U,expectedCountries:Ve,fields:ke,ipAddress:xe,text:Zn,timeZone:Ct}=kn();c.blockedCountries=M,c.classifier=j,c.disableRules=V,c.email=p===!1?void 0:_n(p),c.expectedCountries=Ve,c.expectedLanguages=U||(ot?[ot]:void 0),c.fields=ke===!1?void 0:xn(ke),c.ipAddress=xe===!1?void 0:xe||"auto",c.text=Zn,c.timeZone=Ct===!1?void 0:Ct||sn()}const m=await fetch(ne,{body:JSON.stringify(c),headers:{"content-type":"application/json"},method:"POST"});if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const L=await m.json();if(L!=null&&L.payload&&t(6,se=L.payload),ve("serververification",L),I&&L.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}function Ne(r){k("expire",r),J&&(clearTimeout(J),J=null),r<1?st():J=setTimeout(st,r)}function mt(r){k("floating",r),N!==r&&(t(9,E.style.left="",E),t(9,E.style.top="",E)),t(1,N=r===!0||r===""?"auto":r===!1||r==="false"?void 0:N),N?(f||t(0,f="onsubmit"),document.addEventListener("scroll",at),document.addEventListener("click",ct),window.addEventListener("resize",gt)):f==="onsubmit"&&t(0,f=void 0)}function bt(r){if(!r.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(r.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!it.includes(r.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${it.join(", ")}`);if(!r.challenge||r.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!r.salt||r.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function yt(r){let c=null;if("Worker"in window){try{c=await Nn(r,r.maxnumber)}catch(m){k(m)}if((c==null?void 0:c.number)!==void 0||"obfuscated"in r)return{data:r,solution:c}}if("obfuscated"in r){const m=await fn(r.obfuscated,r.key,r.maxnumber);return{data:r,solution:await m.promise}}return{data:r,solution:await ln(r.challenge,r.salt,r.algorithm,r.maxnumber||B).promise}}async function Nn(r,c=typeof y=="number"?y:B,m=Math.ceil(de)){const L=[];m=Math.min(16,Math.max(1,m));for(let V=0;V{const U=p*M;return new Promise(Ve=>{V.addEventListener("message",ke=>{if(ke.data)for(const xe of L)xe!==V&&xe.postMessage({type:"abort"});Ve(ke.data)}),V.postMessage({payload:r,max:U+M,start:U,type:"work"})})}));for(const V of L)V.terminate();return j.find(V=>!!V)||null}async function we(){if(!x){t(7,R=g.ERROR);return}const r=re.find(c=>c.constructor.pluginName==="obfuscation");if(!r||!("clarify"in r)){t(7,R=g.ERROR),k("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in r&&typeof r.clarify=="function")return r.clarify()}function vt(r){r.obfuscated!==void 0&&t(24,x=r.obfuscated),r.auto!==void 0&&(t(0,f=r.auto),f==="onload"&&(x?we():ie())),r.blockspam!==void 0&&t(16,I=!!r.blockspam),r.floatinganchor!==void 0&&t(20,q=r.floatinganchor),r.delay!==void 0&&t(18,W=r.delay),r.floatingoffset!==void 0&&t(21,ee=r.floatingoffset),r.floating!==void 0&&mt(r.floating),r.expire!==void 0&&(Ne(r.expire),t(19,T=r.expire)),r.challenge&&(bt(r.challenge),o=r.challenge),r.challengeurl!==void 0&&t(15,b=r.challengeurl),r.debug!==void 0&&t(17,P=!!r.debug),r.hidefooter!==void 0&&t(2,G=!!r.hidefooter),r.hidelogo!==void 0&&t(3,A=!!r.hidelogo),r.maxnumber!==void 0&&t(22,B=+r.maxnumber),r.mockerror!==void 0&&t(23,Y=!!r.mockerror),r.name!==void 0&&t(4,te=r.name),r.refetchonexpire!==void 0&&t(25,z=!!r.refetchonexpire),r.spamfilter!==void 0&&t(26,_=typeof r.spamfilter=="object"?r.spamfilter:!!r.spamfilter),r.strings&&t(44,l=r.strings),r.test!==void 0&&t(27,y=typeof r.test=="number"?r.test:!!r.test),r.verifyurl!==void 0&&t(28,ne=r.verifyurl),r.workers!==void 0&&t(29,de=+r.workers),r.workerurl!==void 0&&t(30,ye=r.workerurl)}function pt(){return{auto:f,blockspam:I,challengeurl:b,debug:P,delay:W,expire:T,floating:N,floatinganchor:q,floatingoffset:ee,hidefooter:G,hidelogo:A,name:te,maxnumber:B,mockerror:Y,obfuscated:x,refetchonexpire:z,spamfilter:_,strings:s,test:y,verifyurl:ne,workers:de,workerurl:ye}}function wt(){return he}function zn(r){return re.find(c=>c.constructor.pluginName===r)}function _t(){return R}function _e(r=g.UNVERIFIED,c=null){J&&(clearTimeout(J),J=null),t(8,oe=!1),t(5,pe=c),t(6,se=null),t(7,R=r)}function kt(r){he=r}function xt(r,c=null){t(7,R=r),t(5,pe=c)}async function ie(){return _e(g.VERIFYING),await new Promise(r=>setTimeout(r,W||0)),wn().then(r=>(bt(r),k("challenge",r),yt(r))).then(({data:r,solution:c})=>{if(k("solution",c),"challenge"in r&&c&&!("clearText"in c))if((c==null?void 0:c.number)!==void 0){if(ne)return Ln(lt(r,c));t(6,se=lt(r,c)),k("payload",se)}else throw k("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{Mt().then(()=>{t(7,R=g.VERIFIED),k("verified"),ve("verified",{payload:se})})}).catch(r=>{k(r),t(7,R=g.ERROR),t(5,pe=r.message)})}function Sn(){oe=this.checked,t(8,oe)}function Tn(r){Re[r?"unshift":"push"](()=>{le=r,t(10,le)})}function An(r){Re[r?"unshift":"push"](()=>{E=r,t(9,E)})}return n.$$set=r=>{"auto"in r&&t(0,f=r.auto),"blockspam"in r&&t(16,I=r.blockspam),"challengeurl"in r&&t(15,b=r.challengeurl),"challengejson"in r&&t(31,O=r.challengejson),"debug"in r&&t(17,P=r.debug),"delay"in r&&t(18,W=r.delay),"expire"in r&&t(19,T=r.expire),"floating"in r&&t(1,N=r.floating),"floatinganchor"in r&&t(20,q=r.floatinganchor),"floatingoffset"in r&&t(21,ee=r.floatingoffset),"hidefooter"in r&&t(2,G=r.hidefooter),"hidelogo"in r&&t(3,A=r.hidelogo),"name"in r&&t(4,te=r.name),"maxnumber"in r&&t(22,B=r.maxnumber),"mockerror"in r&&t(23,Y=r.mockerror),"obfuscated"in r&&t(24,x=r.obfuscated),"plugins"in r&&t(32,Z=r.plugins),"refetchonexpire"in r&&t(25,z=r.refetchonexpire),"spamfilter"in r&&t(26,_=r.spamfilter),"strings"in r&&t(33,u=r.strings),"test"in r&&t(27,y=r.test),"verifyurl"in r&&t(28,ne=r.verifyurl),"workers"in r&&t(29,de=r.workers),"workerurl"in r&&t(30,ye=r.workerurl),"$$scope"in r&&t(45,h=r.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&32768&&t(12,i=!!(b!=null&&b.includes(".altcha.org"))&&!!(b!=null&&b.includes("apiKey=ckey_"))),n.$$.dirty[1]&1&&(o=O?nt(O):void 0),n.$$.dirty[1]&4&&t(44,l=u?nt(u):{}),n.$$.dirty[1]&8192&&t(11,s={ariaLinkLabel:et,error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:`Protected by ALTCHA`,label:"I'm not a robot",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait.",...l}),n.$$.dirty[0]&192&&ve("statechange",{payload:se,state:R}),n.$$.dirty[0]&32&&Cn(),n.$$.dirty[0]&128&&In()},[f,N,G,A,te,pe,se,R,oe,E,le,s,i,Rn,ht,b,I,P,W,T,q,ee,B,Y,x,z,_,y,ne,de,ye,O,Z,u,we,vt,pt,wt,zn,_t,_e,kt,xt,ie,l,h,d,Sn,Tn,An]}class rt extends tn{constructor(e){super(),qt(this,e,vn,yn,Nt,{auto:0,blockspam:16,challengeurl:15,challengejson:31,debug:17,delay:18,expire:19,floating:1,floatinganchor:20,floatingoffset:21,hidefooter:2,hidelogo:3,name:4,maxnumber:22,mockerror:23,obfuscated:24,plugins:32,refetchonexpire:25,spamfilter:26,strings:33,test:27,verifyurl:28,workers:29,workerurl:30,clarify:34,configure:35,getConfiguration:36,getFloatingAnchor:37,getPlugin:38,getState:39,reset:40,setFloatingAnchor:41,setState:42,verify:43},un,[-1,-1,-1])}get auto(){return this.$$.ctx[0]}set auto(e){this.$$set({auto:e}),w()}get blockspam(){return this.$$.ctx[16]}set blockspam(e){this.$$set({blockspam:e}),w()}get challengeurl(){return this.$$.ctx[15]}set challengeurl(e){this.$$set({challengeurl:e}),w()}get challengejson(){return this.$$.ctx[31]}set challengejson(e){this.$$set({challengejson:e}),w()}get debug(){return this.$$.ctx[17]}set debug(e){this.$$set({debug:e}),w()}get delay(){return this.$$.ctx[18]}set delay(e){this.$$set({delay:e}),w()}get expire(){return this.$$.ctx[19]}set expire(e){this.$$set({expire:e}),w()}get floating(){return this.$$.ctx[1]}set floating(e){this.$$set({floating:e}),w()}get floatinganchor(){return this.$$.ctx[20]}set floatinganchor(e){this.$$set({floatinganchor:e}),w()}get floatingoffset(){return this.$$.ctx[21]}set floatingoffset(e){this.$$set({floatingoffset:e}),w()}get hidefooter(){return this.$$.ctx[2]}set hidefooter(e){this.$$set({hidefooter:e}),w()}get hidelogo(){return this.$$.ctx[3]}set hidelogo(e){this.$$set({hidelogo:e}),w()}get name(){return this.$$.ctx[4]}set name(e){this.$$set({name:e}),w()}get maxnumber(){return this.$$.ctx[22]}set maxnumber(e){this.$$set({maxnumber:e}),w()}get mockerror(){return this.$$.ctx[23]}set mockerror(e){this.$$set({mockerror:e}),w()}get obfuscated(){return this.$$.ctx[24]}set obfuscated(e){this.$$set({obfuscated:e}),w()}get plugins(){return this.$$.ctx[32]}set plugins(e){this.$$set({plugins:e}),w()}get refetchonexpire(){return this.$$.ctx[25]}set refetchonexpire(e){this.$$set({refetchonexpire:e}),w()}get spamfilter(){return this.$$.ctx[26]}set spamfilter(e){this.$$set({spamfilter:e}),w()}get strings(){return this.$$.ctx[33]}set strings(e){this.$$set({strings:e}),w()}get test(){return this.$$.ctx[27]}set test(e){this.$$set({test:e}),w()}get verifyurl(){return this.$$.ctx[28]}set verifyurl(e){this.$$set({verifyurl:e}),w()}get workers(){return this.$$.ctx[29]}set workers(e){this.$$set({workers:e}),w()}get workerurl(){return this.$$.ctx[30]}set workerurl(e){this.$$set({workerurl:e}),w()}get clarify(){return this.$$.ctx[34]}get configure(){return this.$$.ctx[35]}get getConfiguration(){return this.$$.ctx[36]}get getFloatingAnchor(){return this.$$.ctx[37]}get getPlugin(){return this.$$.ctx[38]}get getState(){return this.$$.ctx[39]}get reset(){return this.$$.ctx[40]}get setFloatingAnchor(){return this.$$.ctx[41]}get setState(){return this.$$.ctx[42]}get verify(){return this.$$.ctx[43]}}customElements.define("altcha-widget",en(rt,{auto:{},blockspam:{},challengeurl:{},challengejson:{},debug:{type:"Boolean"},delay:{},expire:{},floating:{},floatinganchor:{},floatingoffset:{},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},name:{},maxnumber:{},mockerror:{type:"Boolean"},obfuscated:{},plugins:{},refetchonexpire:{type:"Boolean"},spamfilter:{type:"Boolean"},strings:{},test:{type:"Boolean"},verifyurl:{},workers:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","reset","setFloatingAnchor","setState","verify"],!1)),globalThis.altchaCreateWorker=n=>n?new Worker(new URL(n)):new It,globalThis.altchaPlugins=globalThis.altchaPlugins||[],D.Altcha=rt,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}); diff --git a/dist_external/altcha.js b/dist_external/altcha.js index a55e99a..7c4218f 100644 --- a/dist_external/altcha.js +++ b/dist_external/altcha.js @@ -1,9 +1,9 @@ var jt = Object.defineProperty; -var Ht = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t; -var Z = (n, e, t) => Ht(n, typeof e != "symbol" ? e + "" : e, t); -function xe() { +var $t = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t; +var Z = (n, e, t) => $t(n, typeof e != "symbol" ? e + "" : e, t); +function Ce() { } -function Ot(n, e) { +function Ht(n, e) { for (const t in e) n[t] = e[t]; return ( /** @type {T & S} */ @@ -16,16 +16,16 @@ function ht(n) { function nt() { return /* @__PURE__ */ Object.create(null); } -function pe(n) { +function Ee(n) { n.forEach(ht); } function dt(n) { return typeof n == "function"; } -function Ut(n, e) { +function Ot(n, e) { return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function"; } -function $t(n) { +function Ut(n) { return Object.keys(n).length === 0; } function Bt(n, e, t, i) { @@ -35,7 +35,7 @@ function Bt(n, e, t, i) { } } function gt(n, e, t, i) { - return n[1] && i ? Ot(t.ctx.slice(), n[1](i(e))) : t.ctx; + return n[1] && i ? Ht(t.ctx.slice(), n[1](i(e))) : t.ctx; } function qt(n, e, t, i) { if (n[2] && i) { @@ -70,7 +70,7 @@ function Gt(n) { function L(n, e) { n.appendChild(e); } -function H(n, e, t) { +function $(n, e, t) { n.insertBefore(e, t || null); } function j(n) { @@ -149,7 +149,7 @@ let ue = []; const it = [], mt = /* @__PURE__ */ Promise.resolve(); let Se = !1; function bt() { - Se || (Se = !0, mt.then(p)); + Se || (Se = !0, mt.then(E)); } function en() { return bt(), mt; @@ -159,7 +159,7 @@ function De(n) { } const Re = /* @__PURE__ */ new Set(); let fe = 0; -function p() { +function E() { if (fe !== 0) return; const n = we; @@ -185,7 +185,7 @@ function p() { } function tn(n) { if (n.fragment !== null) { - n.update(), pe(n.before_update); + n.update(), Ee(n.before_update); const e = n.dirty; n.dirty = [-1], n.fragment && n.fragment.p(n.ctx, e), n.after_update.forEach(De); } @@ -211,12 +211,12 @@ function ln(n, e, t) { const { fragment: i, after_update: o } = n.$$; i && i.m(e, t), De(() => { const l = n.$$.on_mount.map(ht).filter(dt); - n.$$.on_destroy ? n.$$.on_destroy.push(...l) : pe(l), n.$$.on_mount = []; + n.$$.on_destroy ? n.$$.on_destroy.push(...l) : Ee(l), n.$$.on_mount = []; }), o.forEach(De); } function sn(n, e) { const t = n.$$; - t.fragment !== null && (nn(t.after_update), pe(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []); + t.fragment !== null && (nn(t.after_update), Ee(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []); } function fn(n, e) { n.$$.dirty[0] === -1 && (ce.push(n), bt(), n.$$.dirty.fill(0)), n.$$.dirty[e / 31 | 0] |= 1 << e % 31; @@ -229,7 +229,7 @@ function cn(n, e, t, i, o, l, s = null, h = [-1]) { ctx: [], // state props: l, - update: xe, + update: Ce, not_equal: o, bound: nt(), // lifecycle @@ -247,16 +247,16 @@ function cn(n, e, t, i, o, l, s = null, h = [-1]) { }; s && s(u.root); let A = !1; - if (u.ctx = t ? t(n, e.props || {}, (b, Y, ...U) => { - const $ = U.length ? U[0] : Y; - return u.ctx && o(u.ctx[b], u.ctx[b] = $) && (!u.skip_bound && u.bound[b] && u.bound[b]($), A && fn(n, b)), Y; - }) : [], u.update(), A = !0, pe(u.before_update), u.fragment = i ? i(u.ctx) : !1, e.target) { + if (u.ctx = t ? t(n, e.props || {}, (b, Y, ...O) => { + const U = O.length ? O[0] : Y; + return u.ctx && o(u.ctx[b], u.ctx[b] = U) && (!u.skip_bound && u.bound[b] && u.bound[b](U), A && fn(n, b)), Y; + }) : [], u.update(), A = !0, Ee(u.before_update), u.fragment = i ? i(u.ctx) : !1, e.target) { if (e.hydrate) { const b = Wt(e.target); u.fragment && u.fragment.l(b), b.forEach(j); } else u.fragment && u.fragment.c(); - e.intro && yt(n.$$.fragment), ln(n, e.target, e.anchor), p(); + e.intro && yt(n.$$.fragment), ln(n, e.target, e.anchor), E(); } _e(d); } @@ -296,6 +296,10 @@ typeof HTMLElement == "function" && (_t = class extends HTMLElement { const o = this.$$l_u.get(t); o && (o(), this.$$l_u.delete(t)); } + if (this.$$l[e]) { + const o = this.$$l[e].indexOf(t); + o >= 0 && this.$$l[e].splice(o, 1); + } } async connectedCallback() { if (this.$$cn = !0, !this.$$c) { @@ -311,7 +315,7 @@ typeof HTMLElement == "function" && (_t = class extends HTMLElement { * @param {HTMLElement} [anchor] */ m: function(u, A) { - H(u, s, A); + $(u, s, A); }, d: function(u) { u && j(s); @@ -326,7 +330,7 @@ typeof HTMLElement == "function" && (_t = class extends HTMLElement { l in i && (t[l] = [e(l)]); for (const l of this.attributes) { const s = this.$$g_p(l.name); - s in this.$$d || (this.$$d[s] = Ce(s, l.value, this.$$p_d, "toProp")); + s in this.$$d || (this.$$d[s] = xe(s, l.value, this.$$p_d, "toProp")); } for (const l in this.$$p_d) !(l in this.$$d) && this[l] !== void 0 && (this.$$d[l] = this[l], delete this[l]); @@ -344,7 +348,7 @@ typeof HTMLElement == "function" && (_t = class extends HTMLElement { this.$$r = !0; for (const l in this.$$p_d) if (this.$$d[l] = this.$$c.$$.ctx[this.$$c.$$.props[l]], this.$$p_d[l].reflect) { - const s = Ce( + const s = xe( l, this.$$d[l], this.$$p_d, @@ -367,7 +371,7 @@ typeof HTMLElement == "function" && (_t = class extends HTMLElement { // and setting attributes through setAttribute etc, this is helpful attributeChangedCallback(e, t, i) { var o; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = Ce(e, i, this.$$p_d, "toProp"), (o = this.$$c) == null || o.$set({ [e]: this.$$d[e] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = xe(e, i, this.$$p_d, "toProp"), (o = this.$$c) == null || o.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -380,7 +384,7 @@ typeof HTMLElement == "function" && (_t = class extends HTMLElement { ) || e; } }); -function Ce(n, e, t, i) { +function xe(n, e, t, i) { var l; const o = (l = t[n]) == null ? void 0 : l.type; if (e = o === "Boolean" && typeof e != "boolean" ? e != null : e, !i || !t[n]) @@ -428,7 +432,7 @@ function un(n, e, t, i, o, l) { }, set(d) { var u; - d = Ce(h, d, e), this.$$d[h] = d, (u = this.$$c) == null || u.$set({ [h]: d }); + d = xe(h, d, e), this.$$d[h] = d, (u = this.$$c) == null || u.$set({ [h]: d }); } }); }), i.forEach((h) => { @@ -462,7 +466,7 @@ class an { } /** @returns {void} */ $destroy() { - sn(this, 1), this.$destroy = xe; + sn(this, 1), this.$destroy = Ce; } /** * @template {Extract} K @@ -472,7 +476,7 @@ class an { */ $on(e, t) { if (!dt(t)) - return xe; + return Ce; const i = this.$$.callbacks[e] || (this.$$.callbacks[e] = []); return i.push(t), () => { const o = i.indexOf(t); @@ -484,7 +488,7 @@ class an { * @returns {void} */ $set(e) { - this.$$set && !$t(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1); + this.$$set && !Ut(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1); } } const hn = "4"; @@ -496,7 +500,7 @@ function dn(n) { async function gn(n, e = "SHA-256", t = 1e5) { const i = Date.now().toString(16); n || (n = Math.round(Math.random() * t)); - const o = await pt(i, n, e); + const o = await Et(i, n, e); return { algorithm: e, challenge: o, @@ -504,7 +508,7 @@ async function gn(n, e = "SHA-256", t = 1e5) { signature: "" }; } -async function pt(n, e, t) { +async function Et(n, e, t) { return dn( await crypto.subtle.digest( t.toUpperCase(), @@ -519,7 +523,7 @@ function mn(n, e, t = "SHA-256", i = 1e6, o = 0) { for (let d = o; d <= i; d += 1) { if (l.signal.aborted) return null; - if (await pt(e, d, t) === n) + if (await Et(e, d, t) === n) return { number: d, took: Date.now() - s @@ -605,14 +609,14 @@ function ot(n) { e = K("svg"), t = K("path"), i = K("path"), c(t, "d", "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"), c(t, "fill", "currentColor"), c(t, "opacity", ".25"), c(i, "d", "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"), c(i, "fill", "currentColor"), c(i, "class", "altcha-spinner"), c(e, "width", "24"), c(e, "height", "24"), c(e, "viewBox", "0 0 24 24"), c(e, "xmlns", "http://www.w3.org/2000/svg"); }, m(o, l) { - H(o, e, l), L(e, t), L(e, i); + $(o, e, l), L(e, t), L(e, i); }, d(o) { o && j(e); } }; } -function pn(n) { +function En(n) { let e, t = ( /*_strings*/ n[11].label + "" @@ -623,7 +627,7 @@ function pn(n) { n[4] + "_checkbox"); }, m(o, l) { - H(o, e, l), e.innerHTML = t; + $(o, e, l), e.innerHTML = t; }, p(o, l) { l[0] & /*_strings*/ @@ -637,7 +641,7 @@ function pn(n) { } }; } -function En(n) { +function pn(n) { let e, t = ( /*_strings*/ n[11].verifying + "" @@ -647,7 +651,7 @@ function En(n) { e = F("span"); }, m(i, o) { - H(i, e, o), e.innerHTML = t; + $(i, e, o), e.innerHTML = t; }, p(i, o) { o[0] & /*_strings*/ @@ -675,7 +679,7 @@ function kn(n) { n[6]; }, m(l, s) { - H(l, e, s), e.innerHTML = t, H(l, i, s), H(l, o, s); + $(l, e, s), e.innerHTML = t, $(l, i, s), $(l, o, s); }, p(l, s) { s[0] & /*_strings*/ @@ -699,11 +703,11 @@ function lt(n) { let e, t, i, o, l, s, h; return { c() { - e = F("div"), t = F("a"), i = K("svg"), o = K("path"), l = K("path"), s = K("path"), c(o, "d", "M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"), c(o, "fill", "currentColor"), c(l, "d", "M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"), c(l, "fill", "currentColor"), c(s, "d", "M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"), c(s, "fill", "currentColor"), c(i, "width", "22"), c(i, "height", "22"), c(i, "viewBox", "0 0 20 20"), c(i, "fill", "none"), c(i, "xmlns", "http://www.w3.org/2000/svg"), c(t, "href", Et), c(t, "target", "_blank"), c(t, "class", "altcha-logo"), c(t, "aria-label", h = /*_strings*/ + e = F("div"), t = F("a"), i = K("svg"), o = K("path"), l = K("path"), s = K("path"), c(o, "d", "M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"), c(o, "fill", "currentColor"), c(l, "d", "M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"), c(l, "fill", "currentColor"), c(s, "d", "M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"), c(s, "fill", "currentColor"), c(i, "width", "22"), c(i, "height", "22"), c(i, "viewBox", "0 0 20 20"), c(i, "fill", "none"), c(i, "xmlns", "http://www.w3.org/2000/svg"), c(t, "href", pt), c(t, "target", "_blank"), c(t, "class", "altcha-logo"), c(t, "aria-label", h = /*_strings*/ n[11].ariaLinkLabel); }, m(d, u) { - H(d, e, u), L(e, t), L(t, i), L(i, o), L(i, l), L(i, s); + $(d, e, u), L(e, t), L(t, i), L(i, o), L(i, l), L(i, s); }, p(d, u) { u[0] & /*_strings*/ @@ -720,7 +724,7 @@ function st(n) { function l(d, u) { return ( /*state*/ - d[7] === m.EXPIRED ? Cn : vn + d[7] === m.EXPIRED ? xn : vn ); } let s = l(n), h = s(n); @@ -729,7 +733,7 @@ function st(n) { e = F("div"), t = K("svg"), i = K("path"), o = z(), h.c(), c(i, "stroke-linecap", "round"), c(i, "stroke-linejoin", "round"), c(i, "d", "M6 18L18 6M6 6l12 12"), c(t, "width", "14"), c(t, "height", "14"), c(t, "xmlns", "http://www.w3.org/2000/svg"), c(t, "fill", "none"), c(t, "viewBox", "0 0 24 24"), c(t, "stroke-width", "1.5"), c(t, "stroke", "currentColor"), c(e, "class", "altcha-error"); }, m(d, u) { - H(d, e, u), L(e, t), L(t, i), L(e, o), h.m(e, null); + $(d, e, u), L(e, t), L(t, i), L(e, o), h.m(e, null); }, p(d, u) { s === (s = l(d)) && h ? h.p(d, u) : (h.d(1), h = s(d), h && (h.c(), h.m(e, null))); @@ -754,7 +758,7 @@ function vn(n) { ); }, m(i, o) { - H(i, e, o), e.innerHTML = t; + $(i, e, o), e.innerHTML = t; }, p(i, o) { o[0] & /*_strings*/ @@ -772,7 +776,7 @@ function vn(n) { } }; } -function Cn(n) { +function xn(n) { let e, t = ( /*_strings*/ n[11].expired + "" @@ -787,7 +791,7 @@ function Cn(n) { ); }, m(i, o) { - H(i, e, o), e.innerHTML = t; + $(i, e, o), e.innerHTML = t; }, p(i, o) { o[0] & /*_strings*/ @@ -815,7 +819,7 @@ function ft(n) { e = F("div"), t = F("div"), c(e, "class", "altcha-footer"); }, m(o, l) { - H(o, e, l), L(e, t), t.innerHTML = i; + $(o, e, l), L(e, t), t.innerHTML = i; }, p(o, l) { l[0] & /*_strings*/ @@ -834,16 +838,16 @@ function ct(n) { e = F("div"), c(e, "class", "altcha-anchor-arrow"); }, m(t, i) { - H(t, e, i), n[48](e); + $(t, e, i), n[48](e); }, - p: xe, + p: Ce, d(t) { t && j(e), n[48](null); } }; } -function xn(n) { - let e, t, i, o, l, s, h, d, u, A, b, Y, U, $, D, R, X; +function Cn(n) { + let e, t, i, o, l, s, h, d, u, A, b, Y, O, U, D, R, X; const J = ( /*#slots*/ n[46].default @@ -863,7 +867,7 @@ function xn(n) { /*state*/ a[7] === m.VERIFIED ? kn : ( /*state*/ - a[7] === m.VERIFYING ? En : pn + a[7] === m.VERIFYING ? pn : En ) ); } @@ -880,13 +884,13 @@ function xn(n) { n[11].footer && /*hidefooter*/ (n[2] !== !0 || /*isFreeSaaS*/ n[12]) && ft(n) - ), E = ( + ), p = ( /*floating*/ n[1] && ct(n) ); return { c() { - N && N.c(), e = z(), t = F("div"), i = F("div"), T && T.c(), o = z(), l = F("div"), s = F("input"), u = z(), A = F("div"), V.c(), b = z(), v && v.c(), Y = z(), P && P.c(), U = z(), S && S.c(), $ = z(), E && E.c(), c(s, "type", "checkbox"), c(s, "id", h = /*name*/ + N && N.c(), e = z(), t = F("div"), i = F("div"), T && T.c(), o = z(), l = F("div"), s = F("input"), u = z(), A = F("div"), V.c(), b = z(), v && v.c(), Y = z(), P && P.c(), O = z(), S && S.c(), U = z(), p && p.c(), c(s, "type", "checkbox"), c(s, "id", h = /*name*/ n[4] + "_checkbox"), s.required = d = /*auto*/ n[0] !== "onsubmit" && (!/*floating*/ n[1] || /*auto*/ @@ -908,8 +912,8 @@ function xn(n) { ); }, m(a, y) { - N && N.m(a, y), H(a, e, y), H(a, t, y), L(t, i), T && T.m(i, null), L(i, o), L(i, l), L(l, s), s.checked = /*checked*/ - n[8], L(i, u), L(i, A), V.m(A, null), L(i, b), v && v.m(i, null), L(t, Y), P && P.m(t, null), L(t, U), S && S.m(t, null), L(t, $), E && E.m(t, null), n[49](t), D = !0, R || (X = [ + N && N.m(a, y), $(a, e, y), $(a, t, y), L(t, i), T && T.m(i, null), L(i, o), L(i, l), L(l, s), s.checked = /*checked*/ + n[8], L(i, u), L(i, A), V.m(A, null), L(i, b), v && v.m(i, null), L(t, Y), P && P.m(t, null), L(t, O), S && S.m(t, null), L(t, U), p && p.m(t, null), n[49](t), D = !0, R || (X = [ Le( s, "change", @@ -968,11 +972,11 @@ function xn(n) { a[3] !== !0 || /*isFreeSaaS*/ a[12] ? v ? v.p(a, y) : (v = lt(a), v.c(), v.m(i, null)) : v && (v.d(1), v = null), /*error*/ a[5] || /*state*/ - a[7] === m.EXPIRED ? P ? P.p(a, y) : (P = st(a), P.c(), P.m(t, U)) : P && (P.d(1), P = null), /*_strings*/ + a[7] === m.EXPIRED ? P ? P.p(a, y) : (P = st(a), P.c(), P.m(t, O)) : P && (P.d(1), P = null), /*_strings*/ a[11].footer && /*hidefooter*/ (a[2] !== !0 || /*isFreeSaaS*/ - a[12]) ? S ? S.p(a, y) : (S = ft(a), S.c(), S.m(t, $)) : S && (S.d(1), S = null), /*floating*/ - a[1] ? E ? E.p(a, y) : (E = ct(a), E.c(), E.m(t, null)) : E && (E.d(1), E = null), (!D || y[0] & /*state*/ + a[12]) ? S ? S.p(a, y) : (S = ft(a), S.c(), S.m(t, U)) : S && (S.d(1), S = null), /*floating*/ + a[1] ? p ? p.p(a, y) : (p = ct(a), p.c(), p.m(t, null)) : p && (p.d(1), p = null), (!D || y[0] & /*state*/ 128) && c( t, "data-state", @@ -993,23 +997,23 @@ function xn(n) { on(N, a), D = !1; }, d(a) { - a && (j(e), j(t)), N && N.d(a), T && T.d(), V.d(), v && v.d(), P && P.d(), S && S.d(), E && E.d(), n[49](null), R = !1, pe(X); + a && (j(e), j(t)), N && N.d(a), T && T.d(), V.d(), v && v.d(), P && P.d(), S && S.d(), p && p.d(), n[49](null), R = !1, Ee(X); } }; } -const ut = "Visit Altcha.org", Et = "https://altcha.org/"; +const ut = "Visit Altcha.org", pt = "https://altcha.org/"; function at(n) { return JSON.parse(n); } function An(n, e, t) { var Qe, et; - let i, o, l, s, { $$slots: h = {}, $$scope: d } = e, { auto: u = void 0 } = e, { blockspam: A = void 0 } = e, { challengeurl: b = void 0 } = e, { challengejson: Y = void 0 } = e, { debug: U = !1 } = e, { delay: $ = 0 } = e, { expire: D = void 0 } = e, { floating: R = void 0 } = e, { floatinganchor: X = void 0 } = e, { floatingoffset: J = void 0 } = e, { hidefooter: N = !1 } = e, { hidelogo: T = !1 } = e, { name: Q = "altcha" } = e, { maxnumber: G = 1e6 } = e, { mockerror: V = !1 } = e, { obfuscated: v = void 0 } = e, { plugins: P = void 0 } = e, { refetchonexpire: S = !0 } = e, { spamfilter: E = !1 } = e, { strings: a = void 0 } = e, { test: y = !1 } = e, { verifyurl: ee = void 0 } = e, { workers: le = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ae = void 0 } = e; + let i, o, l, s, { $$slots: h = {}, $$scope: d } = e, { auto: u = void 0 } = e, { blockspam: A = void 0 } = e, { challengeurl: b = void 0 } = e, { challengejson: Y = void 0 } = e, { debug: O = !1 } = e, { delay: U = 0 } = e, { expire: D = void 0 } = e, { floating: R = void 0 } = e, { floatinganchor: X = void 0 } = e, { floatingoffset: J = void 0 } = e, { hidefooter: N = !1 } = e, { hidelogo: T = !1 } = e, { name: Q = "altcha" } = e, { maxnumber: G = 1e6 } = e, { mockerror: V = !1 } = e, { obfuscated: v = void 0 } = e, { plugins: P = void 0 } = e, { refetchonexpire: S = !0 } = e, { spamfilter: p = !1 } = e, { strings: a = void 0 } = e, { test: y = !1 } = e, { verifyurl: ee = void 0 } = e, { workers: le = Math.min(16, navigator.hardwareConcurrency || 8) } = e, { workerurl: ae = void 0 } = e; const he = Qt(), Pe = ["SHA-256", "SHA-384", "SHA-512"], Me = (et = (Qe = document.documentElement.lang) == null ? void 0 : Qe.split("-")) == null ? void 0 : et[0]; - let re = !1, C, ie = null, se = null, _ = null, de = null, W = null, oe = null, te = [], x = m.UNVERIFIED; + let re = !1, x, ie = null, se = null, _ = null, de = null, W = null, oe = null, te = [], C = m.UNVERIFIED; Kt(() => { - kt(), _ && (_.removeEventListener("submit", Oe), _.removeEventListener("reset", Ue), _.removeEventListener("focusin", He), _ = null), W && (clearTimeout(W), W = null), document.removeEventListener("click", Ve), document.removeEventListener("scroll", je), window.removeEventListener("resize", Be); + kt(), _ && (_.removeEventListener("submit", He), _.removeEventListener("reset", Oe), _.removeEventListener("focusin", $e), _ = null), W && (clearTimeout(W), W = null), document.removeEventListener("click", Ve), document.removeEventListener("scroll", je), window.removeEventListener("resize", Be); }), zt(() => { - k("mounted", "1.0.0"), k("workers", le), It(), k("plugins", te.length ? te.map((r) => r.constructor.pluginName).join(", ") : "none"), y && k("using test mode"), D && ke(D), u !== void 0 && k("auto", u), R !== void 0 && qe(R), _ = C.closest("form"), _ && (_.addEventListener("submit", Oe, { capture: !0 }), _.addEventListener("reset", Ue), u === "onfocus" && _.addEventListener("focusin", He)), u === "onload" && (v ? ge() : ne()), i && (N || T) && k("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."), requestAnimationFrame(() => { + k("mounted", "1.0.1"), k("workers", le), It(), k("plugins", te.length ? te.map((r) => r.constructor.pluginName).join(", ") : "none"), y && k("using test mode"), D && ke(D), u !== void 0 && k("auto", u), R !== void 0 && qe(R), _ = x.closest("form"), _ && (_.addEventListener("submit", He, { capture: !0 }), _.addEventListener("reset", Oe), u === "onfocus" && _.addEventListener("focusin", $e)), u === "onload" && (v ? ge() : ne()), i && (N || T) && k("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."), requestAnimationFrame(() => { he("load"); }); }); @@ -1029,7 +1033,7 @@ function An(n, e, t) { r.destroy(); } function Ne() { - b && S && x === m.VERIFIED ? ne() : me(m.EXPIRED, s.expired); + b && S && C === m.VERIFIED ? ne() : me(m.EXPIRED, s.expired); } async function vt() { var r; @@ -1048,11 +1052,11 @@ function An(n, e, t) { throw new Error("Attribute challengeurl not set."); k("fetching challenge from", b); const f = await fetch(b, { - headers: E ? { "x-altcha-spam-filter": "1" } : {} + headers: p ? { "x-altcha-spam-filter": "1" } : {} }); if (f.status !== 200) throw new Error(`Server responded with ${f.status}.`); - const g = f.headers.get("Expires"), I = f.headers.get("X-Altcha-Config"), B = await f.json(), O = new URLSearchParams((r = B.salt.split("?")) == null ? void 0 : r[1]), M = O.get("expires") || O.get("expire"); + const g = f.headers.get("Expires"), I = f.headers.get("X-Altcha-Config"), B = await f.json(), H = new URLSearchParams((r = B.salt.split("?")) == null ? void 0 : r[1]), M = H.get("expires") || H.get("expire"); if (M) { const w = new Date(+M * 1e3), q = isNaN(w.getTime()) ? 0 : w.getTime() - Date.now(); q > 0 && ke(q); @@ -1074,13 +1078,13 @@ function An(n, e, t) { return B; } } - function Ct(r) { + function xt(r) { var g; const f = _ == null ? void 0 : _.querySelector(typeof r == "string" ? `input[name="${r}"]` : 'input[type="email"]:not([data-no-spamfilter])'); return ((g = f == null ? void 0 : f.value) == null ? void 0 : g.slice(f.value.indexOf("@"))) || void 0; } - function xt() { - return E === "ipAddress" ? { + function Ct() { + return p === "ipAddress" ? { blockedCountries: void 0, classifier: void 0, disableRules: void 0, @@ -1091,7 +1095,7 @@ function An(n, e, t) { ipAddress: void 0, text: void 0, timeZone: void 0 - } : typeof E == "object" ? E : { + } : typeof p == "object" ? p : { blockedCountries: void 0, classifier: void 0, disableRules: void 0, @@ -1109,9 +1113,9 @@ function An(n, e, t) { ...(_ == null ? void 0 : _.querySelectorAll(r != null && r.length ? r.map((g) => `input[name="${g}"]`).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || [] ].reduce( (g, I) => { - const B = I.name, O = I.value; - return B && O && (g[B] = /\n/.test(O) ? O.replace(new RegExp("(? f instanceof Error)) && console[r[0] instanceof Error ? "error" : "log"]("ALTCHA", `[name=${Q}]`, ...r); + (O || r.some((f) => f instanceof Error)) && console[r[0] instanceof Error ? "error" : "log"]("ALTCHA", `[name=${Q}]`, ...r); } function Lt() { - [m.UNVERIFIED, m.ERROR, m.EXPIRED].includes(x) ? E && (_ == null ? void 0 : _.reportValidity()) === !1 ? t(8, re = !1) : v ? ge() : ne() : t(8, re = !0); + [m.UNVERIFIED, m.ERROR, m.EXPIRED].includes(C) ? p && (_ == null ? void 0 : _.reportValidity()) === !1 ? t(8, re = !1) : v ? ge() : ne() : t(8, re = !0); } function Ve(r) { const f = r.target; - R && f && !C.contains(f) && (x === m.VERIFIED || u === "off" && x === m.UNVERIFIED) && t(9, C.style.display = "none", C); + R && f && !x.contains(f) && (C === m.VERIFIED || u === "off" && C === m.UNVERIFIED) && t(9, x.style.display = "none", x); } function je() { - R && x !== m.UNVERIFIED && Ee(); + R && C !== m.UNVERIFIED && pe(); } function Rt(r) { for (const f of te) typeof f.onErrorChange == "function" && f.onErrorChange(de); } - function He(r) { - x === m.UNVERIFIED && ne(); + function $e(r) { + C === m.UNVERIFIED && ne(); } - function Oe(r) { - _ && u === "onsubmit" ? x === m.UNVERIFIED ? (r.preventDefault(), r.stopPropagation(), ne().then(() => { + function He(r) { + _ && u === "onsubmit" ? C === m.UNVERIFIED ? (r.preventDefault(), r.stopPropagation(), ne().then(() => { _ == null || _.requestSubmit(); - })) : x !== m.VERIFIED && (r.preventDefault(), r.stopPropagation(), x === m.VERIFYING && $e()) : _ && R && u === "off" && x === m.UNVERIFIED && (r.preventDefault(), r.stopPropagation(), t(9, C.style.display = "block", C), Ee()); + })) : C !== m.VERIFIED && (r.preventDefault(), r.stopPropagation(), C === m.VERIFYING && Ue()) : _ && R && u === "off" && C === m.UNVERIFIED && (r.preventDefault(), r.stopPropagation(), t(9, x.style.display = "block", x), pe()); } - function Ue() { + function Oe() { me(); } - function $e() { - x === m.VERIFYING && s.waitAlert && alert(s.waitAlert); + function Ue() { + C === m.VERIFYING && s.waitAlert && alert(s.waitAlert); } function St(r) { for (const f of te) - typeof f.onStateChange == "function" && f.onStateChange(x); - R && x !== m.UNVERIFIED && requestAnimationFrame(() => { - Ee(); - }), t(8, re = x === m.VERIFIED); + typeof f.onStateChange == "function" && f.onStateChange(C); + R && C !== m.UNVERIFIED && requestAnimationFrame(() => { + pe(); + }), t(8, re = C === m.VERIFIED); } function Be() { - R && Ee(); + R && pe(); } - function Ee(r = 20) { - if (C) + function pe(r = 20) { + if (x) if (se || (se = (X ? document.querySelector(X) : _ == null ? void 0 : _.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])')) || _), se) { - const f = parseInt(J, 10) || 12, g = se.getBoundingClientRect(), I = C.getBoundingClientRect(), B = document.documentElement.clientHeight, O = document.documentElement.clientWidth, M = R === "auto" ? g.bottom + I.height + f + r > B : R === "top", w = Math.max(r, Math.min(O - r - I.width, g.left + g.width / 2 - I.width / 2)); - if (M ? t(9, C.style.top = `${g.top - (I.height + f)}px`, C) : t(9, C.style.top = `${g.bottom + f}px`, C), t(9, C.style.left = `${w}px`, C), C.setAttribute("data-floating", M ? "top" : "bottom"), ie) { + const f = parseInt(J, 10) || 12, g = se.getBoundingClientRect(), I = x.getBoundingClientRect(), B = document.documentElement.clientHeight, H = document.documentElement.clientWidth, M = R === "auto" ? g.bottom + I.height + f + r > B : R === "top", w = Math.max(r, Math.min(H - r - I.width, g.left + g.width / 2 - I.width / 2)); + if (M ? t(9, x.style.top = `${g.top - (I.height + f)}px`, x) : t(9, x.style.top = `${g.bottom + f}px`, x), t(9, x.style.left = `${w}px`, x), x.setAttribute("data-floating", M ? "top" : "bottom"), ie) { const q = ie.getBoundingClientRect(); t(10, ie.style.left = g.left - w + g.width / 2 - q.width / 2 + "px", ie); } @@ -1191,9 +1195,9 @@ function An(n, e, t) { throw new Error("Attribute verifyurl not set."); k("requesting server verification from", ee); const f = { payload: r }; - if (E) { - const { blockedCountries: B, classifier: O, disableRules: M, email: w, expectedLanguages: q, expectedCountries: Ie, fields: be, ipAddress: ye, text: Vt, timeZone: tt } = xt(); - f.blockedCountries = B, f.classifier = O, f.disableRules = M, f.email = w === !1 ? void 0 : Ct(w), f.expectedCountries = Ie, f.expectedLanguages = q || (Me ? [Me] : void 0), f.fields = be === !1 ? void 0 : At(be), f.ipAddress = ye === !1 ? void 0 : ye || "auto", f.text = Vt, f.timeZone = tt === !1 ? void 0 : tt || bn(); + if (p) { + const { blockedCountries: B, classifier: H, disableRules: M, email: w, expectedLanguages: q, expectedCountries: Ie, fields: be, ipAddress: ye, text: Vt, timeZone: tt } = Ct(); + f.blockedCountries = B, f.classifier = H, f.disableRules = M, f.email = w === !1 ? void 0 : xt(w), f.expectedCountries = Ie, f.expectedLanguages = q || (Me ? [Me] : void 0), f.fields = be === !1 ? void 0 : At(be), f.ipAddress = ye === !1 ? void 0 : ye || "auto", f.text = Vt, f.timeZone = tt === !1 ? void 0 : tt || bn(); } const g = await fetch(ee, { body: JSON.stringify(f), @@ -1210,7 +1214,7 @@ function An(n, e, t) { k("expire", r), W && (clearTimeout(W), W = null), r < 1 ? Ne() : W = setTimeout(Ne, r); } function qe(r) { - k("floating", r), R !== r && (t(9, C.style.left = "", C), t(9, C.style.top = "", C)), t(1, R = r === !0 || r === "" ? "auto" : r === !1 || r === "false" ? void 0 : R), R ? (u || t(0, u = "onsubmit"), document.addEventListener("scroll", je), document.addEventListener("click", Ve), window.addEventListener("resize", Be)) : u === "onsubmit" && t(0, u = void 0); + k("floating", r), R !== r && (t(9, x.style.left = "", x), t(9, x.style.top = "", x)), t(1, R = r === !0 || r === "" ? "auto" : r === !1 || r === "false" ? void 0 : R), R ? (u || t(0, u = "onsubmit"), document.addEventListener("scroll", je), document.addEventListener("click", Ve), window.addEventListener("resize", Be)) : u === "onsubmit" && t(0, u = void 0); } function Ze(r) { if (!r.algorithm) @@ -1249,7 +1253,7 @@ function An(n, e, t) { g = Math.min(16, Math.max(1, g)); for (let M = 0; M < g; M++) I.push(altchaCreateWorker(ae)); - const B = Math.ceil(f / g), O = await Promise.all(I.map((M, w) => { + const B = Math.ceil(f / g), H = await Promise.all(I.map((M, w) => { const q = w * B; return new Promise((Ie) => { M.addEventListener("message", (be) => { @@ -1267,31 +1271,31 @@ function An(n, e, t) { })); for (const M of I) M.terminate(); - return O.find((M) => !!M) || null; + return H.find((M) => !!M) || null; } async function ge() { if (!v) { - t(7, x = m.ERROR); + t(7, C = m.ERROR); return; } const r = te.find((f) => f.constructor.pluginName === "obfuscation"); if (!r || !("clarify" in r)) { - t(7, x = m.ERROR), k("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it."); + t(7, C = m.ERROR), k("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it."); return; } if ("clarify" in r && typeof r.clarify == "function") return r.clarify(); } function Ye(r) { - r.obfuscated !== void 0 && t(24, v = r.obfuscated), r.auto !== void 0 && (t(0, u = r.auto), u === "onload" && (v ? ge() : ne())), r.blockspam !== void 0 && t(16, A = !!r.blockspam), r.floatinganchor !== void 0 && t(20, X = r.floatinganchor), r.delay !== void 0 && t(18, $ = r.delay), r.floatingoffset !== void 0 && t(21, J = r.floatingoffset), r.floating !== void 0 && qe(r.floating), r.expire !== void 0 && (ke(r.expire), t(19, D = r.expire)), r.challenge && (Ze(r.challenge), o = r.challenge), r.challengeurl !== void 0 && t(15, b = r.challengeurl), r.debug !== void 0 && t(17, U = !!r.debug), r.hidefooter !== void 0 && t(2, N = !!r.hidefooter), r.hidelogo !== void 0 && t(3, T = !!r.hidelogo), r.maxnumber !== void 0 && t(22, G = +r.maxnumber), r.mockerror !== void 0 && t(23, V = !!r.mockerror), r.name !== void 0 && t(4, Q = r.name), r.refetchonexpire !== void 0 && t(25, S = !!r.refetchonexpire), r.spamfilter !== void 0 && t(26, E = typeof r.spamfilter == "object" ? r.spamfilter : !!r.spamfilter), r.strings && t(44, l = r.strings), r.test !== void 0 && t(27, y = typeof r.test == "number" ? r.test : !!r.test), r.verifyurl !== void 0 && t(28, ee = r.verifyurl), r.workers !== void 0 && t(29, le = +r.workers), r.workerurl !== void 0 && t(30, ae = r.workerurl); + r.obfuscated !== void 0 && t(24, v = r.obfuscated), r.auto !== void 0 && (t(0, u = r.auto), u === "onload" && (v ? ge() : ne())), r.blockspam !== void 0 && t(16, A = !!r.blockspam), r.floatinganchor !== void 0 && t(20, X = r.floatinganchor), r.delay !== void 0 && t(18, U = r.delay), r.floatingoffset !== void 0 && t(21, J = r.floatingoffset), r.floating !== void 0 && qe(r.floating), r.expire !== void 0 && (ke(r.expire), t(19, D = r.expire)), r.challenge && (Ze(r.challenge), o = r.challenge), r.challengeurl !== void 0 && t(15, b = r.challengeurl), r.debug !== void 0 && t(17, O = !!r.debug), r.hidefooter !== void 0 && t(2, N = !!r.hidefooter), r.hidelogo !== void 0 && t(3, T = !!r.hidelogo), r.maxnumber !== void 0 && t(22, G = +r.maxnumber), r.mockerror !== void 0 && t(23, V = !!r.mockerror), r.name !== void 0 && t(4, Q = r.name), r.refetchonexpire !== void 0 && t(25, S = !!r.refetchonexpire), r.spamfilter !== void 0 && t(26, p = typeof r.spamfilter == "object" ? r.spamfilter : !!r.spamfilter), r.strings && t(44, l = r.strings), r.test !== void 0 && t(27, y = typeof r.test == "number" ? r.test : !!r.test), r.verifyurl !== void 0 && t(28, ee = r.verifyurl), r.workers !== void 0 && t(29, le = +r.workers), r.workerurl !== void 0 && t(30, ae = r.workerurl); } function We() { return { auto: u, blockspam: A, challengeurl: b, - debug: U, - delay: $, + debug: O, + delay: U, expire: D, floating: R, floatinganchor: X, @@ -1303,7 +1307,7 @@ function An(n, e, t) { mockerror: V, obfuscated: v, refetchonexpire: S, - spamfilter: E, + spamfilter: p, strings: s, test: y, verifyurl: ee, @@ -1318,19 +1322,19 @@ function An(n, e, t) { return te.find((f) => f.constructor.pluginName === r); } function Je() { - return x; + return C; } function me(r = m.UNVERIFIED, f = null) { - W && (clearTimeout(W), W = null), t(8, re = !1), t(5, de = f), t(6, oe = null), t(7, x = r); + W && (clearTimeout(W), W = null), t(8, re = !1), t(5, de = f), t(6, oe = null), t(7, C = r); } function ze(r) { se = r; } function Ke(r, f = null) { - t(7, x = r), t(5, de = f); + t(7, C = r), t(5, de = f); } async function ne() { - return me(m.VERIFYING), await new Promise((r) => setTimeout(r, $ || 0)), vt().then((r) => (Ze(r), k("challenge", r), Ge(r))).then(({ data: r, solution: f }) => { + return me(m.VERIFYING), await new Promise((r) => setTimeout(r, U || 0)), vt().then((r) => (Ze(r), k("challenge", r), Ge(r))).then(({ data: r, solution: f }) => { if (k("solution", f), "challenge" in r && f && !("clearText" in f)) if ((f == null ? void 0 : f.number) !== void 0) { if (ee) @@ -1340,10 +1344,10 @@ function An(n, e, t) { throw k("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."), new Error("Unexpected result returned."); }).then(() => { en().then(() => { - t(7, x = m.VERIFIED), k("verified"), he("verified", { payload: oe }); + t(7, C = m.VERIFIED), k("verified"), he("verified", { payload: oe }); }); }).catch((r) => { - k(r), t(7, x = m.ERROR), t(5, de = r.message); + k(r), t(7, C = m.ERROR), t(5, de = r.message); }); } function Mt() { @@ -1356,11 +1360,11 @@ function An(n, e, t) { } function Nt(r) { Ae[r ? "unshift" : "push"](() => { - C = r, t(9, C); + x = r, t(9, x); }); } return n.$$set = (r) => { - "auto" in r && t(0, u = r.auto), "blockspam" in r && t(16, A = r.blockspam), "challengeurl" in r && t(15, b = r.challengeurl), "challengejson" in r && t(31, Y = r.challengejson), "debug" in r && t(17, U = r.debug), "delay" in r && t(18, $ = r.delay), "expire" in r && t(19, D = r.expire), "floating" in r && t(1, R = r.floating), "floatinganchor" in r && t(20, X = r.floatinganchor), "floatingoffset" in r && t(21, J = r.floatingoffset), "hidefooter" in r && t(2, N = r.hidefooter), "hidelogo" in r && t(3, T = r.hidelogo), "name" in r && t(4, Q = r.name), "maxnumber" in r && t(22, G = r.maxnumber), "mockerror" in r && t(23, V = r.mockerror), "obfuscated" in r && t(24, v = r.obfuscated), "plugins" in r && t(32, P = r.plugins), "refetchonexpire" in r && t(25, S = r.refetchonexpire), "spamfilter" in r && t(26, E = r.spamfilter), "strings" in r && t(33, a = r.strings), "test" in r && t(27, y = r.test), "verifyurl" in r && t(28, ee = r.verifyurl), "workers" in r && t(29, le = r.workers), "workerurl" in r && t(30, ae = r.workerurl), "$$scope" in r && t(45, d = r.$$scope); + "auto" in r && t(0, u = r.auto), "blockspam" in r && t(16, A = r.blockspam), "challengeurl" in r && t(15, b = r.challengeurl), "challengejson" in r && t(31, Y = r.challengejson), "debug" in r && t(17, O = r.debug), "delay" in r && t(18, U = r.delay), "expire" in r && t(19, D = r.expire), "floating" in r && t(1, R = r.floating), "floatinganchor" in r && t(20, X = r.floatinganchor), "floatingoffset" in r && t(21, J = r.floatingoffset), "hidefooter" in r && t(2, N = r.hidefooter), "hidelogo" in r && t(3, T = r.hidelogo), "name" in r && t(4, Q = r.name), "maxnumber" in r && t(22, G = r.maxnumber), "mockerror" in r && t(23, V = r.mockerror), "obfuscated" in r && t(24, v = r.obfuscated), "plugins" in r && t(32, P = r.plugins), "refetchonexpire" in r && t(25, S = r.refetchonexpire), "spamfilter" in r && t(26, p = r.spamfilter), "strings" in r && t(33, a = r.strings), "test" in r && t(27, y = r.test), "verifyurl" in r && t(28, ee = r.verifyurl), "workers" in r && t(29, le = r.workers), "workerurl" in r && t(30, ae = r.workerurl), "$$scope" in r && t(45, d = r.$$scope); }, n.$$.update = () => { n.$$.dirty[0] & /*challengeurl*/ 32768 && t(12, i = !!(b != null && b.includes(".altcha.org")) && !!(b != null && b.includes("apiKey=ckey_"))), n.$$.dirty[1] & /*challengejson*/ @@ -1370,14 +1374,14 @@ function An(n, e, t) { ariaLinkLabel: ut, error: "Verification failed. Try again later.", expired: "Verification expired. Try again.", - footer: `Protected by ALTCHA`, + footer: `Protected by ALTCHA`, label: "I'm not a robot", verified: "Verified", verifying: "Verifying...", waitAlert: "Verifying... please wait.", ...l }), n.$$.dirty[0] & /*payload, state*/ - 192 && he("statechange", { payload: oe, state: x }), n.$$.dirty[0] & /*error*/ + 192 && he("statechange", { payload: oe, state: C }), n.$$.dirty[0] & /*error*/ 32 && Rt(), n.$$.dirty[0] & /*state*/ 128 && St(); }, [ @@ -1388,18 +1392,18 @@ function An(n, e, t) { Q, de, oe, - x, - re, C, + re, + x, ie, s, i, Lt, - $e, + Ue, b, A, + O, U, - $, D, X, J, @@ -1407,7 +1411,7 @@ function An(n, e, t) { V, v, S, - E, + p, y, ee, le, @@ -1439,8 +1443,8 @@ class In extends an { this, e, An, - xn, - Ut, + Cn, + Ot, { auto: 0, blockspam: 16, @@ -1485,145 +1489,145 @@ class In extends an { return this.$$.ctx[0]; } set auto(e) { - this.$$set({ auto: e }), p(); + this.$$set({ auto: e }), E(); } get blockspam() { return this.$$.ctx[16]; } set blockspam(e) { - this.$$set({ blockspam: e }), p(); + this.$$set({ blockspam: e }), E(); } get challengeurl() { return this.$$.ctx[15]; } set challengeurl(e) { - this.$$set({ challengeurl: e }), p(); + this.$$set({ challengeurl: e }), E(); } get challengejson() { return this.$$.ctx[31]; } set challengejson(e) { - this.$$set({ challengejson: e }), p(); + this.$$set({ challengejson: e }), E(); } get debug() { return this.$$.ctx[17]; } set debug(e) { - this.$$set({ debug: e }), p(); + this.$$set({ debug: e }), E(); } get delay() { return this.$$.ctx[18]; } set delay(e) { - this.$$set({ delay: e }), p(); + this.$$set({ delay: e }), E(); } get expire() { return this.$$.ctx[19]; } set expire(e) { - this.$$set({ expire: e }), p(); + this.$$set({ expire: e }), E(); } get floating() { return this.$$.ctx[1]; } set floating(e) { - this.$$set({ floating: e }), p(); + this.$$set({ floating: e }), E(); } get floatinganchor() { return this.$$.ctx[20]; } set floatinganchor(e) { - this.$$set({ floatinganchor: e }), p(); + this.$$set({ floatinganchor: e }), E(); } get floatingoffset() { return this.$$.ctx[21]; } set floatingoffset(e) { - this.$$set({ floatingoffset: e }), p(); + this.$$set({ floatingoffset: e }), E(); } get hidefooter() { return this.$$.ctx[2]; } set hidefooter(e) { - this.$$set({ hidefooter: e }), p(); + this.$$set({ hidefooter: e }), E(); } get hidelogo() { return this.$$.ctx[3]; } set hidelogo(e) { - this.$$set({ hidelogo: e }), p(); + this.$$set({ hidelogo: e }), E(); } get name() { return this.$$.ctx[4]; } set name(e) { - this.$$set({ name: e }), p(); + this.$$set({ name: e }), E(); } get maxnumber() { return this.$$.ctx[22]; } set maxnumber(e) { - this.$$set({ maxnumber: e }), p(); + this.$$set({ maxnumber: e }), E(); } get mockerror() { return this.$$.ctx[23]; } set mockerror(e) { - this.$$set({ mockerror: e }), p(); + this.$$set({ mockerror: e }), E(); } get obfuscated() { return this.$$.ctx[24]; } set obfuscated(e) { - this.$$set({ obfuscated: e }), p(); + this.$$set({ obfuscated: e }), E(); } get plugins() { return this.$$.ctx[32]; } set plugins(e) { - this.$$set({ plugins: e }), p(); + this.$$set({ plugins: e }), E(); } get refetchonexpire() { return this.$$.ctx[25]; } set refetchonexpire(e) { - this.$$set({ refetchonexpire: e }), p(); + this.$$set({ refetchonexpire: e }), E(); } get spamfilter() { return this.$$.ctx[26]; } set spamfilter(e) { - this.$$set({ spamfilter: e }), p(); + this.$$set({ spamfilter: e }), E(); } get strings() { return this.$$.ctx[33]; } set strings(e) { - this.$$set({ strings: e }), p(); + this.$$set({ strings: e }), E(); } get test() { return this.$$.ctx[27]; } set test(e) { - this.$$set({ test: e }), p(); + this.$$set({ test: e }), E(); } get verifyurl() { return this.$$.ctx[28]; } set verifyurl(e) { - this.$$set({ verifyurl: e }), p(); + this.$$set({ verifyurl: e }), E(); } get workers() { return this.$$.ctx[29]; } set workers(e) { - this.$$set({ workers: e }), p(); + this.$$set({ workers: e }), E(); } get workerurl() { return this.$$.ctx[30]; } set workerurl(e) { - this.$$set({ workerurl: e }), p(); + this.$$set({ workerurl: e }), E(); } get clarify() { return this.$$.ctx[34]; diff --git a/dist_external/altcha.umd.cjs b/dist_external/altcha.umd.cjs index 507647c..c02c0ad 100644 --- a/dist_external/altcha.umd.cjs +++ b/dist_external/altcha.umd.cjs @@ -1,2 +1,2 @@ -(function($,H){typeof exports=="object"&&typeof module<"u"?H(exports):typeof define=="function"&&define.amd?define(["exports"],H):($=typeof globalThis<"u"?globalThis:$||self,H($.altcha={}))})(this,function($){"use strict";var Rn=Object.defineProperty;var Ln=($,H,z)=>H in $?Rn($,H,{enumerable:!0,configurable:!0,writable:!0,value:z}):$[H]=z;var Y=($,H,z)=>Ln($,typeof H!="symbol"?H+"":H,z);var H=typeof document<"u"?document.currentScript:null;function z(){}function xt(n,e){for(const t in e)n[t]=e[t];return n}function Fe(n){return n()}function Ne(){return Object.create(null)}function ge(n){n.forEach(Fe)}function je(n){return typeof n=="function"}function At(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}function It(n){return Object.keys(n).length===0}function Rt(n,e,t,i){if(n){const o=Ve(n,e,t,i);return n[0](o)}}function Ve(n,e,t,i){return n[1]&&i?xt(t.ctx.slice(),n[1](i(e))):t.ctx}function Lt(n,e,t,i){if(n[2]&&i){const o=n[2](i(t));if(e.dirty===void 0)return o;if(typeof o=="object"){const l=[],s=Math.max(e.dirty.length,o.length);for(let h=0;h32){const e=[],t=n.ctx.length/32;for(let i=0;in.removeEventListener(e,t,i)}function c(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Pt(n){return Array.from(n.childNodes)}function Ue(n,e,t){n.classList.toggle(e,!!t)}function Mt(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Ft(n){const e={};return n.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}let me;function be(n){me=n}function Se(){if(!me)throw new Error("Function called outside component initialization");return me}function Nt(n){Se().$$.on_mount.push(n)}function jt(n){Se().$$.on_destroy.push(n)}function Vt(){const n=Se();return(e,t,{cancelable:i=!1}={})=>{const o=n.$$.callbacks[e];if(o){const l=Mt(e,t,{cancelable:i});return o.slice().forEach(s=>{s.call(n,l)}),!l.defaultPrevented}return!0}}const ce=[],Ce=[];let ue=[];const He=[],Oe=Promise.resolve();let Te=!1;function $e(){Te||(Te=!0,Oe.then(p))}function Ut(){return $e(),Oe}function De(n){ue.push(n)}const Pe=new Set;let ae=0;function p(){if(ae!==0)return;const n=me;do{try{for(;aen.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ue=e}const xe=new Set;let $t;function Be(n,e){n&&n.i&&(xe.delete(n),n.i(e))}function Bt(n,e,t,i){if(n&&n.o){if(xe.has(n))return;xe.add(n),$t.c.push(()=>{xe.delete(n)}),n.o(e)}}function qt(n,e,t){const{fragment:i,after_update:o}=n.$$;i&&i.m(e,t),De(()=>{const l=n.$$.on_mount.map(Fe).filter(je);n.$$.on_destroy?n.$$.on_destroy.push(...l):ge(l),n.$$.on_mount=[]}),o.forEach(De)}function Zt(n,e){const t=n.$$;t.fragment!==null&&(Ot(t.after_update),ge(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Gt(n,e){n.$$.dirty[0]===-1&&(ce.push(n),$e(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const q=B.length?B[0]:X;return u.ctx&&o(u.ctx[b],u.ctx[b]=q)&&(!u.skip_bound&&u.bound[b]&&u.bound[b](q),A&&Gt(n,b)),X}):[],u.update(),A=!0,ge(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const b=Pt(e.target);u.fragment&&u.fragment.l(b),b.forEach(j)}else u.fragment&&u.fragment.c();e.intro&&Be(n.$$.fragment),qt(n,e.target,e.anchor),p()}be(d)}let qe;typeof HTMLElement=="function"&&(qe=class extends HTMLElement{constructor(e,t,i){super();Y(this,"$$ctor");Y(this,"$$s");Y(this,"$$c");Y(this,"$$cn",!1);Y(this,"$$d",{});Y(this,"$$r",!1);Y(this,"$$p_d",{});Y(this,"$$l",{});Y(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,i&&this.attachShadow({mode:"open"})}addEventListener(e,t,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const o=this.$$c.$on(e,t);this.$$l_u.set(t,o)}super.addEventListener(e,t,i)}removeEventListener(e,t,i){if(super.removeEventListener(e,t,i),this.$$c){const o=this.$$l_u.get(t);o&&(o(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(l){return()=>{let s;return{c:function(){s=M("slot"),l!=="default"&&c(s,"name",l)},m:function(u,A){U(u,s,A)},d:function(u){u&&j(s)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},i=Ft(this);for(const l of this.$$s)l in i&&(t[l]=[e(l)]);for(const l of this.attributes){const s=this.$$g_p(l.name);s in this.$$d||(this.$$d[s]=Ae(s,l.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});const o=()=>{this.$$r=!0;for(const l in this.$$p_d)if(this.$$d[l]=this.$$c.$$.ctx[this.$$c.$$.props[l]],this.$$p_d[l].reflect){const s=Ae(l,this.$$d[l],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,s)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(const l in this.$$l)for(const s of this.$$l[l]){const h=this.$$c.$on(l,s);this.$$l_u.set(s,h)}this.$$l={}}}attributeChangedCallback(e,t,i){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ae(e,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ae(n,e,t,i){var l;const o=(l=t[n])==null?void 0:l.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!t[n])return e;if(i==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Wt(n,e,t,i,o,l){let s=class extends qe{constructor(){super(n,t,o),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map(h=>(e[h].attribute||h).toLowerCase())}};return Object.keys(e).forEach(h=>{Object.defineProperty(s.prototype,h,{get(){return this.$$c&&h in this.$$c?this.$$c[h]:this.$$d[h]},set(d){var u;d=Ae(h,d,e),this.$$d[h]=d,(u=this.$$c)==null||u.$set({[h]:d})}})}),i.forEach(h=>{Object.defineProperty(s.prototype,h,{get(){var d;return(d=this.$$c)==null?void 0:d[h]}})}),n.element=s,s}class Xt{constructor(){Y(this,"$$");Y(this,"$$set")}$destroy(){Zt(this,1),this.$destroy=z}$on(e,t){if(!je(t))return z;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const o=i.indexOf(t);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!It(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Jt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Jt);const Ze=new TextEncoder;function zt(n){return[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,"0")).join("")}async function Kt(n,e="SHA-256",t=1e5){const i=Date.now().toString(16);n||(n=Math.round(Math.random()*t));const o=await Ge(i,n,e);return{algorithm:e,challenge:o,salt:i,signature:""}}async function Ge(n,e,t){return zt(await crypto.subtle.digest(t.toUpperCase(),Ze.encode(n+e)))}function Qt(n,e,t="SHA-256",i=1e6,o=0){const l=new AbortController,s=Date.now();return{promise:(async()=>{for(let d=o;d<=i;d+=1){if(l.signal.aborted)return null;if(await Ge(e,d,t)===n)return{number:d,took:Date.now()-s}}return null})(),controller:l}}function en(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function tn(n){const e=atob(n),t=new Uint8Array(e.length);for(let i=0;i{for(let A=i;A<=t;A+=1){if(l.signal.aborted||!d||!u)return null;try{const b=await crypto.subtle.decrypt({name:o,iv:nn(A)},d,u);if(b)return{clearText:new TextDecoder().decode(b),took:Date.now()-s}}catch{}}return null};let d=null,u=null;try{u=tn(n);const A=await crypto.subtle.digest("SHA-256",Ze.encode(e));d=await crypto.subtle.importKey("raw",A,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:h(),controller:l}}var g=(n=>(n.ERROR="error",n.VERIFIED="verified",n.VERIFYING="verifying",n.UNVERIFIED="unverified",n.EXPIRED="expired",n))(g||{});function Ye(n){let e,t,i;return{c(){e=K("svg"),t=K("path"),i=K("path"),c(t,"d","M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"),c(t,"fill","currentColor"),c(t,"opacity",".25"),c(i,"d","M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"),c(i,"fill","currentColor"),c(i,"class","altcha-spinner"),c(e,"width","24"),c(e,"height","24"),c(e,"viewBox","0 0 24 24"),c(e,"xmlns","http://www.w3.org/2000/svg")},m(o,l){U(o,e,l),R(e,t),R(e,i)},d(o){o&&j(e)}}}function on(n){let e,t=n[11].label+"",i;return{c(){e=M("label"),c(e,"for",i=n[4]+"_checkbox")},m(o,l){U(o,e,l),e.innerHTML=t},p(o,l){l[0]&2048&&t!==(t=o[11].label+"")&&(e.innerHTML=t),l[0]&16&&i!==(i=o[4]+"_checkbox")&&c(e,"for",i)},d(o){o&&j(e)}}}function ln(n){let e,t=n[11].verifying+"";return{c(){e=M("span")},m(i,o){U(i,e,o),e.innerHTML=t},p(i,o){o[0]&2048&&t!==(t=i[11].verifying+"")&&(e.innerHTML=t)},d(i){i&&j(e)}}}function sn(n){let e,t=n[11].verified+"",i,o;return{c(){e=M("span"),i=Q(),o=M("input"),c(o,"type","hidden"),c(o,"name",n[4]),o.value=n[6]},m(l,s){U(l,e,s),e.innerHTML=t,U(l,i,s),U(l,o,s)},p(l,s){s[0]&2048&&t!==(t=l[11].verified+"")&&(e.innerHTML=t),s[0]&16&&c(o,"name",l[4]),s[0]&64&&(o.value=l[6])},d(l){l&&(j(e),j(i),j(o))}}}function We(n){let e,t,i,o,l,s,h;return{c(){e=M("div"),t=M("a"),i=K("svg"),o=K("path"),l=K("path"),s=K("path"),c(o,"d","M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"),c(o,"fill","currentColor"),c(l,"d","M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"),c(l,"fill","currentColor"),c(s,"d","M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"),c(s,"fill","currentColor"),c(i,"width","22"),c(i,"height","22"),c(i,"viewBox","0 0 20 20"),c(i,"fill","none"),c(i,"xmlns","http://www.w3.org/2000/svg"),c(t,"href",Qe),c(t,"target","_blank"),c(t,"class","altcha-logo"),c(t,"aria-label",h=n[11].ariaLinkLabel)},m(d,u){U(d,e,u),R(e,t),R(t,i),R(i,o),R(i,l),R(i,s)},p(d,u){u[0]&2048&&h!==(h=d[11].ariaLinkLabel)&&c(t,"aria-label",h)},d(d){d&&j(e)}}}function Xe(n){let e,t,i,o;function l(d,u){return d[7]===g.EXPIRED?cn:fn}let s=l(n),h=s(n);return{c(){e=M("div"),t=K("svg"),i=K("path"),o=Q(),h.c(),c(i,"stroke-linecap","round"),c(i,"stroke-linejoin","round"),c(i,"d","M6 18L18 6M6 6l12 12"),c(t,"width","14"),c(t,"height","14"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke-width","1.5"),c(t,"stroke","currentColor"),c(e,"class","altcha-error")},m(d,u){U(d,e,u),R(e,t),R(t,i),R(e,o),h.m(e,null)},p(d,u){s===(s=l(d))&&h?h.p(d,u):(h.d(1),h=s(d),h&&(h.c(),h.m(e,null)))},d(d){d&&j(e),h.d()}}}function fn(n){let e,t=n[11].error+"";return{c(){e=M("div"),c(e,"title",n[5])},m(i,o){U(i,e,o),e.innerHTML=t},p(i,o){o[0]&2048&&t!==(t=i[11].error+"")&&(e.innerHTML=t),o[0]&32&&c(e,"title",i[5])},d(i){i&&j(e)}}}function cn(n){let e,t=n[11].expired+"";return{c(){e=M("div"),c(e,"title",n[5])},m(i,o){U(i,e,o),e.innerHTML=t},p(i,o){o[0]&2048&&t!==(t=i[11].expired+"")&&(e.innerHTML=t),o[0]&32&&c(e,"title",i[5])},d(i){i&&j(e)}}}function Je(n){let e,t,i=n[11].footer+"";return{c(){e=M("div"),t=M("div"),c(e,"class","altcha-footer")},m(o,l){U(o,e,l),R(e,t),t.innerHTML=i},p(o,l){l[0]&2048&&i!==(i=o[11].footer+"")&&(t.innerHTML=i)},d(o){o&&j(e)}}}function ze(n){let e;return{c(){e=M("div"),c(e,"class","altcha-anchor-arrow")},m(t,i){U(t,e,i),n[48](e)},p:z,d(t){t&&j(e),n[48](null)}}}function un(n){let e,t,i,o,l,s,h,d,u,A,b,X,B,q,T,L,ee;const te=n[46].default,N=Rt(te,n,n[45],null);let D=n[7]===g.VERIFYING&&Ye();function ne(a,y){return a[7]===g.VERIFIED?sn:a[7]===g.VERIFYING?ln:on}let W=ne(n),V=W(n),k=(n[3]!==!0||n[12])&&We(n),P=(n[5]||n[7]===g.EXPIRED)&&Xe(n),S=n[11].footer&&(n[2]!==!0||n[12])&&Je(n),E=n[1]&&ze(n);return{c(){N&&N.c(),e=Q(),t=M("div"),i=M("div"),D&&D.c(),o=Q(),l=M("div"),s=M("input"),u=Q(),A=M("div"),V.c(),b=Q(),k&&k.c(),X=Q(),P&&P.c(),B=Q(),S&&S.c(),q=Q(),E&&E.c(),c(s,"type","checkbox"),c(s,"id",h=n[4]+"_checkbox"),s.required=d=n[0]!=="onsubmit"&&(!n[1]||n[0]!=="off"),c(l,"class","altcha-checkbox"),Ue(l,"altcha-hidden",n[7]===g.VERIFYING),c(A,"class","altcha-label"),c(i,"class","altcha-main"),c(t,"class","altcha"),c(t,"data-state",n[7]),c(t,"data-floating",n[1])},m(a,y){N&&N.m(a,y),U(a,e,y),U(a,t,y),R(t,i),D&&D.m(i,null),R(i,o),R(i,l),R(l,s),s.checked=n[8],R(i,u),R(i,A),V.m(A,null),R(i,b),k&&k.m(i,null),R(t,X),P&&P.m(t,null),R(t,B),S&&S.m(t,null),R(t,q),E&&E.m(t,null),n[49](t),T=!0,L||(ee=[Le(s,"change",n[47]),Le(s,"change",n[13]),Le(s,"invalid",n[14])],L=!0)},p(a,y){N&&N.p&&(!T||y[1]&16384)&&St(N,te,a,a[45],T?Lt(te,a[45],y,null):Tt(a[45]),null),a[7]===g.VERIFYING?D||(D=Ye(),D.c(),D.m(i,o)):D&&(D.d(1),D=null),(!T||y[0]&16&&h!==(h=a[4]+"_checkbox"))&&c(s,"id",h),(!T||y[0]&3&&d!==(d=a[0]!=="onsubmit"&&(!a[1]||a[0]!=="off")))&&(s.required=d),y[0]&256&&(s.checked=a[8]),(!T||y[0]&128)&&Ue(l,"altcha-hidden",a[7]===g.VERIFYING),W===(W=ne(a))&&V?V.p(a,y):(V.d(1),V=W(a),V&&(V.c(),V.m(A,null))),a[3]!==!0||a[12]?k?k.p(a,y):(k=We(a),k.c(),k.m(i,null)):k&&(k.d(1),k=null),a[5]||a[7]===g.EXPIRED?P?P.p(a,y):(P=Xe(a),P.c(),P.m(t,B)):P&&(P.d(1),P=null),a[11].footer&&(a[2]!==!0||a[12])?S?S.p(a,y):(S=Je(a),S.c(),S.m(t,q)):S&&(S.d(1),S=null),a[1]?E?E.p(a,y):(E=ze(a),E.c(),E.m(t,null)):E&&(E.d(1),E=null),(!T||y[0]&128)&&c(t,"data-state",a[7]),(!T||y[0]&2)&&c(t,"data-floating",a[1])},i(a){T||(Be(N,a),T=!0)},o(a){Bt(N,a),T=!1},d(a){a&&(j(e),j(t)),N&&N.d(a),D&&D.d(),V.d(),k&&k.d(),P&&P.d(),S&&S.d(),E&&E.d(),n[49](null),L=!1,ge(ee)}}}const Ke="Visit Altcha.org",Qe="https://altcha.org/";function et(n){return JSON.parse(n)}function an(n,e,t){var vt,kt;let i,o,l,s,{$$slots:h={},$$scope:d}=e,{auto:u=void 0}=e,{blockspam:A=void 0}=e,{challengeurl:b=void 0}=e,{challengejson:X=void 0}=e,{debug:B=!1}=e,{delay:q=0}=e,{expire:T=void 0}=e,{floating:L=void 0}=e,{floatinganchor:ee=void 0}=e,{floatingoffset:te=void 0}=e,{hidefooter:N=!1}=e,{hidelogo:D=!1}=e,{name:ne="altcha"}=e,{maxnumber:W=1e6}=e,{mockerror:V=!1}=e,{obfuscated:k=void 0}=e,{plugins:P=void 0}=e,{refetchonexpire:S=!0}=e,{spamfilter:E=!1}=e,{strings:a=void 0}=e,{test:y=!1}=e,{verifyurl:re=void 0}=e,{workers:he=Math.min(16,navigator.hardwareConcurrency||8)}=e,{workerurl:ye=void 0}=e;const _e=Vt(),nt=["SHA-256","SHA-384","SHA-512"],rt=(kt=(vt=document.documentElement.lang)==null?void 0:vt.split("-"))==null?void 0:kt[0];let le=!1,C,se=null,de=null,_=null,we=null,J=null,fe=null,ie=[],x=g.UNVERIFIED;jt(()=>{hn(),_&&(_.removeEventListener("submit",ct),_.removeEventListener("reset",ut),_.removeEventListener("focusin",ft),_=null),J&&(clearTimeout(J),J=null),document.removeEventListener("click",lt),document.removeEventListener("scroll",st),window.removeEventListener("resize",ht)}),Nt(()=>{v("mounted","1.0.0"),v("workers",he),yn(),v("plugins",ie.length?ie.map(r=>r.constructor.pluginName).join(", "):"none"),y&&v("using test mode"),T&&Re(T),u!==void 0&&v("auto",u),L!==void 0&&dt(L),_=C.closest("form"),_&&(_.addEventListener("submit",ct,{capture:!0}),_.addEventListener("reset",ut),u==="onfocus"&&_.addEventListener("focusin",ft)),u==="onload"&&(k?pe():oe()),i&&(N||D)&&v("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{_e("load")})});function it(r,f){return btoa(JSON.stringify({algorithm:r.algorithm,challenge:r.challenge,number:f.number,salt:r.salt,signature:r.signature,test:y?!0:void 0,took:f.took}))}function hn(){for(const r of ie)r.destroy()}function ot(){b&&S&&x===g.VERIFIED?oe():Ee(g.EXPIRED,s.expired)}async function dn(){var r;if(V)throw v("mocking error"),new Error("Mocked error.");if(o)return v("using provided json data"),o;if(y)return v("generating test challenge",{test:y}),Kt(typeof y!="boolean"?+y:void 0);{if(!b&&_){const w=_.getAttribute("action");w!=null&&w.includes("/form/")&&t(15,b=w+"/altcha")}if(!b)throw new Error("Attribute challengeurl not set.");v("fetching challenge from",b);const f=await fetch(b,{headers:E?{"x-altcha-spam-filter":"1"}:{}});if(f.status!==200)throw new Error(`Server responded with ${f.status}.`);const m=f.headers.get("Expires"),I=f.headers.get("X-Altcha-Config"),Z=await f.json(),O=new URLSearchParams((r=Z.salt.split("?"))==null?void 0:r[1]),F=O.get("expires")||O.get("expire");if(F){const w=new Date(+F*1e3),G=isNaN(w.getTime())?0:w.getTime()-Date.now();G>0&&Re(G)}if(I)try{const w=JSON.parse(I);w&&typeof w=="object"&&(w.verifyurl&&(w.verifyurl=new URL(w.verifyurl,new URL(b)).toString()),bt(w))}catch(w){v("unable to configure from X-Altcha-Config",w)}if(!T&&(m!=null&&m.length)){const w=Date.parse(m);if(w){const G=w-Date.now();G>0&&Re(G)}}return Z}}function gn(r){var m;const f=_==null?void 0:_.querySelector(typeof r=="string"?`input[name="${r}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=f==null?void 0:f.value)==null?void 0:m.slice(f.value.indexOf("@")))||void 0}function mn(){return E==="ipAddress"?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:typeof E=="object"?E:{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0}}function bn(r){return[...(_==null?void 0:_.querySelectorAll(r!=null&&r.length?r.map(m=>`input[name="${m}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((m,I)=>{const Z=I.name,O=I.value;return Z&&O&&(m[Z]=/\n/.test(O)?O.replace(new RegExp("(?f instanceof Error))&&console[r[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ne}]`,...r)}function _n(){[g.UNVERIFIED,g.ERROR,g.EXPIRED].includes(x)?E&&(_==null?void 0:_.reportValidity())===!1?t(8,le=!1):k?pe():oe():t(8,le=!0)}function lt(r){const f=r.target;L&&f&&!C.contains(f)&&(x===g.VERIFIED||u==="off"&&x===g.UNVERIFIED)&&t(9,C.style.display="none",C)}function st(){L&&x!==g.UNVERIFIED&&Ie()}function wn(r){for(const f of ie)typeof f.onErrorChange=="function"&&f.onErrorChange(we)}function ft(r){x===g.UNVERIFIED&&oe()}function ct(r){_&&u==="onsubmit"?x===g.UNVERIFIED?(r.preventDefault(),r.stopPropagation(),oe().then(()=>{_==null||_.requestSubmit()})):x!==g.VERIFIED&&(r.preventDefault(),r.stopPropagation(),x===g.VERIFYING&&at()):_&&L&&u==="off"&&x===g.UNVERIFIED&&(r.preventDefault(),r.stopPropagation(),t(9,C.style.display="block",C),Ie())}function ut(){Ee()}function at(){x===g.VERIFYING&&s.waitAlert&&alert(s.waitAlert)}function pn(r){for(const f of ie)typeof f.onStateChange=="function"&&f.onStateChange(x);L&&x!==g.UNVERIFIED&&requestAnimationFrame(()=>{Ie()}),t(8,le=x===g.VERIFIED)}function ht(){L&&Ie()}function Ie(r=20){if(C)if(de||(de=(ee?document.querySelector(ee):_==null?void 0:_.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||_),de){const f=parseInt(te,10)||12,m=de.getBoundingClientRect(),I=C.getBoundingClientRect(),Z=document.documentElement.clientHeight,O=document.documentElement.clientWidth,F=L==="auto"?m.bottom+I.height+f+r>Z:L==="top",w=Math.max(r,Math.min(O-r-I.width,m.left+m.width/2-I.width/2));if(F?t(9,C.style.top=`${m.top-(I.height+f)}px`,C):t(9,C.style.top=`${m.bottom+f}px`,C),t(9,C.style.left=`${w}px`,C),C.setAttribute("data-floating",F?"top":"bottom"),se){const G=se.getBoundingClientRect();t(10,se.style.left=m.left-w+m.width/2-G.width/2+"px",se)}}else v("unable to find floating anchor element")}async function En(r){if(!re)throw new Error("Attribute verifyurl not set.");v("requesting server verification from",re);const f={payload:r};if(E){const{blockedCountries:Z,classifier:O,disableRules:F,email:w,expectedLanguages:G,expectedCountries:Me,fields:ve,ipAddress:ke,text:In,timeZone:Ct}=mn();f.blockedCountries=Z,f.classifier=O,f.disableRules=F,f.email=w===!1?void 0:gn(w),f.expectedCountries=Me,f.expectedLanguages=G||(rt?[rt]:void 0),f.fields=ve===!1?void 0:bn(ve),f.ipAddress=ke===!1?void 0:ke||"auto",f.text=In,f.timeZone=Ct===!1?void 0:Ct||en()}const m=await fetch(re,{body:JSON.stringify(f),headers:{"content-type":"application/json"},method:"POST"});if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const I=await m.json();if(I!=null&&I.payload&&t(6,fe=I.payload),_e("serververification",I),A&&I.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}function Re(r){v("expire",r),J&&(clearTimeout(J),J=null),r<1?ot():J=setTimeout(ot,r)}function dt(r){v("floating",r),L!==r&&(t(9,C.style.left="",C),t(9,C.style.top="",C)),t(1,L=r===!0||r===""?"auto":r===!1||r==="false"?void 0:L),L?(u||t(0,u="onsubmit"),document.addEventListener("scroll",st),document.addEventListener("click",lt),window.addEventListener("resize",ht)):u==="onsubmit"&&t(0,u=void 0)}function gt(r){if(!r.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(r.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!nt.includes(r.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${nt.join(", ")}`);if(!r.challenge||r.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!r.salt||r.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function mt(r){let f=null;if("Worker"in window){try{f=await vn(r,r.maxnumber)}catch(m){v(m)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in r)return{data:r,solution:f}}if("obfuscated"in r){const m=await rn(r.obfuscated,r.key,r.maxnumber);return{data:r,solution:await m.promise}}return{data:r,solution:await Qt(r.challenge,r.salt,r.algorithm,r.maxnumber||W).promise}}async function vn(r,f=typeof y=="number"?y:W,m=Math.ceil(he)){const I=[];m=Math.min(16,Math.max(1,m));for(let F=0;F{const G=w*Z;return new Promise(Me=>{F.addEventListener("message",ve=>{if(ve.data)for(const ke of I)ke!==F&&ke.postMessage({type:"abort"});Me(ve.data)}),F.postMessage({payload:r,max:G+Z,start:G,type:"work"})})}));for(const F of I)F.terminate();return O.find(F=>!!F)||null}async function pe(){if(!k){t(7,x=g.ERROR);return}const r=ie.find(f=>f.constructor.pluginName==="obfuscation");if(!r||!("clarify"in r)){t(7,x=g.ERROR),v("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in r&&typeof r.clarify=="function")return r.clarify()}function bt(r){r.obfuscated!==void 0&&t(24,k=r.obfuscated),r.auto!==void 0&&(t(0,u=r.auto),u==="onload"&&(k?pe():oe())),r.blockspam!==void 0&&t(16,A=!!r.blockspam),r.floatinganchor!==void 0&&t(20,ee=r.floatinganchor),r.delay!==void 0&&t(18,q=r.delay),r.floatingoffset!==void 0&&t(21,te=r.floatingoffset),r.floating!==void 0&&dt(r.floating),r.expire!==void 0&&(Re(r.expire),t(19,T=r.expire)),r.challenge&&(gt(r.challenge),o=r.challenge),r.challengeurl!==void 0&&t(15,b=r.challengeurl),r.debug!==void 0&&t(17,B=!!r.debug),r.hidefooter!==void 0&&t(2,N=!!r.hidefooter),r.hidelogo!==void 0&&t(3,D=!!r.hidelogo),r.maxnumber!==void 0&&t(22,W=+r.maxnumber),r.mockerror!==void 0&&t(23,V=!!r.mockerror),r.name!==void 0&&t(4,ne=r.name),r.refetchonexpire!==void 0&&t(25,S=!!r.refetchonexpire),r.spamfilter!==void 0&&t(26,E=typeof r.spamfilter=="object"?r.spamfilter:!!r.spamfilter),r.strings&&t(44,l=r.strings),r.test!==void 0&&t(27,y=typeof r.test=="number"?r.test:!!r.test),r.verifyurl!==void 0&&t(28,re=r.verifyurl),r.workers!==void 0&&t(29,he=+r.workers),r.workerurl!==void 0&&t(30,ye=r.workerurl)}function yt(){return{auto:u,blockspam:A,challengeurl:b,debug:B,delay:q,expire:T,floating:L,floatinganchor:ee,floatingoffset:te,hidefooter:N,hidelogo:D,name:ne,maxnumber:W,mockerror:V,obfuscated:k,refetchonexpire:S,spamfilter:E,strings:s,test:y,verifyurl:re,workers:he,workerurl:ye}}function _t(){return de}function kn(r){return ie.find(f=>f.constructor.pluginName===r)}function wt(){return x}function Ee(r=g.UNVERIFIED,f=null){J&&(clearTimeout(J),J=null),t(8,le=!1),t(5,we=f),t(6,fe=null),t(7,x=r)}function pt(r){de=r}function Et(r,f=null){t(7,x=r),t(5,we=f)}async function oe(){return Ee(g.VERIFYING),await new Promise(r=>setTimeout(r,q||0)),dn().then(r=>(gt(r),v("challenge",r),mt(r))).then(({data:r,solution:f})=>{if(v("solution",f),"challenge"in r&&f&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0){if(re)return En(it(r,f));t(6,fe=it(r,f)),v("payload",fe)}else throw v("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{Ut().then(()=>{t(7,x=g.VERIFIED),v("verified"),_e("verified",{payload:fe})})}).catch(r=>{v(r),t(7,x=g.ERROR),t(5,we=r.message)})}function Cn(){le=this.checked,t(8,le)}function xn(r){Ce[r?"unshift":"push"](()=>{se=r,t(10,se)})}function An(r){Ce[r?"unshift":"push"](()=>{C=r,t(9,C)})}return n.$$set=r=>{"auto"in r&&t(0,u=r.auto),"blockspam"in r&&t(16,A=r.blockspam),"challengeurl"in r&&t(15,b=r.challengeurl),"challengejson"in r&&t(31,X=r.challengejson),"debug"in r&&t(17,B=r.debug),"delay"in r&&t(18,q=r.delay),"expire"in r&&t(19,T=r.expire),"floating"in r&&t(1,L=r.floating),"floatinganchor"in r&&t(20,ee=r.floatinganchor),"floatingoffset"in r&&t(21,te=r.floatingoffset),"hidefooter"in r&&t(2,N=r.hidefooter),"hidelogo"in r&&t(3,D=r.hidelogo),"name"in r&&t(4,ne=r.name),"maxnumber"in r&&t(22,W=r.maxnumber),"mockerror"in r&&t(23,V=r.mockerror),"obfuscated"in r&&t(24,k=r.obfuscated),"plugins"in r&&t(32,P=r.plugins),"refetchonexpire"in r&&t(25,S=r.refetchonexpire),"spamfilter"in r&&t(26,E=r.spamfilter),"strings"in r&&t(33,a=r.strings),"test"in r&&t(27,y=r.test),"verifyurl"in r&&t(28,re=r.verifyurl),"workers"in r&&t(29,he=r.workers),"workerurl"in r&&t(30,ye=r.workerurl),"$$scope"in r&&t(45,d=r.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&32768&&t(12,i=!!(b!=null&&b.includes(".altcha.org"))&&!!(b!=null&&b.includes("apiKey=ckey_"))),n.$$.dirty[1]&1&&(o=X?et(X):void 0),n.$$.dirty[1]&4&&t(44,l=a?et(a):{}),n.$$.dirty[1]&8192&&t(11,s={ariaLinkLabel:Ke,error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:`Protected by ALTCHA`,label:"I'm not a robot",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait.",...l}),n.$$.dirty[0]&192&&_e("statechange",{payload:fe,state:x}),n.$$.dirty[0]&32&&wn(),n.$$.dirty[0]&128&&pn()},[u,L,N,D,ne,we,fe,x,le,C,se,s,i,_n,at,b,A,B,q,T,ee,te,W,V,k,S,E,y,re,he,ye,X,P,a,pe,bt,yt,_t,kn,wt,Ee,pt,Et,oe,l,d,h,Cn,xn,An]}class tt extends Xt{constructor(e){super(),Yt(this,e,an,un,At,{auto:0,blockspam:16,challengeurl:15,challengejson:31,debug:17,delay:18,expire:19,floating:1,floatinganchor:20,floatingoffset:21,hidefooter:2,hidelogo:3,name:4,maxnumber:22,mockerror:23,obfuscated:24,plugins:32,refetchonexpire:25,spamfilter:26,strings:33,test:27,verifyurl:28,workers:29,workerurl:30,clarify:34,configure:35,getConfiguration:36,getFloatingAnchor:37,getPlugin:38,getState:39,reset:40,setFloatingAnchor:41,setState:42,verify:43},null,[-1,-1,-1])}get auto(){return this.$$.ctx[0]}set auto(e){this.$$set({auto:e}),p()}get blockspam(){return this.$$.ctx[16]}set blockspam(e){this.$$set({blockspam:e}),p()}get challengeurl(){return this.$$.ctx[15]}set challengeurl(e){this.$$set({challengeurl:e}),p()}get challengejson(){return this.$$.ctx[31]}set challengejson(e){this.$$set({challengejson:e}),p()}get debug(){return this.$$.ctx[17]}set debug(e){this.$$set({debug:e}),p()}get delay(){return this.$$.ctx[18]}set delay(e){this.$$set({delay:e}),p()}get expire(){return this.$$.ctx[19]}set expire(e){this.$$set({expire:e}),p()}get floating(){return this.$$.ctx[1]}set floating(e){this.$$set({floating:e}),p()}get floatinganchor(){return this.$$.ctx[20]}set floatinganchor(e){this.$$set({floatinganchor:e}),p()}get floatingoffset(){return this.$$.ctx[21]}set floatingoffset(e){this.$$set({floatingoffset:e}),p()}get hidefooter(){return this.$$.ctx[2]}set hidefooter(e){this.$$set({hidefooter:e}),p()}get hidelogo(){return this.$$.ctx[3]}set hidelogo(e){this.$$set({hidelogo:e}),p()}get name(){return this.$$.ctx[4]}set name(e){this.$$set({name:e}),p()}get maxnumber(){return this.$$.ctx[22]}set maxnumber(e){this.$$set({maxnumber:e}),p()}get mockerror(){return this.$$.ctx[23]}set mockerror(e){this.$$set({mockerror:e}),p()}get obfuscated(){return this.$$.ctx[24]}set obfuscated(e){this.$$set({obfuscated:e}),p()}get plugins(){return this.$$.ctx[32]}set plugins(e){this.$$set({plugins:e}),p()}get refetchonexpire(){return this.$$.ctx[25]}set refetchonexpire(e){this.$$set({refetchonexpire:e}),p()}get spamfilter(){return this.$$.ctx[26]}set spamfilter(e){this.$$set({spamfilter:e}),p()}get strings(){return this.$$.ctx[33]}set strings(e){this.$$set({strings:e}),p()}get test(){return this.$$.ctx[27]}set test(e){this.$$set({test:e}),p()}get verifyurl(){return this.$$.ctx[28]}set verifyurl(e){this.$$set({verifyurl:e}),p()}get workers(){return this.$$.ctx[29]}set workers(e){this.$$set({workers:e}),p()}get workerurl(){return this.$$.ctx[30]}set workerurl(e){this.$$set({workerurl:e}),p()}get clarify(){return this.$$.ctx[34]}get configure(){return this.$$.ctx[35]}get getConfiguration(){return this.$$.ctx[36]}get getFloatingAnchor(){return this.$$.ctx[37]}get getPlugin(){return this.$$.ctx[38]}get getState(){return this.$$.ctx[39]}get reset(){return this.$$.ctx[40]}get setFloatingAnchor(){return this.$$.ctx[41]}get setState(){return this.$$.ctx[42]}get verify(){return this.$$.ctx[43]}}customElements.define("altcha-widget",Wt(tt,{auto:{},blockspam:{},challengeurl:{},challengejson:{},debug:{type:"Boolean"},delay:{},expire:{},floating:{},floatinganchor:{},floatingoffset:{},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},name:{},maxnumber:{},mockerror:{type:"Boolean"},obfuscated:{},plugins:{},refetchonexpire:{type:"Boolean"},spamfilter:{type:"Boolean"},strings:{},test:{type:"Boolean"},verifyurl:{},workers:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","reset","setFloatingAnchor","setState","verify"],!1)),globalThis.altchaCreateWorker=n=>new Worker(new URL(n||"./worker.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:H&&H.src||new URL("altcha.umd.cjs",document.baseURI).href)),globalThis.altchaPlugins=globalThis.altchaPlugins||[],$.Altcha=tt,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})}); +(function(H,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(H=typeof globalThis<"u"?globalThis:H||self,$(H.altcha={}))})(this,function(H){"use strict";var Rn=Object.defineProperty;var Ln=(H,$,z)=>$ in H?Rn(H,$,{enumerable:!0,configurable:!0,writable:!0,value:z}):H[$]=z;var Y=(H,$,z)=>Ln(H,typeof $!="symbol"?$+"":$,z);var $=typeof document<"u"?document.currentScript:null;function z(){}function xt(n,e){for(const t in e)n[t]=e[t];return n}function Fe(n){return n()}function Ne(){return Object.create(null)}function ge(n){n.forEach(Fe)}function je(n){return typeof n=="function"}function At(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}function It(n){return Object.keys(n).length===0}function Rt(n,e,t,r){if(n){const o=Ve(n,e,t,r);return n[0](o)}}function Ve(n,e,t,r){return n[1]&&r?xt(t.ctx.slice(),n[1](r(e))):t.ctx}function Lt(n,e,t,r){if(n[2]&&r){const o=n[2](r(t));if(e.dirty===void 0)return o;if(typeof o=="object"){const l=[],s=Math.max(e.dirty.length,o.length);for(let h=0;h32){const e=[],t=n.ctx.length/32;for(let r=0;rn.removeEventListener(e,t,r)}function c(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Pt(n){return Array.from(n.childNodes)}function $e(n,e,t){n.classList.toggle(e,!!t)}function Mt(n,e,{bubbles:t=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:r})}function Ft(n){const e={};return n.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}let me;function be(n){me=n}function Se(){if(!me)throw new Error("Function called outside component initialization");return me}function Nt(n){Se().$$.on_mount.push(n)}function jt(n){Se().$$.on_destroy.push(n)}function Vt(){const n=Se();return(e,t,{cancelable:r=!1}={})=>{const o=n.$$.callbacks[e];if(o){const l=Mt(e,t,{cancelable:r});return o.slice().forEach(s=>{s.call(n,l)}),!l.defaultPrevented}return!0}}const ce=[],Ce=[];let ue=[];const Ue=[],Oe=Promise.resolve();let Te=!1;function He(){Te||(Te=!0,Oe.then(p))}function $t(){return He(),Oe}function De(n){ue.push(n)}const Pe=new Set;let ae=0;function p(){if(ae!==0)return;const n=me;do{try{for(;aen.indexOf(r)===-1?e.push(r):t.push(r)),t.forEach(r=>r()),ue=e}const xe=new Set;let Ht;function Be(n,e){n&&n.i&&(xe.delete(n),n.i(e))}function Bt(n,e,t,r){if(n&&n.o){if(xe.has(n))return;xe.add(n),Ht.c.push(()=>{xe.delete(n)}),n.o(e)}}function qt(n,e,t){const{fragment:r,after_update:o}=n.$$;r&&r.m(e,t),De(()=>{const l=n.$$.on_mount.map(Fe).filter(je);n.$$.on_destroy?n.$$.on_destroy.push(...l):ge(l),n.$$.on_mount=[]}),o.forEach(De)}function Zt(n,e){const t=n.$$;t.fragment!==null&&(Ot(t.after_update),ge(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Gt(n,e){n.$$.dirty[0]===-1&&(ce.push(n),He(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const q=B.length?B[0]:X;return u.ctx&&o(u.ctx[b],u.ctx[b]=q)&&(!u.skip_bound&&u.bound[b]&&u.bound[b](q),A&&Gt(n,b)),X}):[],u.update(),A=!0,ge(u.before_update),u.fragment=r?r(u.ctx):!1,e.target){if(e.hydrate){const b=Pt(e.target);u.fragment&&u.fragment.l(b),b.forEach(j)}else u.fragment&&u.fragment.c();e.intro&&Be(n.$$.fragment),qt(n,e.target,e.anchor),p()}be(d)}let qe;typeof HTMLElement=="function"&&(qe=class extends HTMLElement{constructor(e,t,r){super();Y(this,"$$ctor");Y(this,"$$s");Y(this,"$$c");Y(this,"$$cn",!1);Y(this,"$$d",{});Y(this,"$$r",!1);Y(this,"$$p_d",{});Y(this,"$$l",{});Y(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const o=this.$$c.$on(e,t);this.$$l_u.set(t,o)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){const o=this.$$l_u.get(t);o&&(o(),this.$$l_u.delete(t))}if(this.$$l[e]){const o=this.$$l[e].indexOf(t);o>=0&&this.$$l[e].splice(o,1)}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(l){return()=>{let s;return{c:function(){s=M("slot"),l!=="default"&&c(s,"name",l)},m:function(u,A){U(u,s,A)},d:function(u){u&&j(s)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},r=Ft(this);for(const l of this.$$s)l in r&&(t[l]=[e(l)]);for(const l of this.attributes){const s=this.$$g_p(l.name);s in this.$$d||(this.$$d[s]=Ae(s,l.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$scope:{ctx:[]}}});const o=()=>{this.$$r=!0;for(const l in this.$$p_d)if(this.$$d[l]=this.$$c.$$.ctx[this.$$c.$$.props[l]],this.$$p_d[l].reflect){const s=Ae(l,this.$$d[l],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,s)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(const l in this.$$l)for(const s of this.$$l[l]){const h=this.$$c.$on(l,s);this.$$l_u.set(s,h)}this.$$l={}}}attributeChangedCallback(e,t,r){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ae(e,r,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ae(n,e,t,r){var l;const o=(l=t[n])==null?void 0:l.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!t[n])return e;if(r==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Wt(n,e,t,r,o,l){let s=class extends qe{constructor(){super(n,t,o),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map(h=>(e[h].attribute||h).toLowerCase())}};return Object.keys(e).forEach(h=>{Object.defineProperty(s.prototype,h,{get(){return this.$$c&&h in this.$$c?this.$$c[h]:this.$$d[h]},set(d){var u;d=Ae(h,d,e),this.$$d[h]=d,(u=this.$$c)==null||u.$set({[h]:d})}})}),r.forEach(h=>{Object.defineProperty(s.prototype,h,{get(){var d;return(d=this.$$c)==null?void 0:d[h]}})}),n.element=s,s}class Xt{constructor(){Y(this,"$$");Y(this,"$$set")}$destroy(){Zt(this,1),this.$destroy=z}$on(e,t){if(!je(t))return z;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(t),()=>{const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}$set(e){this.$$set&&!It(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Jt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Jt);const Ze=new TextEncoder;function zt(n){return[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,"0")).join("")}async function Kt(n,e="SHA-256",t=1e5){const r=Date.now().toString(16);n||(n=Math.round(Math.random()*t));const o=await Ge(r,n,e);return{algorithm:e,challenge:o,salt:r,signature:""}}async function Ge(n,e,t){return zt(await crypto.subtle.digest(t.toUpperCase(),Ze.encode(n+e)))}function Qt(n,e,t="SHA-256",r=1e6,o=0){const l=new AbortController,s=Date.now();return{promise:(async()=>{for(let d=o;d<=r;d+=1){if(l.signal.aborted)return null;if(await Ge(e,d,t)===n)return{number:d,took:Date.now()-s}}return null})(),controller:l}}function en(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function tn(n){const e=atob(n),t=new Uint8Array(e.length);for(let r=0;r{for(let A=r;A<=t;A+=1){if(l.signal.aborted||!d||!u)return null;try{const b=await crypto.subtle.decrypt({name:o,iv:nn(A)},d,u);if(b)return{clearText:new TextDecoder().decode(b),took:Date.now()-s}}catch{}}return null};let d=null,u=null;try{u=tn(n);const A=await crypto.subtle.digest("SHA-256",Ze.encode(e));d=await crypto.subtle.importKey("raw",A,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:h(),controller:l}}var g=(n=>(n.ERROR="error",n.VERIFIED="verified",n.VERIFYING="verifying",n.UNVERIFIED="unverified",n.EXPIRED="expired",n))(g||{});function Ye(n){let e,t,r;return{c(){e=K("svg"),t=K("path"),r=K("path"),c(t,"d","M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"),c(t,"fill","currentColor"),c(t,"opacity",".25"),c(r,"d","M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"),c(r,"fill","currentColor"),c(r,"class","altcha-spinner"),c(e,"width","24"),c(e,"height","24"),c(e,"viewBox","0 0 24 24"),c(e,"xmlns","http://www.w3.org/2000/svg")},m(o,l){U(o,e,l),R(e,t),R(e,r)},d(o){o&&j(e)}}}function on(n){let e,t=n[11].label+"",r;return{c(){e=M("label"),c(e,"for",r=n[4]+"_checkbox")},m(o,l){U(o,e,l),e.innerHTML=t},p(o,l){l[0]&2048&&t!==(t=o[11].label+"")&&(e.innerHTML=t),l[0]&16&&r!==(r=o[4]+"_checkbox")&&c(e,"for",r)},d(o){o&&j(e)}}}function ln(n){let e,t=n[11].verifying+"";return{c(){e=M("span")},m(r,o){U(r,e,o),e.innerHTML=t},p(r,o){o[0]&2048&&t!==(t=r[11].verifying+"")&&(e.innerHTML=t)},d(r){r&&j(e)}}}function sn(n){let e,t=n[11].verified+"",r,o;return{c(){e=M("span"),r=Q(),o=M("input"),c(o,"type","hidden"),c(o,"name",n[4]),o.value=n[6]},m(l,s){U(l,e,s),e.innerHTML=t,U(l,r,s),U(l,o,s)},p(l,s){s[0]&2048&&t!==(t=l[11].verified+"")&&(e.innerHTML=t),s[0]&16&&c(o,"name",l[4]),s[0]&64&&(o.value=l[6])},d(l){l&&(j(e),j(r),j(o))}}}function We(n){let e,t,r,o,l,s,h;return{c(){e=M("div"),t=M("a"),r=K("svg"),o=K("path"),l=K("path"),s=K("path"),c(o,"d","M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z"),c(o,"fill","currentColor"),c(l,"d","M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z"),c(l,"fill","currentColor"),c(s,"d","M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z"),c(s,"fill","currentColor"),c(r,"width","22"),c(r,"height","22"),c(r,"viewBox","0 0 20 20"),c(r,"fill","none"),c(r,"xmlns","http://www.w3.org/2000/svg"),c(t,"href",Qe),c(t,"target","_blank"),c(t,"class","altcha-logo"),c(t,"aria-label",h=n[11].ariaLinkLabel)},m(d,u){U(d,e,u),R(e,t),R(t,r),R(r,o),R(r,l),R(r,s)},p(d,u){u[0]&2048&&h!==(h=d[11].ariaLinkLabel)&&c(t,"aria-label",h)},d(d){d&&j(e)}}}function Xe(n){let e,t,r,o;function l(d,u){return d[7]===g.EXPIRED?cn:fn}let s=l(n),h=s(n);return{c(){e=M("div"),t=K("svg"),r=K("path"),o=Q(),h.c(),c(r,"stroke-linecap","round"),c(r,"stroke-linejoin","round"),c(r,"d","M6 18L18 6M6 6l12 12"),c(t,"width","14"),c(t,"height","14"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"stroke-width","1.5"),c(t,"stroke","currentColor"),c(e,"class","altcha-error")},m(d,u){U(d,e,u),R(e,t),R(t,r),R(e,o),h.m(e,null)},p(d,u){s===(s=l(d))&&h?h.p(d,u):(h.d(1),h=s(d),h&&(h.c(),h.m(e,null)))},d(d){d&&j(e),h.d()}}}function fn(n){let e,t=n[11].error+"";return{c(){e=M("div"),c(e,"title",n[5])},m(r,o){U(r,e,o),e.innerHTML=t},p(r,o){o[0]&2048&&t!==(t=r[11].error+"")&&(e.innerHTML=t),o[0]&32&&c(e,"title",r[5])},d(r){r&&j(e)}}}function cn(n){let e,t=n[11].expired+"";return{c(){e=M("div"),c(e,"title",n[5])},m(r,o){U(r,e,o),e.innerHTML=t},p(r,o){o[0]&2048&&t!==(t=r[11].expired+"")&&(e.innerHTML=t),o[0]&32&&c(e,"title",r[5])},d(r){r&&j(e)}}}function Je(n){let e,t,r=n[11].footer+"";return{c(){e=M("div"),t=M("div"),c(e,"class","altcha-footer")},m(o,l){U(o,e,l),R(e,t),t.innerHTML=r},p(o,l){l[0]&2048&&r!==(r=o[11].footer+"")&&(t.innerHTML=r)},d(o){o&&j(e)}}}function ze(n){let e;return{c(){e=M("div"),c(e,"class","altcha-anchor-arrow")},m(t,r){U(t,e,r),n[48](e)},p:z,d(t){t&&j(e),n[48](null)}}}function un(n){let e,t,r,o,l,s,h,d,u,A,b,X,B,q,T,L,ee;const te=n[46].default,N=Rt(te,n,n[45],null);let D=n[7]===g.VERIFYING&&Ye();function ne(a,y){return a[7]===g.VERIFIED?sn:a[7]===g.VERIFYING?ln:on}let W=ne(n),V=W(n),k=(n[3]!==!0||n[12])&&We(n),P=(n[5]||n[7]===g.EXPIRED)&&Xe(n),S=n[11].footer&&(n[2]!==!0||n[12])&&Je(n),E=n[1]&&ze(n);return{c(){N&&N.c(),e=Q(),t=M("div"),r=M("div"),D&&D.c(),o=Q(),l=M("div"),s=M("input"),u=Q(),A=M("div"),V.c(),b=Q(),k&&k.c(),X=Q(),P&&P.c(),B=Q(),S&&S.c(),q=Q(),E&&E.c(),c(s,"type","checkbox"),c(s,"id",h=n[4]+"_checkbox"),s.required=d=n[0]!=="onsubmit"&&(!n[1]||n[0]!=="off"),c(l,"class","altcha-checkbox"),$e(l,"altcha-hidden",n[7]===g.VERIFYING),c(A,"class","altcha-label"),c(r,"class","altcha-main"),c(t,"class","altcha"),c(t,"data-state",n[7]),c(t,"data-floating",n[1])},m(a,y){N&&N.m(a,y),U(a,e,y),U(a,t,y),R(t,r),D&&D.m(r,null),R(r,o),R(r,l),R(l,s),s.checked=n[8],R(r,u),R(r,A),V.m(A,null),R(r,b),k&&k.m(r,null),R(t,X),P&&P.m(t,null),R(t,B),S&&S.m(t,null),R(t,q),E&&E.m(t,null),n[49](t),T=!0,L||(ee=[Le(s,"change",n[47]),Le(s,"change",n[13]),Le(s,"invalid",n[14])],L=!0)},p(a,y){N&&N.p&&(!T||y[1]&16384)&&St(N,te,a,a[45],T?Lt(te,a[45],y,null):Tt(a[45]),null),a[7]===g.VERIFYING?D||(D=Ye(),D.c(),D.m(r,o)):D&&(D.d(1),D=null),(!T||y[0]&16&&h!==(h=a[4]+"_checkbox"))&&c(s,"id",h),(!T||y[0]&3&&d!==(d=a[0]!=="onsubmit"&&(!a[1]||a[0]!=="off")))&&(s.required=d),y[0]&256&&(s.checked=a[8]),(!T||y[0]&128)&&$e(l,"altcha-hidden",a[7]===g.VERIFYING),W===(W=ne(a))&&V?V.p(a,y):(V.d(1),V=W(a),V&&(V.c(),V.m(A,null))),a[3]!==!0||a[12]?k?k.p(a,y):(k=We(a),k.c(),k.m(r,null)):k&&(k.d(1),k=null),a[5]||a[7]===g.EXPIRED?P?P.p(a,y):(P=Xe(a),P.c(),P.m(t,B)):P&&(P.d(1),P=null),a[11].footer&&(a[2]!==!0||a[12])?S?S.p(a,y):(S=Je(a),S.c(),S.m(t,q)):S&&(S.d(1),S=null),a[1]?E?E.p(a,y):(E=ze(a),E.c(),E.m(t,null)):E&&(E.d(1),E=null),(!T||y[0]&128)&&c(t,"data-state",a[7]),(!T||y[0]&2)&&c(t,"data-floating",a[1])},i(a){T||(Be(N,a),T=!0)},o(a){Bt(N,a),T=!1},d(a){a&&(j(e),j(t)),N&&N.d(a),D&&D.d(),V.d(),k&&k.d(),P&&P.d(),S&&S.d(),E&&E.d(),n[49](null),L=!1,ge(ee)}}}const Ke="Visit Altcha.org",Qe="https://altcha.org/";function et(n){return JSON.parse(n)}function an(n,e,t){var vt,kt;let r,o,l,s,{$$slots:h={},$$scope:d}=e,{auto:u=void 0}=e,{blockspam:A=void 0}=e,{challengeurl:b=void 0}=e,{challengejson:X=void 0}=e,{debug:B=!1}=e,{delay:q=0}=e,{expire:T=void 0}=e,{floating:L=void 0}=e,{floatinganchor:ee=void 0}=e,{floatingoffset:te=void 0}=e,{hidefooter:N=!1}=e,{hidelogo:D=!1}=e,{name:ne="altcha"}=e,{maxnumber:W=1e6}=e,{mockerror:V=!1}=e,{obfuscated:k=void 0}=e,{plugins:P=void 0}=e,{refetchonexpire:S=!0}=e,{spamfilter:E=!1}=e,{strings:a=void 0}=e,{test:y=!1}=e,{verifyurl:ie=void 0}=e,{workers:he=Math.min(16,navigator.hardwareConcurrency||8)}=e,{workerurl:ye=void 0}=e;const _e=Vt(),nt=["SHA-256","SHA-384","SHA-512"],it=(kt=(vt=document.documentElement.lang)==null?void 0:vt.split("-"))==null?void 0:kt[0];let le=!1,C,se=null,de=null,_=null,we=null,J=null,fe=null,re=[],x=g.UNVERIFIED;jt(()=>{hn(),_&&(_.removeEventListener("submit",ct),_.removeEventListener("reset",ut),_.removeEventListener("focusin",ft),_=null),J&&(clearTimeout(J),J=null),document.removeEventListener("click",lt),document.removeEventListener("scroll",st),window.removeEventListener("resize",ht)}),Nt(()=>{v("mounted","1.0.1"),v("workers",he),yn(),v("plugins",re.length?re.map(i=>i.constructor.pluginName).join(", "):"none"),y&&v("using test mode"),T&&Re(T),u!==void 0&&v("auto",u),L!==void 0&&dt(L),_=C.closest("form"),_&&(_.addEventListener("submit",ct,{capture:!0}),_.addEventListener("reset",ut),u==="onfocus"&&_.addEventListener("focusin",ft)),u==="onload"&&(k?pe():oe()),r&&(N||D)&&v("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{_e("load")})});function rt(i,f){return btoa(JSON.stringify({algorithm:i.algorithm,challenge:i.challenge,number:f.number,salt:i.salt,signature:i.signature,test:y?!0:void 0,took:f.took}))}function hn(){for(const i of re)i.destroy()}function ot(){b&&S&&x===g.VERIFIED?oe():Ee(g.EXPIRED,s.expired)}async function dn(){var i;if(V)throw v("mocking error"),new Error("Mocked error.");if(o)return v("using provided json data"),o;if(y)return v("generating test challenge",{test:y}),Kt(typeof y!="boolean"?+y:void 0);{if(!b&&_){const w=_.getAttribute("action");w!=null&&w.includes("/form/")&&t(15,b=w+"/altcha")}if(!b)throw new Error("Attribute challengeurl not set.");v("fetching challenge from",b);const f=await fetch(b,{headers:E?{"x-altcha-spam-filter":"1"}:{}});if(f.status!==200)throw new Error(`Server responded with ${f.status}.`);const m=f.headers.get("Expires"),I=f.headers.get("X-Altcha-Config"),Z=await f.json(),O=new URLSearchParams((i=Z.salt.split("?"))==null?void 0:i[1]),F=O.get("expires")||O.get("expire");if(F){const w=new Date(+F*1e3),G=isNaN(w.getTime())?0:w.getTime()-Date.now();G>0&&Re(G)}if(I)try{const w=JSON.parse(I);w&&typeof w=="object"&&(w.verifyurl&&(w.verifyurl=new URL(w.verifyurl,new URL(b)).toString()),bt(w))}catch(w){v("unable to configure from X-Altcha-Config",w)}if(!T&&(m!=null&&m.length)){const w=Date.parse(m);if(w){const G=w-Date.now();G>0&&Re(G)}}return Z}}function gn(i){var m;const f=_==null?void 0:_.querySelector(typeof i=="string"?`input[name="${i}"]`:'input[type="email"]:not([data-no-spamfilter])');return((m=f==null?void 0:f.value)==null?void 0:m.slice(f.value.indexOf("@")))||void 0}function mn(){return E==="ipAddress"?{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:!1,expectedCountries:void 0,expectedLanguages:void 0,fields:!1,ipAddress:void 0,text:void 0,timeZone:void 0}:typeof E=="object"?E:{blockedCountries:void 0,classifier:void 0,disableRules:void 0,email:void 0,expectedCountries:void 0,expectedLanguages:void 0,fields:void 0,ipAddress:void 0,text:void 0,timeZone:void 0}}function bn(i){return[...(_==null?void 0:_.querySelectorAll(i!=null&&i.length?i.map(m=>`input[name="${m}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((m,I)=>{const Z=I.name,O=I.value;return Z&&O&&(m[Z]=/\n/.test(O)?O.replace(new RegExp("(?f instanceof Error))&&console[i[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ne}]`,...i)}function _n(){[g.UNVERIFIED,g.ERROR,g.EXPIRED].includes(x)?E&&(_==null?void 0:_.reportValidity())===!1?t(8,le=!1):k?pe():oe():t(8,le=!0)}function lt(i){const f=i.target;L&&f&&!C.contains(f)&&(x===g.VERIFIED||u==="off"&&x===g.UNVERIFIED)&&t(9,C.style.display="none",C)}function st(){L&&x!==g.UNVERIFIED&&Ie()}function wn(i){for(const f of re)typeof f.onErrorChange=="function"&&f.onErrorChange(we)}function ft(i){x===g.UNVERIFIED&&oe()}function ct(i){_&&u==="onsubmit"?x===g.UNVERIFIED?(i.preventDefault(),i.stopPropagation(),oe().then(()=>{_==null||_.requestSubmit()})):x!==g.VERIFIED&&(i.preventDefault(),i.stopPropagation(),x===g.VERIFYING&&at()):_&&L&&u==="off"&&x===g.UNVERIFIED&&(i.preventDefault(),i.stopPropagation(),t(9,C.style.display="block",C),Ie())}function ut(){Ee()}function at(){x===g.VERIFYING&&s.waitAlert&&alert(s.waitAlert)}function pn(i){for(const f of re)typeof f.onStateChange=="function"&&f.onStateChange(x);L&&x!==g.UNVERIFIED&&requestAnimationFrame(()=>{Ie()}),t(8,le=x===g.VERIFIED)}function ht(){L&&Ie()}function Ie(i=20){if(C)if(de||(de=(ee?document.querySelector(ee):_==null?void 0:_.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||_),de){const f=parseInt(te,10)||12,m=de.getBoundingClientRect(),I=C.getBoundingClientRect(),Z=document.documentElement.clientHeight,O=document.documentElement.clientWidth,F=L==="auto"?m.bottom+I.height+f+i>Z:L==="top",w=Math.max(i,Math.min(O-i-I.width,m.left+m.width/2-I.width/2));if(F?t(9,C.style.top=`${m.top-(I.height+f)}px`,C):t(9,C.style.top=`${m.bottom+f}px`,C),t(9,C.style.left=`${w}px`,C),C.setAttribute("data-floating",F?"top":"bottom"),se){const G=se.getBoundingClientRect();t(10,se.style.left=m.left-w+m.width/2-G.width/2+"px",se)}}else v("unable to find floating anchor element")}async function En(i){if(!ie)throw new Error("Attribute verifyurl not set.");v("requesting server verification from",ie);const f={payload:i};if(E){const{blockedCountries:Z,classifier:O,disableRules:F,email:w,expectedLanguages:G,expectedCountries:Me,fields:ve,ipAddress:ke,text:In,timeZone:Ct}=mn();f.blockedCountries=Z,f.classifier=O,f.disableRules=F,f.email=w===!1?void 0:gn(w),f.expectedCountries=Me,f.expectedLanguages=G||(it?[it]:void 0),f.fields=ve===!1?void 0:bn(ve),f.ipAddress=ke===!1?void 0:ke||"auto",f.text=In,f.timeZone=Ct===!1?void 0:Ct||en()}const m=await fetch(ie,{body:JSON.stringify(f),headers:{"content-type":"application/json"},method:"POST"});if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const I=await m.json();if(I!=null&&I.payload&&t(6,fe=I.payload),_e("serververification",I),A&&I.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}function Re(i){v("expire",i),J&&(clearTimeout(J),J=null),i<1?ot():J=setTimeout(ot,i)}function dt(i){v("floating",i),L!==i&&(t(9,C.style.left="",C),t(9,C.style.top="",C)),t(1,L=i===!0||i===""?"auto":i===!1||i==="false"?void 0:L),L?(u||t(0,u="onsubmit"),document.addEventListener("scroll",st),document.addEventListener("click",lt),window.addEventListener("resize",ht)):u==="onsubmit"&&t(0,u=void 0)}function gt(i){if(!i.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(i.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!nt.includes(i.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${nt.join(", ")}`);if(!i.challenge||i.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!i.salt||i.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function mt(i){let f=null;if("Worker"in window){try{f=await vn(i,i.maxnumber)}catch(m){v(m)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in i)return{data:i,solution:f}}if("obfuscated"in i){const m=await rn(i.obfuscated,i.key,i.maxnumber);return{data:i,solution:await m.promise}}return{data:i,solution:await Qt(i.challenge,i.salt,i.algorithm,i.maxnumber||W).promise}}async function vn(i,f=typeof y=="number"?y:W,m=Math.ceil(he)){const I=[];m=Math.min(16,Math.max(1,m));for(let F=0;F{const G=w*Z;return new Promise(Me=>{F.addEventListener("message",ve=>{if(ve.data)for(const ke of I)ke!==F&&ke.postMessage({type:"abort"});Me(ve.data)}),F.postMessage({payload:i,max:G+Z,start:G,type:"work"})})}));for(const F of I)F.terminate();return O.find(F=>!!F)||null}async function pe(){if(!k){t(7,x=g.ERROR);return}const i=re.find(f=>f.constructor.pluginName==="obfuscation");if(!i||!("clarify"in i)){t(7,x=g.ERROR),v("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in i&&typeof i.clarify=="function")return i.clarify()}function bt(i){i.obfuscated!==void 0&&t(24,k=i.obfuscated),i.auto!==void 0&&(t(0,u=i.auto),u==="onload"&&(k?pe():oe())),i.blockspam!==void 0&&t(16,A=!!i.blockspam),i.floatinganchor!==void 0&&t(20,ee=i.floatinganchor),i.delay!==void 0&&t(18,q=i.delay),i.floatingoffset!==void 0&&t(21,te=i.floatingoffset),i.floating!==void 0&&dt(i.floating),i.expire!==void 0&&(Re(i.expire),t(19,T=i.expire)),i.challenge&&(gt(i.challenge),o=i.challenge),i.challengeurl!==void 0&&t(15,b=i.challengeurl),i.debug!==void 0&&t(17,B=!!i.debug),i.hidefooter!==void 0&&t(2,N=!!i.hidefooter),i.hidelogo!==void 0&&t(3,D=!!i.hidelogo),i.maxnumber!==void 0&&t(22,W=+i.maxnumber),i.mockerror!==void 0&&t(23,V=!!i.mockerror),i.name!==void 0&&t(4,ne=i.name),i.refetchonexpire!==void 0&&t(25,S=!!i.refetchonexpire),i.spamfilter!==void 0&&t(26,E=typeof i.spamfilter=="object"?i.spamfilter:!!i.spamfilter),i.strings&&t(44,l=i.strings),i.test!==void 0&&t(27,y=typeof i.test=="number"?i.test:!!i.test),i.verifyurl!==void 0&&t(28,ie=i.verifyurl),i.workers!==void 0&&t(29,he=+i.workers),i.workerurl!==void 0&&t(30,ye=i.workerurl)}function yt(){return{auto:u,blockspam:A,challengeurl:b,debug:B,delay:q,expire:T,floating:L,floatinganchor:ee,floatingoffset:te,hidefooter:N,hidelogo:D,name:ne,maxnumber:W,mockerror:V,obfuscated:k,refetchonexpire:S,spamfilter:E,strings:s,test:y,verifyurl:ie,workers:he,workerurl:ye}}function _t(){return de}function kn(i){return re.find(f=>f.constructor.pluginName===i)}function wt(){return x}function Ee(i=g.UNVERIFIED,f=null){J&&(clearTimeout(J),J=null),t(8,le=!1),t(5,we=f),t(6,fe=null),t(7,x=i)}function pt(i){de=i}function Et(i,f=null){t(7,x=i),t(5,we=f)}async function oe(){return Ee(g.VERIFYING),await new Promise(i=>setTimeout(i,q||0)),dn().then(i=>(gt(i),v("challenge",i),mt(i))).then(({data:i,solution:f})=>{if(v("solution",f),"challenge"in i&&f&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0){if(ie)return En(rt(i,f));t(6,fe=rt(i,f)),v("payload",fe)}else throw v("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{$t().then(()=>{t(7,x=g.VERIFIED),v("verified"),_e("verified",{payload:fe})})}).catch(i=>{v(i),t(7,x=g.ERROR),t(5,we=i.message)})}function Cn(){le=this.checked,t(8,le)}function xn(i){Ce[i?"unshift":"push"](()=>{se=i,t(10,se)})}function An(i){Ce[i?"unshift":"push"](()=>{C=i,t(9,C)})}return n.$$set=i=>{"auto"in i&&t(0,u=i.auto),"blockspam"in i&&t(16,A=i.blockspam),"challengeurl"in i&&t(15,b=i.challengeurl),"challengejson"in i&&t(31,X=i.challengejson),"debug"in i&&t(17,B=i.debug),"delay"in i&&t(18,q=i.delay),"expire"in i&&t(19,T=i.expire),"floating"in i&&t(1,L=i.floating),"floatinganchor"in i&&t(20,ee=i.floatinganchor),"floatingoffset"in i&&t(21,te=i.floatingoffset),"hidefooter"in i&&t(2,N=i.hidefooter),"hidelogo"in i&&t(3,D=i.hidelogo),"name"in i&&t(4,ne=i.name),"maxnumber"in i&&t(22,W=i.maxnumber),"mockerror"in i&&t(23,V=i.mockerror),"obfuscated"in i&&t(24,k=i.obfuscated),"plugins"in i&&t(32,P=i.plugins),"refetchonexpire"in i&&t(25,S=i.refetchonexpire),"spamfilter"in i&&t(26,E=i.spamfilter),"strings"in i&&t(33,a=i.strings),"test"in i&&t(27,y=i.test),"verifyurl"in i&&t(28,ie=i.verifyurl),"workers"in i&&t(29,he=i.workers),"workerurl"in i&&t(30,ye=i.workerurl),"$$scope"in i&&t(45,d=i.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&32768&&t(12,r=!!(b!=null&&b.includes(".altcha.org"))&&!!(b!=null&&b.includes("apiKey=ckey_"))),n.$$.dirty[1]&1&&(o=X?et(X):void 0),n.$$.dirty[1]&4&&t(44,l=a?et(a):{}),n.$$.dirty[1]&8192&&t(11,s={ariaLinkLabel:Ke,error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:`Protected by ALTCHA`,label:"I'm not a robot",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait.",...l}),n.$$.dirty[0]&192&&_e("statechange",{payload:fe,state:x}),n.$$.dirty[0]&32&&wn(),n.$$.dirty[0]&128&&pn()},[u,L,N,D,ne,we,fe,x,le,C,se,s,r,_n,at,b,A,B,q,T,ee,te,W,V,k,S,E,y,ie,he,ye,X,P,a,pe,bt,yt,_t,kn,wt,Ee,pt,Et,oe,l,d,h,Cn,xn,An]}class tt extends Xt{constructor(e){super(),Yt(this,e,an,un,At,{auto:0,blockspam:16,challengeurl:15,challengejson:31,debug:17,delay:18,expire:19,floating:1,floatinganchor:20,floatingoffset:21,hidefooter:2,hidelogo:3,name:4,maxnumber:22,mockerror:23,obfuscated:24,plugins:32,refetchonexpire:25,spamfilter:26,strings:33,test:27,verifyurl:28,workers:29,workerurl:30,clarify:34,configure:35,getConfiguration:36,getFloatingAnchor:37,getPlugin:38,getState:39,reset:40,setFloatingAnchor:41,setState:42,verify:43},null,[-1,-1,-1])}get auto(){return this.$$.ctx[0]}set auto(e){this.$$set({auto:e}),p()}get blockspam(){return this.$$.ctx[16]}set blockspam(e){this.$$set({blockspam:e}),p()}get challengeurl(){return this.$$.ctx[15]}set challengeurl(e){this.$$set({challengeurl:e}),p()}get challengejson(){return this.$$.ctx[31]}set challengejson(e){this.$$set({challengejson:e}),p()}get debug(){return this.$$.ctx[17]}set debug(e){this.$$set({debug:e}),p()}get delay(){return this.$$.ctx[18]}set delay(e){this.$$set({delay:e}),p()}get expire(){return this.$$.ctx[19]}set expire(e){this.$$set({expire:e}),p()}get floating(){return this.$$.ctx[1]}set floating(e){this.$$set({floating:e}),p()}get floatinganchor(){return this.$$.ctx[20]}set floatinganchor(e){this.$$set({floatinganchor:e}),p()}get floatingoffset(){return this.$$.ctx[21]}set floatingoffset(e){this.$$set({floatingoffset:e}),p()}get hidefooter(){return this.$$.ctx[2]}set hidefooter(e){this.$$set({hidefooter:e}),p()}get hidelogo(){return this.$$.ctx[3]}set hidelogo(e){this.$$set({hidelogo:e}),p()}get name(){return this.$$.ctx[4]}set name(e){this.$$set({name:e}),p()}get maxnumber(){return this.$$.ctx[22]}set maxnumber(e){this.$$set({maxnumber:e}),p()}get mockerror(){return this.$$.ctx[23]}set mockerror(e){this.$$set({mockerror:e}),p()}get obfuscated(){return this.$$.ctx[24]}set obfuscated(e){this.$$set({obfuscated:e}),p()}get plugins(){return this.$$.ctx[32]}set plugins(e){this.$$set({plugins:e}),p()}get refetchonexpire(){return this.$$.ctx[25]}set refetchonexpire(e){this.$$set({refetchonexpire:e}),p()}get spamfilter(){return this.$$.ctx[26]}set spamfilter(e){this.$$set({spamfilter:e}),p()}get strings(){return this.$$.ctx[33]}set strings(e){this.$$set({strings:e}),p()}get test(){return this.$$.ctx[27]}set test(e){this.$$set({test:e}),p()}get verifyurl(){return this.$$.ctx[28]}set verifyurl(e){this.$$set({verifyurl:e}),p()}get workers(){return this.$$.ctx[29]}set workers(e){this.$$set({workers:e}),p()}get workerurl(){return this.$$.ctx[30]}set workerurl(e){this.$$set({workerurl:e}),p()}get clarify(){return this.$$.ctx[34]}get configure(){return this.$$.ctx[35]}get getConfiguration(){return this.$$.ctx[36]}get getFloatingAnchor(){return this.$$.ctx[37]}get getPlugin(){return this.$$.ctx[38]}get getState(){return this.$$.ctx[39]}get reset(){return this.$$.ctx[40]}get setFloatingAnchor(){return this.$$.ctx[41]}get setState(){return this.$$.ctx[42]}get verify(){return this.$$.ctx[43]}}customElements.define("altcha-widget",Wt(tt,{auto:{},blockspam:{},challengeurl:{},challengejson:{},debug:{type:"Boolean"},delay:{},expire:{},floating:{},floatinganchor:{},floatingoffset:{},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},name:{},maxnumber:{},mockerror:{type:"Boolean"},obfuscated:{},plugins:{},refetchonexpire:{type:"Boolean"},spamfilter:{type:"Boolean"},strings:{},test:{type:"Boolean"},verifyurl:{},workers:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","reset","setFloatingAnchor","setState","verify"],!1)),globalThis.altchaCreateWorker=n=>new Worker(new URL(n||"./worker.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:$&&$.tagName.toUpperCase()==="SCRIPT"&&$.src||new URL("altcha.umd.cjs",document.baseURI).href)),globalThis.altchaPlugins=globalThis.altchaPlugins||[],H.Altcha=tt,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}); diff --git a/package-lock.json b/package-lock.json index f77dd4c..17f4e16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,19 @@ { "name": "altcha", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "altcha", - "version": "1.0.0", + "version": "1.0.1", + "hasInstallScript": true, "license": "MIT", "dependencies": { "@altcha/crypto": "^0.0.1" }, "devDependencies": { + "@ovx/svelte": "4.2.19", "@playwright/test": "^1.46.1", "@sveltejs/vite-plugin-svelte": "^3.1.2", "@tsconfig/svelte": "^5.0.4", @@ -462,18 +464,6 @@ "node": ">=6.0.0" } }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" - } - }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", @@ -490,13 +480,311 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@ovx/svelte": { + "version": "4.2.19", + "resolved": "https://registry.npmjs.org/@ovx/svelte/-/svelte-4.2.19.tgz", + "integrity": "sha512-+M8AyOH24Zq/rmPPQ93GFcNIB++0QvvB6jLDl2Os9NPzPgNeQylq1t8InfJtfAat9wETW/jQtc6Ggm+HEd80Hw==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.1", + "@jridgewell/sourcemap-codec": "^1.4.15", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/estree": "^1.0.1", + "acorn": "^8.9.0", + "aria-query": "^5.3.0", + "axobject-query": "^4.0.0", + "code-red": "^1.0.3", + "css-tree": "^2.3.1", + "estree-walker": "^3.0.3", + "is-reference": "^3.0.1", + "locate-character": "^3.0.0", + "magic-string": "^0.30.4", + "periscopic": "^3.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.1.tgz", + "integrity": "sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA==", + "dev": true, + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.4.1", + "@parcel/watcher-darwin-arm64": "2.4.1", + "@parcel/watcher-darwin-x64": "2.4.1", + "@parcel/watcher-freebsd-x64": "2.4.1", + "@parcel/watcher-linux-arm-glibc": "2.4.1", + "@parcel/watcher-linux-arm64-glibc": "2.4.1", + "@parcel/watcher-linux-arm64-musl": "2.4.1", + "@parcel/watcher-linux-x64-glibc": "2.4.1", + "@parcel/watcher-linux-x64-musl": "2.4.1", + "@parcel/watcher-win32-arm64": "2.4.1", + "@parcel/watcher-win32-ia32": "2.4.1", + "@parcel/watcher-win32-x64": "2.4.1" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.1.tgz", + "integrity": "sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.4.1.tgz", + "integrity": "sha512-ln41eihm5YXIY043vBrrHfn94SIBlqOWmoROhsMVTSXGh0QahKGy77tfEywQ7v3NywyxBBkGIfrWRHm0hsKtzA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.4.1.tgz", + "integrity": "sha512-yrw81BRLjjtHyDu7J61oPuSoeYWR3lDElcPGJyOvIXmor6DEo7/G2u1o7I38cwlcoBHQFULqF6nesIX3tsEXMg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.4.1.tgz", + "integrity": "sha512-TJa3Pex/gX3CWIx/Co8k+ykNdDCLx+TuZj3f3h7eOjgpdKM+Mnix37RYsYU4LHhiYJz3DK5nFCCra81p6g050w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.4.1.tgz", + "integrity": "sha512-4rVYDlsMEYfa537BRXxJ5UF4ddNwnr2/1O4MHM5PjI9cvV2qymvhwZSFgXqbS8YoTk5i/JR0L0JDs69BUn45YA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.4.1.tgz", + "integrity": "sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.4.1.tgz", + "integrity": "sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.4.1.tgz", + "integrity": "sha512-s9O3fByZ/2pyYDPoLM6zt92yu6P4E39a03zvO0qCHOTjxmt3GHRMLuRZEWhWLASTMSrrnVNWdVI/+pUElJBBBg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.4.1.tgz", + "integrity": "sha512-L2nZTYR1myLNST0O632g0Dx9LyMNHrn6TOt76sYxWLdff3cB22/GZX2UPtJnaqQPdCRoszoY5rcOj4oMTtp5fQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.4.1.tgz", + "integrity": "sha512-Uq2BPp5GWhrq/lcuItCHoqxjULU1QYEcyjSO5jqqOK8RNFDBQnenMMx4gAl3v8GiWa59E9+uDM7yZ6LxwUIfRg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.4.1.tgz", + "integrity": "sha512-maNRit5QQV2kgHFSYwftmPBxiuK5u4DXjbXx7q6eKjq5dsLXZ4FJiVvlcw35QXzk0KrUecJmuVFbj4uV9oYrcw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.4.1.tgz", + "integrity": "sha512-+DvS92F9ezicfswqrvIRM2njcYJbd5mb9CUgtrHCHmvn7pPPa+nMDRu1o1bYYz/l5IB2NVGNJWiH7h1E58IF2A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, "node_modules/@playwright/test": { - "version": "1.46.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.46.1.tgz", - "integrity": "sha512-Fq6SwLujA/DOIvNC2EL/SojJnkKf/rAwJ//APpJJHRyMi1PdKrY3Az+4XNQ51N4RTbItbIByQ0jgd1tayq1aeA==", + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.0.tgz", + "integrity": "sha512-W5lhqPUVPqhtc/ySvZI5Q8X2ztBOUgZ8LbAFy0JQgrXZs2xaILrUcNO3rQjwbLPfGK13+rZsDa1FpG+tqYkT5w==", "dev": true, "dependencies": { - "playwright": "1.46.1" + "playwright": "1.48.0" }, "bin": { "playwright": "cli.js" @@ -506,9 +794,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", - "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.2.tgz", + "integrity": "sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==", "dev": true, "dependencies": { "@types/estree": "^1.0.0", @@ -527,10 +815,16 @@ } } }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.2.tgz", - "integrity": "sha512-fSuPrt0ZO8uXeS+xP3b+yYTCBUd05MoSp2N/MFOgjhhUhMmchXlpTQrTpI8T+YAwAQuK7MafsCOxW7VrPMrJcg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz", + "integrity": "sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==", "cpu": [ "arm" ], @@ -541,9 +835,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.2.tgz", - "integrity": "sha512-xGU5ZQmPlsjQS6tzTTGwMsnKUtu0WVbl0hYpTPauvbRAnmIvpInhJtgjj3mcuJpEiuUw4v1s4BimkdfDWlh7gA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.0.tgz", + "integrity": "sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==", "cpu": [ "arm64" ], @@ -554,9 +848,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.2.tgz", - "integrity": "sha512-99AhQ3/ZMxU7jw34Sq8brzXqWH/bMnf7ZVhvLk9QU2cOepbQSVTns6qoErJmSiAvU3InRqC2RRZ5ovh1KN0d0Q==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.0.tgz", + "integrity": "sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==", "cpu": [ "arm64" ], @@ -567,9 +861,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.2.tgz", - "integrity": "sha512-ZbRaUvw2iN/y37x6dY50D8m2BnDbBjlnMPotDi/qITMJ4sIxNY33HArjikDyakhSv0+ybdUxhWxE6kTI4oX26w==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.0.tgz", + "integrity": "sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==", "cpu": [ "x64" ], @@ -580,9 +874,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.2.tgz", - "integrity": "sha512-ztRJJMiE8nnU1YFcdbd9BcH6bGWG1z+jP+IPW2oDUAPxPjo9dverIOyXz76m6IPA6udEL12reYeLojzW2cYL7w==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.0.tgz", + "integrity": "sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==", "cpu": [ "arm" ], @@ -593,9 +887,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.2.tgz", - "integrity": "sha512-flOcGHDZajGKYpLV0JNc0VFH361M7rnV1ee+NTeC/BQQ1/0pllYcFmxpagltANYt8FYf9+kL6RSk80Ziwyhr7w==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.0.tgz", + "integrity": "sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==", "cpu": [ "arm" ], @@ -606,9 +900,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.2.tgz", - "integrity": "sha512-69CF19Kp3TdMopyteO/LJbWufOzqqXzkrv4L2sP8kfMaAQ6iwky7NoXTp7bD6/irKgknDKM0P9E/1l5XxVQAhw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.0.tgz", + "integrity": "sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==", "cpu": [ "arm64" ], @@ -619,9 +913,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.2.tgz", - "integrity": "sha512-48pD/fJkTiHAZTnZwR0VzHrao70/4MlzJrq0ZsILjLW/Ab/1XlVUStYyGt7tdyIiVSlGZbnliqmult/QGA2O2w==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.0.tgz", + "integrity": "sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==", "cpu": [ "arm64" ], @@ -632,9 +926,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.2.tgz", - "integrity": "sha512-cZdyuInj0ofc7mAQpKcPR2a2iu4YM4FQfuUzCVA2u4HI95lCwzjoPtdWjdpDKyHxI0UO82bLDoOaLfpZ/wviyQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.0.tgz", + "integrity": "sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==", "cpu": [ "ppc64" ], @@ -645,9 +939,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.2.tgz", - "integrity": "sha512-RL56JMT6NwQ0lXIQmMIWr1SW28z4E4pOhRRNqwWZeXpRlykRIlEpSWdsgNWJbYBEWD84eocjSGDu/XxbYeCmwg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.0.tgz", + "integrity": "sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==", "cpu": [ "riscv64" ], @@ -658,9 +952,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.2.tgz", - "integrity": "sha512-PMxkrWS9z38bCr3rWvDFVGD6sFeZJw4iQlhrup7ReGmfn7Oukrr/zweLhYX6v2/8J6Cep9IEA/SmjXjCmSbrMQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.0.tgz", + "integrity": "sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==", "cpu": [ "s390x" ], @@ -683,9 +977,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.2.tgz", - "integrity": "sha512-7twFizNXudESmC9oneLGIUmoHiiLppz/Xs5uJQ4ShvE6234K0VB1/aJYU3f/4g7PhssLGKBVCC37uRkkOi8wjg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.0.tgz", + "integrity": "sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==", "cpu": [ "x64" ], @@ -696,9 +990,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.2.tgz", - "integrity": "sha512-9rRero0E7qTeYf6+rFh3AErTNU1VCQg2mn7CQcI44vNUWM9Ze7MSRS/9RFuSsox+vstRt97+x3sOhEey024FRQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.0.tgz", + "integrity": "sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==", "cpu": [ "arm64" ], @@ -709,9 +1003,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.2.tgz", - "integrity": "sha512-5rA4vjlqgrpbFVVHX3qkrCo/fZTj1q0Xxpg+Z7yIo3J2AilW7t2+n6Q8Jrx+4MrYpAnjttTYF8rr7bP46BPzRw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.0.tgz", + "integrity": "sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==", "cpu": [ "ia32" ], @@ -722,9 +1016,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.2.tgz", - "integrity": "sha512-6UUxd0+SKomjdzuAcp+HAmxw1FlGBnl1v2yEPSabtx4lBfdXHDVsW7+lQkgz9cNFJGY3AWR7+V8P5BqkD9L9nA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.0.tgz", + "integrity": "sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==", "cpu": [ "x64" ], @@ -786,9 +1080,9 @@ "dev": true }, "node_modules/@types/chai": { - "version": "4.3.19", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.19.tgz", - "integrity": "sha512-2hHHvQBVE2FiSK4eN0Br6snX9MtolHaTo/batnLjlGRhoQzlCL61iVpxoqO7SfFyOw+P/pwv+0zNHzKoGWz9Cw==", + "version": "4.3.20", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", + "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", "dev": true }, "node_modules/@types/chai-subset": { @@ -801,15 +1095,15 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "node_modules/@types/node": { - "version": "20.16.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.3.tgz", - "integrity": "sha512-/wdGiWRkMOm53gAsSyFMXFZHbVg7C6CbkrzHNpaHoYfsUWPg7m6ZRKtvQjgvQ9i8WT540a3ydRlRQbxjY30XxQ==", + "version": "20.16.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.11.tgz", + "integrity": "sha512-y+cTCACu92FyA5fgQSAI8A1H429g7aSK2HsO7K4XYUWc4dY5IUz55JSDIYT6/VsOLfGy8vmvQYC2hfb0iF16Uw==", "dev": true, "dependencies": { "undici-types": "~6.19.2" @@ -902,9 +1196,9 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.3", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", - "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", "dev": true, "dependencies": { "acorn": "^8.11.0" @@ -939,12 +1233,12 @@ } }, "node_modules/aria-query": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", - "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", "dev": true, - "dependencies": { - "dequal": "^2.0.3" + "engines": { + "node": ">= 0.4" } }, "node_modules/assertion-error": { @@ -1014,14 +1308,6 @@ "node": ">=8.0.0" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "optional": true, - "peer": true - }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -1062,27 +1348,18 @@ } }, "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz", + "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==", "dev": true, "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "^4.0.1" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 14.16.0" }, "funding": { "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" } }, "node_modules/code-red": { @@ -1098,23 +1375,6 @@ "periscopic": "^3.1.0" } }, - "node_modules/code-red/node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "optional": true, - "peer": true - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1122,9 +1382,9 @@ "dev": true }, "node_modules/confbox": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", - "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", "dev": true }, "node_modules/css-tree": { @@ -1141,12 +1401,12 @@ } }, "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -1178,15 +1438,6 @@ "node": ">=0.10.0" } }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/detect-indent": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", @@ -1196,6 +1447,18 @@ "node": ">=8" } }, + "node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -1250,10 +1513,13 @@ } }, "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } }, "node_modules/fill-range": { "version": "7.1.1", @@ -1336,9 +1602,9 @@ "dev": true }, "node_modules/husky": { - "version": "9.1.5", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.5.tgz", - "integrity": "sha512-rowAVRUBfI0b4+niA4SJMhfQwc107VLkBUgEYYAOQAbqDCnra1nYh83hF/MDmhYs9t9n1E3DuKOrs2LYNC+0Ag==", + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", + "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", "dev": true, "bin": { "husky": "bin.js" @@ -1475,6 +1741,19 @@ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", "dev": true }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -1518,15 +1797,15 @@ } }, "node_modules/mlly": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz", - "integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.2.tgz", + "integrity": "sha512-tN3dvVHYVz4DhSXinXIk7u9syPYaJvio118uomkovAtWBT+RdbP6Lfh/5Lvo519YMmwBafwlh20IPTXIStscpA==", "dev": true, "dependencies": { - "acorn": "^8.11.3", + "acorn": "^8.12.1", "pathe": "^1.1.2", - "pkg-types": "^1.1.1", - "ufo": "^1.5.3" + "pkg-types": "^1.2.0", + "ufo": "^1.5.4" } }, "node_modules/mri": { @@ -1539,9 +1818,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/nanoid": { @@ -1562,6 +1841,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1630,19 +1915,10 @@ "is-reference": "^3.0.0" } }, - "node_modules/periscopic/node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "dependencies": { - "@types/estree": "^1.0.0" - } - }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", "dev": true }, "node_modules/picomatch": { @@ -1658,23 +1934,23 @@ } }, "node_modules/pkg-types": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.0.tgz", - "integrity": "sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.1.tgz", + "integrity": "sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==", "dev": true, "dependencies": { - "confbox": "^0.1.7", - "mlly": "^1.7.1", + "confbox": "^0.1.8", + "mlly": "^1.7.2", "pathe": "^1.1.2" } }, "node_modules/playwright": { - "version": "1.46.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.46.1.tgz", - "integrity": "sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng==", + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.0.tgz", + "integrity": "sha512-qPqFaMEHuY/ug8o0uteYJSRfMGFikhUysk8ZvAtfKmUK3kc/6oNl/y3EczF8OFGYIi/Ex2HspMfzYArk6+XQSA==", "dev": true, "dependencies": { - "playwright-core": "1.46.1" + "playwright-core": "1.48.0" }, "bin": { "playwright": "cli.js" @@ -1687,9 +1963,9 @@ } }, "node_modules/playwright-core": { - "version": "1.46.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.46.1.tgz", - "integrity": "sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A==", + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.0.tgz", + "integrity": "sha512-RBvzjM9rdpP7UUFrQzRwR8L/xR4HyC1QXMzGYTbf1vjw25/ya9NRAVnXi/0fvFopjebvyPzsmoK58xxeEOaVvA==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -1699,9 +1975,9 @@ } }, "node_modules/postcss": { - "version": "8.4.44", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.44.tgz", - "integrity": "sha512-Aweb9unOEpQ3ezu4Q00DPvvM2ZTUitJdNKeP/+uQgr1IBIqu574IaZoURId7BKtWMREwzKa9OgzPzezWGPWFQw==", + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", "dev": true, "funding": [ { @@ -1719,8 +1995,8 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -1742,9 +2018,9 @@ } }, "node_modules/prettier-plugin-svelte": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.2.6.tgz", - "integrity": "sha512-Y1XWLw7vXUQQZmgv1JAEiLcErqUniAF2wO7QJsw8BVMvpLET2dI5WpEIEJx1r11iHVdSMzQxivyfrH9On9t2IQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.2.7.tgz", + "integrity": "sha512-/Dswx/ea0lV34If1eDcG3nulQ63YNr5KPDfMsjbdtpSWOxKKJ7nAc2qlVuYwEvCr4raIuredNoR7K4JCkmTGaQ==", "dev": true, "peerDependencies": { "prettier": "^3.0.0", @@ -1772,15 +2048,16 @@ "dev": true }, "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.2.tgz", + "integrity": "sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==", "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, "engines": { - "node": ">=8.10.0" + "node": ">= 14.16.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/rimraf": { @@ -1797,12 +2074,12 @@ } }, "node_modules/rollup": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.2.tgz", - "integrity": "sha512-e3TapAgYf9xjdLvKQCkQTnbTKd4a6jwlpQSJJFokHGaX2IVjoEqkIIhiQfqsi0cdwlOD+tQGuOd5AJkc5RngBw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.0.tgz", + "integrity": "sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==", "dev": true, "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -1812,22 +2089,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.21.2", - "@rollup/rollup-android-arm64": "4.21.2", - "@rollup/rollup-darwin-arm64": "4.21.2", - "@rollup/rollup-darwin-x64": "4.21.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.21.2", - "@rollup/rollup-linux-arm-musleabihf": "4.21.2", - "@rollup/rollup-linux-arm64-gnu": "4.21.2", - "@rollup/rollup-linux-arm64-musl": "4.21.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.21.2", - "@rollup/rollup-linux-riscv64-gnu": "4.21.2", - "@rollup/rollup-linux-s390x-gnu": "4.21.2", - "@rollup/rollup-linux-x64-gnu": "4.21.2", - "@rollup/rollup-linux-x64-musl": "4.21.2", - "@rollup/rollup-win32-arm64-msvc": "4.21.2", - "@rollup/rollup-win32-ia32-msvc": "4.21.2", - "@rollup/rollup-win32-x64-msvc": "4.21.2", + "@rollup/rollup-android-arm-eabi": "4.24.0", + "@rollup/rollup-android-arm64": "4.24.0", + "@rollup/rollup-darwin-arm64": "4.24.0", + "@rollup/rollup-darwin-x64": "4.24.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.24.0", + "@rollup/rollup-linux-arm-musleabihf": "4.24.0", + "@rollup/rollup-linux-arm64-gnu": "4.24.0", + "@rollup/rollup-linux-arm64-musl": "4.24.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.24.0", + "@rollup/rollup-linux-riscv64-gnu": "4.24.0", + "@rollup/rollup-linux-s390x-gnu": "4.24.0", + "@rollup/rollup-linux-x64-gnu": "4.24.0", + "@rollup/rollup-linux-x64-musl": "4.24.0", + "@rollup/rollup-win32-arm64-msvc": "4.24.0", + "@rollup/rollup-win32-ia32-msvc": "4.24.0", + "@rollup/rollup-win32-x64-msvc": "4.24.0", "fsevents": "~2.3.2" } }, @@ -1847,9 +2124,9 @@ } }, "node_modules/rollup/node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.2.tgz", - "integrity": "sha512-B90tYAUoLhU22olrafY3JQCFLnT3NglazdwkHyxNDYF/zAxJt5fJUB/yBoWFoIQ7SQj+KLe3iL4BhOMa9fzgpw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz", + "integrity": "sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==", "cpu": [ "x64" ], @@ -1884,12 +2161,13 @@ } }, "node_modules/sass": { - "version": "1.77.8", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.8.tgz", - "integrity": "sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==", + "version": "1.79.5", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.79.5.tgz", + "integrity": "sha512-W1h5kp6bdhqFh2tk3DsI771MoEJjvrSY/2ihJRJS4pjIyfJCw0nTsxqhnrUzaLMOJjFchj8rOvraI/YUVjtx5g==", "dev": true, "dependencies": { - "chokidar": ">=3.0.0 <4.0.0", + "@parcel/watcher": "^2.4.1", + "chokidar": "^4.0.0", "immutable": "^4.0.0", "source-map-js": ">=0.6.2 <2.0.0" }, @@ -1921,38 +2199,15 @@ "sorcery": "bin/sorcery" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -2034,6 +2289,42 @@ "svelte": "^3.55.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0" } }, + "node_modules/svelte-check/node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/svelte-check/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, "node_modules/svelte-hmr": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.16.0.tgz", @@ -2108,35 +2399,6 @@ } } }, - "node_modules/svelte/node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/terser": { - "version": "5.31.6", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", - "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -2189,9 +2451,9 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -2214,9 +2476,9 @@ "dev": true }, "node_modules/vite": { - "version": "5.4.7", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.7.tgz", - "integrity": "sha512-5l2zxqMEPVENgvzTuBpHer2awaetimj2BGkhBPdnwKbPNOlHsODU+oiazEZzLK7KhAnOrO+XGYJYn4ZlUhDtDQ==", + "version": "5.4.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", + "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", "dev": true, "dependencies": { "esbuild": "^0.21.3", diff --git a/package.json b/package.json index a820398..046e025 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "altcha", "description": "GDPR compliant, self-hosted CAPTCHA alternative.", - "version": "1.0.0", + "version": "1.0.1", "license": "MIT", "author": { "name": "Daniel Regeci", @@ -74,9 +74,11 @@ "format": "prettier --write ./src/**/*", "test": "vitest run tests/helpers.test.ts", "test:e2e": "playwright test", - "prepare": "husky" + "prepare": "husky", + "postinstall": "rm -rf node_modules/svelte && cp -R node_modules/@ovx/svelte node_modules/svelte" }, "devDependencies": { + "@ovx/svelte": "4.2.19", "@playwright/test": "^1.46.1", "@sveltejs/vite-plugin-svelte": "^3.1.2", "@tsconfig/svelte": "^5.0.4",