diff --git a/client/package.json b/client/package.json index 4067d3d145a4..95eb55129110 100644 --- a/client/package.json +++ b/client/package.json @@ -9,7 +9,7 @@ "dependencies": { "@sentry/browser": "8.47.0", "@tarekraafat/autocomplete.js": "10.2.9", - "altcha": "1.0.7", + "altcha": "1.1.0", "autosize": "6.0.1", "daterangepicker": "3.1.0", "jquery": "3.7.1", diff --git a/client/yarn.lock b/client/yarn.lock index 9aed783d2622..856d08fb7fdd 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -331,10 +331,10 @@ ajv@^8.0.0, ajv@^8.9.0: json-schema-traverse "^1.0.0" require-from-string "^2.0.2" -altcha@1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/altcha/-/altcha-1.0.7.tgz#47d180f0da5ccedd04c2dace67f82859b8cc430f" - integrity sha512-rQJpGW00ZJ0vlunQXf5AZqf8iTnoFjb8DmIXz+IUggB0o27Z9VD3jfrISiYtOtVa9AKSTyE2QIuxv9zPxrmW8A== +altcha@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/altcha/-/altcha-1.1.0.tgz#d7439b949694dfc368a72060d7c7bf5b9f368948" + integrity sha512-0urTfQq97qBHYsztSnO32LCuuswxdddJQVmpFkJkKcqmCbvWP9aatN8CkJ+QNDE4GCdFaJ4kCwhmuyflANTPpg== dependencies: "@altcha/crypto" "^0.0.1" optionalDependencies: diff --git a/weblate/static/js/vendor/altcha.js b/weblate/static/js/vendor/altcha.js index 64b0dd55e781..9ec1d053e23f 100644 --- a/weblate/static/js/vendor/altcha.js +++ b/weblate/static/js/vendor/altcha.js @@ -1 +1 @@ -(()=>{"use strict";var t={r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e);var n=Object.defineProperty,r=(t,e,r)=>((t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);const o="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGQ9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIHAoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBiKGUsdCxyKXtpZih0eXBlb2YgY3J5cHRvPiJ1Inx8ISgic3VidGxlImluIGNyeXB0byl8fCEoImRpZ2VzdCJpbiBjcnlwdG8uc3VidGxlKSl0aHJvdyBuZXcgRXJyb3IoIldlYiBDcnlwdG8gaXMgbm90IGF2YWlsYWJsZS4gU2VjdXJlIGNvbnRleHQgaXMgcmVxdWlyZWQgKGh0dHBzOi8vZGV2ZWxvcGVyLm1vemlsbGEub3JnL2VuLVVTL2RvY3MvV2ViL1NlY3VyaXR5L1NlY3VyZV9Db250ZXh0cykuIik7cmV0dXJuIHAoYXdhaXQgY3J5cHRvLnN1YnRsZS5kaWdlc3Qoci50b1VwcGVyQ2FzZSgpLGQuZW5jb2RlKGUrdCkpKX1mdW5jdGlvbiB3KGUsdCxyPSJTSEEtMjU2IixuPTFlNixzPTApe2NvbnN0IG89bmV3IEFib3J0Q29udHJvbGxlcixhPURhdGUubm93KCk7cmV0dXJue3Byb21pc2U6KGFzeW5jKCk9Pntmb3IobGV0IGM9cztjPD1uO2MrPTEpe2lmKG8uc2lnbmFsLmFib3J0ZWQpcmV0dXJuIG51bGw7aWYoYXdhaXQgYih0LGMscik9PT1lKXJldHVybntudW1iZXI6Yyx0b29rOkRhdGUubm93KCktYX19cmV0dXJuIG51bGx9KSgpLGNvbnRyb2xsZXI6b319ZnVuY3Rpb24gaChlKXtjb25zdCB0PWF0b2IoZSkscj1uZXcgVWludDhBcnJheSh0Lmxlbmd0aCk7Zm9yKGxldCBuPTA7bjx0Lmxlbmd0aDtuKyspcltuXT10LmNoYXJDb2RlQXQobik7cmV0dXJuIHJ9ZnVuY3Rpb24gZyhlLHQ9MTIpe2NvbnN0IHI9bmV3IFVpbnQ4QXJyYXkodCk7Zm9yKGxldCBuPTA7bjx0O24rKylyW25dPWUlMjU2LGU9TWF0aC5mbG9vcihlLzI1Nik7cmV0dXJuIHJ9YXN5bmMgZnVuY3Rpb24gbShlLHQ9IiIscj0xZTYsbj0wKXtjb25zdCBzPSJBRVMtR0NNIixvPW5ldyBBYm9ydENvbnRyb2xsZXIsYT1EYXRlLm5vdygpLGw9YXN5bmMoKT0+e2ZvcihsZXQgdT1uO3U8PXI7dSs9MSl7aWYoby5zaWduYWwuYWJvcnRlZHx8IWN8fCF5KXJldHVybiBudWxsO3RyeXtjb25zdCBmPWF3YWl0IGNyeXB0by5zdWJ0bGUuZGVjcnlwdCh7bmFtZTpzLGl2OmcodSl9LGMseSk7aWYoZilyZXR1cm57Y2xlYXJUZXh0Om5ldyBUZXh0RGVjb2RlcigpLmRlY29kZShmKSx0b29rOkRhdGUubm93KCktYX19Y2F0Y2h7fX1yZXR1cm4gbnVsbH07bGV0IGM9bnVsbCx5PW51bGw7dHJ5e3k9aChlKTtjb25zdCB1PWF3YWl0IGNyeXB0by5zdWJ0bGUuZGlnZXN0KCJTSEEtMjU2IixkLmVuY29kZSh0KSk7Yz1hd2FpdCBjcnlwdG8uc3VidGxlLmltcG9ydEtleSgicmF3Iix1LHMsITEsWyJkZWNyeXB0Il0pfWNhdGNoe3JldHVybntwcm9taXNlOlByb21pc2UucmVqZWN0KCksY29udHJvbGxlcjpvfX1yZXR1cm57cHJvbWlzZTpsKCksY29udHJvbGxlcjpvfX1sZXQgaTtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOnIsc3RhcnQ6bixtYXg6c309ZS5kYXRhO2xldCBvPW51bGw7aWYodD09PSJhYm9ydCIpaT09bnVsbHx8aS5hYm9ydCgpLGk9dm9pZCAwO2Vsc2UgaWYodD09PSJ3b3JrIil7aWYoIm9iZnVzY2F0ZWQiaW4gcil7Y29uc3R7a2V5OmEsb2JmdXNjYXRlZDpsfT1yfHx7fTtvPWF3YWl0IG0obCxhLHMsbil9ZWxzZXtjb25zdHthbGdvcml0aG06YSxjaGFsbGVuZ2U6bCxzYWx0OmN9PXJ8fHt9O289dyhsLGMsYSxzLG4pfWk9by5jb250cm9sbGVyLG8ucHJvbWlzZS50aGVuKGE9PntzZWxmLnBvc3RNZXNzYWdlKGEmJnsuLi5hLHdvcmtlcjohMH0pfSl9fX0pKCk7Cg==",i=typeof self<"u"&&self.Blob&&new Blob([(l=o,Uint8Array.from(atob(l),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var l;function s(t){let e;try{if(e=i&&(self.URL||self.webkitURL).createObjectURL(i),!e)throw"";const n=new Worker(e,{name:null==t?void 0:t.name});return n.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),n}catch{return new Worker("data:text/javascript;base64,"+o,{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}function a(){}function c(t){return t()}function d(){return Object.create(null)}function u(t){t.forEach(c)}function f(t){return"function"==typeof t}function h(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function g(t,e,n,r){return t[1]&&r?function(t,e){for(const n in e)t[n]=e[n];return t}(n.ctx.slice(),t[1](r(e))):n.ctx}function p(t,e){t.appendChild(e)}function m(t,e,n){const r=function(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}(t);if(!r.getElementById(e)){const t=v("style");t.id=e,t.textContent=n,function(t,e){p(t.head||t,e),e.sheet}(r,t)}}function $(t,e,n){t.insertBefore(e,n||null)}function b(t){t.parentNode&&t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function y(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function x(){return function(t){return document.createTextNode(t)}(" ")}function w(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function k(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function E(t,e,n){t.classList.toggle(e,!!n)}let I;function C(t){I=t}function R(){if(!I)throw new Error("Function called outside component initialization");return I}function L(){const t=R();return(e,n,{cancelable:r=!1}={})=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}(e,n,{cancelable:r});return o.slice().forEach((e=>{e.call(t,i)})),!i.defaultPrevented}return!0}}const z=[],V=[];let G=[];const S=[],N=Promise.resolve();let X=!1;function Z(){X||(X=!0,N.then(W))}function A(t){G.push(t)}const Y=new Set;let j=0;function W(){if(0!==j)return;const t=I;do{try{for(;j-1===t.indexOf(r)?e.push(r):n.push(r))),n.forEach((t=>t())),G=e}(n.after_update),u(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function _(t,e,n,r,o,i,l=null,s=[-1]){const h=I;C(t);const g=t.$$={fragment:null,ctx:[],props:i,update:a,not_equal:o,bound:d(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(h?h.$$.context:[])),callbacks:d(),dirty:s,skip_bound:!1,root:e.target||h.$$.root};l&&l(g.root);let p=!1;if(g.ctx=n?n(t,e.props||{},((e,n,...r)=>{const i=r.length?r[0]:n;return g.ctx&&o(g.ctx[e],g.ctx[e]=i)&&(!g.skip_bound&&g.bound[e]&&g.bound[e](i),p&&function(t,e){-1===t.$$.dirty[0]&&(z.push(t),Z(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const e=t.$$.on_mount.map(c).filter(f);t.$$.on_destroy?t.$$.on_destroy.push(...e):u(e),t.$$.on_mount=[]})),o.forEach(A)}(t,e.target,e.anchor),W()}C(h)}function H(t,e,n,r){var o;const i=null==(o=n[t])?void 0:o.type;if(e="Boolean"===i&&"boolean"!=typeof e?null!=e:e,!r||!n[t])return e;if("toAttribute"===r)switch(i){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(T=class extends HTMLElement{constructor(t,e,n){super(),r(this,"$$ctor"),r(this,"$$s"),r(this,"$$c"),r(this,"$$cn",!1),r(this,"$$d",{}),r(this,"$$r",!1),r(this,"$$p_d",{}),r(this,"$$l",{}),r(this,"$$l_u",new Map),this.$$ctor=t,this.$$s=e,n&&this.attachShadow({mode:"open"})}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}if(this.$$l[t]){const n=this.$$l[t].indexOf(e);n>=0&&this.$$l[t].splice(n,1)}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(t){return()=>{let e;return{c:function(){e=v("slot"),"default"!==t&&k(e,"name",t)},m:function(t,n){$(t,e,n)},d:function(t){t&&b(e)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const e={},n=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const r of this.$$s)r in n&&(e[r]=[t(r)]);for(const t of this.attributes){const e=this.$$g_p(t.name);e in this.$$d||(this.$$d[e]=H(e,t.value,this.$$p_d,"toProp"))}for(const t in this.$$p_d)!(t in this.$$d)&&void 0!==this[t]&&(this.$$d[t]=this[t],delete this[t]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$scope:{ctx:[]}}});const r=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=H(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(this.$$p_d[t].attribute||t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(r),r();for(const t in this.$$l)for(const e of this.$$l[t]){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}this.$$l={}}}attributeChangedCallback(t,e,n){var r;this.$$r||(t=this.$$g_p(t),this.$$d[t]=H(t,n,this.$$p_d,"toProp"),null==(r=this.$$c)||r.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});class J{constructor(){r(this,"$$"),r(this,"$$set")}$destroy(){U(this,1),this.$destroy=a}$on(t,e){if(!f(e))return a;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!function(t){return 0===Object.keys(t).length}(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");const B=new TextEncoder;async function O(t,e,n){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return function(t){return[...new Uint8Array(t)].map((t=>t.toString(16).padStart(2,"0"))).join("")}(await crypto.subtle.digest(n.toUpperCase(),B.encode(t+e)))}function D(t,e,n="SHA-256",r=1e6,o=0){const i=new AbortController,l=Date.now();return{promise:(async()=>{for(let s=o;s<=r;s+=1){if(i.signal.aborted)return null;if(await O(e,s,n)===t)return{number:s,took:Date.now()-l}}return null})(),controller:i}}function K(t,e=12){const n=new Uint8Array(e);for(let r=0;r{for(let t=r;t<=n;t+=1){if(i.signal.aborted||!s||!a)return null;try{const e=await crypto.subtle.decrypt({name:o,iv:K(t)},s,a);if(e)return{clearText:(new TextDecoder).decode(e),took:Date.now()-l}}catch{}}return null})(),controller:i}}var q=(t=>(t.ERROR="error",t.VERIFIED="verified",t.VERIFYING="verifying",t.UNVERIFIED="unverified",t.EXPIRED="expired",t))(q||{});function tt(t){m(t,"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 et(t){let e,n,r;return{c(){e=y("svg"),n=y("path"),r=y("path"),k(n,"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"),k(n,"fill","currentColor"),k(n,"opacity",".25"),k(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"),k(r,"fill","currentColor"),k(r,"class","altcha-spinner svelte-ddsc3z"),k(e,"width","24"),k(e,"height","24"),k(e,"viewBox","0 0 24 24"),k(e,"xmlns","http://www.w3.org/2000/svg")},m(t,o){$(t,e,o),p(e,n),p(e,r)},d(t){t&&b(e)}}}function nt(t){let e,n,r=t[11].label+"";return{c(){e=v("label"),k(e,"for",n=t[4]+"_checkbox"),k(e,"class","svelte-ddsc3z")},m(t,n){$(t,e,n),e.innerHTML=r},p(t,o){2048&o[0]&&r!==(r=t[11].label+"")&&(e.innerHTML=r),16&o[0]&&n!==(n=t[4]+"_checkbox")&&k(e,"for",n)},d(t){t&&b(e)}}}function rt(t){let e,n=t[11].verifying+"";return{c(){e=v("span")},m(t,r){$(t,e,r),e.innerHTML=n},p(t,r){2048&r[0]&&n!==(n=t[11].verifying+"")&&(e.innerHTML=n)},d(t){t&&b(e)}}}function ot(t){let e,n,r,o=t[11].verified+"";return{c(){e=v("span"),n=x(),r=v("input"),k(r,"type","hidden"),k(r,"name",t[4]),r.value=t[6]},m(t,i){$(t,e,i),e.innerHTML=o,$(t,n,i),$(t,r,i)},p(t,n){2048&n[0]&&o!==(o=t[11].verified+"")&&(e.innerHTML=o),16&n[0]&&k(r,"name",t[4]),64&n[0]&&(r.value=t[6])},d(t){t&&(b(e),b(n),b(r))}}}function it(t){let e,n,r,o,i,l,s;return{c(){e=v("div"),n=v("a"),r=y("svg"),o=y("path"),i=y("path"),l=y("path"),k(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"),k(o,"fill","currentColor"),k(i,"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"),k(i,"fill","currentColor"),k(l,"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"),k(l,"fill","currentColor"),k(r,"width","22"),k(r,"height","22"),k(r,"viewBox","0 0 20 20"),k(r,"fill","none"),k(r,"xmlns","http://www.w3.org/2000/svg"),k(n,"href",ht),k(n,"target","_blank"),k(n,"class","altcha-logo svelte-ddsc3z"),k(n,"aria-label",s=t[11].ariaLinkLabel)},m(t,s){$(t,e,s),p(e,n),p(n,r),p(r,o),p(r,i),p(r,l)},p(t,e){2048&e[0]&&s!==(s=t[11].ariaLinkLabel)&&k(n,"aria-label",s)},d(t){t&&b(e)}}}function lt(t){let e,n,r,o;function i(t,e){return t[7]===q.EXPIRED?at:st}let l=i(t),s=l(t);return{c(){e=v("div"),n=y("svg"),r=y("path"),o=x(),s.c(),k(r,"stroke-linecap","round"),k(r,"stroke-linejoin","round"),k(r,"d","M6 18L18 6M6 6l12 12"),k(n,"width","14"),k(n,"height","14"),k(n,"xmlns","http://www.w3.org/2000/svg"),k(n,"fill","none"),k(n,"viewBox","0 0 24 24"),k(n,"stroke-width","1.5"),k(n,"stroke","currentColor"),k(e,"class","altcha-error svelte-ddsc3z")},m(t,i){$(t,e,i),p(e,n),p(n,r),p(e,o),s.m(e,null)},p(t,n){l===(l=i(t))&&s?s.p(t,n):(s.d(1),s=l(t),s&&(s.c(),s.m(e,null)))},d(t){t&&b(e),s.d()}}}function st(t){let e,n=t[11].error+"";return{c(){e=v("div"),k(e,"title",t[5])},m(t,r){$(t,e,r),e.innerHTML=n},p(t,r){2048&r[0]&&n!==(n=t[11].error+"")&&(e.innerHTML=n),32&r[0]&&k(e,"title",t[5])},d(t){t&&b(e)}}}function at(t){let e,n=t[11].expired+"";return{c(){e=v("div"),k(e,"title",t[5])},m(t,r){$(t,e,r),e.innerHTML=n},p(t,r){2048&r[0]&&n!==(n=t[11].expired+"")&&(e.innerHTML=n),32&r[0]&&k(e,"title",t[5])},d(t){t&&b(e)}}}function ct(t){let e,n,r=t[11].footer+"";return{c(){e=v("div"),n=v("div"),k(n,"class","svelte-ddsc3z"),k(e,"class","altcha-footer svelte-ddsc3z")},m(t,o){$(t,e,o),p(e,n),n.innerHTML=r},p(t,e){2048&e[0]&&r!==(r=t[11].footer+"")&&(n.innerHTML=r)},d(t){t&&b(e)}}}function dt(t){let e;return{c(){e=v("div"),k(e,"class","altcha-anchor-arrow svelte-ddsc3z")},m(n,r){$(n,e,r),t[48](e)},p:a,d(n){n&&b(e),t[48](null)}}}function ut(t){let e,n,r,o,i,l,s,a,c,d,f,h,m,y,I,C,R;const L=t[46].default,z=function(t,e,n,r){if(t){const o=g(t,e,n,r);return t[0](o)}}(L,t,t[45],null);let V=t[7]===q.VERIFYING&&et();function G(t,e){return t[7]===q.VERIFIED?ot:t[7]===q.VERIFYING?rt:nt}let S=G(t),N=S(t),X=(!0!==t[3]||t[12])&&it(t),Z=(t[5]||t[7]===q.EXPIRED)&<(t),A=t[11].footer&&(!0!==t[2]||t[12])&&ct(t),Y=t[1]&&dt(t);return{c(){z&&z.c(),e=x(),n=v("div"),r=v("div"),V&&V.c(),o=x(),i=v("div"),l=v("input"),c=x(),d=v("div"),N.c(),f=x(),X&&X.c(),h=x(),Z&&Z.c(),m=x(),A&&A.c(),y=x(),Y&&Y.c(),k(l,"type","checkbox"),k(l,"id",s=t[4]+"_checkbox"),l.required=a="onsubmit"!==t[0]&&(!t[1]||"off"!==t[0]),k(l,"class","svelte-ddsc3z"),k(i,"class","altcha-checkbox svelte-ddsc3z"),E(i,"altcha-hidden",t[7]===q.VERIFYING),k(d,"class","altcha-label svelte-ddsc3z"),k(r,"class","altcha-main svelte-ddsc3z"),k(n,"class","altcha svelte-ddsc3z"),k(n,"data-state",t[7]),k(n,"data-floating",t[1])},m(s,a){z&&z.m(s,a),$(s,e,a),$(s,n,a),p(n,r),V&&V.m(r,null),p(r,o),p(r,i),p(i,l),l.checked=t[8],p(r,c),p(r,d),N.m(d,null),p(r,f),X&&X.m(r,null),p(n,h),Z&&Z.m(n,null),p(n,m),A&&A.m(n,null),p(n,y),Y&&Y.m(n,null),t[49](n),I=!0,C||(R=[w(l,"change",t[47]),w(l,"change",t[13]),w(l,"invalid",t[14])],C=!0)},p(t,e){z&&z.p&&(!I||16384&e[1])&&function(t,e,n,r,o,i){if(o){const l=g(e,n,r,i);t.p(l,o)}}(z,L,t,t[45],I?function(t,e,n,r){if(t[2]&&r){const o=t[2](r(n));if(void 0===e.dirty)return o;if("object"==typeof o){const t=[],n=Math.max(e.dirty.length,o.length);for(let r=0;r32){const e=[],n=t.ctx.length/32;for(let t=0;t{M.delete(t)})),t.o(e)}})(z,t),I=!1},d(r){r&&(b(e),b(n)),z&&z.d(r),V&&V.d(),N.d(),X&&X.d(),Z&&Z.d(),A&&A.d(),Y&&Y.d(),t[49](null),C=!1,u(R)}}}const ft="Visit Altcha.org",ht="https://altcha.org/";function gt(t){return JSON.parse(t)}function pt(t,e,n){var r,o;let i,l,s,a,{$$slots:c={},$$scope:d}=e,{auto:u}=e,{blockspam:f}=e,{challengeurl:h}=e,{challengejson:g}=e,{debug:p=!1}=e,{delay:m=0}=e,{expire:$}=e,{floating:b}=e,{floatinganchor:v}=e,{floatingoffset:y}=e,{hidefooter:x=!1}=e,{hidelogo:w=!1}=e,{name:k="altcha"}=e,{maxnumber:E=1e6}=e,{mockerror:I=!1}=e,{obfuscated:C}=e,{plugins:z}=e,{refetchonexpire:G=!0}=e,{spamfilter:S=!1}=e,{strings:X}=e,{test:A=!1}=e,{verifyurl:Y}=e,{workers:j=Math.min(16,navigator.hardwareConcurrency||8)}=e,{workerurl:W}=e;const F=L(),M=["SHA-256","SHA-384","SHA-512"],T=null==(o=null==(r=document.documentElement.lang)?void 0:r.split("-"))?void 0:o[0];let P,U=!1,_=null,H=null,J=null,B=null,K=null,tt=null,et=[],nt=q.UNVERIFIED;function rt(t,e){return btoa(JSON.stringify({algorithm:t.algorithm,challenge:t.challenge,number:e.number,salt:t.salt,signature:t.signature,test:!!A||void 0,took:e.took}))}function ot(){h&&G&&nt===q.VERIFIED?Gt():Lt(q.EXPIRED,a.expired)}async function it(){var t;if(I)throw lt("mocking error"),new Error("Mocked error.");if(l)return lt("using provided json data"),l;if(A)return lt("generating test challenge",{test:A}),async function(t,e="SHA-256",n=1e5){const r=Date.now().toString(16);return t||(t=Math.round(Math.random()*n)),{algorithm:e,challenge:await O(r,t,e),salt:r,signature:""}}("boolean"!=typeof A?+A:void 0);{if(!h&&J){const t=J.getAttribute("action");null!=t&&t.includes("/form/")&&n(15,h=t+"/altcha")}if(!h)throw new Error("Attribute challengeurl not set.");lt("fetching challenge from",h);const e=await fetch(h,{headers:S?{"x-altcha-spam-filter":"1"}:{}});if(200!==e.status)throw new Error(`Server responded with ${e.status}.`);const r=e.headers.get("Expires"),o=e.headers.get("X-Altcha-Config"),i=await e.json(),l=new URLSearchParams(null==(t=i.salt.split("?"))?void 0:t[1]),s=l.get("expires")||l.get("expire");if(s){const t=new Date(1e3*+s),e=isNaN(t.getTime())?0:t.getTime()-Date.now();e>0&&vt(e)}if(o)try{const t=JSON.parse(o);t&&"object"==typeof t&&(t.verifyurl&&(t.verifyurl=new URL(t.verifyurl,new URL(h)).toString()),Et(t))}catch(t){lt("unable to configure from X-Altcha-Config",t)}if(!$&&null!=r&&r.length){const t=Date.parse(r);if(t){const e=t-Date.now();e>0&&vt(e)}}return i}}function lt(...t){(p||t.some((t=>t instanceof Error)))&&console[t[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${k}]`,...t)}function st(t){const e=t.target;b&&e&&!P.contains(e)&&(nt===q.VERIFIED||"off"===u&&nt===q.UNVERIFIED)&&n(9,P.style.display="none",P)}function at(){b&&nt!==q.UNVERIFIED&&$t()}function ct(t){nt===q.UNVERIFIED&&Gt()}function dt(t){J&&"onsubmit"===u?nt===q.UNVERIFIED?(t.preventDefault(),t.stopPropagation(),Gt().then((()=>{null==J||J.requestSubmit()}))):nt!==q.VERIFIED&&(t.preventDefault(),t.stopPropagation(),nt===q.VERIFYING&&pt()):J&&b&&"off"===u&&nt===q.UNVERIFIED&&(t.preventDefault(),t.stopPropagation(),n(9,P.style.display="block",P),$t())}function ut(){Lt()}function pt(){nt===q.VERIFYING&&a.waitAlert&&alert(a.waitAlert)}function mt(){b&&$t()}function $t(t=20){if(P)if(H||(H=(v?document.querySelector(v):null==J?void 0:J.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||J),H){const e=parseInt(y,10)||12,r=H.getBoundingClientRect(),o=P.getBoundingClientRect(),i=document.documentElement.clientHeight,l=document.documentElement.clientWidth,s="auto"===b?r.bottom+o.height+e+t>i:"top"===b,a=Math.max(t,Math.min(l-t-o.width,r.left+r.width/2-o.width/2));if(n(9,P.style.top=s?r.top-(o.height+e)+"px":`${r.bottom+e}px`,P),n(9,P.style.left=`${a}px`,P),P.setAttribute("data-floating",s?"top":"bottom"),_){const t=_.getBoundingClientRect();n(10,_.style.left=r.left-a+r.width/2-t.width/2+"px",_)}}else lt("unable to find floating anchor element")}async function bt(t){if(!Y)throw new Error("Attribute verifyurl not set.");lt("requesting server verification from",Y);const e={payload:t};if(S){const{blockedCountries:t,classifier:n,disableRules:r,email:o,expectedLanguages:i,expectedCountries:l,fields:s,ipAddress:a,text:c,timeZone:d}="ipAddress"===S?{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}:"object"==typeof S?S:{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};e.blockedCountries=t,e.classifier=n,e.disableRules=r,e.email=!1===o?void 0:function(t){var e;const n=null==J?void 0:J.querySelector("string"==typeof t?`input[name="${t}"]`:'input[type="email"]:not([data-no-spamfilter])');return(null==(e=null==n?void 0:n.value)?void 0:e.slice(n.value.indexOf("@")))||void 0}(o),e.expectedCountries=l,e.expectedLanguages=i||(T?[T]:void 0),e.fields=!1===s?void 0:function(t){return[...(null==J?void 0:J.querySelectorAll(null!=t&&t.length?t.map((t=>`input[name="${t}"]`)).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce(((t,e)=>{const n=e.name,r=e.value;return n&&r&&(t[n]=/\n/.test(r)?r.replace(new RegExp("(?{const i=n*o;return new Promise((n=>{e.addEventListener("message",(t=>{if(t.data)for(const t of r)t!==e&&t.postMessage({type:"abort"});n(t.data)})),e.postMessage({payload:t,max:i+o,start:i,type:"work"})}))})));for(const t of r)t.terminate();return i.find((t=>!!t))||null}(t,t.maxnumber)}catch(t){lt(t)}if(void 0!==(null==e?void 0:e.number)||"obfuscated"in t)return{data:t,solution:e}}if("obfuscated"in t){const e=await Q(t.obfuscated,t.key,t.maxnumber);return{data:t,solution:await e.promise}}return{data:t,solution:await D(t.challenge,t.salt,t.algorithm,t.maxnumber||E).promise}}async function kt(){if(!C)return void n(7,nt=q.ERROR);const t=et.find((t=>"obfuscation"===t.constructor.pluginName));return t&&"clarify"in t?"clarify"in t&&"function"==typeof t.clarify?t.clarify():void 0:(n(7,nt=q.ERROR),void lt("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it."))}function Et(t){void 0!==t.obfuscated&&n(24,C=t.obfuscated),void 0!==t.auto&&(n(0,u=t.auto),"onload"===u&&(C?kt():Gt())),void 0!==t.blockspam&&n(16,f=!!t.blockspam),void 0!==t.floatinganchor&&n(20,v=t.floatinganchor),void 0!==t.delay&&n(18,m=t.delay),void 0!==t.floatingoffset&&n(21,y=t.floatingoffset),void 0!==t.floating&&yt(t.floating),void 0!==t.expire&&(vt(t.expire),n(19,$=t.expire)),t.challenge&&(xt(t.challenge),l=t.challenge),void 0!==t.challengeurl&&n(15,h=t.challengeurl),void 0!==t.debug&&n(17,p=!!t.debug),void 0!==t.hidefooter&&n(2,x=!!t.hidefooter),void 0!==t.hidelogo&&n(3,w=!!t.hidelogo),void 0!==t.maxnumber&&n(22,E=+t.maxnumber),void 0!==t.mockerror&&n(23,I=!!t.mockerror),void 0!==t.name&&n(4,k=t.name),void 0!==t.refetchonexpire&&n(25,G=!!t.refetchonexpire),void 0!==t.spamfilter&&n(26,S="object"==typeof t.spamfilter?t.spamfilter:!!t.spamfilter),t.strings&&n(44,s=t.strings),void 0!==t.test&&n(27,A="number"==typeof t.test?t.test:!!t.test),void 0!==t.verifyurl&&n(28,Y=t.verifyurl),void 0!==t.workers&&n(29,j=+t.workers),void 0!==t.workerurl&&n(30,W=t.workerurl)}function It(){return{auto:u,blockspam:f,challengeurl:h,debug:p,delay:m,expire:$,floating:b,floatinganchor:v,floatingoffset:y,hidefooter:x,hidelogo:w,name:k,maxnumber:E,mockerror:I,obfuscated:C,refetchonexpire:G,spamfilter:S,strings:a,test:A,verifyurl:Y,workers:j,workerurl:W}}function Ct(){return H}function Rt(){return nt}function Lt(t=q.UNVERIFIED,e=null){K&&(clearTimeout(K),K=null),n(8,U=!1),n(5,B=e),n(6,tt=null),n(7,nt=t)}function zt(t){H=t}function Vt(t,e=null){n(7,nt=t),n(5,B=e)}async function Gt(){return Lt(q.VERIFYING),await new Promise((t=>setTimeout(t,m||0))),it().then((t=>(xt(t),lt("challenge",t),wt(t)))).then((({data:t,solution:e})=>{if(lt("solution",e),"challenge"in t&&e&&!("clearText"in e)){if(void 0===(null==e?void 0:e.number))throw lt("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.");if(Y)return bt(rt(t,e));n(6,tt=rt(t,e)),lt("payload",tt)}})).then((()=>{n(7,nt=q.VERIFIED),lt("verified"),(Z(),N).then((()=>{F("verified",{payload:tt})}))})).catch((t=>{lt(t),n(7,nt=q.ERROR),n(5,B=t.message)}))}return function(t){R().$$.on_destroy.push(t)}((()=>{(function(){for(const t of et)t.destroy()})(),J&&(J.removeEventListener("submit",dt),J.removeEventListener("reset",ut),J.removeEventListener("focusin",ct),J=null),K&&(clearTimeout(K),K=null),document.removeEventListener("click",st),document.removeEventListener("scroll",at),window.removeEventListener("resize",mt)})),function(t){R().$$.on_mount.push(t)}((()=>{lt("mounted","1.0.7"),lt("workers",j),function(){const t=void 0!==z?z.split(","):void 0;for(const e of globalThis.altchaPlugins)(!t||t.includes(e.pluginName))&&et.push(new e({el:P,clarify:kt,dispatch:F,getConfiguration:It,getFloatingAnchor:Ct,getState:Rt,log:lt,reset:Lt,solve:wt,setState:Vt,setFloatingAnchor:zt,verify:Gt}))}(),lt("plugins",et.length?et.map((t=>t.constructor.pluginName)).join(", "):"none"),A&<("using test mode"),$&&vt($),void 0!==u&<("auto",u),void 0!==b&&yt(b),J=P.closest("form"),J&&(J.addEventListener("submit",dt,{capture:!0}),J.addEventListener("reset",ut),"onfocus"===u&&J.addEventListener("focusin",ct)),"onload"===u&&(C?kt():Gt()),i&&(x||w)&<("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame((()=>{F("load")}))})),t.$$set=t=>{"auto"in t&&n(0,u=t.auto),"blockspam"in t&&n(16,f=t.blockspam),"challengeurl"in t&&n(15,h=t.challengeurl),"challengejson"in t&&n(31,g=t.challengejson),"debug"in t&&n(17,p=t.debug),"delay"in t&&n(18,m=t.delay),"expire"in t&&n(19,$=t.expire),"floating"in t&&n(1,b=t.floating),"floatinganchor"in t&&n(20,v=t.floatinganchor),"floatingoffset"in t&&n(21,y=t.floatingoffset),"hidefooter"in t&&n(2,x=t.hidefooter),"hidelogo"in t&&n(3,w=t.hidelogo),"name"in t&&n(4,k=t.name),"maxnumber"in t&&n(22,E=t.maxnumber),"mockerror"in t&&n(23,I=t.mockerror),"obfuscated"in t&&n(24,C=t.obfuscated),"plugins"in t&&n(32,z=t.plugins),"refetchonexpire"in t&&n(25,G=t.refetchonexpire),"spamfilter"in t&&n(26,S=t.spamfilter),"strings"in t&&n(33,X=t.strings),"test"in t&&n(27,A=t.test),"verifyurl"in t&&n(28,Y=t.verifyurl),"workers"in t&&n(29,j=t.workers),"workerurl"in t&&n(30,W=t.workerurl),"$$scope"in t&&n(45,d=t.$$scope)},t.$$.update=()=>{32768&t.$$.dirty[0]|1&t.$$.dirty[1]&&n(12,i=g&&new URL(g,location.origin).host.endsWith(".altcha.org")&&!(null==h||!h.includes("apiKey=ckey_"))),1&t.$$.dirty[1]&&(l=g?gt(g):void 0),4&t.$$.dirty[1]&&n(44,s=X?gt(X):{}),8192&t.$$.dirty[1]&&n(11,a={ariaLinkLabel:ft,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.",...s}),192&t.$$.dirty[0]&&F("statechange",{payload:tt,state:nt}),32&t.$$.dirty[0]&&function(){for(const t of et)"function"==typeof t.onErrorChange&&t.onErrorChange(B)}(),128&t.$$.dirty[0]&&function(){for(const t of et)"function"==typeof t.onStateChange&&t.onStateChange(nt);b&&nt!==q.UNVERIFIED&&requestAnimationFrame((()=>{$t()})),n(8,U=nt===q.VERIFIED)}()},[u,b,x,w,k,B,tt,nt,U,P,_,a,i,function(){[q.UNVERIFIED,q.ERROR,q.EXPIRED].includes(nt)?S&&!1===(null==J?void 0:J.reportValidity())?n(8,U=!1):C?kt():Gt():n(8,U=!0)},pt,h,f,p,m,$,v,y,E,I,C,G,S,A,Y,j,W,g,z,X,kt,Et,It,Ct,function(t){return et.find((e=>e.constructor.pluginName===t))},Rt,Lt,zt,Vt,Gt,s,d,c,function(){U=this.checked,n(8,U)},function(t){V[t?"unshift":"push"]((()=>{_=t,n(10,_)}))},function(t){V[t?"unshift":"push"]((()=>{P=t,n(9,P)}))}]}customElements.define("altcha-widget",function(t,e,n,r,o){let i=class extends T{constructor(){super(t,n,o),this.$$p_d=e}static get observedAttributes(){return Object.keys(e).map((t=>(e[t].attribute||t).toLowerCase()))}};return Object.keys(e).forEach((t=>{Object.defineProperty(i.prototype,t,{get(){return this.$$c&&t in this.$$c?this.$$c[t]:this.$$d[t]},set(n){var r;n=H(t,n,e),this.$$d[t]=n,null==(r=this.$$c)||r.$set({[t]:n})}})})),r.forEach((t=>{Object.defineProperty(i.prototype,t,{get(){var e;return null==(e=this.$$c)?void 0:e[t]}})})),t.element=i,i}(class extends J{constructor(t){super(),_(this,t,pt,ut,h,{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},tt,[-1,-1,-1])}get auto(){return this.$$.ctx[0]}set auto(t){this.$$set({auto:t}),W()}get blockspam(){return this.$$.ctx[16]}set blockspam(t){this.$$set({blockspam:t}),W()}get challengeurl(){return this.$$.ctx[15]}set challengeurl(t){this.$$set({challengeurl:t}),W()}get challengejson(){return this.$$.ctx[31]}set challengejson(t){this.$$set({challengejson:t}),W()}get debug(){return this.$$.ctx[17]}set debug(t){this.$$set({debug:t}),W()}get delay(){return this.$$.ctx[18]}set delay(t){this.$$set({delay:t}),W()}get expire(){return this.$$.ctx[19]}set expire(t){this.$$set({expire:t}),W()}get floating(){return this.$$.ctx[1]}set floating(t){this.$$set({floating:t}),W()}get floatinganchor(){return this.$$.ctx[20]}set floatinganchor(t){this.$$set({floatinganchor:t}),W()}get floatingoffset(){return this.$$.ctx[21]}set floatingoffset(t){this.$$set({floatingoffset:t}),W()}get hidefooter(){return this.$$.ctx[2]}set hidefooter(t){this.$$set({hidefooter:t}),W()}get hidelogo(){return this.$$.ctx[3]}set hidelogo(t){this.$$set({hidelogo:t}),W()}get name(){return this.$$.ctx[4]}set name(t){this.$$set({name:t}),W()}get maxnumber(){return this.$$.ctx[22]}set maxnumber(t){this.$$set({maxnumber:t}),W()}get mockerror(){return this.$$.ctx[23]}set mockerror(t){this.$$set({mockerror:t}),W()}get obfuscated(){return this.$$.ctx[24]}set obfuscated(t){this.$$set({obfuscated:t}),W()}get plugins(){return this.$$.ctx[32]}set plugins(t){this.$$set({plugins:t}),W()}get refetchonexpire(){return this.$$.ctx[25]}set refetchonexpire(t){this.$$set({refetchonexpire:t}),W()}get spamfilter(){return this.$$.ctx[26]}set spamfilter(t){this.$$set({spamfilter:t}),W()}get strings(){return this.$$.ctx[33]}set strings(t){this.$$set({strings:t}),W()}get test(){return this.$$.ctx[27]}set test(t){this.$$set({test:t}),W()}get verifyurl(){return this.$$.ctx[28]}set verifyurl(t){this.$$set({verifyurl:t}),W()}get workers(){return this.$$.ctx[29]}set workers(t){this.$$set({workers:t}),W()}get workerurl(){return this.$$.ctx[30]}set workerurl(t){this.$$set({workerurl:t}),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]}},{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=t=>t?new Worker(new URL(t)):new s,globalThis.altchaPlugins=globalThis.altchaPlugins||[],window.Altcha=e.default})(); \ No newline at end of file +(()=>{"use strict";var e={r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t);var n=Object.defineProperty,r=e=>{throw TypeError(e)},o=(e,t,r)=>((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=(e,t,n)=>t.has(e)||r("Cannot "+n),i=(e,t,n)=>(l(e,t,"read from private field"),n?n.call(e):t.get(e)),a=(e,t,n)=>t.has(e)?r("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),s=(e,t,n,r)=>(l(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);const u="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGQ9bmV3IFRleHRFbmNvZGVyO2Z1bmN0aW9uIHAoZSl7cmV0dXJuWy4uLm5ldyBVaW50OEFycmF5KGUpXS5tYXAodD0+dC50b1N0cmluZygxNikucGFkU3RhcnQoMiwiMCIpKS5qb2luKCIiKX1hc3luYyBmdW5jdGlvbiBiKGUsdCxyKXtpZih0eXBlb2YgY3J5cHRvPiJ1Inx8ISgic3VidGxlImluIGNyeXB0byl8fCEoImRpZ2VzdCJpbiBjcnlwdG8uc3VidGxlKSl0aHJvdyBuZXcgRXJyb3IoIldlYiBDcnlwdG8gaXMgbm90IGF2YWlsYWJsZS4gU2VjdXJlIGNvbnRleHQgaXMgcmVxdWlyZWQgKGh0dHBzOi8vZGV2ZWxvcGVyLm1vemlsbGEub3JnL2VuLVVTL2RvY3MvV2ViL1NlY3VyaXR5L1NlY3VyZV9Db250ZXh0cykuIik7cmV0dXJuIHAoYXdhaXQgY3J5cHRvLnN1YnRsZS5kaWdlc3Qoci50b1VwcGVyQ2FzZSgpLGQuZW5jb2RlKGUrdCkpKX1mdW5jdGlvbiB3KGUsdCxyPSJTSEEtMjU2IixuPTFlNixzPTApe2NvbnN0IG89bmV3IEFib3J0Q29udHJvbGxlcixhPURhdGUubm93KCk7cmV0dXJue3Byb21pc2U6KGFzeW5jKCk9Pntmb3IobGV0IGM9cztjPD1uO2MrPTEpe2lmKG8uc2lnbmFsLmFib3J0ZWQpcmV0dXJuIG51bGw7aWYoYXdhaXQgYih0LGMscik9PT1lKXJldHVybntudW1iZXI6Yyx0b29rOkRhdGUubm93KCktYX19cmV0dXJuIG51bGx9KSgpLGNvbnRyb2xsZXI6b319ZnVuY3Rpb24gaChlKXtjb25zdCB0PWF0b2IoZSkscj1uZXcgVWludDhBcnJheSh0Lmxlbmd0aCk7Zm9yKGxldCBuPTA7bjx0Lmxlbmd0aDtuKyspcltuXT10LmNoYXJDb2RlQXQobik7cmV0dXJuIHJ9ZnVuY3Rpb24gZyhlLHQ9MTIpe2NvbnN0IHI9bmV3IFVpbnQ4QXJyYXkodCk7Zm9yKGxldCBuPTA7bjx0O24rKylyW25dPWUlMjU2LGU9TWF0aC5mbG9vcihlLzI1Nik7cmV0dXJuIHJ9YXN5bmMgZnVuY3Rpb24gbShlLHQ9IiIscj0xZTYsbj0wKXtjb25zdCBzPSJBRVMtR0NNIixvPW5ldyBBYm9ydENvbnRyb2xsZXIsYT1EYXRlLm5vdygpLGw9YXN5bmMoKT0+e2ZvcihsZXQgdT1uO3U8PXI7dSs9MSl7aWYoby5zaWduYWwuYWJvcnRlZHx8IWN8fCF5KXJldHVybiBudWxsO3RyeXtjb25zdCBmPWF3YWl0IGNyeXB0by5zdWJ0bGUuZGVjcnlwdCh7bmFtZTpzLGl2OmcodSl9LGMseSk7aWYoZilyZXR1cm57Y2xlYXJUZXh0Om5ldyBUZXh0RGVjb2RlcigpLmRlY29kZShmKSx0b29rOkRhdGUubm93KCktYX19Y2F0Y2h7fX1yZXR1cm4gbnVsbH07bGV0IGM9bnVsbCx5PW51bGw7dHJ5e3k9aChlKTtjb25zdCB1PWF3YWl0IGNyeXB0by5zdWJ0bGUuZGlnZXN0KCJTSEEtMjU2IixkLmVuY29kZSh0KSk7Yz1hd2FpdCBjcnlwdG8uc3VidGxlLmltcG9ydEtleSgicmF3Iix1LHMsITEsWyJkZWNyeXB0Il0pfWNhdGNoe3JldHVybntwcm9taXNlOlByb21pc2UucmVqZWN0KCksY29udHJvbGxlcjpvfX1yZXR1cm57cHJvbWlzZTpsKCksY29udHJvbGxlcjpvfX1sZXQgaTtvbm1lc3NhZ2U9YXN5bmMgZT0+e2NvbnN0e3R5cGU6dCxwYXlsb2FkOnIsc3RhcnQ6bixtYXg6c309ZS5kYXRhO2xldCBvPW51bGw7aWYodD09PSJhYm9ydCIpaT09bnVsbHx8aS5hYm9ydCgpLGk9dm9pZCAwO2Vsc2UgaWYodD09PSJ3b3JrIil7aWYoIm9iZnVzY2F0ZWQiaW4gcil7Y29uc3R7a2V5OmEsb2JmdXNjYXRlZDpsfT1yfHx7fTtvPWF3YWl0IG0obCxhLHMsbil9ZWxzZXtjb25zdHthbGdvcml0aG06YSxjaGFsbGVuZ2U6bCxzYWx0OmN9PXJ8fHt9O289dyhsLGMsYSxzLG4pfWk9by5jb250cm9sbGVyLG8ucHJvbWlzZS50aGVuKGE9PntzZWxmLnBvc3RNZXNzYWdlKGEmJnsuLi5hLHdvcmtlcjohMH0pfSl9fX0pKCk7Cg==",c=typeof self<"u"&&self.Blob&&new Blob([(d=u,Uint8Array.from(atob(d),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var d;function f(e){let t;try{if(t=c&&(self.URL||self.webkitURL).createObjectURL(c),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(t)})),n}catch{return new Worker("data:text/javascript;base64,"+u,{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add("5");const v={},h=Symbol();var p=Array.isArray,g=Array.from,m=Object.keys,b=Object.defineProperty,y=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyDescriptors,$=Object.prototype,x=Array.prototype,E=Object.getPrototypeOf;function k(e){for(var t=0;t=p.v&&O(p,g+1)}ee(a)}return!0},ownKeys(e){Ct(a);var t=Reflect.ownKeys(e).filter((e=>{var t=l.get(e);return void 0===t||t.v!==h}));for(var[n,r]of l)r.v!==h&&!(n in e)&&t.push(n);return t},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}function ee(e,t=1){O(e,e.v+t)}var te,ne,re;function oe(){if(void 0===te){te=window;var e=Element.prototype,t=Node.prototype;ne=y(t,"firstChild").get,re=y(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function le(e=""){return document.createTextNode(e)}function ie(e){return ne.call(e)}function ae(e){return re.call(e)}function se(e,t){if(!J)return ie(e);var n=ie(D);return null===n&&(n=D.appendChild(le())),H(n),n}function ue(e,t){if(!J){var n=ie(e);return n instanceof Comment&&""===n.data?ae(n):n}return D}function ce(e,t=1,n=!1){let r=J?D:e;for(var o;t--;)o=r,r=ae(r);if(!J)return r;var l=null==r?void 0:r.nodeType;if(n&&3!==l){var i=le();return null===r?null==o||o.after(i):r.before(i),H(i),i}return H(r),r}function de(e){var t=2050;null===nt?t|=R:nt.f|=G;var n=null!==et&&2&et.f?et:null;const r={children:null,ctx:ct,deps:null,equals:P,f:t,fn:e,reactions:null,v:null,version:0,parent:n??nt};return null!==n&&(n.children??(n.children=[])).push(r),r}function fe(e){var t=e.children;if(null!==t){e.children=null;for(var n=0;n{Ie(t)}}function we(e){return me(4,e,!1)}function $e(e){return me(8,e,!0)}function xe(e){return Ee(e)}function Ee(e,t=0){return me(24|t,e,!0)}function ke(e,t=!0){return me(40,e,!0,t)}function Ce(e){var t=e.teardown;if(null!==t){const e=Be,n=et;Ke(!0),tt(null);try{t.call(null)}finally{Ke(e),tt(n)}}}function Re(e){var t=e.deriveds;if(null!==t){e.deriveds=null;for(var n=0;n0){var r=()=>--n||t();for(var o of e)o.out(r)}else t()}(n,(()=>{Ie(e),t&&t()}))}function Se(e,t,n){if(!(e.f&S)){if(e.f^=S,null!==e.transitions)for(const r of e.transitions)(r.is_global||n)&&t.push(r);for(var r=e.first;null!==r;){var o=r.next;Se(r,t,!!(!!(r.f&V)||!!(r.f&C))&&n),r=o}}}function ze(e){Ve(e,!0)}function Ve(e,t){if(e.f&S){ft(e)&&mt(e),e.f^=S;for(var n=e.first;null!==n;){var r=n.next;Ve(n,!!(!!(n.f&V)||!!(n.f&C))&&t),n=r}if(null!==e.transitions)for(const n of e.transitions)(n.is_global||t)&&n.in()}}const Ge=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Xe=!1,Ae=!1,Ze=[],Pe=[];function We(){Xe=!1;const e=Ze.slice();Ze=[],k(e)}function Ye(){Ae=!1;const e=Pe.slice();Pe=[],k(e)}function je(e){Xe||(Xe=!0,queueMicrotask(We)),Ze.push(e)}function Me(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}const Te=0;let Oe=!1,Fe=Te,Ue=!1,De=null,Je=!1,Be=!1;function He(e){Je=e}function Ke(e){Be=e}let qe=[],Qe=0,et=null;function tt(e){et=e}let nt=null;function rt(e){nt=e}let ot=null;let lt=null,it=0,at=null;let st=0,ut=!1,ct=null;function dt(){return++st}function ft(e){var t,n,r=e.f;if(r&L)return!0;if(r&N){var o=e.deps,l=!!(r&R);if(null!==o){var i;if(r&_){for(i=0;ie.version)return!0}}l||It(e,I)}return!1}function vt(e,t,n,r){if(Oe){if(null===n&&(Oe=!1),function(e){return!(e.f&z||null!==e.parent&&128&e.parent.f)}(t))throw e}else null!==n&&(Oe=!0),function(e,t){for(var n=t;null!==n;){if(128&n.f)try{return void n.fn(e)}catch{n.f^=128}n=n.parent}throw Oe=!1,e}(e,t)}function ht(e){var t,n=lt,r=it,o=at,l=et,i=ut,a=ot,s=ct,u=e.f;lt=null,it=0,at=null,et=96&u?null:e,ut=!Je&&!!(u&R),ot=null,ct=e.ctx;try{var c=(0,e.fn)(),d=e.deps;if(null!==lt){var f;if(gt(e,it),null!==d&&it>0)for(d.length=it+lt.length,f=0;f1e3){Qe=0;try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(e){if(null===De)throw e;vt(e,De,null)}}Qe++}function yt(e){var t=e.length;if(0!==t){bt();var n=Je;Je=!0;try{for(var r=0;r1001)return;const e=qe;qe=[],yt(e),Ue||(Qe=0,De=null)}function xt(e){Fe===Te&&(Ue||(Ue=!0,queueMicrotask($t))),De=e;for(var t=e;null!==t.parent;){var n=(t=t.parent).f;if(96&n){if(!(n&I))return;t.f^=I}}qe.push(t)}function Et(e,t){var n=e.first,r=[];e:for(;null!==n;){var o=n.f,l=!!(o&C),i=l&&!!(o&I),a=n.next;if(!(i||o&S))if(8&o){if(l)n.f^=I;else try{ft(n)&&mt(n)}catch(e){vt(e,n,null,n.ctx)}var s=n.first;if(null!==s){n=s;continue}}else 4&o&&r.push(n);if(null===a){let t=n.parent;for(;null!==t;){if(e===t)break e;var u=t.next;if(null!==u){n=u;continue e}t=t.parent}}n=a}for(var c=0;c0||t.length>0)&&kt(),Qe=0,De=null,r}finally{Fe=t,qe=n}}function Ct(e){var t,n=e.f,r=!!(2&n);if(r&&n&z){var o=ve(e);return pe(e),o}if(null!==et){null!==ot&&ot.includes(e)&&function(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}();var l=et.deps;null===lt&&null!==l&&l[it]===e?it++:null===lt?lt=[e]:lt.push(e),null!==at&&null!==nt&&nt.f&I&&!(nt.f&C)&&at.includes(e)&&(It(nt,L),xt(nt))}else if(r&&null===e.deps)for(var i=e,a=i.parent,s=i;null!==a;){if(!(2&a.f)){var u=a;null!=(t=u.deriveds)&&t.includes(s)||(u.deriveds??(u.deriveds=[])).push(s);break}s=a,a=a.parent}return r&&(ft(i=e)&&he(i)),e.v}function Rt(e){const t=et;try{return et=null,e()}finally{et=t}}const _t=-7169;function It(e,t){e.f=e.f&_t|t}function Lt(e,t=!1,n){ct={p:ct,c:null,e:null,m:!1,s:e,x:null,l:null}}function Nt(e){const t=ct;if(null!==t){void 0!==e&&(t.x=e);const i=t.e;if(null!==i){var n=nt,r=et;t.e=null;try{for(var o=0;o{Promise.resolve().then((()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)null==(t=n.__on_r)||t.call(n)}))}),{capture:!0}))}function Vt(e){var t=et,n=nt;tt(null),rt(null);try{return e()}finally{tt(t),rt(n)}}const Gt=new Set,Xt=new Set;function At(e,t,n,r,o){var l={capture:r,passive:o},i=function(e,t,n,r){function o(e){if(r.capture||Zt.call(t,e),!e.cancelBubble)return Vt((()=>n.call(this,e)))}return e.startsWith("pointer")||e.startsWith("touch")||"wheel"===e?je((()=>{t.addEventListener(e,o,r)})):t.addEventListener(e,o,r),o}(e,t,n,l);(t===document.body||t===window||t===document)&&function(e){const t=me(8,null,!1);It(t,I),t.teardown=e}((()=>{t.removeEventListener(e,i,l)}))}function Zt(e){var t,n=this,r=n.ownerDocument,o=e.type,l=(null==(t=e.composedPath)?void 0:t.call(e))||[],i=l[0]||e.target,a=0,s=e.__root;if(s){var u=l.indexOf(s);if(-1!==u&&(n===document||n===window))return void(e.__root=n);var c=l.indexOf(n);if(-1===c)return;u<=c&&(a=u)}if((i=l[a]||e.target)!==n){b(e,"currentTarget",{configurable:!0,get:()=>i||r});var d=et,f=nt;tt(null),rt(null);try{for(var v,h=[];null!==i;){var g=i.assignedSlot||i.parentNode||i.host||null;try{var m=i["__"+o];if(void 0!==m&&!i.disabled)if(p(m)){var[y,...w]=m;y.apply(i,[e,...w])}else m.call(i,e)}catch(e){v?h.push(e):v=e}if(e.cancelBubble||g===n||null===g)break;i=g}if(v){for(let e of h)queueMicrotask((()=>{throw e}));throw v}}finally{e.__root=n,delete e.currentTarget,tt(d),rt(f)}}}function Pt(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Wt(e,t){var n=nt;null===n.nodes_start&&(n.nodes_start=e,n.nodes_end=t)}function Yt(e,t){var n,r=!!(1&t),o=!!(2&t),l=!e.startsWith("");return()=>{if(J)return Wt(D,null),D;void 0===n&&(n=Pt(l?e:""+e),r||(n=ie(n)));var t=o?document.importNode(n,!0):n.cloneNode(!0);r?Wt(ie(t),t.lastChild):Wt(t,t);return t}}function jt(e,t){if(J)return nt.nodes_end=D,void K();null!==e&&e.before(t)}const Mt=["touchstart","touchmove"];function Tt(e){return Mt.includes(e)}function Ot(e,t){return Dt(e,t)}function Ft(e,t){oe(),t.intro=t.intro??!1;const n=t.target,r=J,o=D;try{for(var l=ie(n);l&&(8!==l.nodeType||"["!==l.data);)l=ae(l);if(!l)throw v;B(!0),H(l),K();const r=Dt(e,{...t,anchor:l});if(null===D||8!==D.nodeType||"]"!==D.data)throw U(),v;return B(!1),r}catch(r){if(r===v)return!1===t.recover&&function(){throw new Error("https://svelte.dev/e/hydration_failed")}(),oe(),function(e){e.textContent=""}(n),B(!1),Ot(e,t);throw r}finally{B(r),H(o)}}const Ut=new Map;function Dt(e,{target:t,anchor:n,props:r={},events:o,context:l,intro:i=!0}){oe();var a=new Set,s=e=>{for(var n=0;n{var i=n??t.appendChild(le());return ke((()=>{l&&(Lt({}),ct.c=l);o&&(r.$$events=o),J&&Wt(i,null),u=e(i,r)||{},J&&(nt.nodes_end=D),l&&Nt()})),()=>{var e;for(var r of a){t.removeEventListener(r,Zt);var o=Ut.get(r);0==--o?(document.removeEventListener(r,Zt),Ut.delete(r)):Ut.set(r,o)}Xt.delete(s),Jt.delete(u),i!==n&&(null==(e=i.parentNode)||e.removeChild(i))}}));return Jt.set(u,c),u}let Jt=new WeakMap;function Bt(e,t,n=!1){J&&K();var r=e,o=null,l=null,i=h,a=!1;const s=(e,t=!0)=>{a=!0,u(t,e)},u=(e,t)=>{if(i===(i=e))return;let n=!1;if(J){const e="[!"===r.data;!!i===e&&(r=function(){for(var e=0,t=D;;){if(8===t.nodeType){var n=t.data;if("]"===n){if(0===e)return t;e-=1}else("["===n||"[!"===n)&&(e+=1)}var r=ae(t);t.remove(),t=r}}(),H(r),B(!1),n=!0)}i?(o?ze(o):t&&(o=ke((()=>t(r)))),l&&Ne(l,(()=>{l=null}))):(l?ze(l):t&&(l=ke((()=>t(r)))),o&&Ne(o,(()=>{o=null}))),n&&B(!0)};Ee((()=>{a=!1,t(s),a||u(null,null)}),n?V:0),J&&(r=D)}function Ht(e,t,n,r,o){var l,i=e,a="";Ee((()=>{a!==(a=t()??"")?(void 0!==l&&(Ie(l),l=void 0),""!==a&&(l=ke((()=>{if(J){D.data;for(var e=K(),t=e;null!==e&&(8!==e.nodeType||""!==e.data);)t=e,e=ae(e);if(null===e)throw U(),v;return Wt(D,t),void(i=H(e))}var n=Pt(a+"");Wt(ie(n),n.lastChild),i.before(n)})))):J&&K()}))}function Kt(e){if(J){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var n=e.value;qt(e,"value",null),e.value=n}if(e.hasAttribute("checked")){var r=e.checked;qt(e,"checked",null),e.checked=r}}};e.__on_r=n,function(e){Ae||(Ae=!0,Ge(Ye)),Pe.push(e)}(n),zt()}}function qt(e,t,n,r){var o=e.__attributes??(e.__attributes={});J&&(o[t]=e.getAttribute(t),"src"===t||"srcset"===t||"href"===t&&"LINK"===e.nodeName)||o[t]!==(o[t]=n)&&("style"===t&&"__styles"in e&&(e.__styles={}),"loading"===t&&(e[Z]=n),null==n?e.removeAttribute(t):"string"!=typeof n&&function(e){var t=Qt.get(e.nodeName);if(t)return t;Qt.set(e.nodeName,t=[]);for(var n,r=E(e),o=Element.prototype;o!==r;){for(var l in n=w(r))n[l].set&&t.push(l);r=E(r)}return t}(e).includes(t)?e[t]=n:e.setAttribute(t,n))}var Qt=new Map;function en(e,t,n=t){(function(e,t,n,r=n){e.addEventListener(t,(()=>Vt(n)));const o=e.__on_r;e.__on_r=o?()=>{o(),r(!0)}:()=>r(!0),zt()})(e,"change",(t=>{var r=t?e.defaultChecked:e.checked;n(r)})),(J&&e.defaultChecked!==e.checked||null==Rt(t))&&n(e.checked),$e((()=>{var n=t();e.checked=!!n}))}function tn(e,t){return e===t||(null==e?void 0:e[X])===t}function nn(e={},t,n,r){return we((()=>{var r,o;return $e((()=>{r=o,o=[],Rt((()=>{e!==n(...o)&&(t(e,...o),r&&tn(n(...r),e)&&t(null,...r))}))})),()=>{je((()=>{o&&tn(n(...o),e)&&t(null,...o)}))}})),e}function rn(e){null===ct&&Me(),be((()=>{const t=Rt(e);if("function"==typeof t)return t}))}let on=!1;function ln(e,t,n,r){var o,l,i=!!(1&n),a=!!(8&n),s=!!(16&n),u=!1;a?[l,u]=function(e){var t=on;try{return on=!1,[e(),on]}finally{on=t}}((()=>e[t])):l=e[t];var c,d=X in e||A in e,f=(null==(o=y(e,t))?void 0:o.set)??(d&&a&&t in e?n=>e[t]=n:void 0),v=r,h=!0,p=!1,g=()=>(p=!0,h&&(h=!1,v=s?Rt(r):r),v);if(void 0===l&&void 0!==r&&(f&&function(){throw new Error("https://svelte.dev/e/props_invalid_value")}(),l=g(),f&&f(l)),c=()=>{var n=e[t];return void 0===n?g():(h=!0,p=!1,n)},!(4&n))return c;if(f){var m=e.$$legacy;return function(e,t){return arguments.length>0?((!t||m||u)&&f(t?c():e),e):c()}}var b=!1,w=M(l),$=function(e){for(var t=nt,n=nt;null!==t&&!(96&t.f);)t=t.parent;try{return rt(t),e()}finally{rt(n)}}((()=>de((()=>{var e=c(),t=Ct(w);return b?(b=!1,t):w.v=e}))));return i||($.equals=W),function(e,t){if(arguments.length>0){const n=t?Ct($):a?Q(e):e;return $.equals(n)||(b=!0,O(w,n),p&&void 0!==v&&(v=n),Rt((()=>Ct($)))),e}return Ct($)}}var an,sn;class un{constructor(e){var t;a(this,an),a(this,sn);var n=new Map,r=(e,t)=>{var r=M(t);return n.set(e,r),r};const o=new Proxy({...e.props||{},$$events:{}},{get:(e,t)=>Ct(n.get(t)??r(t,Reflect.get(e,t))),has:(e,t)=>t===A||(Ct(n.get(t)??r(t,Reflect.get(e,t))),Reflect.has(e,t)),set:(e,t,o)=>(O(n.get(t)??r(t,o),o),Reflect.set(e,t,o))});s(this,sn,(e.hydrate?Ft:Ot)(e.component,{target:e.target,anchor:e.anchor,props:o,context:e.context,intro:e.intro??!1,recover:e.recover})),(!(null!=(t=null==e?void 0:e.props)&&t.$$host)||!1===e.sync)&&kt(),s(this,an,o.$$events);for(const e of Object.keys(i(this,sn)))"$set"===e||"$destroy"===e||"$on"===e||b(this,e,{get(){return i(this,sn)[e]},set(t){i(this,sn)[e]=t},enumerable:!0});i(this,sn).$set=e=>{Object.assign(o,e)},i(this,sn).$destroy=()=>{!function(e){const t=Jt.get(e);t&&t()}(i(this,sn))}}$set(e){i(this,sn).$set(e)}$on(e,t){i(this,an)[e]=i(this,an)[e]||[];const n=(...e)=>t.call(this,...e);return i(this,an)[e].push(n),()=>{i(this,an)[e]=i(this,an)[e].filter((e=>e!==n))}}$destroy(){i(this,sn).$destroy()}}let cn;function dn(e,t,n,r){var o;const l=null==(o=n[e])?void 0:o.type;if(t="Boolean"===l&&"boolean"!=typeof t?null!=t:t,!r||!n[e])return t;if("toAttribute"===r)switch(l){case"Object":case"Array":return null==t?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(l){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":default:return t;case"Number":return null!=t?+t:t}}an=new WeakMap,sn=new WeakMap,"function"==typeof HTMLElement&&(cn=class extends HTMLElement{constructor(e,t,n){super(),o(this,"$$ctor"),o(this,"$$s"),o(this,"$$c"),o(this,"$$cn",!1),o(this,"$$d",{}),o(this,"$$r",!1),o(this,"$$p_d",{}),o(this,"$$l",{}),o(this,"$$l_u",new Map),o(this,"$$me"),this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(e){return t=>{const n=document.createElement("slot");"default"!==e&&(n.name=e),jt(t,n)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=function(e){const t={};return e.childNodes.forEach((e=>{t[e.slot||"default"]=!0})),t}(this);for(const r of this.$$s)r in n&&("default"!==r||this.$$d.children?t[r]=e(r):(this.$$d.children=e(r),t.default=!0));for(const e of this.attributes){const t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=dn(t,e.value,this.$$p_d,"toProp"))}for(const e in this.$$p_d)!(e in this.$$d)&&void 0!==this[e]&&(this.$$d[e]=this[e],delete this[e]);this.$$c=function(e){return new un(e)}({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ye((()=>{$e((()=>{var e;this.$$r=!0;for(const t of m(this.$$c)){if(null==(e=this.$$p_d[t])||!e.reflect)continue;this.$$d[t]=this.$$c[t];const n=dn(t,this.$$d[t],this.$$p_d,"toAttribute");null==n?this.removeAttribute(this.$$p_d[t].attribute||t):this.setAttribute(this.$$p_d[t].attribute||t,n)}this.$$r=!1}))}));for(const e in this.$$l)for(const t of this.$$l[e]){const n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){var r;this.$$r||(e=this.$$g_p(e),this.$$d[e]=dn(e,n,this.$$p_d,"toProp"),null==(r=this.$$c)||r.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)}))}$$g_p(e){return m(this.$$p_d).find((t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e))||e}});const fn=new TextEncoder;async function vn(e,t,n){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return function(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}(await crypto.subtle.digest(n.toUpperCase(),fn.encode(e+t)))}function hn(e,t,n="SHA-256",r=1e6,o=0){const l=new AbortController,i=Date.now();return{promise:(async()=>{for(let a=o;a<=r;a+=1){if(l.signal.aborted)return null;if(await vn(t,a,n)===e)return{number:a,took:Date.now()-i}}return null})(),controller:l}}function pn(e,t=12){const n=new Uint8Array(t);for(let r=0;r{for(let e=r;e<=n;e+=1){if(l.signal.aborted||!a||!s)return null;try{const t=await crypto.subtle.decrypt({name:o,iv:pn(e)},a,s);if(t)return{clearText:(new TextDecoder).decode(t),took:Date.now()-i}}catch{}}return null})(),controller:l}}var mn=(e=>(e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(mn||{}),bn=Yt(''),yn=Yt(' ',1),wn=Yt(''),$n=Yt(''),xn=Yt('
'),En=Yt('
'),kn=Yt('
'),Cn=Yt('
'),Rn=Yt(''),_n=Yt('
'),In=Yt('
',1);const Ln={hash:"svelte-ddsc3z",code:'.altcha.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:focus-within {border-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].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:where(.svelte-ddsc3z) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto;}.altcha[data-floating=bottom].svelte-ddsc3z:focus-within::after {border-bottom-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating=top].svelte-ddsc3z:focus-within::after {border-top-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z:not([data-state=unverified]) {display:block;}.altcha-anchor-arrow.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 {align-items:center;display:flex;gap:0.4rem;padding:0.7rem;}.altcha-label.svelte-ddsc3z {flex-grow:1;}.altcha-label.svelte-ddsc3z label:where(.svelte-ddsc3z) {cursor:pointer;}.altcha-logo.svelte-ddsc3z {color:currentColor;opacity:0.3;}.altcha-logo.svelte-ddsc3z:hover {opacity:1;}.altcha-error.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 {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:hover {opacity:1;}.altcha-footer.svelte-ddsc3z > :where(.svelte-ddsc3z):first-child {flex-grow:1;}.altcha-footer.svelte-ddsc3z a {color:currentColor;}.altcha-checkbox.svelte-ddsc3z {display:flex;align-items:center;height:24px;width:24px;}.altcha-checkbox.svelte-ddsc3z input:where(.svelte-ddsc3z) {width:18px;height:18px;margin:0;}.altcha-hidden.svelte-ddsc3z {display:none;}.altcha-spinner.svelte-ddsc3z {\n animation: svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center;}\n\n@keyframes svelte-ddsc3z-altcha-spinner {\n 100% {\n transform: rotate(360deg);\n }\n}'};!function(e){for(var t=0;t(t[e].attribute||e).toLowerCase()))}};return m(t).forEach((e=>{b(l.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){var r;n=dn(e,n,t),this.$$d[e]=n;var o=this.$$c;o&&((null==(r=y(o,e))?void 0:r.get)?o[e]=n:o.$set({[e]:n}))}})})),r.forEach((e=>{b(l.prototype,e,{get(){var t;return null==(t=this.$$c)?void 0:t[e]}})})),e.element=l,l}((function(e,t){var n,r;Lt(t,!0),function(e,t){je((()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+t.hash)){const e=document.createElement("style");e.id=t.hash,e.textContent=t.code,r.appendChild(e)}}))}(e,Ln);let o=ln(t,"auto",7,void 0),l=ln(t,"blockspam",7,void 0),i=ln(t,"challengeurl",7,void 0),a=ln(t,"challengejson",7,void 0),s=ln(t,"customfetch",7,void 0),u=ln(t,"debug",7,!1),c=ln(t,"delay",7,0),d=ln(t,"expire",7,void 0),f=ln(t,"floating",7,void 0),v=ln(t,"floatinganchor",7,void 0),h=ln(t,"floatingoffset",7,void 0),p=ln(t,"hidefooter",7,!1),g=ln(t,"hidelogo",7,!1),m=ln(t,"name",7,"altcha"),b=ln(t,"maxnumber",7,1e6),y=ln(t,"mockerror",7,!1),w=ln(t,"obfuscated",7,void 0),$=ln(t,"plugins",7,void 0),x=ln(t,"refetchonexpire",7,!0),E=ln(t,"spamfilter",7,!1),k=ln(t,"strings",7,void 0),C=ln(t,"test",7,!1),R=ln(t,"verifyurl",7,void 0),_=ln(t,"workers",23,(()=>Math.min(16,navigator.hardwareConcurrency||8))),I=ln(t,"workerurl",7,void 0);const L=["SHA-256","SHA-384","SHA-512"],N="Visit Altcha.org",S="https://altcha.org/",z=(e,n)=>{t.$$host.dispatchEvent(new CustomEvent(e,{detail:n}))},V=null==(r=null==(n=document.documentElement.lang)?void 0:n.split("-"))?void 0:r[0],G=de((()=>{var e;return i()&&new URL(i(),location.origin).host.endsWith(".altcha.org")&&!(null==(e=i())||!e.includes("apiKey=ckey_"))})),X=de((()=>a()?me(a()):void 0)),A=de((()=>k()?me(k()):{})),Z=de((()=>{var e;return{ariaLinkLabel:N,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.",...Ct(A)}}));let P=j(!1),W=j(Q(mn.UNVERIFIED)),Y=j(void 0),M=j(null),T=null,F=null,U=j(null),B=null,H=[],ee=j(null);function te(e,t){return btoa(JSON.stringify({algorithm:e.algorithm,challenge:e.challenge,number:t.number,salt:e.salt,signature:e.signature,test:!!C()||void 0,took:t.took}))}function ne(){i()&&x()&&Ct(W)===mn.VERIFIED?Ge():Se(mn.EXPIRED,Ct(Z).expired)}async function re(){var e;if(y())throw oe("mocking error"),new Error("Mocked error.");if(Ct(X))return oe("using provided json data"),Ct(X);if(C())return oe("generating test challenge",{test:C()}),async function(e,t="SHA-256",n=1e5){const r=Date.now().toString(16);return e||(e=Math.round(Math.random()*n)),{algorithm:t,challenge:await vn(r,e,t),salt:r,signature:""}}("boolean"!=typeof C()?+C():void 0);{if(!i()&&F){const e=F.getAttribute("action");null!=e&&e.includes("/form/")&&i(e+"/altcha")}if(!i())throw new Error("Attribute challengeurl not set.");oe("fetching challenge from",i());let t=null,n=null;if(s())if(oe("using customfetch"),"string"==typeof s()){if(t=globalThis[s()]||null,!t)throw new Error(`Custom fetch function not found: ${s()}`)}else t=s();const r={headers:!1!==E()?{"x-altcha-spam-filter":"1"}:{}};if(t){if(n=await t(i(),r),!(n&&n instanceof Response))throw new Error("Custom fetch function did not return a response.")}else n=await fetch(i(),r);if(200!==n.status)throw new Error(`Server responded with ${n.status}.`);const o=n.headers.get("Expires"),l=n.headers.get("X-Altcha-Config"),a=await n.json(),u=new URLSearchParams(null==(e=a.salt.split("?"))?void 0:e[1]),c=u.get("expires")||u.get("expire");if(c){const e=new Date(1e3*+c),t=isNaN(e.getTime())?0:e.getTime()-Date.now();t>0&&$e(t)}if(l)try{const e=JSON.parse(l);e&&"object"==typeof e&&(e.verifyurl&&(e.verifyurl=new URL(e.verifyurl,new URL(i())).toString()),_e(e))}catch(e){oe("unable to configure from X-Altcha-Config",e)}if(!d()&&null!=o&&o.length){const e=Date.parse(o);if(e){const t=e-Date.now();t>0&&$e(t)}}return a}}function oe(...e){(u()||e.some((e=>e instanceof Error)))&&console[e[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${m()}]`,...e)}function ie(e){const t=e.target;f()&&t&&!Ct(Y).contains(t)&&(Ct(W)===mn.VERIFIED||"off"===o()&&Ct(W)===mn.UNVERIFIED)&&(Ct(Y).style.display="none")}function ae(){f()&&Ct(W)!==mn.UNVERIFIED&&ye()}function fe(e){Ct(W)===mn.UNVERIFIED&&Ge()}function ve(e){F&&"onsubmit"===o()?Ct(W)===mn.UNVERIFIED?(e.preventDefault(),e.stopPropagation(),Ge().then((()=>{null==F||F.requestSubmit()}))):Ct(W)!==mn.VERIFIED&&(e.preventDefault(),e.stopPropagation(),Ct(W)===mn.VERIFYING&&pe()):F&&f()&&"off"===o()&&Ct(W)===mn.UNVERIFIED&&(e.preventDefault(),e.stopPropagation(),Ct(Y).style.display="block",ye())}function he(){Se()}function pe(){Ct(W)===mn.VERIFYING&&Ct(Z).waitAlert&&alert(Ct(Z).waitAlert)}function ge(){f()&&ye()}function me(e){return JSON.parse(e)}function ye(e=20){if(Ct(Y))if(T||(T=(v()?document.querySelector(v()):null==F?void 0:F.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||F),T){const t=parseInt(h(),10)||12,n=T.getBoundingClientRect(),r=Ct(Y).getBoundingClientRect(),o=document.documentElement.clientHeight,l=document.documentElement.clientWidth,i="auto"===f()?n.bottom+r.height+t+e>o:"top"===f(),a=Math.max(e,Math.min(l-e-r.width,n.left+n.width/2-r.width/2));if(Ct(Y).style.top=i?n.top-(r.height+t)+"px":`${n.bottom+t}px`,Ct(Y).style.left=`${a}px`,Ct(Y).setAttribute("data-floating",i?"top":"bottom"),Ct(M)){const e=Ct(M).getBoundingClientRect();Ct(M).style.left=n.left-a+n.width/2-e.width/2+"px"}}else oe("unable to find floating anchor element")}async function we(e){if(!R())throw new Error("Attribute verifyurl not set.");oe("requesting server verification from",R());const t={payload:e};if(!1!==E()){const{blockedCountries:e,classifier:n,disableRules:r,email:o,expectedLanguages:l,expectedCountries:i,fields:a,ipAddress:s,text:u,timeZone:c}="ipAddress"===E()?{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}:"object"==typeof E()?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};t.blockedCountries=e,t.classifier=n,t.disableRules=r,t.email=!1===o?void 0:function(e){var t;const n=null==F?void 0:F.querySelector("string"==typeof e?`input[name="${e}"]`:'input[type="email"]:not([data-no-spamfilter])');return(null==(t=null==n?void 0:n.value)?void 0:t.slice(n.value.indexOf("@")))||void 0}(o),t.expectedCountries=i,t.expectedLanguages=l||(V?[V]:void 0),t.fields=!1===a?void 0:function(e){return[...(null==F?void 0:F.querySelectorAll(null!=e&&e.length?e.map((e=>`input[name="${e}"]`)).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce(((e,t)=>{const n=t.name,r=t.value;return n&&r&&(e[n]=/\n/.test(r)?r.replace(new RegExp("(?{const l=n*o;return new Promise((n=>{t.addEventListener("message",(e=>{if(e.data)for(const e of r)e!==t&&e.postMessage({type:"abort"});n(e.data)})),t.postMessage({payload:e,max:l+o,start:l,type:"work"})}))})));for(const e of r)e.terminate();return l.find((e=>!!e))||null}(e,e.maxnumber)}catch(e){oe(e)}if(void 0!==(null==t?void 0:t.number)||"obfuscated"in e)return{data:e,solution:t}}if("obfuscated"in e){const t=await gn(e.obfuscated,e.key,e.maxnumber);return{data:e,solution:await t.promise}}return{data:e,solution:await hn(e.challenge,e.salt,e.algorithm,e.maxnumber||b()).promise}}async function Re(){if(!w())return void Ve(mn.ERROR);const e=H.find((e=>"obfuscation"===e.constructor.pluginName));return e&&"clarify"in e?"clarify"in e&&"function"==typeof e.clarify?e.clarify():void 0:(Ve(mn.ERROR),void oe("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it."))}function _e(e){void 0!==e.obfuscated&&w(e.obfuscated),void 0!==e.auto&&(o(e.auto),"onload"===o()&&(w()?Re():Ge())),void 0!==e.blockspam&&l(!!e.blockspam),void 0!==e.customfetch&&s(e.customfetch),void 0!==e.floatinganchor&&v(e.floatinganchor),void 0!==e.delay&&c(e.delay),void 0!==e.floatingoffset&&h(e.floatingoffset),void 0!==e.floating&&Ee(e.floating),void 0!==e.expire&&($e(e.expire),d(e.expire)),e.challenge&&(a("string"==typeof e.challenge?e.challenge:JSON.stringify(e.challenge)),ke(Ct(X))),void 0!==e.challengeurl&&i(e.challengeurl),void 0!==e.debug&&u(!!e.debug),void 0!==e.hidefooter&&p(!!e.hidefooter),void 0!==e.hidelogo&&g(!!e.hidelogo),void 0!==e.maxnumber&&b(+e.maxnumber),void 0!==e.mockerror&&y(!!e.mockerror),void 0!==e.name&&m(e.name),void 0!==e.refetchonexpire&&x(!!e.refetchonexpire),void 0!==e.spamfilter&&E("object"==typeof e.spamfilter?e.spamfilter:!!e.spamfilter),e.strings&&k("string"==typeof e.strings?e.strings:JSON.stringify(e.strings)),void 0!==e.test&&C("number"==typeof e.test?e.test:!!e.test),void 0!==e.verifyurl&&R(e.verifyurl),void 0!==e.workers&&_(+e.workers),void 0!==e.workerurl&&I(e.workerurl)}function Ie(){return{auto:o(),blockspam:l(),challengeurl:i(),debug:u(),delay:c(),expire:d(),floating:f(),floatinganchor:v(),floatingoffset:h(),hidefooter:p(),hidelogo:g(),name:m(),maxnumber:b(),mockerror:y(),obfuscated:w(),refetchonexpire:x(),spamfilter:E(),strings:Ct(Z),test:C(),verifyurl:R(),workers:_(),workerurl:I()}}function Le(){return T}function Ne(){return Ct(W)}function Se(e=mn.UNVERIFIED,t=null){B&&(clearTimeout(B),B=null),O(P,!1),O(ee,null),Ve(e,t)}function ze(e){T=e}function Ve(e,t=null){O(W,Q(e)),O(U,Q(t)),z("statechange",{payload:Ct(ee),state:Ct(W)})}async function Ge(){return Se(mn.VERIFYING),await new Promise((e=>setTimeout(e,c()||0))),re().then((e=>(ke(e),oe("challenge",e),Ce(e)))).then((({data:e,solution:t})=>{if(oe("solution",t),"challenge"in e&&t&&!("clearText"in t)){if(void 0===(null==t?void 0:t.number))throw oe("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.");if(R())return we(te(e,t));O(ee,Q(te(e,t))),oe("payload",Ct(ee))}})).then((()=>{Ve(mn.VERIFIED),oe("verified"),async function(){await Promise.resolve(),kt()}().then((()=>{z("verified",{payload:Ct(ee)})}))})).catch((e=>{oe(e),Ve(mn.ERROR,e.message)}))}be((()=>{!function(){for(const e of H)"function"==typeof e.onErrorChange&&e.onErrorChange(Ct(U))}(Ct(U))})),be((()=>{!function(){for(const e of H)"function"==typeof e.onStateChange&&e.onStateChange(Ct(W));f()&&Ct(W)!==mn.UNVERIFIED&&requestAnimationFrame((()=>{ye()})),O(P,Ct(W)===mn.VERIFIED)}(Ct(W))})),function(e){null===ct&&Me(),rn((()=>()=>Rt(e)))}((()=>{(function(){for(const e of H)e.destroy()})(),F&&(F.removeEventListener("submit",ve),F.removeEventListener("reset",he),F.removeEventListener("focusin",fe),F=null),B&&(clearTimeout(B),B=null),document.removeEventListener("click",ie),document.removeEventListener("scroll",ae),window.removeEventListener("resize",ge)})),rn((()=>{var e;oe("mounted","1.1.0"),oe("workers",_()),function(){const e=void 0!==$()?$().split(","):void 0;for(const t of globalThis.altchaPlugins)(!e||e.includes(t.pluginName))&&H.push(new t({el:Ct(Y),clarify:Re,dispatch:z,getConfiguration:Ie,getFloatingAnchor:Le,getState:Ne,log:oe,reset:Se,solve:Ce,setState:Ve,setFloatingAnchor:ze,verify:Ge}))}(),oe("plugins",H.length?H.map((e=>e.constructor.pluginName)).join(", "):"none"),C()&&oe("using test mode"),d()&&$e(d()),void 0!==o()&&oe("auto",o()),void 0!==f()&&Ee(f()),F=null==(e=Ct(Y))?void 0:e.closest("form"),F&&(F.addEventListener("submit",ve,{capture:!0}),F.addEventListener("reset",he),"onfocus"===o()&&F.addEventListener("focusin",fe)),"onload"===o()&&(w()?Re():Ge()),Ct(G)&&(p()||g())&&oe("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame((()=>{z("load")}))}));var Xe=In(),Ae=ue(Xe);!function(e,t,n,r){var o;J&&K();var l=null==(o=t.$$slots)?void 0:o[n],i=!1;!0===l&&(l=t.children,i=!0),void 0===l||l(e,i?()=>r:r)}(Ae,t,"default",{});var Ze=ce(Ae,2),Pe=se(Ze),We=se(Pe),Ye=e=>{jt(e,bn())};Bt(We,(e=>{Ct(W)===mn.VERIFYING&&e(Ye)}));var Te=ce(We,2),Oe=se(Te);Kt(Oe),Oe.__change=function(){[mn.UNVERIFIED,mn.ERROR,mn.EXPIRED].includes(Ct(W))?!1!==E()&&!1===(null==F?void 0:F.reportValidity())?O(P,!1):w()?Re():Ge():O(P,!0)},q(Te);var Fe=ce(Te,2),Ue=se(Fe),De=e=>{var t=yn(),n=ue(t);Ht(se(n),(()=>Ct(Z).verified)),q(n);var r=ce(n,2);Kt(r),xe((()=>{qt(r,"name",m()),function(e,t){var n=e.__attributes??(e.__attributes={});n.value===(n.value=t??void 0)||e.value===t&&(0!==t||"PROGRESS"!==e.nodeName)||(e.value=t)}(r,Ct(ee))})),jt(e,t)},Je=e=>{var t=function(){if(J)return Wt(D,null),D;var e=document.createDocumentFragment(),t=document.createComment(""),n=le();return e.append(t,n),Wt(t,n),e}(),n=ue(t),r=e=>{var t=wn();Ht(se(t),(()=>Ct(Z).verifying)),q(t),jt(e,t)},o=e=>{var t=$n();Ht(se(t),(()=>Ct(Z).label)),q(t),xe((()=>qt(t,"for",`${m()??""}_checkbox`))),jt(e,t)};Bt(n,(e=>{Ct(W)===mn.VERIFYING?e(r):e(o,!1)}),!0),jt(e,t)};Bt(Ue,(e=>{Ct(W)===mn.VERIFIED?e(De):e(Je,!1)})),q(Fe);var Be=ce(Fe,2),He=e=>{var t=xn(),n=se(t);qt(n,"href",S),q(t),xe((()=>qt(n,"aria-label",Ct(Z).ariaLinkLabel))),jt(e,t)};Bt(Be,(e=>{(!0!==g()||Ct(G))&&e(He)})),q(Pe);var Ke=ce(Pe,2),qe=e=>{var t=Cn(),n=ce(se(t),2),r=e=>{var t=En();Ht(se(t),(()=>Ct(Z).expired)),q(t),xe((()=>qt(t,"title",Ct(U)))),jt(e,t)},o=e=>{var t=kn();Ht(se(t),(()=>Ct(Z).error)),q(t),xe((()=>qt(t,"title",Ct(U)))),jt(e,t)};Bt(n,(e=>{Ct(W)===mn.EXPIRED?e(r):e(o,!1)})),q(t),jt(e,t)};Bt(Ke,(e=>{(Ct(U)||Ct(W)===mn.EXPIRED)&&e(qe)}));var Qe=ce(Ke,2),et=e=>{var t=Rn(),n=se(t);Ht(se(n),(()=>Ct(Z).footer)),q(n),q(t),jt(e,t)};Bt(Qe,(e=>{Ct(Z).footer&&(!0!==p()||Ct(G))&&e(et)}));var tt=ce(Qe,2),nt=e=>{var t=_n();nn(t,(e=>O(M,e)),(()=>Ct(M))),jt(e,t)};return Bt(tt,(e=>{f()&&e(nt)})),q(Ze),nn(Ze,(e=>O(Y,e)),(()=>Ct(Y))),xe((()=>{qt(Ze,"data-state",Ct(W)),qt(Ze,"data-floating",f()),function(e,t,n){if(n){if(e.classList.contains(t))return;e.classList.add(t)}else{if(!e.classList.contains(t))return;e.classList.remove(t)}}(Te,"altcha-hidden",Ct(W)===mn.VERIFYING),qt(Oe,"id",`${m()??""}_checkbox`),Oe.required="onsubmit"!==o()&&(!f()||"off"!==o())})),At("invalid",Oe,pe),en(Oe,(()=>Ct(P)),(e=>O(P,e))),jt(e,Xe),Nt({clarify:Re,configure:_e,getConfiguration:Ie,getFloatingAnchor:Le,getPlugin:function(e){return H.find((t=>t.constructor.pluginName===e))},getState:Ne,reset:Se,setFloatingAnchor:ze,setState:Ve,verify:Ge,get auto(){return o()},set auto(e=void 0){o(e),kt()},get blockspam(){return l()},set blockspam(e=void 0){l(e),kt()},get challengeurl(){return i()},set challengeurl(e=void 0){i(e),kt()},get challengejson(){return a()},set challengejson(e=void 0){a(e),kt()},get customfetch(){return s()},set customfetch(e=void 0){s(e),kt()},get debug(){return u()},set debug(e=!1){u(e),kt()},get delay(){return c()},set delay(e=0){c(e),kt()},get expire(){return d()},set expire(e=void 0){d(e),kt()},get floating(){return f()},set floating(e=void 0){f(e),kt()},get floatinganchor(){return v()},set floatinganchor(e=void 0){v(e),kt()},get floatingoffset(){return h()},set floatingoffset(e=void 0){h(e),kt()},get hidefooter(){return p()},set hidefooter(e=!1){p(e),kt()},get hidelogo(){return g()},set hidelogo(e=!1){g(e),kt()},get name(){return m()},set name(e="altcha"){m(e),kt()},get maxnumber(){return b()},set maxnumber(e=1e6){b(e),kt()},get mockerror(){return y()},set mockerror(e=!1){y(e),kt()},get obfuscated(){return w()},set obfuscated(e=void 0){w(e),kt()},get plugins(){return $()},set plugins(e=void 0){$(e),kt()},get refetchonexpire(){return x()},set refetchonexpire(e=!0){x(e),kt()},get spamfilter(){return E()},set spamfilter(e=!1){E(e),kt()},get strings(){return k()},set strings(e=void 0){k(e),kt()},get test(){return C()},set test(e=!1){C(e),kt()},get verifyurl(){return R()},set verifyurl(e=void 0){R(e),kt()},get workers(){return _()},set workers(e=Math.min(16,navigator.hardwareConcurrency||8)){_(e),kt()},get workerurl(){return I()},set workerurl(e=void 0){I(e),kt()}})}),{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},expire:{type:"Number"},floatingoffset:{type:"Number"},hidefooter:{type:"Boolean"},hidelogo:{type:"Boolean"},maxnumber:{type:"Number"},mockerror:{type:"Boolean"},refetchonexpire:{type:"Boolean"},test:{type:"Boolean"},workers:{type:"Number"},auto:{},challengeurl:{},challengejson:{},customfetch:{},floating:{},floatinganchor:{},name:{},obfuscated:{},plugins:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","reset","setFloatingAnchor","setState","verify"],!1)),globalThis.altchaCreateWorker=e=>e?new Worker(new URL(e)):new f,globalThis.altchaPlugins=globalThis.altchaPlugins||[],window.Altcha=t.default})(); \ No newline at end of file