altcha 2.0.5 → 2.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/altcha.d.ts +2 -0
- package/dist/altcha.i18n.d.ts +2 -0
- package/dist/altcha.i18n.js +1472 -1446
- package/dist/altcha.i18n.umd.js +4 -4
- package/dist/altcha.js +1245 -1219
- package/dist/altcha.umd.cjs +4 -4
- package/dist_external/altcha.css +1 -1
- package/dist_external/altcha.d.ts +2 -0
- package/dist_external/altcha.js +1280 -1254
- package/dist_external/altcha.umd.cjs +3 -3
- package/dist_plugins/upload.js +7 -2
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(S,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(S=typeof globalThis<"u"?globalThis:S||self,T(S.altcha={}))})(this,function(S){"use strict";var $a=Object.defineProperty;var Zi=S=>{throw TypeError(S)};var ka=(S,T,G)=>T in S?$a(S,T,{enumerable:!0,configurable:!0,writable:!0,value:G}):S[T]=G;var Re=(S,T,G)=>ka(S,typeof T!="symbol"?T+"":T,G),Wi=(S,T,G)=>T.has(S)||Zi("Cannot "+G);var he=(S,T,G)=>(Wi(S,T,"read from private field"),G?G.call(S):T.get(S)),Kr=(S,T,G)=>T.has(S)?Zi("Cannot add the same private member more than once"):T instanceof WeakSet?T.add(S):T.set(S,G),zr=(S,T,G,Bt)=>(Wi(S,T,"write to private field"),Bt?Bt.call(S,G):T.set(S,G),G);var si,Oe,we;var T=typeof document<"u"?document.currentScript:null;const G="5";typeof window<"u"&&((si=window.__svelte??(window.__svelte={})).v??(si.v=new Set)).add(G);const Bt=1,Ji=4,Ki=8,zi=16,Xi=1,Qi=2,br="[",Xr="[!",Qr="]",st={},ue=Symbol(),el="http://www.w3.org/1999/xhtml",en=!1;function tn(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var rn=Array.isArray,tl=Array.prototype.indexOf,rl=Array.from,Ht=Object.keys,Ct=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,nl=Object.getOwnPropertyDescriptors,il=Object.prototype,ll=Array.prototype,nn=Object.getPrototypeOf,ln=Object.isExtensible;const ut=()=>{};function on(e){for(var t=0;t<e.length;t++)e[t]()}function ol(e,t,r=!1){return e===void 0?r?t():t:e}const ye=2,an=4,Yt=8,wr=16,Pe=32,Xe=64,Gt=128,ve=256,Zt=512,fe=1024,$e=2048,Qe=4096,ft=8192,Wt=16384,al=32768,pr=65536,sl=1<<19,sn=1<<20,yr=1<<21,At=Symbol("$state"),un=Symbol("legacy props"),ul=Symbol("");function fl(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function cl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function dl(e){throw new Error("https://svelte.dev/e/effect_orphan")}function hl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function vl(){throw new Error("https://svelte.dev/e/hydration_failed")}function gl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function _l(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ml(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function bl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Jt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let F=!1;function ct(e){F=e}let V;function Me(e){if(e===null)throw Jt(),st;return V=e}function dt(){return Me(qe(V))}function Z(e){if(F){if(qe(V)!==null)throw Jt(),st;V=e}}function wl(){for(var e=0,t=V;;){if(t.nodeType===8){var r=t.data;if(r===Qr){if(e===0)return t;e-=1}else(r===br||r===Xr)&&(e+=1)}var i=qe(t);t.remove(),t=i}}let pl=!1;function Ue(e){if(typeof e!="object"||e===null||At in e)return e;const t=nn(e);if(t!==il&&t!==ll)return e;var r=new Map,i=rn(e),o=U(0),l=D,u=s=>{var c=D;Se(l);var d=s();return Se(c),d};return i&&r.set("length",U(e.length)),new Proxy(e,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&_l();var m=r.get(c);return m===void 0?(m=u(()=>U(d.value)),r.set(c,m)):w(m,u(()=>Ue(d.value))),!0},deleteProperty(s,c){var d=r.get(c);if(d===void 0)c in s&&(r.set(c,u(()=>U(ue))),Er(o));else{if(i&&typeof c=="string"){var m=r.get("length"),h=Number(c);Number.isInteger(h)&&h<m.v&&w(m,h)}w(d,ue),Er(o)}return!0},get(s,c,d){var y;if(c===At)return e;var m=r.get(c),h=c in s;if(m===void 0&&(!h||(y=ze(s,c))!=null&&y.writable)&&(m=u(()=>U(Ue(h?s[c]:ue))),r.set(c,m)),m!==void 0){var g=a(m);return g===ue?void 0:g}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var m=r.get(c);m&&(d.value=a(m))}else if(d===void 0){var h=r.get(c),g=h==null?void 0:h.v;if(h!==void 0&&g!==ue)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return d},has(s,c){var g;if(c===At)return!0;var d=r.get(c),m=d!==void 0&&d.v!==ue||Reflect.has(s,c);if(d!==void 0||L!==null&&(!m||(g=ze(s,c))!=null&&g.writable)){d===void 0&&(d=u(()=>U(m?Ue(s[c]):ue)),r.set(c,d));var h=a(d);if(h===ue)return!1}return m},set(s,c,d,m){var ee;var h=r.get(c),g=c in s;if(i&&c==="length")for(var y=d;y<h.v;y+=1){var N=r.get(y+"");N!==void 0?w(N,ue):y in s&&(N=u(()=>U(ue)),r.set(y+"",N))}h===void 0?(!g||(ee=ze(s,c))!=null&&ee.writable)&&(h=u(()=>U(void 0)),w(h,u(()=>Ue(d))),r.set(c,h)):(g=h.v!==ue,w(h,u(()=>Ue(d))));var E=Reflect.getOwnPropertyDescriptor(s,c);if(E!=null&&E.set&&E.set.call(m,d),!g){if(i&&typeof c=="string"){var q=r.get("length"),_e=Number(c);Number.isInteger(_e)&&_e>=q.v&&w(q,_e+1)}Er(o)}return!0},ownKeys(s){a(o);var c=Reflect.ownKeys(s).filter(h=>{var g=r.get(h);return g===void 0||g.v!==ue});for(var[d,m]of r)m.v!==ue&&!(d in s)&&c.push(d);return c},setPrototypeOf(){ml()}})}function Er(e,t=1){w(e,e.v+t)}var fn,cn,dn,hn;function Cr(){if(fn===void 0){fn=window,cn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;dn=ze(t,"firstChild").get,hn=ze(t,"nextSibling").get,ln(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),ln(r)&&(r.__t=void 0)}}function Kt(e=""){return document.createTextNode(e)}function me(e){return dn.call(e)}function qe(e){return hn.call(e)}function W(e,t){if(!F)return me(e);var r=me(V);return r===null&&(r=V.appendChild(Kt())),Me(r),r}function It(e,t){if(!F){var r=me(e);return r instanceof Comment&&r.data===""?qe(r):r}return V}function J(e,t=1,r=!1){let i=F?V:e;for(var o;t--;)o=i,i=qe(i);if(!F)return i;var l=i==null?void 0:i.nodeType;if(r&&l!==3){var u=Kt();return i===null?o==null||o.after(u):i.before(u),Me(u),u}return Me(i),i}function yl(e){e.textContent=""}function vn(e){return e===this.v}function gn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Ar(e){return!gn(e,this.v)}function zt(e){var t=ye|$e,r=D!==null&&(D.f&ye)!==0?D:null;return L===null||r!==null&&(r.f&ve)!==0?t|=ve:L.f|=sn,{ctx:le,deps:null,effects:null,equals:vn,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??L}}function Rt(e){const t=zt(e);return Sn(t),t}function El(e){const t=zt(e);return t.equals=Ar,t}function _n(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)je(t[r])}}function Cl(e){for(var t=e.parent;t!==null;){if((t.f&ye)===0)return t;t=t.parent}return null}function mn(e){var t,r=L;Be(Cl(e));try{_n(e),t=Pn(e)}finally{Be(r)}return t}function bn(e){var t=mn(e),r=(He||(e.f&ve)!==0)&&e.deps!==null?Qe:fe;Ee(e,r),e.equals(t)||(e.v=t,e.wv=Nn())}function Al(e){L===null&&D===null&&dl(),D!==null&&(D.f&ve)!==0&&L===null&&cl(),xt&&fl()}function Il(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function et(e,t,r,i=!0){var o=L,l={ctx:le,deps:null,nodes_start:null,nodes_end:null,f:e|$e,first:null,fn:t,last:null,next:null,parent:o,prev:null,teardown:null,transitions:null,wv:0};if(r)try{Nr(l),l.f|=al}catch(c){throw je(l),c}else t!==null&&ir(l);var u=r&&l.deps===null&&l.first===null&&l.nodes_start===null&&l.teardown===null&&(l.f&(sn|Gt))===0;if(!u&&i&&(o!==null&&Il(l,o),D!==null&&(D.f&ye)!==0)){var s=D;(s.effects??(s.effects=[])).push(l)}return l}function Ir(e){const t=et(Yt,null,!1);return Ee(t,fe),t.teardown=e,t}function Rr(e){Al();var t=L!==null&&(L.f&Pe)!==0&&le!==null&&!le.m;if(t){var r=le;(r.e??(r.e=[])).push({fn:e,effect:L,reaction:D})}else{var i=$r(e);return i}}function Rl(e){const t=et(Xe,e,!0);return()=>{je(t)}}function $l(e){const t=et(Xe,e,!0);return(r={})=>new Promise(i=>{r.outro?Sr(t,()=>{je(t),i(void 0)}):(je(t),i(void 0))})}function $r(e){return et(an,e,!1)}function kr(e){return et(Yt,e,!0)}function ke(e,t=[],r=zt){const i=t.map(r);return wn(()=>e(...i.map(a)))}function wn(e,t=0){return et(Yt|wr|t,e,!0)}function xr(e,t=!0){return et(Yt|Pe,e,!0,t)}function pn(e){var t=e.teardown;if(t!==null){const r=xt,i=D;xn(!0),Se(null);try{t.call(null)}finally{xn(r),Se(i)}}}function yn(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){var i=r.next;(r.f&Xe)!==0?r.parent=null:je(r,t),r=i}}function kl(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&Pe)===0&&je(t),t=r}}function je(e,t=!0){var r=!1;(t||(e.f&sl)!==0)&&e.nodes_start!==null&&(En(e.nodes_start,e.nodes_end),r=!0),yn(e,t&&!r),nr(e,0),Ee(e,Wt);var i=e.transitions;if(i!==null)for(const l of i)l.stop();pn(e);var o=e.parent;o!==null&&o.first!==null&&Cn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function En(e,t){for(;e!==null;){var r=e===t?null:qe(e);e.remove(),e=r}}function Cn(e){var t=e.parent,r=e.prev,i=e.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=r))}function Sr(e,t){var r=[];An(e,r,!0),xl(r,()=>{je(e),t&&t()})}function xl(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var o of e)o.out(i)}else t()}function An(e,t,r){if((e.f&ft)===0){if(e.f^=ft,e.transitions!==null)for(const u of e.transitions)(u.is_global||r)&&t.push(u);for(var i=e.first;i!==null;){var o=i.next,l=(i.f&pr)!==0||(i.f&Pe)!==0;An(i,t,l?r:!1),i=o}}}function In(e){Rn(e,!0)}function Rn(e,t){if((e.f&ft)!==0){e.f^=ft,(e.f&fe)===0&&(e.f^=fe),Tt(e)&&(Ee(e,$e),ir(e));for(var r=e.first;r!==null;){var i=r.next,o=(r.f&pr)!==0||(r.f&Pe)!==0;Rn(r,o?t:!1),r=i}if(e.transitions!==null)for(const l of e.transitions)(l.is_global||t)&&l.in()}}const Sl=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let $t=[],kt=[];function $n(){var e=$t;$t=[],on(e)}function kn(){var e=kt;kt=[],on(e)}function Tr(e){$t.length===0&&queueMicrotask($n),$t.push(e)}function Tl(e){kt.length===0&&Sl(kn),kt.push(e)}function Nl(){$t.length>0&&$n(),kt.length>0&&kn()}let Xt=!1,Qt=!1,er=null,tt=!1,xt=!1;function xn(e){xt=e}let St=[],xa=[],D=null,xe=!1;function Se(e){D=e}let L=null;function Be(e){L=e}let ne=null;function Sn(e){D!==null&&D.f&yr&&(ne===null?ne=[e]:ne.push(e))}let ie=null,ge=0,be=null;function Dl(e){be=e}let Tn=1,tr=0,He=!1;function Nn(){return++Tn}function Tt(e){var h;var t=e.f;if((t&$e)!==0)return!0;if((t&Qe)!==0){var r=e.deps,i=(t&ve)!==0;if(r!==null){var o,l,u=(t&Zt)!==0,s=i&&L!==null&&!He,c=r.length;if(u||s){var d=e,m=d.parent;for(o=0;o<c;o++)l=r[o],(u||!((h=l==null?void 0:l.reactions)!=null&&h.includes(d)))&&(l.reactions??(l.reactions=[])).push(d);u&&(d.f^=Zt),s&&m!==null&&(m.f&ve)===0&&(d.f^=ve)}for(o=0;o<c;o++)if(l=r[o],Tt(l)&&bn(l),l.wv>e.wv)return!0}(!i||L!==null&&!He)&&Ee(e,fe)}return!1}function Ll(e,t){for(var r=t;r!==null;){if((r.f&Gt)!==0)try{r.fn(e);return}catch{r.f^=Gt}r=r.parent}throw Xt=!1,e}function Dn(e){return(e.f&Wt)===0&&(e.parent===null||(e.parent.f&Gt)===0)}function rr(e,t,r,i){if(Xt){if(r===null&&(Xt=!1),Dn(t))throw e;return}if(r!==null&&(Xt=!0),Ll(e,t),Dn(t))throw e}function Ln(e,t,r=!0){var i=e.reactions;if(i!==null)for(var o=0;o<i.length;o++){var l=i[o];ne!=null&&ne.includes(e)||((l.f&ye)!==0?Ln(l,t,!1):t===l&&(r?Ee(l,$e):(l.f&fe)!==0&&Ee(l,Qe),ir(l)))}}function Pn(e){var y;var t=ie,r=ge,i=be,o=D,l=He,u=ne,s=le,c=xe,d=e.f;ie=null,ge=0,be=null,He=(d&ve)!==0&&(xe||!tt||D===null),D=(d&(Pe|Xe))===0?e:null,ne=null,Mn(e.ctx),xe=!1,tr++,e.f|=yr;try{var m=(0,e.fn)(),h=e.deps;if(ie!==null){var g;if(nr(e,ge),h!==null&&ge>0)for(h.length=ge+ie.length,g=0;g<ie.length;g++)h[ge+g]=ie[g];else e.deps=h=ie;if(!He)for(g=ge;g<h.length;g++)((y=h[g]).reactions??(y.reactions=[])).push(e)}else h!==null&&ge<h.length&&(nr(e,ge),h.length=ge);if(jn()&&be!==null&&!xe&&h!==null&&(e.f&(ye|Qe|$e))===0)for(g=0;g<be.length;g++)Ln(be[g],e);return o!==null&&o!==e&&(tr++,be!==null&&(i===null?i=be:i.push(...be))),m}finally{ie=t,ge=r,be=i,D=o,He=l,ne=u,Mn(s),xe=c,e.f^=yr}}function Pl(e,t){let r=t.reactions;if(r!==null){var i=tl.call(r,e);if(i!==-1){var o=r.length-1;o===0?r=t.reactions=null:(r[i]=r[o],r.pop())}}r===null&&(t.f&ye)!==0&&(ie===null||!ie.includes(t))&&(Ee(t,Qe),(t.f&(ve|Zt))===0&&(t.f^=Zt),_n(t),nr(t,0))}function nr(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)Pl(e,r[i])}function Nr(e){var t=e.f;if((t&Wt)===0){Ee(e,fe);var r=L,i=le,o=tt;L=e,tt=!0;try{(t&wr)!==0?kl(e):yn(e),pn(e);var l=Pn(e);e.teardown=typeof l=="function"?l:null,e.wv=Tn;var u=e.deps,s;en&&pl&&e.f&$e}catch(c){rr(c,e,r,i||e.ctx)}finally{tt=o,L=r}}}function Ol(){try{hl()}catch(e){if(er!==null)rr(e,er,null);else throw e}}function On(){var e=tt;try{var t=0;for(tt=!0;St.length>0;){t++>1e3&&Ol();var r=St,i=r.length;St=[];for(var o=0;o<i;o++){var l=Vl(r[o]);Fl(l)}Nt.clear()}}finally{Qt=!1,tt=e,er=null}}function Fl(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var i=e[r];if((i.f&(Wt|ft))===0)try{Tt(i)&&(Nr(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?Cn(i):i.fn=null))}catch(o){rr(o,i,null,i.ctx)}}}function ir(e){Qt||(Qt=!0,queueMicrotask(On));for(var t=er=e;t.parent!==null;){t=t.parent;var r=t.f;if((r&(Xe|Pe))!==0){if((r&fe)===0)return;t.f^=fe}}St.push(t)}function Vl(e){for(var t=[],r=e;r!==null;){var i=r.f,o=(i&(Pe|Xe))!==0,l=o&&(i&fe)!==0;if(!l&&(i&ft)===0){if((i&an)!==0)t.push(r);else if(o)r.f^=fe;else try{Tt(r)&&Nr(r)}catch(c){rr(c,r,null,r.ctx)}var u=r.first;if(u!==null){r=u;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return t}function R(e){for(var t;;){if(Nl(),St.length===0)return t;Qt=!0,On()}}async function Dr(){await Promise.resolve(),R()}function a(e){var t=e.f,r=(t&ye)!==0;if(D!==null&&!xe){if(!(ne!=null&&ne.includes(e))){var i=D.deps;e.rv<tr&&(e.rv=tr,ie===null&&i!==null&&i[ge]===e?ge++:ie===null?ie=[e]:(!He||!ie.includes(e))&&ie.push(e))}}else if(r&&e.deps===null&&e.effects===null){var o=e,l=o.parent;l!==null&&(l.f&ve)===0&&(o.f^=ve)}return r&&(o=e,Tt(o)&&bn(o)),xt&&Nt.has(e)?Nt.get(e):e.v}function rt(e){var t=xe;try{return xe=!0,e()}finally{xe=t}}const Ml=-7169;function Ee(e,t){e.f=e.f&Ml|t}const Nt=new Map;function Fn(e,t){var r={f:0,v:e,reactions:null,equals:vn,rv:0,wv:0};return r}function U(e,t){const r=Fn(e);return Sn(r),r}function Lr(e,t=!1){const r=Fn(e);return t||(r.equals=Ar),r}function w(e,t,r=!1){D!==null&&!xe&&jn()&&(D.f&(ye|wr))!==0&&!(ne!=null&&ne.includes(e))&&bl();let i=r?Ue(t):t;return Ul(e,i)}function Ul(e,t){if(!e.equals(t)){var r=e.v;xt?Nt.set(e,t):Nt.set(e,r),e.v=t,(e.f&ye)!==0&&((e.f&$e)!==0&&mn(e),Ee(e,(e.f&ve)===0?fe:Qe)),e.wv=Nn(),Vn(e,$e),L!==null&&(L.f&fe)!==0&&(L.f&(Pe|Xe))===0&&(be===null?Dl([e]):be.push(e))}return t}function Vn(e,t){var r=e.reactions;if(r!==null)for(var i=r.length,o=0;o<i;o++){var l=r[o],u=l.f;(u&$e)===0&&(Ee(l,t),(u&(fe|ve))!==0&&((u&ye)!==0?Vn(l,Qe):ir(l)))}}let le=null;function Mn(e){le=e}function Un(e,t=!1,r){var i=le={p:le,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};Ir(()=>{i.d=!0})}function qn(e){const t=le;if(t!==null){e!==void 0&&(t.x=e);const u=t.e;if(u!==null){var r=L,i=D;t.e=null;try{for(var o=0;o<u.length;o++){var l=u[o];Be(l.effect),Se(l.reaction),$r(l.fn)}}finally{Be(r),Se(i)}}le=t.p,t.m=!0}return e||{}}function jn(){return!0}const ql=["touchstart","touchmove"];function jl(e){return ql.includes(e)}function Bl(e,t){if(t){const r=document.body;e.autofocus=!0,Tr(()=>{document.activeElement===r&&e.focus()})}}let Bn=!1;function Hn(){Bn||(Bn=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const r of e.target.elements)(t=r.__on_r)==null||t.call(r)})},{capture:!0}))}function Yn(e){var t=D,r=L;Se(null),Be(null);try{return e()}finally{Se(t),Be(r)}}function Hl(e,t,r,i=r){e.addEventListener(t,()=>Yn(r));const o=e.__on_r;o?e.__on_r=()=>{o(),i(!0)}:e.__on_r=()=>i(!0),Hn()}const Gn=new Set,Pr=new Set;function Yl(e,t,r,i={}){function o(l){if(i.capture||Dt.call(t,l),!l.cancelBubble)return Yn(()=>r==null?void 0:r.call(this,l))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Tr(()=>{t.addEventListener(e,o,i)}):t.addEventListener(e,o,i),o}function Ye(e,t,r,i,o){var l={capture:i,passive:o},u=Yl(e,t,r,l);(t===document.body||t===window||t===document)&&Ir(()=>{t.removeEventListener(e,u,l)})}function Gl(e){for(var t=0;t<e.length;t++)Gn.add(e[t]);for(var r of Pr)r(e)}function Dt(e){var ee;var t=this,r=t.ownerDocument,i=e.type,o=((ee=e.composedPath)==null?void 0:ee.call(e))||[],l=o[0]||e.target,u=0,s=e.__root;if(s){var c=o.indexOf(s);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=o.indexOf(t);if(d===-1)return;c<=d&&(u=c)}if(l=o[u]||e.target,l!==t){Ct(e,"currentTarget",{configurable:!0,get(){return l||r}});var m=D,h=L;Se(null),Be(null);try{for(var g,y=[];l!==null;){var N=l.assignedSlot||l.parentNode||l.host||null;try{var E=l["__"+i];if(E!=null&&(!l.disabled||e.target===l))if(rn(E)){var[q,..._e]=E;q.apply(l,[e,..._e])}else E.call(l,e)}catch(oe){g?y.push(oe):g=oe}if(e.cancelBubble||N===t||N===null)break;l=N}if(g){for(let oe of y)queueMicrotask(()=>{throw oe});throw g}}finally{e.__root=t,delete e.currentTarget,Se(m),Be(h)}}}function Or(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Te(e,t){var r=L;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function Ce(e,t){var r=(t&Xi)!==0,i=(t&Qi)!==0,o,l=!e.startsWith("<!>");return()=>{if(F)return Te(V,null),V;o===void 0&&(o=Or(l?e:"<!>"+e),r||(o=me(o)));var u=i||cn?document.importNode(o,!0):o.cloneNode(!0);if(r){var s=me(u),c=u.lastChild;Te(s,c)}else Te(u,u);return u}}function lr(e,t,r="svg"){var i=!e.startsWith("<!>"),o=`<${r}>${i?e:"<!>"+e}</${r}>`,l;return()=>{if(F)return Te(V,null),V;if(!l){var u=Or(o),s=me(u);l=me(s)}var c=l.cloneNode(!0);return Te(c,c),c}}function or(){if(F)return Te(V,null),V;var e=document.createDocumentFragment(),t=document.createComment(""),r=Kt();return e.append(t,r),Te(t,r),e}function j(e,t){if(F){L.nodes_end=V,dt();return}e!==null&&e.before(t)}function Zl(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=r,e.nodeValue=r+"")}function Zn(e,t){return Wn(e,t)}function Wl(e,t){Cr(),t.intro=t.intro??!1;const r=t.target,i=F,o=V;try{for(var l=me(r);l&&(l.nodeType!==8||l.data!==br);)l=qe(l);if(!l)throw st;ct(!0),Me(l),dt();const u=Wn(e,{...t,anchor:l});if(V===null||V.nodeType!==8||V.data!==Qr)throw Jt(),st;return ct(!1),u}catch(u){if(u===st)return t.recover===!1&&vl(),Cr(),yl(r),ct(!1),Zn(e,t);throw u}finally{ct(i),Me(o)}}const ht=new Map;function Wn(e,{target:t,anchor:r,props:i={},events:o,context:l,intro:u=!0}){Cr();var s=new Set,c=h=>{for(var g=0;g<h.length;g++){var y=h[g];if(!s.has(y)){s.add(y);var N=jl(y);t.addEventListener(y,Dt,{passive:N});var E=ht.get(y);E===void 0?(document.addEventListener(y,Dt,{passive:N}),ht.set(y,1)):ht.set(y,E+1)}}};c(rl(Gn)),Pr.add(c);var d=void 0,m=$l(()=>{var h=r??t.appendChild(Kt());return xr(()=>{if(l){Un({});var g=le;g.c=l}o&&(i.$$events=o),F&&Te(h,null),d=e(h,i)||{},F&&(L.nodes_end=V),l&&qn()}),()=>{var N;for(var g of s){t.removeEventListener(g,Dt);var y=ht.get(g);--y===0?(document.removeEventListener(g,Dt),ht.delete(g)):ht.set(g,y)}Pr.delete(c),h!==r&&((N=h.parentNode)==null||N.removeChild(h))}});return Fr.set(d,m),d}let Fr=new WeakMap;function Jl(e,t){const r=Fr.get(e);return r?(Fr.delete(e),r(t)):Promise.resolve()}function K(e,t,[r,i]=[0,0]){F&&r===0&&dt();var o=e,l=null,u=null,s=ue,c=r>0?pr:0,d=!1;const m=(g,y=!0)=>{d=!0,h(y,g)},h=(g,y)=>{if(s===(s=g))return;let N=!1;if(F&&i!==-1){if(r===0){const q=o.data;q===br?i=0:q===Xr?i=1/0:(i=parseInt(q.substring(1)),i!==i&&(i=s?1/0:-1))}const E=i>r;!!s===E&&(o=wl(),Me(o),ct(!1),N=!0,i=-1)}s?(l?In(l):y&&(l=xr(()=>y(o))),u&&Sr(u,()=>{u=null})):(u?In(u):y&&(u=xr(()=>y(o,[r+1,i]))),l&&Sr(l,()=>{l=null})),N&&ct(!0)};wn(()=>{d=!1,t(m),d||h(null,null)},c),F&&(o=V)}function nt(e,t,r=!1,i=!1,o=!1){var l=e,u="";ke(()=>{var s=L;if(u===(u=t()??"")){F&&dt();return}if(s.nodes_start!==null&&(En(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),u!==""){if(F){V.data;for(var c=dt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=qe(c);if(c===null)throw Jt(),st;Te(V,d),l=Me(c);return}var m=u+"";r?m=`<svg>${m}</svg>`:i&&(m=`<math>${m}</math>`);var h=Or(m);if((r||i)&&(h=me(h)),Te(me(h),h.lastChild),r||i)for(;me(h);)l.before(me(h));else l.before(h)}})}function Kl(e,t,r,i,o){var s;F&&dt();var l=(s=t.$$slots)==null?void 0:s[r],u=!1;l===!0&&(l=t.children,u=!0),l===void 0||l(e,u?()=>i:i)}const Jn=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function zl(e,t,r){var i=""+e;if(r){for(var o in r)if(r[o])i=i?i+" "+o:o;else if(i.length)for(var l=o.length,u=0;(u=i.indexOf(o,u))>=0;){var s=u+l;(u===0||Jn.includes(i[u-1]))&&(s===i.length||Jn.includes(i[s]))?i=(u===0?"":i.substring(0,u))+i.substring(s+1):u=s}}return i===""?null:i}function Xl(e,t,r,i,o,l){var u=e.__className;if(F||u!==r||u===void 0){var s=zl(r,i,l);(!F||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=r}else if(l&&o!==l)for(var c in l){var d=!!l[c];(o==null||d!==!!o[c])&&e.classList.toggle(c,d)}return l}const Ql=Symbol("is custom element"),eo=Symbol("is html");function Kn(e){if(F){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;P(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var o=e.checked;P(e,"checked",null),e.checked=o}}};e.__on_r=r,Tl(r),Hn()}}function to(e,t){var r=zn(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function P(e,t,r,i){var o=zn(e);F&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=r)&&(t==="loading"&&(e[ul]=r),r==null?e.removeAttribute(t):typeof r!="string"&&ro(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function zn(e){return e.__attributes??(e.__attributes={[Ql]:e.nodeName.includes("-"),[eo]:e.namespaceURI===el})}var Xn=new Map;function ro(e){var t=Xn.get(e.nodeName);if(t)return t;Xn.set(e.nodeName,t=[]);for(var r,i=e,o=Element.prototype;o!==i;){r=nl(i);for(var l in r)r[l].set&&t.push(l);i=nn(i)}return t}function no(e,t,r=t){Hl(e,"change",i=>{var o=i?e.defaultChecked:e.checked;r(o)}),(F&&e.defaultChecked!==e.checked||rt(t)==null)&&r(e.checked),kr(()=>{var i=t();e.checked=!!i})}function Qn(e,t){return e===t||(e==null?void 0:e[At])===t}function ar(e={},t,r,i){return $r(()=>{var o,l;return kr(()=>{o=l,l=[],rt(()=>{e!==r(...l)&&(t(e,...l),o&&Qn(r(...o),e)&&t(null,...o))})}),()=>{Tr(()=>{l&&Qn(r(...l),e)&&t(null,...l)})}}),e}function ei(e){le===null&&tn(),Rr(()=>{const t=rt(e);if(typeof t=="function")return t})}function io(e){le===null&&tn(),ei(()=>()=>rt(e))}function ti(e,t,r){if(e==null)return t(void 0),ut;const i=rt(()=>e.subscribe(t,r));return i.unsubscribe?()=>i.unsubscribe():i}const vt=[];function lo(e,t=ut){let r=null;const i=new Set;function o(s){if(gn(e,s)&&(e=s,r)){const c=!vt.length;for(const d of i)d[1](),vt.push(d,e);if(c){for(let d=0;d<vt.length;d+=2)vt[d][0](vt[d+1]);vt.length=0}}}function l(s){o(s(e))}function u(s,c=ut){const d=[s,c];return i.add(d),i.size===1&&(r=t(o,l)||ut),s(e),()=>{i.delete(d),i.size===0&&r&&(r(),r=null)}}return{set:o,update:l,subscribe:u}}function sr(e){let t;return ti(e,r=>t=r)(),t}let ur=!1,Vr=Symbol();function oo(e,t,r){const i=r[t]??(r[t]={store:null,source:Lr(void 0),unsubscribe:ut});if(i.store!==e&&!(Vr in r))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=ut;else{var o=!0;i.unsubscribe=ti(e,l=>{o?i.source.v=l:w(i.source,l)}),o=!1}return e&&Vr in r?sr(e):a(i.source)}function ao(){const e={};function t(){Ir(()=>{for(var r in e)e[r].unsubscribe();Ct(e,Vr,{enumerable:!1,value:!0})})}return[e,t]}function so(e){var t=ur;try{return ur=!1,[e(),ur]}finally{ur=t}}function ri(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function $(e,t,r,i){var gt;var o=(r&Bt)!==0,l=!0,u=(r&Ki)!==0,s=(r&zi)!==0,c=!1,d;u?[d,c]=so(()=>e[t]):d=e[t];var m=At in e||un in e,h=u&&(((gt=ze(e,t))==null?void 0:gt.set)??(m&&t in e&&(B=>e[t]=B)))||void 0,g=i,y=!0,N=!1,E=()=>(N=!0,y&&(y=!1,s?g=rt(i):g=i),g);d===void 0&&i!==void 0&&(h&&l&&gl(),d=E(),h&&h(d));var q;if(q=()=>{var B=e[t];return B===void 0?E():(y=!0,N=!1,B)},(r&Ji)===0)return q;if(h){var _e=e.$$legacy;return function(B,ce){return arguments.length>0?((!ce||_e||c)&&h(ce?q():B),B):q()}}var ee=!1,oe=Lr(d),te=zt(()=>{var B=q(),ce=a(oe);return ee?(ee=!1,ce):oe.v=B});return u&&a(te),o||(te.equals=Ar),function(B,ce){if(arguments.length>0){const Ae=ce?a(te):u?Ue(B):B;if(!te.equals(Ae)){if(ee=!0,w(oe,Ae),N&&g!==void 0&&(g=Ae),ri(te))return B;rt(()=>a(te))}return B}return ri(te)?te.v:a(te)}}function uo(e){return new fo(e)}class fo{constructor(t){Kr(this,Oe);Kr(this,we);var l;var r=new Map,i=(u,s)=>{var c=Lr(s);return r.set(u,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(u,s){return a(r.get(s)??i(s,Reflect.get(u,s)))},has(u,s){return s===un?!0:(a(r.get(s)??i(s,Reflect.get(u,s))),Reflect.has(u,s))},set(u,s,c){return w(r.get(s)??i(s,c),c),Reflect.set(u,s,c)}});zr(this,we,(t.hydrate?Wl:Zn)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&R(),zr(this,Oe,o.$$events);for(const u of Object.keys(he(this,we)))u==="$set"||u==="$destroy"||u==="$on"||Ct(this,u,{get(){return he(this,we)[u]},set(s){he(this,we)[u]=s},enumerable:!0});he(this,we).$set=u=>{Object.assign(o,u)},he(this,we).$destroy=()=>{Jl(he(this,we))}}$set(t){he(this,we).$set(t)}$on(t,r){he(this,Oe)[t]=he(this,Oe)[t]||[];const i=(...o)=>r.call(this,...o);return he(this,Oe)[t].push(i),()=>{he(this,Oe)[t]=he(this,Oe)[t].filter(o=>o!==i)}}$destroy(){he(this,we).$destroy()}}Oe=new WeakMap,we=new WeakMap;let ni;typeof HTMLElement=="function"&&(ni=class extends HTMLElement{constructor(t,r,i){super();Re(this,"$$ctor");Re(this,"$$s");Re(this,"$$c");Re(this,"$$cn",!1);Re(this,"$$d",{});Re(this,"$$r",!1);Re(this,"$$p_d",{});Re(this,"$$l",{});Re(this,"$$l_u",new Map);Re(this,"$$me");this.$$ctor=t,this.$$s=r,i&&this.attachShadow({mode:"open"})}addEventListener(t,r,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(r),this.$$c){const o=this.$$c.$on(t,r);this.$$l_u.set(r,o)}super.addEventListener(t,r,i)}removeEventListener(t,r,i){if(super.removeEventListener(t,r,i),this.$$c){const o=this.$$l_u.get(r);o&&(o(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return l=>{const u=document.createElement("slot");o!=="default"&&(u.name=o),j(l,u)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const r={},i=co(this);for(const o of this.$$s)o in i&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),r.default=!0):r[o]=t(o));for(const o of this.attributes){const l=this.$$g_p(o.name);l in this.$$d||(this.$$d[l]=fr(l,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=uo({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Rl(()=>{kr(()=>{var o;this.$$r=!0;for(const l of Ht(this.$$c)){if(!((o=this.$$p_d[l])!=null&&o.reflect))continue;this.$$d[l]=this.$$c[l];const u=fr(l,this.$$d[l],this.$$p_d,"toAttribute");u==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,u)}this.$$r=!1})});for(const o in this.$$l)for(const l of this.$$l[o]){const u=this.$$c.$on(o,l);this.$$l_u.set(l,u)}this.$$l={}}}attributeChangedCallback(t,r,i){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=fr(t,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Ht(this.$$p_d).find(r=>this.$$p_d[r].attribute===t||!this.$$p_d[r].attribute&&r.toLowerCase()===t)||t}});function fr(e,t,r,i){var l;const o=(l=r[e])==null?void 0:l.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!r[e])return t;if(i==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function co(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function ho(e,t,r,i,o,l){let u=class extends ni{constructor(){super(e,r,o),this.$$p_d=t}static get observedAttributes(){return Ht(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Ht(t).forEach(s=>{Ct(u.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var h;c=fr(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var m=(h=ze(d,s))==null?void 0:h.get;m?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{Ct(u.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=u,u}const ii=new TextEncoder;function vo(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function go(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const o=await li(i,e,t);return{algorithm:t,challenge:o,salt:i,signature:""}}async function li(e,t,r){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 vo(await crypto.subtle.digest(r.toUpperCase(),ii.encode(e+t)))}function _o(e,t,r="SHA-256",i=1e6,o=0){const l=new AbortController,u=Date.now();return{promise:(async()=>{for(let c=o;c<=i;c+=1){if(l.signal.aborted)return null;if(await li(t,c,r)===e)return{number:c,took:Date.now()-u}}return null})(),controller:l}}function oi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function mo(e){const t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function bo(e,t=12){const r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e%256,e=Math.floor(e/256);return r}async function wo(e,t="",r=1e6,i=0){const o="AES-GCM",l=new AbortController,u=Date.now(),s=async()=>{for(let m=i;m<=r;m+=1){if(l.signal.aborted||!c||!d)return null;try{const h=await crypto.subtle.decrypt({name:o,iv:bo(m)},c,d);if(h)return{clearText:new TextDecoder().decode(h),took:Date.now()-u}}catch{}}return null};let c=null,d=null;try{d=mo(e);const m=await crypto.subtle.digest("SHA-256",ii.encode(t));c=await crypto.subtle.importKey("raw",m,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:s(),controller:l}}var C=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(C||{}),Q=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(Q||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>sr(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(sr(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(sr(globalThis.altchaI18n.store))},store:lo({})};const po={ariaLinkLabel:"Visit Altcha.org",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" target="_blank" aria-label="Visit Altcha.org">ALTCHA</a>',getAudioChallenge:"Get an audio challenge",label:"I'm not a robot",loading:"Loading...",reload:"Reload",verify:"Verify",verificationRequired:"Verification required!",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait."};globalThis.altchaI18n.set("en",po);const Mr=(e,t)=>{let r=El(()=>ol(t==null?void 0:t(),24));var i=Ao();ke(()=>{P(i,"width",a(r)),P(i,"height",a(r))}),j(e,i)};function yo(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function Eo(e,t){e.preventDefault(),t()}function Co(e,t,r,i,o,l,u,s){var c;[C.UNVERIFIED,C.ERROR,C.EXPIRED,C.CODE].includes(a(t))?r()!==!1&&((c=a(i))==null?void 0:c.reportValidity())===!1?w(o,!1):l()?u():s():w(o,!0)}var Ao=lr('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="altcha-spinner"><path 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" fill="currentColor" opacity=".25"></path><path 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" fill="currentColor"></path></svg>'),Io=Ce('<input type="hidden">'),Ro=Ce('<div><a target="_blank" class="altcha-logo" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path 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" fill="currentColor"></path><path 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" fill="currentColor"></path><path 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" fill="currentColor"></path></svg></a></div>'),$o=lr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z"></path></svg>'),ko=lr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 7C15 6.44772 15.4477 6 16 6C16.5523 6 17 6.44772 17 7V17C17 17.5523 16.5523 18 16 18C15.4477 18 15 17.5523 15 17V7ZM7 7C7 6.44772 7.44772 6 8 6C8.55228 6 9 6.44772 9 7V17C9 17.5523 8.55228 18 8 18C7.44772 18 7 17.5523 7 17V7Z"></path></svg>'),xo=lr('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 12H7C8.10457 12 9 12.8954 9 14V19C9 20.1046 8.10457 21 7 21H4C2.89543 21 2 20.1046 2 19V12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12V19C22 20.1046 21.1046 21 20 21H17C15.8954 21 15 20.1046 15 19V14C15 12.8954 15.8954 12 17 12H20C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12Z"></path></svg>'),So=Ce('<button type="button" class="altcha-code-challenge-audio"><!></button>'),To=Ce("<audio hidden autoplay><source></audio>"),No=Ce('<div class="altcha-code-challenge" role="dialog"><div class="altcha-code-challenge-arrow"></div> <form data-code-challenge-form="1"><img class="altcha-code-challenge-image" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input" required> <div class="altcha-code-challenge-buttons"><div class="altcha-code-challenge-buttons-left"><!> <button type="button" class="altcha-code-challenge-reload"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2V4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 9.25022 5.38734 6.82447 7.50024 5.38451L7.5 8H9.5V2L3.5 2V4L5.99918 3.99989C3.57075 5.82434 2 8.72873 2 12Z"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify"><!> </button></div> <!></form></div>'),Do=Ce("<div><!></div>"),Lo=Ce("<div><!></div>"),Po=Ce('<div class="altcha-error"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg> <!></div>'),Oo=Ce('<div class="altcha-footer"><div><!></div></div>'),Fo=Ce('<div class="altcha-anchor-arrow"></div>'),Vo=Ce('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function ai(e,t){var Yi,Gi;Un(t,!0);const[r,i]=ao(),o=()=>oo(Uo,"$altchaI18nStore",r);let l=$(t,"auto",7,void 0),u=$(t,"blockspam",7,void 0),s=$(t,"challengeurl",7,void 0),c=$(t,"challengejson",7,void 0),d=$(t,"credentials",7,void 0),m=$(t,"customfetch",7,void 0),h=$(t,"debug",7,!1),g=$(t,"delay",7,0),y=$(t,"disableautofocus",7,!1),N=$(t,"expire",7,void 0),E=$(t,"floating",7,void 0),q=$(t,"floatinganchor",7,void 0),_e=$(t,"floatingoffset",7,void 0),ee=$(t,"floatingpersist",7,!1),oe=$(t,"hidefooter",7,!1),te=$(t,"hidelogo",7,!1),gt=$(t,"id",7,void 0),B=$(t,"language",7,void 0),ce=$(t,"name",7,"altcha"),Ae=$(t,"maxnumber",7,1e6),Lt=$(t,"mockerror",7,!1),Ge=$(t,"obfuscated",7,void 0),cr=$(t,"plugins",7,void 0),Pt=$(t,"refetchonexpire",7,!0),it=$(t,"sentinel",7,void 0),Ne=$(t,"spamfilter",7,!1),_t=$(t,"strings",7,void 0),pe=$(t,"test",7,!1),ae=$(t,"verifyurl",7,void 0),mt=$(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),Ot=$(t,"workerurl",7,void 0);const{altchaI18n:Mo}=globalThis,Uo=Mo.store,ui=["SHA-256","SHA-384","SHA-512"],qo="https://altcha.org/",Ze=(n,f)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:f}))},fi=(Gi=(Yi=document.documentElement.lang)==null?void 0:Yi.split("-"))==null?void 0:Gi[0],Ur=Rt(()=>{var n;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((n=s())!=null&&n.includes("apiKey=ckey_"))}),qr=Rt(()=>c()?Ii(c()):void 0),jo=Rt(()=>_t()?Ii(_t()):{}),M=Rt(()=>({...vi(o()),...a(jo)})),ci=Rt(()=>`${gt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let Ft=U(!1),Y=U(null),k=U(Ue(C.UNVERIFIED)),se=U(void 0),Vt=U(null),We=U(null),jr=U(null),bt=U(null),O=U(null),dr=U(null),lt=U(null),De=null,z=U(null),ot=U(!1),Je=[],Br=U(!1),Fe=U(null);Rr(()=>{ta(a(lt))}),Rr(()=>{ra(a(k))}),io(()=>{Bo(),w(dr,null),a(O)&&(a(O).removeEventListener("submit",pi),a(O).removeEventListener("reset",yi),a(O).removeEventListener("focusin",wi),w(O,null)),De&&(clearTimeout(De),De=null),document.removeEventListener("click",mi),document.removeEventListener("scroll",bi),window.removeEventListener("resize",Ai)}),ei(()=>{var n;x("mounted","2.0.5"),x("workers",mt()),Zo(),x("plugins",Je.length?Je.map(f=>f.constructor.pluginName).join(", "):"none"),pe()&&x("using test mode"),N()&&Hr(N()),l()!==void 0&&x("auto",l()),E()!==void 0&&ki(E()),w(O,(n=a(se))==null?void 0:n.closest("form"),!0),a(O)&&(a(O).addEventListener("submit",pi,{capture:!0}),a(O).addEventListener("reset",yi),(l()==="onfocus"||ee()==="focus")&&a(O).addEventListener("focusin",wi)),l()==="onload"&&(Ge()?Mt():Ve()),a(Ur)&&(oe()||te())&&x("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Ze("load")})});function hr(n,f){return btoa(JSON.stringify({algorithm:n.algorithm,challenge:n.challenge,number:f.number,salt:n.salt,signature:n.signature,test:pe()?!0:void 0,took:f.took}))}function Bo(){for(const n of Je)n.destroy()}function di(){s()&&Pt()&&a(k)===C.VERIFIED?Ve():wt(C.EXPIRED,a(M).expired)}async function Ho(){var n;if(Lt())throw x("mocking error"),new Error("Mocked error.");if(a(qr))return x("using provided json data"),a(qr);if(pe())return x("generating test challenge",{test:pe()}),go(typeof pe()!="boolean"?+pe():void 0);{if(!s()&&a(O)){const I=a(O).getAttribute("action");I!=null&&I.includes("/form/")&&s(I+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");x("fetching challenge from",s());const f={credentials:typeof d()=="boolean"?"include":d(),headers:Ne()!==!1?{"x-altcha-spam-filter":"1"}:{}},v=await hi()(s(),f);if(!v||!(v instanceof Response))throw new Error("Custom fetch function did not return a response.");if(v.status!==200)throw new Error(`Server responded with ${v.status}.`);const b=v.headers.get("X-Altcha-Config"),_=await v.json(),A=new URLSearchParams((n=_.salt.split("?"))==null?void 0:n[1]),p=A.get("expires")||A.get("expire");if(p){const I=new Date(+p*1e3),H=isNaN(I.getTime())?0:I.getTime()-Date.now();H>0&&Hr(H)}if(b)try{const I=JSON.parse(b);I&&typeof I=="object"&&(I.verifyurl&&!I.verifyurl.startsWith("fn:")&&(I.verifyurl=_i(I.verifyurl)),Ti(I))}catch(I){x("unable to configure from X-Altcha-Config",I)}return _}}function Yo(n){var v,b;const f=(v=a(O))==null?void 0:v.querySelector(typeof n=="string"?`input[name="${n}"]`:'input[type="email"]:not([data-no-spamfilter])');return((b=f==null?void 0:f.value)==null?void 0:b.slice(f.value.indexOf("@")))||void 0}function hi(){let n=fetch;if(m())if(x("using customfetch"),typeof m()=="string"){if(n=globalThis[m()]||null,!n)throw new Error(`Custom fetch function not found: ${m()}`)}else n=m();return n}function vi(n,f=[B()||"",document.documentElement.lang||"",...navigator.languages]){const v=Object.keys(n).map(_=>_.toLowerCase()),b=f.reduce((_,A)=>(A=A.toLowerCase(),_||(n[A]?A:null)||v.find(p=>A.split("-")[0]===p.split("-")[0])||null),null);return n[b||"en"]}function Go(){return Ne()==="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 Ne()=="object"?Ne():{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 gi(n){var v;return[...((v=a(O))==null?void 0:v.querySelectorAll(n!=null&&n.length?n.map(b=>`input[name="${b}"]`).join(", "):'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'))||[]].reduce((b,_)=>{const A=_.name,p=_.value;return A&&p&&(b[A]=/\n/.test(p)?p.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
3
|
-
`):p),b},{})}function _i(n,f){const v=new URL(s()||location.origin),b=new URL(n,v);if(b.search||(b.search=v.search),f)for(const _ in f)f[_]!==void 0&&f[_]!==null&&b.searchParams.set(_,f[_]);return b.toString()}function Zo(){const n=cr()!==void 0?cr().split(","):void 0;for(const f of globalThis.altchaPlugins)(!n||n.includes(f.pluginName))&&Je.push(new f({el:a(se),clarify:Mt,dispatch:Ze,getConfiguration:Ni,getFloatingAnchor:Di,getState:Li,log:x,reset:wt,solve:Si,setState:Le,setFloatingAnchor:Oi,verify:Ve}))}function x(...n){(h()||n.some(f=>f instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...n)}function Wo(){w(z,Q.PAUSED,!0)}function Jo(n){w(z,Q.ERROR,!0)}function Ko(){w(z,Q.READY,!0)}function zo(){w(z,Q.LOADING,!0)}function Xo(){w(z,Q.PLAYING,!0)}function Qo(){w(z,Q.PAUSED,!0)}function ea(n){var f;if(n.preventDefault(),n.stopPropagation(),a(Y)){const v=new FormData(n.target),b=String(v.get("code"));if((f=ae())!=null&&f.startsWith("fn:")){const _=ae().replace(/^fn:/,"");if(x(`calling ${_} function instead of verifyurl`),!(_ in globalThis))throw new Error(`Global function "${_}" is undefined.`);return globalThis[_]({challenge:a(Y).challenge,code:b,solution:a(Y).solution})}w(ot,!0),Ri(hr(a(Y).challenge,a(Y).solution),b).then(({reason:_,verified:A})=>{A?(w(Y,null),Le(C.VERIFIED),x("verified"),Dr().then(()=>{var p;(p=a(jr))==null||p.focus(),Ze("verified",{payload:a(Fe)}),l()==="onsubmit"&&$i(a(dr))})):(wt(),w(lt,_||"Verification failed",!0))}).catch(_=>{w(Y,null),Le(C.ERROR,_),x("sentinel verification failed:",_)}).finally(()=>{w(ot,!1)})}}function mi(n){var v;const f=n.target;E()&&f&&!a(se).contains(f)&&(a(k)===C.VERIFIED&&ee()===!1||a(k)===C.VERIFIED&&ee()==="focus"&&!((v=a(O))!=null&&v.matches(":focus-within"))||l()==="off"&&a(k)===C.UNVERIFIED)&&Pi()}function bi(){E()&&a(k)!==C.UNVERIFIED&&Ut()}function ta(n){for(const f of Je)typeof f.onErrorChange=="function"&&f.onErrorChange(a(lt))}function wi(n){a(k)===C.UNVERIFIED?Ve():E()&&ee()==="focus"&&a(k)===C.VERIFIED&&Yr()}function pi(n){const f=n.target;f!=null&&f.hasAttribute("data-code-challenge-form")||(w(dr,n.submitter,!0),a(O)&&l()==="onsubmit"?a(k)===C.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Ve().then(()=>{$i(a(dr))})):a(k)!==C.VERIFIED&&(n.preventDefault(),n.stopPropagation(),a(k)===C.VERIFYING&&Ei()):a(O)&&E()&&l()==="off"&&a(k)===C.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Yr()))}function yi(){wt()}function Ei(){a(k)===C.VERIFYING&&a(M).waitAlert&&alert(a(M).waitAlert)}function Ci(){a(We)?a(We).paused?(a(We).currentTime=0,a(We).play()):a(We).pause():(w(Br,!0),requestAnimationFrame(()=>{var n;(n=a(We))==null||n.play()}))}function ra(n){for(const f of Je)typeof f.onStateChange=="function"&&f.onStateChange(a(k));E()&&a(k)!==C.UNVERIFIED&&requestAnimationFrame(()=>{Ut()}),w(Ft,a(k)===C.VERIFIED)}function Ai(){E()&&Ut()}function Ii(n){return JSON.parse(n)}async function na(n){if(!ae())throw new Error("Attribute verifyurl not set.");x("requesting server verification from",ae());const f={payload:n};if(Ne()!==!1){const{blockedCountries:_,classifier:A,disableRules:p,email:I,expectedLanguages:H,expectedCountries:re,fields:de,ipAddress:Ke,text:Zr,timeZone:_r}=Go();f.blockedCountries=_,f.classifier=A,f.disableRules=p,f.email=I===!1?void 0:Yo(I),f.expectedCountries=re,f.expectedLanguages=H||(fi?[fi]:void 0),f.fields=de===!1?void 0:gi(de),f.ipAddress=Ke===!1?void 0:Ke||"auto",f.text=Zr,f.timeZone=_r===!1?void 0:_r||oi()}const v=await hi()(ae(),{body:JSON.stringify(f),headers:{"content-type":"application/json"},method:"POST"});if(!v||!(v instanceof Response))throw new Error("Custom fetch function did not return a response.");if(v.status!==200)throw new Error(`Server responded with ${v.status}.`);const b=await v.json();if(b!=null&&b.payload&&w(Fe,b.payload,!0),Ze("serververification",b),u()&&b.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ri(n,f){if(!ae())throw new Error("Attribute verifyurl not set.");x("requesting sentinel verification from",ae());const v={code:f,payload:n};it()&&(v.fields=it().fields?gi():void 0,v.timeZone=it().timeZone?oi():void 0);const b=await fetch(ae(),{body:JSON.stringify(v),headers:{"content-type":"application/json"},method:"POST"});if(!b||!(b instanceof Response))throw new Error("Fetch function did not return a response.");if(b.status!==200)throw new Error(`Server responded with ${b.status}.`);const _=await b.json();return _!=null&&_.payload&&w(Fe,_.payload,!0),Ze("sentinelverification",_),_}function $i(n){var f;a(O)&&"requestSubmit"in a(O)?a(O).requestSubmit(n):(f=a(O))!=null&&f.reportValidity()&&(n?n.click():a(O).submit())}function Hr(n){x("expire",n),De&&(clearTimeout(De),De=null),n<1?di():De=setTimeout(di,n)}function ki(n){x("floating",n),E()!==n&&(a(se).style.left="",a(se).style.top=""),E(n===!0||n===""?"auto":n===!1||n==="false"?void 0:E()),E()?(l()||l("onsubmit"),document.addEventListener("scroll",bi),document.addEventListener("click",mi),window.addEventListener("resize",Ai)):l()==="onsubmit"&&l(void 0)}function xi(n){if(!n.algorithm)throw new Error("Invalid challenge. Property algorithm is missing.");if(n.signature===void 0)throw new Error("Invalid challenge. Property signature is missing.");if(!ui.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${ui.join(", ")}`);if(!n.challenge||n.challenge.length<40)throw new Error("Challenge is too short. Min. 40 chars.");if(!n.salt||n.salt.length<10)throw new Error("Salt is too short. Min. 10 chars.")}async function Si(n){let f=null;if("Worker"in window){try{f=await ia(n,n.maxNumber||n.maxnumber||Ae())}catch(v){x(v)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in n)return{data:n,solution:f}}if("obfuscated"in n){const v=await wo(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await v.promise}}return{data:n,solution:await _o(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||Ae()).promise}}async function ia(n,f=typeof pe()=="number"?pe():n.maxNumber||n.maxnumber||Ae(),v=Math.ceil(mt())){const b=[];v=Math.min(16,f,Math.max(1,v));for(let p=0;p<v;p++)b.push(altchaCreateWorker(Ot()));const _=Math.ceil(f/v),A=await Promise.all(b.map((p,I)=>{const H=I*_;return new Promise(re=>{p.addEventListener("message",de=>{if(de.data)for(const Ke of b)Ke!==p&&Ke.postMessage({type:"abort"});re(de.data)}),p.postMessage({payload:n,max:H+_,start:H,type:"work"})})}));for(const p of b)p.terminate();return A.find(p=>!!p)||null}async function Mt(){if(!Ge()){Le(C.ERROR);return}const n=Je.find(f=>f.constructor.pluginName==="obfuscation");if(!n||!("clarify"in n)){Le(C.ERROR),x("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in n&&typeof n.clarify=="function")return n.clarify()}function Ti(n){n.obfuscated!==void 0&&Ge(n.obfuscated),n.auto!==void 0&&(l(n.auto),l()==="onload"&&(Ge()?Mt():Ve())),n.blockspam!==void 0&&u(!!n.blockspam),n.customfetch!==void 0&&m(n.customfetch),n.floatinganchor!==void 0&&q(n.floatinganchor),n.delay!==void 0&&g(n.delay),n.floatingoffset!==void 0&&_e(n.floatingoffset),n.floating!==void 0&&ki(n.floating),n.expire!==void 0&&(Hr(n.expire),N(n.expire)),n.challenge&&(c(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),xi(a(qr))),n.challengeurl!==void 0&&s(n.challengeurl),n.debug!==void 0&&h(!!n.debug),n.hidefooter!==void 0&&oe(!!n.hidefooter),n.hidelogo!==void 0&&te(!!n.hidelogo),n.language!==void 0&&_t(vi(o(),[n.language])),n.maxnumber!==void 0&&Ae(+n.maxnumber),n.mockerror!==void 0&&Lt(!!n.mockerror),n.name!==void 0&&ce(n.name),n.refetchonexpire!==void 0&&Pt(!!n.refetchonexpire),n.sentinel!==void 0&&typeof n.sentinel=="object"&&it(n.sentinel),n.spamfilter!==void 0&&Ne(typeof n.spamfilter=="object"?n.spamfilter:!!n.spamfilter),n.strings&&_t(typeof n.strings=="string"?n.strings:JSON.stringify(n.strings)),n.test!==void 0&&pe(typeof n.test=="number"?n.test:!!n.test),n.verifyurl!==void 0&&ae(n.verifyurl),n.workers!==void 0&&mt(+n.workers),n.workerurl!==void 0&&Ot(n.workerurl)}function Ni(){return{auto:l(),blockspam:u(),challengeurl:s(),debug:h(),delay:g(),expire:N(),floating:E(),floatinganchor:q(),floatingoffset:_e(),hidefooter:oe(),hidelogo:te(),name:ce(),maxnumber:Ae(),mockerror:Lt(),obfuscated:Ge(),refetchonexpire:Pt(),spamfilter:Ne(),strings:a(M),test:pe(),verifyurl:ae(),workers:mt(),workerurl:Ot()}}function Di(){return a(bt)}function la(n){return Je.find(f=>f.constructor.pluginName===n)}function Li(){return a(k)}function Pi(){a(se).style.display="none"}function Ut(n=20){var f;if(a(se))if(a(bt)||w(bt,(q()?document.querySelector(q()):(f=a(O))==null?void 0:f.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||a(O),!0),a(bt)){const v=parseInt(_e(),10)||12,b=a(bt).getBoundingClientRect(),_=a(se).getBoundingClientRect(),A=document.documentElement.clientHeight,p=document.documentElement.clientWidth,I=E()==="auto"?b.bottom+_.height+v+n>A:E()==="top",H=Math.max(n,Math.min(p-n-_.width,b.left+b.width/2-_.width/2));if(I?a(se).style.top=`${b.top-(_.height+v)}px`:a(se).style.top=`${b.bottom+v}px`,a(se).style.left=`${H}px`,a(se).setAttribute("data-floating",I?"top":"bottom"),a(Vt)){const re=a(Vt).getBoundingClientRect();a(Vt).style.left=b.left-H+b.width/2-re.width/2+"px"}}else x("unable to find floating anchor element")}function wt(n=C.UNVERIFIED,f=null){De&&(clearTimeout(De),De=null),w(Ft,!1),w(Fe,null),w(Y,null),w(Br,!1),w(z,null),Le(n,f)}function Oi(n){w(bt,n,!0)}function Le(n,f=null){w(k,n,!0),w(lt,f,!0),Ze("statechange",{payload:a(Fe),state:a(k)})}function Yr(){a(se).style.display="block",E()&&Ut()}async function Ve(){return wt(C.VERIFYING),await new Promise(n=>setTimeout(n,g()||0)),Ho().then(n=>(xi(n),x("challenge",n),Si(n))).then(({data:n,solution:f})=>{var v;if(x("solution",f),!f||n&&"challenge"in n&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0&&"challenge"in n)if(ae()&&"codeChallenge"in n)["INPUT","BUTTON","SELECT","TEXTAREA"].includes(((v=document.activeElement)==null?void 0:v.tagName)||"")&&y()===!1&&document.activeElement.blur(),w(Y,{challenge:n,solution:f},!0);else{if(ae()&&it()!==void 0)return Ri(hr(n,f));if(ae())return na(hr(n,f));w(Fe,hr(n,f),!0),x("payload",a(Fe))}else throw x("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{a(Y)?(Le(C.CODE),Dr().then(()=>{Ze("code",{codeChallenge:a(Y)})})):(Le(C.VERIFIED),x("verified"),Dr().then(()=>{Ze("verified",{payload:a(Fe)})}))}).catch(n=>{x(n),Le(C.ERROR,n.message)})}var Fi=Vo(),Vi=It(Fi);Kl(Vi,t,"default",{});var qt=J(Vi,2),Gr=W(qt),vr=W(Gr);let Mi;var Ui=W(vr);{var oa=n=>{Mr(n)};K(Ui,n=>{a(k)===C.VERIFYING&&n(oa)})}var at=J(Ui,2);Kn(at),at.__change=[Co,k,Ne,O,Ft,Ge,Mt,Ve],ar(at,n=>w(jr,n),()=>a(jr)),Z(vr);var gr=J(vr,2),aa=W(gr);{var sa=n=>{var f=or(),v=It(f);nt(v,()=>a(M).verified),j(n,f)},ua=(n,f)=>{{var v=_=>{var A=or(),p=It(A);nt(p,()=>a(M).verifying),j(_,A)},b=(_,A)=>{{var p=H=>{var re=or(),de=It(re);nt(de,()=>a(M).verificationRequired),j(H,re)},I=H=>{var re=or(),de=It(re);nt(de,()=>a(M).label),j(H,re)};K(_,H=>{a(k)===C.CODE?H(p):H(I,!1)},A)}};K(n,_=>{a(k)===C.VERIFYING?_(v):_(b,!1)},f)}};K(aa,n=>{a(k)===C.VERIFIED?n(sa):n(ua,!1)})}Z(gr);var qi=J(gr,2);{var fa=n=>{var f=Io();Kn(f),ke(()=>{P(f,"name",ce()),to(f,a(Fe))}),j(n,f)};K(qi,n=>{a(k)===C.VERIFIED&&n(fa)})}var ji=J(qi,2);{var ca=n=>{var f=Ro(),v=W(f);P(v,"href",qo),Z(f),ke(()=>P(v,"aria-label",a(M).ariaLinkLabel)),j(n,f)};K(ji,n=>{(te()!==!0||a(Ur))&&n(ca)})}var da=J(ji,2);{var ha=n=>{var f=No(),v=J(W(f),2),b=W(v),_=J(b,2);Bl(_,!y()),_.__keydown=[yo,Ci];var A=J(_,2),p=W(A),I=W(p);{var H=Ie=>{var X=So();X.__click=Ci;var mr=W(X);{var jt=pt=>{Mr(pt,()=>20)},ya=(pt,Ea)=>{{var Ca=yt=>{var Wr=$o();j(yt,Wr)},Aa=(yt,Wr)=>{{var Ia=Et=>{var Jr=ko();j(Et,Jr)},Ra=Et=>{var Jr=xo();j(Et,Jr)};K(yt,Et=>{a(z)===Q.PLAYING?Et(Ia):Et(Ra,!1)},Wr)}};K(pt,yt=>{a(z)===Q.ERROR?yt(Ca):yt(Aa,!1)},Ea)}};K(mr,pt=>{a(z)===Q.LOADING?pt(jt):pt(ya,!1)})}Z(X),ke(()=>{P(X,"title",a(M).getAudioChallenge),X.disabled=a(z)===Q.LOADING||a(z)===Q.ERROR||a(ot),P(X,"aria-label",a(z)===Q.LOADING?a(M).loading:a(M).getAudioChallenge)}),j(Ie,X)};K(I,Ie=>{a(Y).challenge.codeChallenge.audio&&Ie(H)})}var re=J(I,2);re.__click=[Eo,Ve],Z(p);var de=J(p,2),Ke=W(de);{var Zr=Ie=>{Mr(Ie,()=>16)};K(Ke,Ie=>{a(ot)&&Ie(Zr)})}var _r=J(Ke);Z(de),Z(A);var wa=J(A,2);{var pa=Ie=>{var X=To(),mr=W(X);Z(X),ar(X,jt=>w(We,jt),()=>a(We)),ke(jt=>P(mr,"src",jt),[()=>_i(a(Y).challenge.codeChallenge.audio,{language:B()})]),Ye("loadstart",X,zo),Ye("canplay",X,Ko),Ye("pause",X,Qo),Ye("playing",X,Xo),Ye("ended",X,Wo),Ye("error",mr,Jo),j(Ie,X)};K(wa,Ie=>{a(Y).challenge.codeChallenge.audio&&a(Br)&&Ie(pa)})}Z(v),Z(f),ke(()=>{P(f,"aria-label",a(M).verificationRequired),P(b,"src",a(Y).challenge.codeChallenge.image),P(_,"minlength",a(Y).challenge.codeChallenge.length||1),P(_,"maxlength",a(Y).challenge.codeChallenge.length),P(_,"placeholder",a(M).enterCode),P(_,"aria-label",a(z)===Q.LOADING?a(M).loading:a(z)===Q.PLAYING?"":a(M).enterCodeAria),P(_,"aria-live",a(z)?"assertive":"polite"),P(_,"aria-busy",a(z)===Q.LOADING),_.disabled=a(ot),P(re,"aria-label",a(M).reload),P(re,"title",a(M).reload),re.disabled=a(ot),de.disabled=a(ot),P(de,"aria-label",a(M).verify),Zl(_r,` ${a(M).verify??""}`)}),Ye("submit",v,ea,!0),j(n,f)};K(da,n=>{var f;(f=a(Y))!=null&&f.challenge.codeChallenge&&n(ha)})}Z(Gr);var Bi=J(Gr,2);{var va=n=>{var f=Po(),v=J(W(f),2);{var b=A=>{var p=Do(),I=W(p);nt(I,()=>a(M).expired),Z(p),ke(()=>P(p,"title",a(lt))),j(A,p)},_=A=>{var p=Lo(),I=W(p);nt(I,()=>a(M).error),Z(p),ke(()=>P(p,"title",a(lt))),j(A,p)};K(v,A=>{a(k)===C.EXPIRED?A(b):A(_,!1)})}Z(f),j(n,f)};K(Bi,n=>{(a(lt)||a(k)===C.EXPIRED)&&n(va)})}var Hi=J(Bi,2);{var ga=n=>{var f=Oo(),v=W(f),b=W(v);nt(b,()=>a(M).footer),Z(v),Z(f),j(n,f)};K(Hi,n=>{a(M).footer&&(oe()!==!0||a(Ur))&&n(ga)})}var _a=J(Hi,2);{var ma=n=>{var f=Fo();ar(f,v=>w(Vt,v),()=>a(Vt)),j(n,f)};K(_a,n=>{E()&&n(ma)})}Z(qt),ar(qt,n=>w(se,n),()=>a(se)),ke(n=>{P(qt,"data-state",a(k)),P(qt,"data-floating",E()),Mi=Xl(vr,1,"altcha-checkbox",null,Mi,n),P(at,"id",a(ci)),at.required=l()!=="onsubmit"&&(!E()||l()!=="off"),P(gr,"for",a(ci))},[()=>({"altcha-checkbox-verifying":a(k)===C.VERIFYING})]),Ye("invalid",at,Ei),no(at,()=>a(Ft),n=>w(Ft,n)),j(e,Fi);var ba=qn({clarify:Mt,configure:Ti,getConfiguration:Ni,getFloatingAnchor:Di,getPlugin:la,getState:Li,hide:Pi,repositionFloating:Ut,reset:wt,setFloatingAnchor:Oi,setState:Le,show:Yr,verify:Ve,get auto(){return l()},set auto(n=void 0){l(n),R()},get blockspam(){return u()},set blockspam(n=void 0){u(n),R()},get challengeurl(){return s()},set challengeurl(n=void 0){s(n),R()},get challengejson(){return c()},set challengejson(n=void 0){c(n),R()},get credentials(){return d()},set credentials(n=void 0){d(n),R()},get customfetch(){return m()},set customfetch(n=void 0){m(n),R()},get debug(){return h()},set debug(n=!1){h(n),R()},get delay(){return g()},set delay(n=0){g(n),R()},get disableautofocus(){return y()},set disableautofocus(n=!1){y(n),R()},get expire(){return N()},set expire(n=void 0){N(n),R()},get floating(){return E()},set floating(n=void 0){E(n),R()},get floatinganchor(){return q()},set floatinganchor(n=void 0){q(n),R()},get floatingoffset(){return _e()},set floatingoffset(n=void 0){_e(n),R()},get floatingpersist(){return ee()},set floatingpersist(n=!1){ee(n),R()},get hidefooter(){return oe()},set hidefooter(n=!1){oe(n),R()},get hidelogo(){return te()},set hidelogo(n=!1){te(n),R()},get id(){return gt()},set id(n=void 0){gt(n),R()},get language(){return B()},set language(n=void 0){B(n),R()},get name(){return ce()},set name(n="altcha"){ce(n),R()},get maxnumber(){return Ae()},set maxnumber(n=1e6){Ae(n),R()},get mockerror(){return Lt()},set mockerror(n=!1){Lt(n),R()},get obfuscated(){return Ge()},set obfuscated(n=void 0){Ge(n),R()},get plugins(){return cr()},set plugins(n=void 0){cr(n),R()},get refetchonexpire(){return Pt()},set refetchonexpire(n=!0){Pt(n),R()},get sentinel(){return it()},set sentinel(n=void 0){it(n),R()},get spamfilter(){return Ne()},set spamfilter(n=!1){Ne(n),R()},get strings(){return _t()},set strings(n=void 0){_t(n),R()},get test(){return pe()},set test(n=!1){pe(n),R()},get verifyurl(){return ae()},set verifyurl(n=void 0){ae(n),R()},get workers(){return mt()},set workers(n=Math.min(16,navigator.hardwareConcurrency||8)){mt(n),R()},get workerurl(){return Ot()},set workerurl(n=void 0){Ot(n),R()}});return i(),ba}Gl(["change","keydown","click"]),customElements.define("altcha-widget",ho(ai,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{type:"Boolean"},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:{},credentials:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},language:{},name:{},obfuscated:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1)),globalThis.altchaCreateWorker=e=>new Worker(new URL(e||"./worker.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:T&&T.tagName.toUpperCase()==="SCRIPT"&&T.src||new URL("altcha.umd.cjs",document.baseURI).href)),S.Altcha=ai,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(S,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(S=typeof globalThis<"u"?globalThis:S||self,T(S.altcha={}))})(this,function(S){"use strict";var Ta=Object.defineProperty;var zi=S=>{throw TypeError(S)};var Na=(S,T,Z)=>T in S?Ta(S,T,{enumerable:!0,configurable:!0,writable:!0,value:Z}):S[T]=Z;var ke=(S,T,Z)=>Na(S,typeof T!="symbol"?T+"":T,Z),Xi=(S,T,Z)=>T.has(S)||zi("Cannot "+Z);var ve=(S,T,Z)=>(Xi(S,T,"read from private field"),Z?Z.call(S):T.get(S)),nr=(S,T,Z)=>T.has(S)?zi("Cannot add the same private member more than once"):T instanceof WeakSet?T.add(S):T.set(S,Z),rr=(S,T,Z,Zt)=>(Xi(S,T,"write to private field"),Zt?Zt.call(S,Z):T.set(S,Z),Z);var vi,Ve,ye;var T=typeof document<"u"?document.currentScript:null;const Z="5";typeof window<"u"&&((vi=window.__svelte??(window.__svelte={})).v??(vi.v=new Set)).add(Z);const Zt=1,Qi=4,el=8,tl=16,nl=1,rl=2,Cn="[",ir="[!",lr="]",ct={},ue=Symbol(),il="http://www.w3.org/1999/xhtml",or=!1;function ar(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var sr=Array.isArray,ll=Array.prototype.indexOf,ol=Array.from,Wt=Object.keys,kt=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,al=Object.getOwnPropertyDescriptors,sl=Object.prototype,ul=Array.prototype,ur=Object.getPrototypeOf,fr=Object.isExtensible;const dt=()=>{};function cr(e){for(var t=0;t<e.length;t++)e[t]()}function fl(e,t,n=!1){return e===void 0?n?t():t:e}const Ee=2,dr=4,Jt=8,An=16,Fe=32,et=64,Kt=128,he=256,zt=512,fe=1024,xe=2048,tt=4096,vt=8192,Xt=16384,cl=32768,In=65536,dl=1<<19,vr=1<<20,Rn=1<<21,xt=Symbol("$state"),hr=Symbol("legacy props"),vl=Symbol("");function hl(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function gl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function _l(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ml(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bl(){throw new Error("https://svelte.dev/e/hydration_failed")}function pl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function yl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function wl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function El(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Qt(e){console.warn("https://svelte.dev/e/hydration_mismatch")}let F=!1;function ht(e){F=e}let V;function qe(e){if(e===null)throw Qt(),ct;return V=e}function gt(){return qe(Be(V))}function W(e){if(F){if(Be(V)!==null)throw Qt(),ct;V=e}}function Cl(){for(var e=0,t=V;;){if(t.nodeType===8){var n=t.data;if(n===lr){if(e===0)return t;e-=1}else(n===Cn||n===ir)&&(e+=1)}var i=Be(t);t.remove(),t=i}}let Al=!1;function je(e){if(typeof e!="object"||e===null||xt in e)return e;const t=ur(e);if(t!==sl&&t!==ul)return e;var n=new Map,i=sr(e),o=M(0),l=L,u=s=>{var c=L;Te(l);var d=s();return Te(c),d};return i&&n.set("length",M(e.length)),new Proxy(e,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&yl();var b=n.get(c);return b===void 0?(b=u(()=>M(d.value)),n.set(c,b)):y(b,u(()=>je(d.value))),!0},deleteProperty(s,c){var d=n.get(c);if(d===void 0)c in s&&(n.set(c,u(()=>M(ue))),kn(o));else{if(i&&typeof c=="string"){var b=n.get("length"),v=Number(c);Number.isInteger(v)&&v<b.v&&y(b,v)}y(d,ue),kn(o)}return!0},get(s,c,d){var w;if(c===xt)return e;var b=n.get(c),v=c in s;if(b===void 0&&(!v||(w=Qe(s,c))!=null&&w.writable)&&(b=u(()=>M(je(v?s[c]:ue))),n.set(c,b)),b!==void 0){var _=a(b);return _===ue?void 0:_}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var b=n.get(c);b&&(d.value=a(b))}else if(d===void 0){var v=n.get(c),_=v==null?void 0:v.v;if(v!==void 0&&_!==ue)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return d},has(s,c){var _;if(c===xt)return!0;var d=n.get(c),b=d!==void 0&&d.v!==ue||Reflect.has(s,c);if(d!==void 0||P!==null&&(!b||(_=Qe(s,c))!=null&&_.writable)){d===void 0&&(d=u(()=>M(b?je(s[c]):ue)),n.set(c,d));var v=a(d);if(v===ue)return!1}return b},set(s,c,d,b){var te;var v=n.get(c),_=c in s;if(i&&c==="length")for(var w=d;w<v.v;w+=1){var D=n.get(w+"");D!==void 0?y(D,ue):w in s&&(D=u(()=>M(ue)),n.set(w+"",D))}v===void 0?(!_||(te=Qe(s,c))!=null&&te.writable)&&(v=u(()=>M(void 0)),y(v,u(()=>je(d))),n.set(c,v)):(_=v.v!==ue,y(v,u(()=>je(d))));var A=Reflect.getOwnPropertyDescriptor(s,c);if(A!=null&&A.set&&A.set.call(b,d),!_){if(i&&typeof c=="string"){var q=n.get("length"),_e=Number(c);Number.isInteger(_e)&&_e>=q.v&&y(q,_e+1)}kn(o)}return!0},ownKeys(s){a(o);var c=Reflect.ownKeys(s).filter(v=>{var _=n.get(v);return _===void 0||_.v!==ue});for(var[d,b]of n)b.v!==ue&&!(d in s)&&c.push(d);return c},setPrototypeOf(){wl()}})}function kn(e,t=1){y(e,e.v+t)}var gr,_r,mr,br;function xn(){if(gr===void 0){gr=window,_r=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;mr=Qe(t,"firstChild").get,br=Qe(t,"nextSibling").get,fr(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),fr(n)&&(n.__t=void 0)}}function en(e=""){return document.createTextNode(e)}function be(e){return mr.call(e)}function Be(e){return br.call(e)}function J(e,t){if(!F)return be(e);var n=be(V);return n===null&&(n=V.appendChild(en())),qe(n),n}function $t(e,t){if(!F){var n=be(e);return n instanceof Comment&&n.data===""?Be(n):n}return V}function K(e,t=1,n=!1){let i=F?V:e;for(var o;t--;)o=i,i=Be(i);if(!F)return i;var l=i==null?void 0:i.nodeType;if(n&&l!==3){var u=en();return i===null?o==null||o.after(u):i.before(u),qe(u),u}return qe(i),i}function Il(e){e.textContent=""}function pr(e){return e===this.v}function yr(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function $n(e){return!yr(e,this.v)}function tn(e){var t=Ee|xe,n=L!==null&&(L.f&Ee)!==0?L:null;return P===null||n!==null&&(n.f&he)!==0?t|=he:P.f|=vr,{ctx:oe,deps:null,effects:null,equals:pr,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:n??P}}function St(e){const t=tn(e);return Pr(t),t}function Rl(e){const t=tn(e);return t.equals=$n,t}function wr(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)He(t[n])}}function kl(e){for(var t=e.parent;t!==null;){if((t.f&Ee)===0)return t;t=t.parent}return null}function Er(e){var t,n=P;Ye(kl(e));try{wr(e),t=Ur(e)}finally{Ye(n)}return t}function Cr(e){var t=Er(e),n=(Ge||(e.f&he)!==0)&&e.deps!==null?tt:fe;Ce(e,n),e.equals(t)||(e.v=t,e.wv=Fr())}function xl(e){P===null&&L===null&&_l(),L!==null&&(L.f&he)!==0&&P===null&&gl(),Dt&&hl()}function $l(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function nt(e,t,n,i=!0){var o=P,l={ctx:oe,deps:null,nodes_start:null,nodes_end:null,f:e|xe,first:null,fn:t,last:null,next:null,parent:o,prev:null,teardown:null,transitions:null,wv:0};if(n)try{Fn(l),l.f|=cl}catch(c){throw He(l),c}else t!==null&&un(l);var u=n&&l.deps===null&&l.first===null&&l.nodes_start===null&&l.teardown===null&&(l.f&(vr|Kt))===0;if(!u&&i&&(o!==null&&$l(l,o),L!==null&&(L.f&Ee)!==0)){var s=L;(s.effects??(s.effects=[])).push(l)}return l}function Sn(e){const t=nt(Jt,null,!1);return Ce(t,fe),t.teardown=e,t}function Tn(e){xl();var t=P!==null&&(P.f&Fe)!==0&&oe!==null&&!oe.m;if(t){var n=oe;(n.e??(n.e=[])).push({fn:e,effect:P,reaction:L})}else{var i=Nn(e);return i}}function Sl(e){const t=nt(et,e,!0);return()=>{He(t)}}function Tl(e){const t=nt(et,e,!0);return(n={})=>new Promise(i=>{n.outro?Pn(t,()=>{He(t),i(void 0)}):(He(t),i(void 0))})}function Nn(e){return nt(dr,e,!1)}function Dn(e){return nt(Jt,e,!0)}function $e(e,t=[],n=tn){const i=t.map(n);return Ar(()=>e(...i.map(a)))}function Ar(e,t=0){return nt(Jt|An|t,e,!0)}function Ln(e,t=!0){return nt(Jt|Fe,e,!0,t)}function Ir(e){var t=e.teardown;if(t!==null){const n=Dt,i=L;Lr(!0),Te(null);try{t.call(null)}finally{Lr(n),Te(i)}}}function Rr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){var i=n.next;(n.f&et)!==0?n.parent=null:He(n,t),n=i}}function Nl(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&Fe)===0&&He(t),t=n}}function He(e,t=!0){var n=!1;(t||(e.f&dl)!==0)&&e.nodes_start!==null&&(kr(e.nodes_start,e.nodes_end),n=!0),Rr(e,t&&!n),sn(e,0),Ce(e,Xt);var i=e.transitions;if(i!==null)for(const l of i)l.stop();Ir(e);var o=e.parent;o!==null&&o.first!==null&&xr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function kr(e,t){for(;e!==null;){var n=e===t?null:Be(e);e.remove(),e=n}}function xr(e){var t=e.parent,n=e.prev,i=e.next;n!==null&&(n.next=i),i!==null&&(i.prev=n),t!==null&&(t.first===e&&(t.first=i),t.last===e&&(t.last=n))}function Pn(e,t){var n=[];$r(e,n,!0),Dl(n,()=>{He(e),t&&t()})}function Dl(e,t){var n=e.length;if(n>0){var i=()=>--n||t();for(var o of e)o.out(i)}else t()}function $r(e,t,n){if((e.f&vt)===0){if(e.f^=vt,e.transitions!==null)for(const u of e.transitions)(u.is_global||n)&&t.push(u);for(var i=e.first;i!==null;){var o=i.next,l=(i.f&In)!==0||(i.f&Fe)!==0;$r(i,t,l?n:!1),i=o}}}function Sr(e){Tr(e,!0)}function Tr(e,t){if((e.f&vt)!==0){e.f^=vt,(e.f&fe)===0&&(e.f^=fe),Pt(e)&&(Ce(e,xe),un(e));for(var n=e.first;n!==null;){var i=n.next,o=(n.f&In)!==0||(n.f&Fe)!==0;Tr(n,o?t:!1),n=i}if(e.transitions!==null)for(const l of e.transitions)(l.is_global||t)&&l.in()}}const Ll=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Tt=[],Nt=[];function Nr(){var e=Tt;Tt=[],cr(e)}function Dr(){var e=Nt;Nt=[],cr(e)}function On(e){Tt.length===0&&queueMicrotask(Nr),Tt.push(e)}function Pl(e){Nt.length===0&&Ll(Dr),Nt.push(e)}function Ol(){Tt.length>0&&Nr(),Nt.length>0&&Dr()}let nn=!1,rn=!1,ln=null,rt=!1,Dt=!1;function Lr(e){Dt=e}let Lt=[],Da=[],L=null,Se=!1;function Te(e){L=e}let P=null;function Ye(e){P=e}let ie=null;function Pr(e){L!==null&&L.f&Rn&&(ie===null?ie=[e]:ie.push(e))}let le=null,ge=0,pe=null;function Fl(e){pe=e}let Or=1,on=0,Ge=!1;function Fr(){return++Or}function Pt(e){var v;var t=e.f;if((t&xe)!==0)return!0;if((t&tt)!==0){var n=e.deps,i=(t&he)!==0;if(n!==null){var o,l,u=(t&zt)!==0,s=i&&P!==null&&!Ge,c=n.length;if(u||s){var d=e,b=d.parent;for(o=0;o<c;o++)l=n[o],(u||!((v=l==null?void 0:l.reactions)!=null&&v.includes(d)))&&(l.reactions??(l.reactions=[])).push(d);u&&(d.f^=zt),s&&b!==null&&(b.f&he)===0&&(d.f^=he)}for(o=0;o<c;o++)if(l=n[o],Pt(l)&&Cr(l),l.wv>e.wv)return!0}(!i||P!==null&&!Ge)&&Ce(e,fe)}return!1}function Vl(e,t){for(var n=t;n!==null;){if((n.f&Kt)!==0)try{n.fn(e);return}catch{n.f^=Kt}n=n.parent}throw nn=!1,e}function Vr(e){return(e.f&Xt)===0&&(e.parent===null||(e.parent.f&Kt)===0)}function an(e,t,n,i){if(nn){if(n===null&&(nn=!1),Vr(t))throw e;return}if(n!==null&&(nn=!0),Vl(e,t),Vr(t))throw e}function Mr(e,t,n=!0){var i=e.reactions;if(i!==null)for(var o=0;o<i.length;o++){var l=i[o];ie!=null&&ie.includes(e)||((l.f&Ee)!==0?Mr(l,t,!1):t===l&&(n?Ce(l,xe):(l.f&fe)!==0&&Ce(l,tt),un(l)))}}function Ur(e){var w;var t=le,n=ge,i=pe,o=L,l=Ge,u=ie,s=oe,c=Se,d=e.f;le=null,ge=0,pe=null,Ge=(d&he)!==0&&(Se||!rt||L===null),L=(d&(Fe|et))===0?e:null,ie=null,Hr(e.ctx),Se=!1,on++,e.f|=Rn;try{var b=(0,e.fn)(),v=e.deps;if(le!==null){var _;if(sn(e,ge),v!==null&&ge>0)for(v.length=ge+le.length,_=0;_<le.length;_++)v[ge+_]=le[_];else e.deps=v=le;if(!Ge)for(_=ge;_<v.length;_++)((w=v[_]).reactions??(w.reactions=[])).push(e)}else v!==null&&ge<v.length&&(sn(e,ge),v.length=ge);if(Zr()&&pe!==null&&!Se&&v!==null&&(e.f&(Ee|tt|xe))===0)for(_=0;_<pe.length;_++)Mr(pe[_],e);return o!==null&&o!==e&&(on++,pe!==null&&(i===null?i=pe:i.push(...pe))),b}finally{le=t,ge=n,pe=i,L=o,Ge=l,ie=u,Hr(s),Se=c,e.f^=Rn}}function Ml(e,t){let n=t.reactions;if(n!==null){var i=ll.call(n,e);if(i!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[i]=n[o],n.pop())}}n===null&&(t.f&Ee)!==0&&(le===null||!le.includes(t))&&(Ce(t,tt),(t.f&(he|zt))===0&&(t.f^=zt),wr(t),sn(t,0))}function sn(e,t){var n=e.deps;if(n!==null)for(var i=t;i<n.length;i++)Ml(e,n[i])}function Fn(e){var t=e.f;if((t&Xt)===0){Ce(e,fe);var n=P,i=oe,o=rt;P=e,rt=!0;try{(t&An)!==0?Nl(e):Rr(e),Ir(e);var l=Ur(e);e.teardown=typeof l=="function"?l:null,e.wv=Or;var u=e.deps,s;or&&Al&&e.f&xe}catch(c){an(c,e,n,i||e.ctx)}finally{rt=o,P=n}}}function Ul(){try{ml()}catch(e){if(ln!==null)an(e,ln,null);else throw e}}function qr(){var e=rt;try{var t=0;for(rt=!0;Lt.length>0;){t++>1e3&&Ul();var n=Lt,i=n.length;Lt=[];for(var o=0;o<i;o++){var l=jl(n[o]);ql(l)}Ot.clear()}}finally{rn=!1,rt=e,ln=null}}function ql(e){var t=e.length;if(t!==0)for(var n=0;n<t;n++){var i=e[n];if((i.f&(Xt|vt))===0)try{Pt(i)&&(Fn(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?xr(i):i.fn=null))}catch(o){an(o,i,null,i.ctx)}}}function un(e){rn||(rn=!0,queueMicrotask(qr));for(var t=ln=e;t.parent!==null;){t=t.parent;var n=t.f;if((n&(et|Fe))!==0){if((n&fe)===0)return;t.f^=fe}}Lt.push(t)}function jl(e){for(var t=[],n=e;n!==null;){var i=n.f,o=(i&(Fe|et))!==0,l=o&&(i&fe)!==0;if(!l&&(i&vt)===0){if((i&dr)!==0)t.push(n);else if(o)n.f^=fe;else try{Pt(n)&&Fn(n)}catch(c){an(c,n,null,n.ctx)}var u=n.first;if(u!==null){n=u;continue}}var s=n.parent;for(n=n.next;n===null&&s!==null;)n=s.next,s=s.parent}return t}function R(e){for(var t;;){if(Ol(),Lt.length===0)return t;rn=!0,qr()}}async function Vn(){await Promise.resolve(),R()}function a(e){var t=e.f,n=(t&Ee)!==0;if(L!==null&&!Se){if(!(ie!=null&&ie.includes(e))){var i=L.deps;e.rv<on&&(e.rv=on,le===null&&i!==null&&i[ge]===e?ge++:le===null?le=[e]:(!Ge||!le.includes(e))&&le.push(e))}}else if(n&&e.deps===null&&e.effects===null){var o=e,l=o.parent;l!==null&&(l.f&he)===0&&(o.f^=he)}return n&&(o=e,Pt(o)&&Cr(o)),Dt&&Ot.has(e)?Ot.get(e):e.v}function it(e){var t=Se;try{return Se=!0,e()}finally{Se=t}}const Bl=-7169;function Ce(e,t){e.f=e.f&Bl|t}const Ot=new Map;function jr(e,t){var n={f:0,v:e,reactions:null,equals:pr,rv:0,wv:0};return n}function M(e,t){const n=jr(e);return Pr(n),n}function Mn(e,t=!1){const n=jr(e);return t||(n.equals=$n),n}function y(e,t,n=!1){L!==null&&!Se&&Zr()&&(L.f&(Ee|An))!==0&&!(ie!=null&&ie.includes(e))&&El();let i=n?je(t):t;return Hl(e,i)}function Hl(e,t){if(!e.equals(t)){var n=e.v;Dt?Ot.set(e,t):Ot.set(e,n),e.v=t,(e.f&Ee)!==0&&((e.f&xe)!==0&&Er(e),Ce(e,(e.f&he)===0?fe:tt)),e.wv=Fr(),Br(e,xe),P!==null&&(P.f&fe)!==0&&(P.f&(Fe|et))===0&&(pe===null?Fl([e]):pe.push(e))}return t}function Br(e,t){var n=e.reactions;if(n!==null)for(var i=n.length,o=0;o<i;o++){var l=n[o],u=l.f;(u&xe)===0&&(Ce(l,t),(u&(fe|he))!==0&&((u&Ee)!==0?Br(l,tt):un(l)))}}let oe=null;function Hr(e){oe=e}function Yr(e,t=!1,n){var i=oe={p:oe,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};Sn(()=>{i.d=!0})}function Gr(e){const t=oe;if(t!==null){e!==void 0&&(t.x=e);const u=t.e;if(u!==null){var n=P,i=L;t.e=null;try{for(var o=0;o<u.length;o++){var l=u[o];Ye(l.effect),Te(l.reaction),Nn(l.fn)}}finally{Ye(n),Te(i)}}oe=t.p,t.m=!0}return e||{}}function Zr(){return!0}const Yl=["touchstart","touchmove"];function Gl(e){return Yl.includes(e)}function Zl(e,t){if(t){const n=document.body;e.autofocus=!0,On(()=>{document.activeElement===n&&e.focus()})}}let Wr=!1;function Jr(){Wr||(Wr=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const n of e.target.elements)(t=n.__on_r)==null||t.call(n)})},{capture:!0}))}function Kr(e){var t=L,n=P;Te(null),Ye(null);try{return e()}finally{Te(t),Ye(n)}}function Wl(e,t,n,i=n){e.addEventListener(t,()=>Kr(n));const o=e.__on_r;o?e.__on_r=()=>{o(),i(!0)}:e.__on_r=()=>i(!0),Jr()}const zr=new Set,Un=new Set;function Jl(e,t,n,i={}){function o(l){if(i.capture||Ft.call(t,l),!l.cancelBubble)return Kr(()=>n==null?void 0:n.call(this,l))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?On(()=>{t.addEventListener(e,o,i)}):t.addEventListener(e,o,i),o}function Ze(e,t,n,i,o){var l={capture:i,passive:o},u=Jl(e,t,n,l);(t===document.body||t===window||t===document)&&Sn(()=>{t.removeEventListener(e,u,l)})}function Kl(e){for(var t=0;t<e.length;t++)zr.add(e[t]);for(var n of Un)n(e)}function Ft(e){var te;var t=this,n=t.ownerDocument,i=e.type,o=((te=e.composedPath)==null?void 0:te.call(e))||[],l=o[0]||e.target,u=0,s=e.__root;if(s){var c=o.indexOf(s);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var d=o.indexOf(t);if(d===-1)return;c<=d&&(u=c)}if(l=o[u]||e.target,l!==t){kt(e,"currentTarget",{configurable:!0,get(){return l||n}});var b=L,v=P;Te(null),Ye(null);try{for(var _,w=[];l!==null;){var D=l.assignedSlot||l.parentNode||l.host||null;try{var A=l["__"+i];if(A!=null&&(!l.disabled||e.target===l))if(sr(A)){var[q,..._e]=A;q.apply(l,[e,..._e])}else A.call(l,e)}catch(ae){_?w.push(ae):_=ae}if(e.cancelBubble||D===t||D===null)break;l=D}if(_){for(let ae of w)queueMicrotask(()=>{throw ae});throw _}}finally{e.__root=t,delete e.currentTarget,Te(b),Ye(v)}}}function qn(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function Ne(e,t){var n=P;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function Ae(e,t){var n=(t&nl)!==0,i=(t&rl)!==0,o,l=!e.startsWith("<!>");return()=>{if(F)return Ne(V,null),V;o===void 0&&(o=qn(l?e:"<!>"+e),n||(o=be(o)));var u=i||_r?document.importNode(o,!0):o.cloneNode(!0);if(n){var s=be(u),c=u.lastChild;Ne(s,c)}else Ne(u,u);return u}}function fn(e,t,n="svg"){var i=!e.startsWith("<!>"),o=`<${n}>${i?e:"<!>"+e}</${n}>`,l;return()=>{if(F)return Ne(V,null),V;if(!l){var u=qn(o),s=be(u);l=be(s)}var c=l.cloneNode(!0);return Ne(c,c),c}}function cn(){if(F)return Ne(V,null),V;var e=document.createDocumentFragment(),t=document.createComment(""),n=en();return e.append(t,n),Ne(t,n),e}function j(e,t){if(F){P.nodes_end=V,gt();return}e!==null&&e.before(t)}function zl(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=n,e.nodeValue=n+"")}function Xr(e,t){return Qr(e,t)}function Xl(e,t){xn(),t.intro=t.intro??!1;const n=t.target,i=F,o=V;try{for(var l=be(n);l&&(l.nodeType!==8||l.data!==Cn);)l=Be(l);if(!l)throw ct;ht(!0),qe(l),gt();const u=Qr(e,{...t,anchor:l});if(V===null||V.nodeType!==8||V.data!==lr)throw Qt(),ct;return ht(!1),u}catch(u){if(u===ct)return t.recover===!1&&bl(),xn(),Il(n),ht(!1),Xr(e,t);throw u}finally{ht(i),qe(o)}}const _t=new Map;function Qr(e,{target:t,anchor:n,props:i={},events:o,context:l,intro:u=!0}){xn();var s=new Set,c=v=>{for(var _=0;_<v.length;_++){var w=v[_];if(!s.has(w)){s.add(w);var D=Gl(w);t.addEventListener(w,Ft,{passive:D});var A=_t.get(w);A===void 0?(document.addEventListener(w,Ft,{passive:D}),_t.set(w,1)):_t.set(w,A+1)}}};c(ol(zr)),Un.add(c);var d=void 0,b=Tl(()=>{var v=n??t.appendChild(en());return Ln(()=>{if(l){Yr({});var _=oe;_.c=l}o&&(i.$$events=o),F&&Ne(v,null),d=e(v,i)||{},F&&(P.nodes_end=V),l&&Gr()}),()=>{var D;for(var _ of s){t.removeEventListener(_,Ft);var w=_t.get(_);--w===0?(document.removeEventListener(_,Ft),_t.delete(_)):_t.set(_,w)}Un.delete(c),v!==n&&((D=v.parentNode)==null||D.removeChild(v))}});return jn.set(d,b),d}let jn=new WeakMap;function Ql(e,t){const n=jn.get(e);return n?(jn.delete(e),n(t)):Promise.resolve()}function z(e,t,[n,i]=[0,0]){F&&n===0&>();var o=e,l=null,u=null,s=ue,c=n>0?In:0,d=!1;const b=(_,w=!0)=>{d=!0,v(w,_)},v=(_,w)=>{if(s===(s=_))return;let D=!1;if(F&&i!==-1){if(n===0){const q=o.data;q===Cn?i=0:q===ir?i=1/0:(i=parseInt(q.substring(1)),i!==i&&(i=s?1/0:-1))}const A=i>n;!!s===A&&(o=Cl(),qe(o),ht(!1),D=!0,i=-1)}s?(l?Sr(l):w&&(l=Ln(()=>w(o))),u&&Pn(u,()=>{u=null})):(u?Sr(u):w&&(u=Ln(()=>w(o,[n+1,i]))),l&&Pn(l,()=>{l=null})),D&&ht(!0)};Ar(()=>{d=!1,t(b),d||v(null,null)},c),F&&(o=V)}function lt(e,t,n=!1,i=!1,o=!1){var l=e,u="";$e(()=>{var s=P;if(u===(u=t()??"")){F&>();return}if(s.nodes_start!==null&&(kr(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),u!==""){if(F){V.data;for(var c=gt(),d=c;c!==null&&(c.nodeType!==8||c.data!=="");)d=c,c=Be(c);if(c===null)throw Qt(),ct;Ne(V,d),l=qe(c);return}var b=u+"";n?b=`<svg>${b}</svg>`:i&&(b=`<math>${b}</math>`);var v=qn(b);if((n||i)&&(v=be(v)),Ne(be(v),v.lastChild),n||i)for(;be(v);)l.before(be(v));else l.before(v)}})}function eo(e,t,n,i,o){var s;F&>();var l=(s=t.$$slots)==null?void 0:s[n],u=!1;l===!0&&(l=t.children,u=!0),l===void 0||l(e,u?()=>i:i)}const ei=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function to(e,t,n){var i=""+e;if(n){for(var o in n)if(n[o])i=i?i+" "+o:o;else if(i.length)for(var l=o.length,u=0;(u=i.indexOf(o,u))>=0;){var s=u+l;(u===0||ei.includes(i[u-1]))&&(s===i.length||ei.includes(i[s]))?i=(u===0?"":i.substring(0,u))+i.substring(s+1):u=s}}return i===""?null:i}function no(e,t,n,i,o,l){var u=e.__className;if(F||u!==n||u===void 0){var s=to(n,i,l);(!F||s!==e.getAttribute("class"))&&(s==null?e.removeAttribute("class"):e.className=s),e.__className=n}else if(l&&o!==l)for(var c in l){var d=!!l[c];(o==null||d!==!!o[c])&&e.classList.toggle(c,d)}return l}const ro=Symbol("is custom element"),io=Symbol("is html");function ti(e){if(F){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var i=e.value;N(e,"value",null),e.value=i}if(e.hasAttribute("checked")){var o=e.checked;N(e,"checked",null),e.checked=o}}};e.__on_r=n,Pl(n),Jr()}}function lo(e,t){var n=ni(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function N(e,t,n,i){var o=ni(e);F&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=n)&&(t==="loading"&&(e[vl]=n),n==null?e.removeAttribute(t):typeof n!="string"&&oo(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ni(e){return e.__attributes??(e.__attributes={[ro]:e.nodeName.includes("-"),[io]:e.namespaceURI===il})}var ri=new Map;function oo(e){var t=ri.get(e.nodeName);if(t)return t;ri.set(e.nodeName,t=[]);for(var n,i=e,o=Element.prototype;o!==i;){n=al(i);for(var l in n)n[l].set&&t.push(l);i=ur(i)}return t}function ao(e,t,n=t){Wl(e,"change",i=>{var o=i?e.defaultChecked:e.checked;n(o)}),(F&&e.defaultChecked!==e.checked||it(t)==null)&&n(e.checked),Dn(()=>{var i=t();e.checked=!!i})}function ii(e,t){return e===t||(e==null?void 0:e[xt])===t}function dn(e={},t,n,i){return Nn(()=>{var o,l;return Dn(()=>{o=l,l=[],it(()=>{e!==n(...l)&&(t(e,...l),o&&ii(n(...o),e)&&t(null,...o))})}),()=>{On(()=>{l&&ii(n(...l),e)&&t(null,...l)})}}),e}function li(e){oe===null&&ar(),Tn(()=>{const t=it(e);if(typeof t=="function")return t})}function so(e){oe===null&&ar(),li(()=>()=>it(e))}function oi(e,t,n){if(e==null)return t(void 0),dt;const i=it(()=>e.subscribe(t,n));return i.unsubscribe?()=>i.unsubscribe():i}const mt=[];function uo(e,t=dt){let n=null;const i=new Set;function o(s){if(yr(e,s)&&(e=s,n)){const c=!mt.length;for(const d of i)d[1](),mt.push(d,e);if(c){for(let d=0;d<mt.length;d+=2)mt[d][0](mt[d+1]);mt.length=0}}}function l(s){o(s(e))}function u(s,c=dt){const d=[s,c];return i.add(d),i.size===1&&(n=t(o,l)||dt),s(e),()=>{i.delete(d),i.size===0&&n&&(n(),n=null)}}return{set:o,update:l,subscribe:u}}function vn(e){let t;return oi(e,n=>t=n)(),t}let hn=!1,Bn=Symbol();function fo(e,t,n){const i=n[t]??(n[t]={store:null,source:Mn(void 0),unsubscribe:dt});if(i.store!==e&&!(Bn in n))if(i.unsubscribe(),i.store=e??null,e==null)i.source.v=void 0,i.unsubscribe=dt;else{var o=!0;i.unsubscribe=oi(e,l=>{o?i.source.v=l:y(i.source,l)}),o=!1}return e&&Bn in n?vn(e):a(i.source)}function co(){const e={};function t(){Sn(()=>{for(var n in e)e[n].unsubscribe();kt(e,Bn,{enumerable:!1,value:!0})})}return[e,t]}function vo(e){var t=hn;try{return hn=!1,[e(),hn]}finally{hn=t}}function ai(e){var t;return((t=e.ctx)==null?void 0:t.d)??!1}function k(e,t,n,i){var bt;var o=(n&Zt)!==0,l=!0,u=(n&el)!==0,s=(n&tl)!==0,c=!1,d;u?[d,c]=vo(()=>e[t]):d=e[t];var b=xt in e||hr in e,v=u&&(((bt=Qe(e,t))==null?void 0:bt.set)??(b&&t in e&&(H=>e[t]=H)))||void 0,_=i,w=!0,D=!1,A=()=>(D=!0,w&&(w=!1,s?_=it(i):_=i),_);d===void 0&&i!==void 0&&(v&&l&&pl(),d=A(),v&&v(d));var q;if(q=()=>{var H=e[t];return H===void 0?A():(w=!0,D=!1,H)},(n&Qi)===0)return q;if(v){var _e=e.$$legacy;return function(H,ce){return arguments.length>0?((!ce||_e||c)&&v(ce?q():H),H):q()}}var te=!1,ae=Mn(d),ne=tn(()=>{var H=q(),ce=a(ae);return te?(te=!1,ce):ae.v=H});return u&&a(ne),o||(ne.equals=$n),function(H,ce){if(arguments.length>0){const Ie=ce?a(ne):u?je(H):H;if(!ne.equals(Ie)){if(te=!0,y(ae,Ie),D&&_!==void 0&&(_=Ie),ai(ne))return H;it(()=>a(ne))}return H}return ai(ne)?ne.v:a(ne)}}function ho(e){return new go(e)}class go{constructor(t){nr(this,Ve);nr(this,ye);var l;var n=new Map,i=(u,s)=>{var c=Mn(s);return n.set(u,c),c};const o=new Proxy({...t.props||{},$$events:{}},{get(u,s){return a(n.get(s)??i(s,Reflect.get(u,s)))},has(u,s){return s===hr?!0:(a(n.get(s)??i(s,Reflect.get(u,s))),Reflect.has(u,s))},set(u,s,c){return y(n.get(s)??i(s,c),c),Reflect.set(u,s,c)}});rr(this,ye,(t.hydrate?Xl:Xr)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover})),(!((l=t==null?void 0:t.props)!=null&&l.$$host)||t.sync===!1)&&R(),rr(this,Ve,o.$$events);for(const u of Object.keys(ve(this,ye)))u==="$set"||u==="$destroy"||u==="$on"||kt(this,u,{get(){return ve(this,ye)[u]},set(s){ve(this,ye)[u]=s},enumerable:!0});ve(this,ye).$set=u=>{Object.assign(o,u)},ve(this,ye).$destroy=()=>{Ql(ve(this,ye))}}$set(t){ve(this,ye).$set(t)}$on(t,n){ve(this,Ve)[t]=ve(this,Ve)[t]||[];const i=(...o)=>n.call(this,...o);return ve(this,Ve)[t].push(i),()=>{ve(this,Ve)[t]=ve(this,Ve)[t].filter(o=>o!==i)}}$destroy(){ve(this,ye).$destroy()}}Ve=new WeakMap,ye=new WeakMap;let si;typeof HTMLElement=="function"&&(si=class extends HTMLElement{constructor(t,n,i){super();ke(this,"$$ctor");ke(this,"$$s");ke(this,"$$c");ke(this,"$$cn",!1);ke(this,"$$d",{});ke(this,"$$r",!1);ke(this,"$$p_d",{});ke(this,"$$l",{});ke(this,"$$l_u",new Map);ke(this,"$$me");this.$$ctor=t,this.$$s=n,i&&this.attachShadow({mode:"open"})}addEventListener(t,n,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){const o=this.$$c.$on(t,n);this.$$l_u.set(n,o)}super.addEventListener(t,n,i)}removeEventListener(t,n,i){if(super.removeEventListener(t,n,i),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(o){return l=>{const u=document.createElement("slot");o!=="default"&&(u.name=o),j(l,u)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},i=_o(this);for(const o of this.$$s)o in i&&(o==="default"&&!this.$$d.children?(this.$$d.children=t(o),n.default=!0):n[o]=t(o));for(const o of this.attributes){const l=this.$$g_p(o.name);l in this.$$d||(this.$$d[l]=gn(l,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=ho({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=Sl(()=>{Dn(()=>{var o;this.$$r=!0;for(const l of Wt(this.$$c)){if(!((o=this.$$p_d[l])!=null&&o.reflect))continue;this.$$d[l]=this.$$c[l];const u=gn(l,this.$$d[l],this.$$p_d,"toAttribute");u==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,u)}this.$$r=!1})});for(const o in this.$$l)for(const l of this.$$l[o]){const u=this.$$c.$on(o,l);this.$$l_u.set(l,u)}this.$$l={}}}attributeChangedCallback(t,n,i){var o;this.$$r||(t=this.$$g_p(t),this.$$d[t]=gn(t,i,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Wt(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function gn(e,t,n,i){var l;const o=(l=n[e])==null?void 0:l.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!i||!n[e])return t;if(i==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function _o(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function mo(e,t,n,i,o,l){let u=class extends si{constructor(){super(e,n,o),this.$$p_d=t}static get observedAttributes(){return Wt(t).map(s=>(t[s].attribute||s).toLowerCase())}};return Wt(t).forEach(s=>{kt(u.prototype,s,{get(){return this.$$c&&s in this.$$c?this.$$c[s]:this.$$d[s]},set(c){var v;c=gn(s,c,t),this.$$d[s]=c;var d=this.$$c;if(d){var b=(v=Qe(d,s))==null?void 0:v.get;b?d[s]=c:d.$set({[s]:c})}}})}),i.forEach(s=>{kt(u.prototype,s,{get(){var c;return(c=this.$$c)==null?void 0:c[s]}})}),e.element=u,u}const ui=new TextEncoder;function bo(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function po(e,t="SHA-256",n=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*n));const o=await fi(i,e,t);return{algorithm:t,challenge:o,salt:i,signature:""}}async function fi(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 bo(await crypto.subtle.digest(n.toUpperCase(),ui.encode(e+t)))}function yo(e,t,n="SHA-256",i=1e6,o=0){const l=new AbortController,u=Date.now();return{promise:(async()=>{for(let c=o;c<=i;c+=1){if(l.signal.aborted)return null;if(await fi(t,c,n)===e)return{number:c,took:Date.now()-u}}return null})(),controller:l}}function ci(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function wo(e){const t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function Eo(e,t=12){const n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e%256,e=Math.floor(e/256);return n}async function Co(e,t="",n=1e6,i=0){const o="AES-GCM",l=new AbortController,u=Date.now(),s=async()=>{for(let b=i;b<=n;b+=1){if(l.signal.aborted||!c||!d)return null;try{const v=await crypto.subtle.decrypt({name:o,iv:Eo(b)},c,d);if(v)return{clearText:new TextDecoder().decode(v),took:Date.now()-u}}catch{}}return null};let c=null,d=null;try{d=wo(e);const b=await crypto.subtle.digest("SHA-256",ui.encode(t));c=await crypto.subtle.importKey("raw",b,o,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:l}}return{promise:s(),controller:l}}var C=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(C||{}),ee=(e=>(e.ERROR="error",e.LOADING="loading",e.PLAYING="playing",e.PAUSED="paused",e.READY="ready",e))(ee||{});globalThis.altchaPlugins=globalThis.altchaPlugins||[],globalThis.altchaI18n=globalThis.altchaI18n||{get:e=>vn(globalThis.altchaI18n.store)[e],set:(e,t)=>{Object.assign(vn(globalThis.altchaI18n.store),{[e]:t}),globalThis.altchaI18n.store.set(vn(globalThis.altchaI18n.store))},store:uo({})};const Ao={ariaLinkLabel:"Visit Altcha.org",enterCode:"Enter code",enterCodeAria:"Enter code you hear. Press Space to play audio.",error:"Verification failed. Try again later.",expired:"Verification expired. Try again.",footer:'Protected by <a href="https://altcha.org/" target="_blank" aria-label="Visit Altcha.org">ALTCHA</a>',getAudioChallenge:"Get an audio challenge",label:"I'm not a robot",loading:"Loading...",reload:"Reload",verify:"Verify",verificationRequired:"Verification required!",verified:"Verified",verifying:"Verifying...",waitAlert:"Verifying... please wait."};globalThis.altchaI18n.set("en",Ao);const Hn=(e,t)=>{let n=Rl(()=>fl(t==null?void 0:t(),24));var i=xo();$e(()=>{N(i,"width",a(n)),N(i,"height",a(n))}),j(e,i)};function Io(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function Ro(e,t){e.preventDefault(),t()}function ko(e,t,n,i,o,l,u,s){var c;[C.UNVERIFIED,C.ERROR,C.EXPIRED,C.CODE].includes(a(t))?n()!==!1&&((c=a(i))==null?void 0:c.reportValidity())===!1?y(o,!1):l()?u():s():y(o,!0)}var xo=fn('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="altcha-spinner"><path 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" fill="currentColor" opacity=".25"></path><path 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" fill="currentColor"></path></svg>'),$o=Ae('<input type="hidden">'),So=Ae('<div><a target="_blank" class="altcha-logo" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path 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" fill="currentColor"></path><path 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" fill="currentColor"></path><path 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" fill="currentColor"></path></svg></a></div>'),To=fn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.8659 3.00017L22.3922 19.5002C22.6684 19.9785 22.5045 20.5901 22.0262 20.8662C21.8742 20.954 21.7017 21.0002 21.5262 21.0002H2.47363C1.92135 21.0002 1.47363 20.5525 1.47363 20.0002C1.47363 19.8246 1.51984 19.6522 1.60761 19.5002L11.1339 3.00017C11.41 2.52187 12.0216 2.358 12.4999 2.63414C12.6519 2.72191 12.7782 2.84815 12.8659 3.00017ZM10.9999 16.0002V18.0002H12.9999V16.0002H10.9999ZM10.9999 9.00017V14.0002H12.9999V9.00017H10.9999Z"></path></svg>'),No=fn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 7C15 6.44772 15.4477 6 16 6C16.5523 6 17 6.44772 17 7V17C17 17.5523 16.5523 18 16 18C15.4477 18 15 17.5523 15 17V7ZM7 7C7 6.44772 7.44772 6 8 6C8.55228 6 9 6.44772 9 7V17C9 17.5523 8.55228 18 8 18C7.44772 18 7 17.5523 7 17V7Z"></path></svg>'),Do=fn('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 12H7C8.10457 12 9 12.8954 9 14V19C9 20.1046 8.10457 21 7 21H4C2.89543 21 2 20.1046 2 19V12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12V19C22 20.1046 21.1046 21 20 21H17C15.8954 21 15 20.1046 15 19V14C15 12.8954 15.8954 12 17 12H20C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12Z"></path></svg>'),Lo=Ae('<button type="button" class="altcha-code-challenge-audio"><!></button>'),Po=Ae("<audio hidden autoplay><source></audio>"),Oo=Ae('<div class="altcha-code-challenge" role="dialog"><div class="altcha-code-challenge-arrow"></div> <form data-code-challenge-form="1"><img class="altcha-code-challenge-image" alt=""> <input type="text" autocomplete="off" name="code" class="altcha-code-challenge-input" required> <div class="altcha-code-challenge-buttons"><div class="altcha-code-challenge-buttons-left"><!> <button type="button" class="altcha-code-challenge-reload"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2V4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 9.25022 5.38734 6.82447 7.50024 5.38451L7.5 8H9.5V2L3.5 2V4L5.99918 3.99989C3.57075 5.82434 2 8.72873 2 12Z"></path></svg></button></div> <button type="submit" class="altcha-code-challenge-verify"><!> </button></div> <!></form></div>'),Fo=Ae("<div><!></div>"),Vo=Ae("<div><!></div>"),Mo=Ae('<div class="altcha-error"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"></path></svg> <!></div>'),Uo=Ae('<div class="altcha-footer"><div><!></div></div>'),qo=Ae('<div class="altcha-anchor-arrow"></div>'),jo=Ae('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function di(e,t){var Ji,Ki;Yr(t,!0);const[n,i]=co(),o=()=>fo(Ho,"$altchaI18nStore",n);let l=k(t,"auto",7,void 0),u=k(t,"blockspam",7,void 0),s=k(t,"challengeurl",7,void 0),c=k(t,"challengejson",7,void 0),d=k(t,"credentials",7,void 0),b=k(t,"customfetch",7,void 0),v=k(t,"debug",7,!1),_=k(t,"delay",7,0),w=k(t,"disableautofocus",7,!1),D=k(t,"expire",7,void 0),A=k(t,"floating",7,void 0),q=k(t,"floatinganchor",7,void 0),_e=k(t,"floatingoffset",7,void 0),te=k(t,"floatingpersist",7,!1),ae=k(t,"hidefooter",7,!1),ne=k(t,"hidelogo",7,!1),bt=k(t,"id",7,void 0),H=k(t,"language",7,void 0),ce=k(t,"name",7,"altcha"),Ie=k(t,"maxnumber",7,1e6),Vt=k(t,"mockerror",7,!1),We=k(t,"obfuscated",7,void 0),De=k(t,"overlay",7,void 0),Mt=k(t,"overlaycontent",7,void 0),_n=k(t,"plugins",7,void 0),Ut=k(t,"refetchonexpire",7,!0),ot=k(t,"sentinel",7,void 0),Le=k(t,"spamfilter",7,!1),pt=k(t,"strings",7,void 0),we=k(t,"test",7,!1),se=k(t,"verifyurl",7,void 0),yt=k(t,"workers",23,()=>Math.min(16,navigator.hardwareConcurrency||8)),qt=k(t,"workerurl",7,void 0);const{altchaI18n:Bo}=globalThis,Ho=Bo.store,hi=["SHA-256","SHA-384","SHA-512"],Yo="https://altcha.org/",Je=(r,f)=>{t.$$host.dispatchEvent(new CustomEvent(r,{detail:f}))},gi=(Ki=(Ji=document.documentElement.lang)==null?void 0:Ji.split("-"))==null?void 0:Ki[0],Yn=St(()=>{var r;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((r=s())!=null&&r.includes("apiKey=ckey_"))}),Gn=St(()=>c()?Si(c()):void 0),Go=St(()=>pt()?Si(pt()):{}),U=St(()=>({...pi(o()),...a(Go)})),_i=St(()=>`${bt()||ce()}_checkbox_${Math.round(Math.random()*1e8)}`);let jt=M(!1),G=M(null),x=M(je(C.UNVERIFIED)),B=M(void 0),Bt=M(null),Ke=M(null),me=M(null),Zn=M(null),wt=M(null),O=M(null),Et=M(null),at=M(null),Pe=null,X=M(null),st=M(!1),ze=[],Wn=M(!1),Me=M(null);Tn(()=>{la(a(at))}),Tn(()=>{oa(a(x))}),so(()=>{Zo(),y(Et,null),a(O)&&(a(O).removeEventListener("submit",Ii),a(O).removeEventListener("reset",Ri),a(O).removeEventListener("focusin",Ai),y(O,null)),Pe&&(clearTimeout(Pe),Pe=null),document.removeEventListener("click",Ei),document.removeEventListener("scroll",Ci),window.removeEventListener("resize",$i)}),li(()=>{var r;$("mounted","2.1.0-beta.2"),$("workers",yt()),zo(),$("plugins",ze.length?ze.map(f=>f.constructor.pluginName).join(", "):"none"),we()&&$("using test mode"),D()&&Kn(D()),l()!==void 0&&$("auto",l()),A()!==void 0&&Ni(A()),y(O,(r=a(B))==null?void 0:r.closest("form"),!0),a(O)&&(a(O).addEventListener("submit",Ii,{capture:!0}),a(O).addEventListener("reset",Ri),(l()==="onfocus"||te()==="focus")&&a(O).addEventListener("focusin",Ai)),De()&&Di(!0),l()==="onload"&&(We()?Ht():Ue()),a(Yn)&&(ae()||ne())&&$("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Je("load")})});function mn(r,f){return btoa(JSON.stringify({algorithm:r.algorithm,challenge:r.challenge,number:f.number,salt:r.salt,signature:r.signature,test:we()?!0:void 0,took:f.took}))}function Zo(){for(const r of ze)r.destroy()}function mi(){s()&&Ut()&&a(x)===C.VERIFIED?Ue():ut(C.EXPIRED,a(U).expired)}async function Wo(){var r;if(Vt())throw $("mocking error"),new Error("Mocked error.");if(a(Gn))return $("using provided json data"),a(Gn);if(we())return $("generating test challenge",{test:we()}),po(typeof we()!="boolean"?+we():void 0);{if(!s()&&a(O)){const I=a(O).getAttribute("action");I!=null&&I.includes("/form/")&&s(I+"/altcha")}if(!s())throw new Error("Attribute challengeurl not set.");$("fetching challenge from",s());const f={credentials:typeof d()=="boolean"?"include":d(),headers:Le()!==!1?{"x-altcha-spam-filter":"1"}:{}},h=await bi()(s(),f);if(!h||!(h instanceof Response))throw new Error("Custom fetch function did not return a response.");if(h.status!==200)throw new Error(`Server responded with ${h.status}.`);const m=h.headers.get("X-Altcha-Config"),g=await h.json(),E=new URLSearchParams((r=g.salt.split("?"))==null?void 0:r[1]),p=E.get("expires")||E.get("expire");if(p){const I=new Date(+p*1e3),Y=isNaN(I.getTime())?0:I.getTime()-Date.now();Y>0&&Kn(Y)}if(m)try{const I=JSON.parse(m);I&&typeof I=="object"&&(I.verifyurl&&!I.verifyurl.startsWith("fn:")&&(I.verifyurl=wi(I.verifyurl)),Oi(I))}catch(I){$("unable to configure from X-Altcha-Config",I)}return g}}function Jo(r){var h,m;const f=(h=a(O))==null?void 0:h.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 bi(){let r=fetch;if(b())if($("using customfetch"),typeof b()=="string"){if(r=globalThis[b()]||null,!r)throw new Error(`Custom fetch function not found: ${b()}`)}else r=b();return r}function pi(r,f=[H()||"",document.documentElement.lang||"",...navigator.languages]){const h=Object.keys(r).map(g=>g.toLowerCase()),m=f.reduce((g,E)=>(E=E.toLowerCase(),g||(r[E]?E:null)||h.find(p=>E.split("-")[0]===p.split("-")[0])||null),null);return r[m||"en"]}function Ko(){return Le()==="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 Le()=="object"?Le():{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 yi(r){var h;return[...((h=a(O))==null?void 0:h.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,g)=>{const E=g.name,p=g.value;return E&&p&&(m[E]=/\n/.test(p)?p.replace(new RegExp("(?<!\\r)\\n","g"),`\r
|
|
3
|
+
`):p),m},{})}function wi(r,f){const h=new URL(s()||location.origin),m=new URL(r,h);if(m.search||(m.search=h.search),f)for(const g in f)f[g]!==void 0&&f[g]!==null&&m.searchParams.set(g,f[g]);return m.toString()}function zo(){const r=_n()!==void 0?_n().split(","):void 0;for(const f of globalThis.altchaPlugins)(!r||r.includes(f.pluginName))&&ze.push(new f({el:a(B),clarify:Ht,dispatch:Je,getConfiguration:Fi,getFloatingAnchor:Vi,getState:Mi,log:$,reset:ut,solve:Pi,setState:Oe,setFloatingAnchor:Ui,verify:Ue}))}function $(...r){(v()||r.some(f=>f instanceof Error))&&console[r[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...r)}function Xo(){y(X,ee.PAUSED,!0)}function Qo(r){y(X,ee.ERROR,!0)}function ea(){y(X,ee.READY,!0)}function ta(){y(X,ee.LOADING,!0)}function na(){y(X,ee.PLAYING,!0)}function ra(){y(X,ee.PAUSED,!0)}function ia(r){var f;if(r.preventDefault(),r.stopPropagation(),a(G)){const h=new FormData(r.target),m=String(h.get("code"));if((f=se())!=null&&f.startsWith("fn:")){const g=se().replace(/^fn:/,"");if($(`calling ${g} function instead of verifyurl`),!(g in globalThis))throw new Error(`Global function "${g}" is undefined.`);return globalThis[g]({challenge:a(G).challenge,code:m,solution:a(G).solution})}y(st,!0),Ti(mn(a(G).challenge,a(G).solution),m).then(({reason:g,verified:E})=>{E?(y(G,null),Oe(C.VERIFIED),$("verified"),Vn().then(()=>{var p;(p=a(Zn))==null||p.focus(),Je("verified",{payload:a(Me)}),l()==="onsubmit"?Jn(a(Et)):De()&&bn()})):(ut(),y(at,g||"Verification failed",!0))}).catch(g=>{y(G,null),Oe(C.ERROR,g),$("sentinel verification failed:",g)}).finally(()=>{y(st,!1)})}}function Ei(r){var h;const f=r.target;A()&&f&&!a(B).contains(f)&&(a(x)===C.VERIFIED&&te()===!1||a(x)===C.VERIFIED&&te()==="focus"&&!((h=a(O))!=null&&h.matches(":focus-within"))||l()==="off"&&a(x)===C.UNVERIFIED)&&bn()}function Ci(){A()&&a(x)!==C.UNVERIFIED&&Yt()}function la(r){for(const f of ze)typeof f.onErrorChange=="function"&&f.onErrorChange(a(at))}function Ai(r){a(x)===C.UNVERIFIED?Ue():A()&&te()==="focus"&&a(x)===C.VERIFIED&&zn()}function Ii(r){var m;const f=r.target;f!=null&&f.hasAttribute("data-code-challenge-form")||(y(Et,r.submitter,!0),a(O)&&l()==="onsubmit"?((m=a(Et))==null||m.blur(),a(x)===C.UNVERIFIED?(r.preventDefault(),r.stopPropagation(),Ue().then(()=>{Jn(a(Et))})):a(x)!==C.VERIFIED&&(r.preventDefault(),r.stopPropagation(),a(x)===C.VERIFYING&&ki())):a(O)&&A()&&l()==="off"&&a(x)===C.UNVERIFIED&&(r.preventDefault(),r.stopPropagation(),zn()))}function Ri(){ut()}function ki(){a(x)===C.VERIFYING&&a(U).waitAlert&&alert(a(U).waitAlert)}function xi(){a(Ke)?a(Ke).paused?(a(Ke).currentTime=0,a(Ke).play()):a(Ke).pause():(y(Wn,!0),requestAnimationFrame(()=>{var r;(r=a(Ke))==null||r.play()}))}function oa(r){for(const f of ze)typeof f.onStateChange=="function"&&f.onStateChange(a(x));A()&&a(x)!==C.UNVERIFIED&&requestAnimationFrame(()=>{Yt()}),y(jt,a(x)===C.VERIFIED),De()&&a(me)&&(a(x)!==C.UNVERIFIED?a(me).style.display="flex":a(me).style.display="none")}function $i(){A()&&Yt()}function Si(r){return JSON.parse(r)}async function aa(r){if(!se())throw new Error("Attribute verifyurl not set.");$("requesting server verification from",se());const f={payload:r};if(Le()!==!1){const{blockedCountries:g,classifier:E,disableRules:p,email:I,expectedLanguages:Y,expectedCountries:re,fields:de,ipAddress:Xe,text:Qn,timeZone:wn}=Ko();f.blockedCountries=g,f.classifier=E,f.disableRules=p,f.email=I===!1?void 0:Jo(I),f.expectedCountries=re,f.expectedLanguages=Y||(gi?[gi]:void 0),f.fields=de===!1?void 0:yi(de),f.ipAddress=Xe===!1?void 0:Xe||"auto",f.text=Qn,f.timeZone=wn===!1?void 0:wn||ci()}const h=await bi()(se(),{body:JSON.stringify(f),headers:{"content-type":"application/json"},method:"POST"});if(!h||!(h instanceof Response))throw new Error("Custom fetch function did not return a response.");if(h.status!==200)throw new Error(`Server responded with ${h.status}.`);const m=await h.json();if(m!=null&&m.payload&&y(Me,m.payload,!0),Je("serververification",m),u()&&m.classification==="BAD")throw new Error("SpamFilter returned negative classification.")}async function Ti(r,f){if(!se())throw new Error("Attribute verifyurl not set.");$("requesting sentinel verification from",se());const h={code:f,payload:r};ot()&&(h.fields=ot().fields?yi():void 0,h.timeZone=ot().timeZone?ci():void 0);const m=await fetch(se(),{body:JSON.stringify(h),headers:{"content-type":"application/json"},method:"POST"});if(!m||!(m instanceof Response))throw new Error("Fetch function did not return a response.");if(m.status!==200)throw new Error(`Server responded with ${m.status}.`);const g=await m.json();return g!=null&&g.payload&&y(Me,g.payload,!0),Je("sentinelverification",g),g}function Jn(r){var f;a(O)&&"requestSubmit"in a(O)?a(O).requestSubmit(r):(f=a(O))!=null&&f.reportValidity()&&(r?r.click():a(O).submit())}function Kn(r){$("expire",r),Pe&&(clearTimeout(Pe),Pe=null),r<1?mi():Pe=setTimeout(mi,r)}function Ni(r){$("floating",r),A()!==r&&(a(B).style.left="",a(B).style.top=""),A(r===!0||r===""?"auto":r===!1||r==="false"?void 0:A()),A()?(l()||l("onsubmit"),document.addEventListener("scroll",Ci),document.addEventListener("click",Ei),window.addEventListener("resize",$i)):l()==="onsubmit"&&l(void 0)}function Di(r){var f,h,m,g;if(a(me)&&((h=(f=a(B).parentElement)==null?void 0:f.parentElement)==null||h.append(a(B).parentElement),document.body.removeChild(a(me))),r&&(l()||l("onsubmit"),(g=(m=a(B))==null?void 0:m.parentElement)!=null&&g.parentElement)){y(me,document.createElement("div"),!0),a(B).parentElement.parentElement.appendChild(a(me));const E=document.createElement("div"),p=document.createElement("button");p.type="button",p.innerHTML="×",p.addEventListener("click",I=>{I.preventDefault(),ut()}),a(me).classList.add("altcha-overlay-backdrop"),p.classList.add("altcha-overlay-close-button"),E.classList.add("altcha-overlay"),a(me).append(E),E.append(p),Mt()&&E.append(...document.querySelectorAll(Mt())),E.append(a(B).parentElement)}}function Li(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(!hi.includes(r.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${hi.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 Pi(r){let f=null;if("Worker"in window){try{f=await sa(r,r.maxNumber||r.maxnumber||Ie())}catch(h){$(h)}if((f==null?void 0:f.number)!==void 0||"obfuscated"in r)return{data:r,solution:f}}if("obfuscated"in r){const h=await Co(r.obfuscated,r.key,r.maxNumber||r.maxnumber);return{data:r,solution:await h.promise}}return{data:r,solution:await yo(r.challenge,r.salt,r.algorithm,r.maxNumber||r.maxnumber||Ie()).promise}}async function sa(r,f=typeof we()=="number"?we():r.maxNumber||r.maxnumber||Ie(),h=Math.ceil(yt())){const m=[];h=Math.min(16,f,Math.max(1,h));for(let p=0;p<h;p++)m.push(altchaCreateWorker(qt()));const g=Math.ceil(f/h),E=await Promise.all(m.map((p,I)=>{const Y=I*g;return new Promise(re=>{p.addEventListener("message",de=>{if(de.data)for(const Xe of m)Xe!==p&&Xe.postMessage({type:"abort"});re(de.data)}),p.postMessage({payload:r,max:Y+g,start:Y,type:"work"})})}));for(const p of m)p.terminate();return E.find(p=>!!p)||null}async function Ht(){if(!We()){Oe(C.ERROR);return}const r=ze.find(f=>f.constructor.pluginName==="obfuscation");if(!r||!("clarify"in r)){Oe(C.ERROR),$("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");return}if("clarify"in r&&typeof r.clarify=="function")return r.clarify()}function Oi(r){r.obfuscated!==void 0&&We(r.obfuscated),r.auto!==void 0&&(l(r.auto),l()==="onload"&&(We()?Ht():Ue())),r.blockspam!==void 0&&u(!!r.blockspam),r.customfetch!==void 0&&b(r.customfetch),r.floatinganchor!==void 0&&q(r.floatinganchor),r.delay!==void 0&&_(r.delay),r.floatingoffset!==void 0&&_e(r.floatingoffset),r.floating!==void 0&&Ni(r.floating),r.expire!==void 0&&(Kn(r.expire),D(r.expire)),r.challenge&&(c(typeof r.challenge=="string"?r.challenge:JSON.stringify(r.challenge)),Li(a(Gn))),r.challengeurl!==void 0&&s(r.challengeurl),r.debug!==void 0&&v(!!r.debug),r.hidefooter!==void 0&&ae(!!r.hidefooter),r.hidelogo!==void 0&&ne(!!r.hidelogo),r.language!==void 0&&pt(pi(o(),[r.language])),r.maxnumber!==void 0&&Ie(+r.maxnumber),r.mockerror!==void 0&&Vt(!!r.mockerror),r.name!==void 0&&ce(r.name),r.overlay!==void 0&&Di(r.overlay),r.overlaycontent!==void 0&&Mt(r.overlaycontent),r.refetchonexpire!==void 0&&Ut(!!r.refetchonexpire),r.sentinel!==void 0&&typeof r.sentinel=="object"&&ot(r.sentinel),r.spamfilter!==void 0&&Le(typeof r.spamfilter=="object"?r.spamfilter:!!r.spamfilter),r.strings&&pt(typeof r.strings=="string"?r.strings:JSON.stringify(r.strings)),r.test!==void 0&&we(typeof r.test=="number"?r.test:!!r.test),r.verifyurl!==void 0&&se(r.verifyurl),r.workers!==void 0&&yt(+r.workers),r.workerurl!==void 0&&qt(r.workerurl)}function Fi(){return{auto:l(),blockspam:u(),challengeurl:s(),debug:v(),delay:_(),expire:D(),floating:A(),floatinganchor:q(),floatingoffset:_e(),hidefooter:ae(),hidelogo:ne(),name:ce(),maxnumber:Ie(),mockerror:Vt(),obfuscated:We(),overlay:De(),refetchonexpire:Ut(),spamfilter:Le(),strings:a(U),test:we(),verifyurl:se(),workers:yt(),workerurl:qt()}}function Vi(){return a(wt)}function ua(r){return ze.find(f=>f.constructor.pluginName===r)}function Mi(){return a(x)}function bn(){a(B).style.display="none",De()&&a(me)&&(a(me).style.display="none")}function Yt(r=20){var f;if(a(B))if(a(wt)||y(wt,(q()?document.querySelector(q()):(f=a(O))==null?void 0:f.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])'))||a(O),!0),a(wt)){const h=parseInt(_e(),10)||12,m=a(wt).getBoundingClientRect(),g=a(B).getBoundingClientRect(),E=document.documentElement.clientHeight,p=document.documentElement.clientWidth,I=A()==="auto"?m.bottom+g.height+h+r>E:A()==="top",Y=Math.max(r,Math.min(p-r-g.width,m.left+m.width/2-g.width/2));if(I?a(B).style.top=`${m.top-(g.height+h)}px`:a(B).style.top=`${m.bottom+h}px`,a(B).style.left=`${Y}px`,a(B).setAttribute("data-floating",I?"top":"bottom"),a(Bt)){const re=a(Bt).getBoundingClientRect();a(Bt).style.left=m.left-Y+m.width/2-re.width/2+"px"}}else $("unable to find floating anchor element")}function ut(r=C.UNVERIFIED,f=null){Pe&&(clearTimeout(Pe),Pe=null),y(jt,!1),y(Me,null),y(G,null),y(Wn,!1),y(X,null),Oe(r,f)}function Ui(r){y(wt,r,!0)}function Oe(r,f=null){y(x,r,!0),y(at,f,!0),Je("statechange",{payload:a(Me),state:a(x)})}function zn(){a(B).style.display="block",A()&&Yt(),De()&&a(me)&&(a(me).style.display="flex")}async function Ue(){return ut(C.VERIFYING),await new Promise(r=>setTimeout(r,_()||0)),Wo().then(r=>(Li(r),$("challenge",r),Pi(r))).then(({data:r,solution:f})=>{var h;if($("solution",f),!f||r&&"challenge"in r&&!("clearText"in f))if((f==null?void 0:f.number)!==void 0&&"challenge"in r)if(se()&&"codeChallenge"in r)["INPUT","BUTTON","SELECT","TEXTAREA"].includes(((h=document.activeElement)==null?void 0:h.tagName)||"")&&w()===!1&&document.activeElement.blur(),y(G,{challenge:r,solution:f},!0);else{if(se()&&ot()!==void 0)return Ti(mn(r,f));if(se())return aa(mn(r,f));y(Me,mn(r,f),!0),$("payload",a(Me))}else throw $("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."),new Error("Unexpected result returned.")}).then(()=>{a(G)?(Oe(C.CODE),Vn().then(()=>{Je("code",{codeChallenge:a(G)})})):(Oe(C.VERIFIED),$("verified"),Vn().then(()=>{Je("verified",{payload:a(Me)}),l()==="onsubmit"?Jn(a(Et)):De()&&bn()}))}).catch(r=>{$(r),Oe(C.ERROR,r.message)})}var qi=jo(),ji=$t(qi);eo(ji,t,"default",{});var Ct=K(ji,2),Xn=J(Ct),pn=J(Xn);let Bi;var Hi=J(pn);{var fa=r=>{Hn(r)};z(Hi,r=>{a(x)===C.VERIFYING&&r(fa)})}var ft=K(Hi,2);ti(ft),ft.__change=[ko,x,Le,O,jt,We,Ht,Ue],dn(ft,r=>y(Zn,r),()=>a(Zn)),W(pn);var yn=K(pn,2),ca=J(yn);{var da=r=>{var f=cn(),h=$t(f);lt(h,()=>a(U).verified),j(r,f)},va=(r,f)=>{{var h=g=>{var E=cn(),p=$t(E);lt(p,()=>a(U).verifying),j(g,E)},m=(g,E)=>{{var p=Y=>{var re=cn(),de=$t(re);lt(de,()=>a(U).verificationRequired),j(Y,re)},I=Y=>{var re=cn(),de=$t(re);lt(de,()=>a(U).label),j(Y,re)};z(g,Y=>{a(x)===C.CODE?Y(p):Y(I,!1)},E)}};z(r,g=>{a(x)===C.VERIFYING?g(h):g(m,!1)},f)}};z(ca,r=>{a(x)===C.VERIFIED?r(da):r(va,!1)})}W(yn);var Yi=K(yn,2);{var ha=r=>{var f=$o();ti(f),$e(()=>{N(f,"name",ce()),lo(f,a(Me))}),j(r,f)};z(Yi,r=>{a(x)===C.VERIFIED&&r(ha)})}var Gi=K(Yi,2);{var ga=r=>{var f=So(),h=J(f);N(h,"href",Yo),W(f),$e(()=>N(h,"aria-label",a(U).ariaLinkLabel)),j(r,f)};z(Gi,r=>{(ne()!==!0||a(Yn))&&r(ga)})}var _a=K(Gi,2);{var ma=r=>{var f=Oo(),h=K(J(f),2),m=J(h),g=K(m,2);Zl(g,!w()),g.__keydown=[Io,xi];var E=K(g,2),p=J(E),I=J(p);{var Y=Re=>{var Q=Lo();Q.__click=xi;var En=J(Q);{var Gt=At=>{Hn(At,()=>20)},Ia=(At,Ra)=>{{var ka=It=>{var er=To();j(It,er)},xa=(It,er)=>{{var $a=Rt=>{var tr=No();j(Rt,tr)},Sa=Rt=>{var tr=Do();j(Rt,tr)};z(It,Rt=>{a(X)===ee.PLAYING?Rt($a):Rt(Sa,!1)},er)}};z(At,It=>{a(X)===ee.ERROR?It(ka):It(xa,!1)},Ra)}};z(En,At=>{a(X)===ee.LOADING?At(Gt):At(Ia,!1)})}W(Q),$e(()=>{N(Q,"title",a(U).getAudioChallenge),Q.disabled=a(X)===ee.LOADING||a(X)===ee.ERROR||a(st),N(Q,"aria-label",a(X)===ee.LOADING?a(U).loading:a(U).getAudioChallenge)}),j(Re,Q)};z(I,Re=>{a(G).challenge.codeChallenge.audio&&Re(Y)})}var re=K(I,2);re.__click=[Ro,Ue],W(p);var de=K(p,2),Xe=J(de);{var Qn=Re=>{Hn(Re,()=>16)};z(Xe,Re=>{a(st)&&Re(Qn)})}var wn=K(Xe);W(de),W(E);var Ca=K(E,2);{var Aa=Re=>{var Q=Po(),En=J(Q);W(Q),dn(Q,Gt=>y(Ke,Gt),()=>a(Ke)),$e(Gt=>N(En,"src",Gt),[()=>wi(a(G).challenge.codeChallenge.audio,{language:H()})]),Ze("loadstart",Q,ta),Ze("canplay",Q,ea),Ze("pause",Q,ra),Ze("playing",Q,na),Ze("ended",Q,Xo),Ze("error",En,Qo),j(Re,Q)};z(Ca,Re=>{a(G).challenge.codeChallenge.audio&&a(Wn)&&Re(Aa)})}W(h),W(f),$e(()=>{N(f,"aria-label",a(U).verificationRequired),N(m,"src",a(G).challenge.codeChallenge.image),N(g,"minlength",a(G).challenge.codeChallenge.length||1),N(g,"maxlength",a(G).challenge.codeChallenge.length),N(g,"placeholder",a(U).enterCode),N(g,"aria-label",a(X)===ee.LOADING?a(U).loading:a(X)===ee.PLAYING?"":a(U).enterCodeAria),N(g,"aria-live",a(X)?"assertive":"polite"),N(g,"aria-busy",a(X)===ee.LOADING),g.disabled=a(st),N(re,"aria-label",a(U).reload),N(re,"title",a(U).reload),re.disabled=a(st),de.disabled=a(st),N(de,"aria-label",a(U).verify),zl(wn,` ${a(U).verify??""}`)}),Ze("submit",h,ia,!0),j(r,f)};z(_a,r=>{var f;(f=a(G))!=null&&f.challenge.codeChallenge&&r(ma)})}W(Xn);var Zi=K(Xn,2);{var ba=r=>{var f=Mo(),h=K(J(f),2);{var m=E=>{var p=Fo(),I=J(p);lt(I,()=>a(U).expired),W(p),$e(()=>N(p,"title",a(at))),j(E,p)},g=E=>{var p=Vo(),I=J(p);lt(I,()=>a(U).error),W(p),$e(()=>N(p,"title",a(at))),j(E,p)};z(h,E=>{a(x)===C.EXPIRED?E(m):E(g,!1)})}W(f),j(r,f)};z(Zi,r=>{(a(at)||a(x)===C.EXPIRED)&&r(ba)})}var Wi=K(Zi,2);{var pa=r=>{var f=Uo(),h=J(f),m=J(h);lt(m,()=>a(U).footer),W(h),W(f),j(r,f)};z(Wi,r=>{a(U).footer&&(ae()!==!0||a(Yn))&&r(pa)})}var ya=K(Wi,2);{var wa=r=>{var f=qo();dn(f,h=>y(Bt,h),()=>a(Bt)),j(r,f)};z(ya,r=>{A()&&r(wa)})}W(Ct),dn(Ct,r=>y(B,r),()=>a(B)),$e(r=>{N(Ct,"data-state",a(x)),N(Ct,"data-floating",A()),N(Ct,"data-overlay",De()),Bi=no(pn,1,"altcha-checkbox",null,Bi,r),N(ft,"id",a(_i)),ft.required=l()!=="onsubmit"&&(!A()||l()!=="off"),N(yn,"for",a(_i))},[()=>({"altcha-checkbox-verifying":a(x)===C.VERIFYING})]),Ze("invalid",ft,ki),ao(ft,()=>a(jt),r=>y(jt,r)),j(e,qi);var Ea=Gr({clarify:Ht,configure:Oi,getConfiguration:Fi,getFloatingAnchor:Vi,getPlugin:ua,getState:Mi,hide:bn,repositionFloating:Yt,reset:ut,setFloatingAnchor:Ui,setState:Oe,show:zn,verify:Ue,get auto(){return l()},set auto(r=void 0){l(r),R()},get blockspam(){return u()},set blockspam(r=void 0){u(r),R()},get challengeurl(){return s()},set challengeurl(r=void 0){s(r),R()},get challengejson(){return c()},set challengejson(r=void 0){c(r),R()},get credentials(){return d()},set credentials(r=void 0){d(r),R()},get customfetch(){return b()},set customfetch(r=void 0){b(r),R()},get debug(){return v()},set debug(r=!1){v(r),R()},get delay(){return _()},set delay(r=0){_(r),R()},get disableautofocus(){return w()},set disableautofocus(r=!1){w(r),R()},get expire(){return D()},set expire(r=void 0){D(r),R()},get floating(){return A()},set floating(r=void 0){A(r),R()},get floatinganchor(){return q()},set floatinganchor(r=void 0){q(r),R()},get floatingoffset(){return _e()},set floatingoffset(r=void 0){_e(r),R()},get floatingpersist(){return te()},set floatingpersist(r=!1){te(r),R()},get hidefooter(){return ae()},set hidefooter(r=!1){ae(r),R()},get hidelogo(){return ne()},set hidelogo(r=!1){ne(r),R()},get id(){return bt()},set id(r=void 0){bt(r),R()},get language(){return H()},set language(r=void 0){H(r),R()},get name(){return ce()},set name(r="altcha"){ce(r),R()},get maxnumber(){return Ie()},set maxnumber(r=1e6){Ie(r),R()},get mockerror(){return Vt()},set mockerror(r=!1){Vt(r),R()},get obfuscated(){return We()},set obfuscated(r=void 0){We(r),R()},get overlay(){return De()},set overlay(r=void 0){De(r),R()},get overlaycontent(){return Mt()},set overlaycontent(r=void 0){Mt(r),R()},get plugins(){return _n()},set plugins(r=void 0){_n(r),R()},get refetchonexpire(){return Ut()},set refetchonexpire(r=!0){Ut(r),R()},get sentinel(){return ot()},set sentinel(r=void 0){ot(r),R()},get spamfilter(){return Le()},set spamfilter(r=!1){Le(r),R()},get strings(){return pt()},set strings(r=void 0){pt(r),R()},get test(){return we()},set test(r=!1){we(r),R()},get verifyurl(){return se()},set verifyurl(r=void 0){se(r),R()},get workers(){return yt()},set workers(r=Math.min(16,navigator.hardwareConcurrency||8)){yt(r),R()},get workerurl(){return qt()},set workerurl(r=void 0){qt(r),R()}});return i(),Ea}Kl(["change","keydown","click"]),customElements.define("altcha-widget",mo(di,{blockspam:{type:"Boolean"},debug:{type:"Boolean"},delay:{type:"Number"},disableautofocus:{type:"Boolean"},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:{},credentials:{},customfetch:{},floating:{},floatinganchor:{},floatingpersist:{},id:{},language:{},name:{},obfuscated:{},overlay:{},overlaycontent:{},plugins:{},sentinel:{},spamfilter:{},strings:{},verifyurl:{},workerurl:{}},["default"],["clarify","configure","getConfiguration","getFloatingAnchor","getPlugin","getState","hide","repositionFloating","reset","setFloatingAnchor","setState","show","verify"],!1)),globalThis.altchaCreateWorker=e=>new Worker(new URL(e||"./worker.js",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:T&&T.tagName.toUpperCase()==="SCRIPT"&&T.src||new URL("altcha.umd.cjs",document.baseURI).href)),S.Altcha=di,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
package/dist_plugins/upload.js
CHANGED
|
@@ -327,7 +327,9 @@ q = function(e) {
|
|
|
327
327
|
*/
|
|
328
328
|
O = function(e) {
|
|
329
329
|
const i = e.target;
|
|
330
|
-
i != null && i.hasAttribute(
|
|
330
|
+
i != null && i.hasAttribute(
|
|
331
|
+
"data-code-challenge-form"
|
|
332
|
+
) || this.pendingFiles.length && (e.preventDefault(), e.stopPropagation(), this.uploadPendingFiles());
|
|
331
333
|
}, A = async function(e, i) {
|
|
332
334
|
const r = u(this, c, H).call(this);
|
|
333
335
|
if (!r)
|
|
@@ -413,7 +415,10 @@ O = function(e) {
|
|
|
413
415
|
return !0;
|
|
414
416
|
}, G = async function(e, i, r, o = {}) {
|
|
415
417
|
var a;
|
|
416
|
-
return e = new URL(
|
|
418
|
+
return e = new URL(
|
|
419
|
+
e,
|
|
420
|
+
((a = this.elForm) == null ? void 0 : a.getAttribute("action")) || location.origin
|
|
421
|
+
).toString(), new Promise((s, l) => {
|
|
417
422
|
const d = new XMLHttpRequest();
|
|
418
423
|
i.controller.signal.addEventListener("abort", () => {
|
|
419
424
|
d.abort();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "altcha",
|
|
3
3
|
"description": "Privacy-first CAPTCHA widget, compliant with global regulations (GDPR/HIPAA/CCPA/LGDP/DPDPA/PIPL) and WCAG accessible. No tracking, self-verifying.",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.1.0-beta.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Daniel Regeci",
|