mirror of
https://github.com/altcha-org/altcha.git
synced 2026-01-25 04:16:41 +00:00
4 lines
58 KiB
JavaScript
4 lines
58 KiB
JavaScript
(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 Ra=Object.defineProperty;var Yi=S=>{throw TypeError(S)};var $a=(S,T,G)=>T in S?Ra(S,T,{enumerable:!0,configurable:!0,writable:!0,value:G}):S[T]=G;var Re=(S,T,G)=>$a(S,typeof T!="symbol"?T+"":T,G),Gi=(S,T,G)=>T.has(S)||Yi("Cannot "+G);var he=(S,T,G)=>(Gi(S,T,"read from private field"),G?G.call(S):T.get(S)),Jr=(S,T,G)=>T.has(S)?Yi("Cannot add the same private member more than once"):T instanceof WeakSet?T.add(S):T.set(S,G),Kr=(S,T,G,Bt)=>(Gi(S,T,"write to private field"),Bt?Bt.call(S,G):T.set(S,G),G);var ai,Oe,we;var T=typeof document<"u"?document.currentScript:null;const G="5";typeof window<"u"&&((ai=window.__svelte??(window.__svelte={})).v??(ai.v=new Set)).add(G);const Bt=1,Zi=4,Wi=8,Ji=16,Ki=1,zi=2,mr="[",zr="[!",Xr="]",st={},ue=Symbol(),Xi="http://www.w3.org/1999/xhtml",Qr=!1;function en(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var tn=Array.isArray,Qi=Array.prototype.indexOf,el=Array.from,Ht=Object.keys,Ct=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,tl=Object.getOwnPropertyDescriptors,rl=Object.prototype,nl=Array.prototype,rn=Object.getPrototypeOf,nn=Object.isExtensible;const ut=()=>{};function ln(e){for(var t=0;t<e.length;t++)e[t]()}function il(e,t,r=!1){return e===void 0?r?t():t:e}const ye=2,on=4,Yt=8,br=16,Pe=32,Xe=64,Gt=128,ve=256,Zt=512,fe=1024,$e=2048,Qe=4096,ft=8192,Wt=16384,ll=32768,wr=65536,ol=1<<19,an=1<<20,pr=1<<21,At=Symbol("$state"),sn=Symbol("legacy props"),al=Symbol("");function sl(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ul(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function fl(e){throw new Error("https://svelte.dev/e/effect_orphan")}function cl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function dl(){throw new Error("https://svelte.dev/e/hydration_failed")}function hl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function vl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function gl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function _l(){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 ml(){for(var e=0,t=V;;){if(t.nodeType===8){var r=t.data;if(r===Xr){if(e===0)return t;e-=1}else(r===mr||r===zr)&&(e+=1)}var i=qe(t);t.remove(),t=i}}let bl=!1;function Ue(e){if(typeof e!="object"||e===null||At in e)return e;const t=rn(e);if(t!==rl&&t!==nl)return e;var r=new Map,i=tn(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)&&vl();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))),yr(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),yr(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)}yr(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(){gl()}})}function yr(e,t=1){w(e,e.v+t)}var un,fn,cn,dn;function Er(){if(un===void 0){un=window,fn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;cn=ze(t,"firstChild").get,dn=ze(t,"nextSibling").get,nn(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),nn(r)&&(r.__t=void 0)}}function Kt(e=""){return document.createTextNode(e)}function me(e){return cn.call(e)}function qe(e){return dn.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 wl(e){e.textContent=""}function hn(e){return e===this.v}function vn(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Cr(e){return!vn(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|=an,{ctx:le,deps:null,effects:null,equals:hn,f:t,fn:e,reactions:null,rv:0,v:null,wv:0,parent:r??L}}function Rt(e){const t=zt(e);return xn(t),t}function pl(e){const t=zt(e);return t.equals=Cr,t}function gn(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)je(t[r])}}function yl(e){for(var t=e.parent;t!==null;){if((t.f&ye)===0)return t;t=t.parent}return null}function _n(e){var t,r=L;Be(yl(e));try{gn(e),t=Ln(e)}finally{Be(r)}return t}function mn(e){var t=_n(e),r=(He||(e.f&ve)!==0)&&e.deps!==null?Qe:fe;Ee(e,r),e.equals(t)||(e.v=t,e.wv=Tn())}function El(e){L===null&&D===null&&fl(),D!==null&&(D.f&ve)!==0&&L===null&&ul(),xt&&sl()}function Cl(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{Tr(l),l.f|=ll}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&(an|Gt))===0;if(!u&&i&&(o!==null&&Cl(l,o),D!==null&&(D.f&ye)!==0)){var s=D;(s.effects??(s.effects=[])).push(l)}return l}function Ar(e){const t=et(Yt,null,!1);return Ee(t,fe),t.teardown=e,t}function Ir(e){El();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=Rr(e);return i}}function Al(e){const t=et(Xe,e,!0);return()=>{je(t)}}function Il(e){const t=et(Xe,e,!0);return(r={})=>new Promise(i=>{r.outro?xr(t,()=>{je(t),i(void 0)}):(je(t),i(void 0))})}function Rr(e){return et(on,e,!1)}function $r(e){return et(Yt,e,!0)}function ke(e,t=[],r=zt){const i=t.map(r);return bn(()=>e(...i.map(a)))}function bn(e,t=0){return et(Yt|br|t,e,!0)}function kr(e,t=!0){return et(Yt|Pe,e,!0,t)}function wn(e){var t=e.teardown;if(t!==null){const r=xt,i=D;kn(!0),Se(null);try{t.call(null)}finally{kn(r),Se(i)}}}function pn(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 Rl(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&ol)!==0)&&e.nodes_start!==null&&(yn(e.nodes_start,e.nodes_end),r=!0),pn(e,t&&!r),nr(e,0),Ee(e,Wt);var i=e.transitions;if(i!==null)for(const l of i)l.stop();wn(e);var o=e.parent;o!==null&&o.first!==null&&En(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function yn(e,t){for(;e!==null;){var r=e===t?null:qe(e);e.remove(),e=r}}function En(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 xr(e,t){var r=[];Cn(e,r,!0),$l(r,()=>{je(e),t&&t()})}function $l(e,t){var r=e.length;if(r>0){var i=()=>--r||t();for(var o of e)o.out(i)}else t()}function Cn(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&wr)!==0||(i.f&Pe)!==0;Cn(i,t,l?r:!1),i=o}}}function An(e){In(e,!0)}function In(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&wr)!==0||(r.f&Pe)!==0;In(r,o?t:!1),r=i}if(e.transitions!==null)for(const l of e.transitions)(l.is_global||t)&&l.in()}}const kl=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let $t=[],kt=[];function Rn(){var e=$t;$t=[],ln(e)}function $n(){var e=kt;kt=[],ln(e)}function Sr(e){$t.length===0&&queueMicrotask(Rn),$t.push(e)}function xl(e){kt.length===0&&kl($n),kt.push(e)}function Sl(){$t.length>0&&Rn(),kt.length>0&&$n()}let Xt=!1,Qt=!1,er=null,tt=!1,xt=!1;function kn(e){xt=e}let St=[],ka=[],D=null,xe=!1;function Se(e){D=e}let L=null;function Be(e){L=e}let ne=null;function xn(e){D!==null&&D.f&pr&&(ne===null?ne=[e]:ne.push(e))}let ie=null,ge=0,be=null;function Tl(e){be=e}let Sn=1,tr=0,He=!1;function Tn(){return++Sn}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)&&mn(l),l.wv>e.wv)return!0}(!i||L!==null&&!He)&&Ee(e,fe)}return!1}function Nl(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 Nn(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),Nn(t))throw e;return}if(r!==null&&(Xt=!0),Nl(e,t),Nn(t))throw e}function Dn(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?Dn(l,t,!1):t===l&&(r?Ee(l,$e):(l.f&fe)!==0&&Ee(l,Qe),ir(l)))}}function Ln(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,Vn(e.ctx),xe=!1,tr++,e.f|=pr;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(qn()&&be!==null&&!xe&&h!==null&&(e.f&(ye|Qe|$e))===0)for(g=0;g<be.length;g++)Dn(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,Vn(s),xe=c,e.f^=pr}}function Dl(e,t){let r=t.reactions;if(r!==null){var i=Qi.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),gn(t),nr(t,0))}function nr(e,t){var r=e.deps;if(r!==null)for(var i=t;i<r.length;i++)Dl(e,r[i])}function Tr(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&br)!==0?Rl(e):pn(e),wn(e);var l=Ln(e);e.teardown=typeof l=="function"?l:null,e.wv=Sn;var u=e.deps,s;Qr&&bl&&e.f&$e}catch(c){rr(c,e,r,i||e.ctx)}finally{tt=o,L=r}}}function Ll(){try{cl()}catch(e){if(er!==null)rr(e,er,null);else throw e}}function Pn(){var e=tt;try{var t=0;for(tt=!0;St.length>0;){t++>1e3&&Ll();var r=St,i=r.length;St=[];for(var o=0;o<i;o++){var l=Ol(r[o]);Pl(l)}Nt.clear()}}finally{Qt=!1,tt=e,er=null}}function Pl(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)&&(Tr(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null?En(i):i.fn=null))}catch(o){rr(o,i,null,i.ctx)}}}function ir(e){Qt||(Qt=!0,queueMicrotask(Pn));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 Ol(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&on)!==0)t.push(r);else if(o)r.f^=fe;else try{Tt(r)&&Tr(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(Sl(),St.length===0)return t;Qt=!0,Pn()}}async function Nr(){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)&&mn(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 Fl=-7169;function Ee(e,t){e.f=e.f&Fl|t}const Nt=new Map;function On(e,t){var r={f:0,v:e,reactions:null,equals:hn,rv:0,wv:0};return r}function U(e,t){const r=On(e);return xn(r),r}function Dr(e,t=!1){const r=On(e);return t||(r.equals=Cr),r}function w(e,t,r=!1){D!==null&&!xe&&qn()&&(D.f&(ye|br))!==0&&!(ne!=null&&ne.includes(e))&&_l();let i=r?Ue(t):t;return Vl(e,i)}function Vl(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&&_n(e),Ee(e,(e.f&ve)===0?fe:Qe)),e.wv=Tn(),Fn(e,$e),L!==null&&(L.f&fe)!==0&&(L.f&(Pe|Xe))===0&&(be===null?Tl([e]):be.push(e))}return t}function Fn(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?Fn(l,Qe):ir(l)))}}let le=null;function Vn(e){le=e}function Mn(e,t=!1,r){var i=le={p:le,c:null,d:!1,e:null,m:!1,s:e,x:null,l:null};Ar(()=>{i.d=!0})}function Un(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),Rr(l.fn)}}finally{Be(r),Se(i)}}le=t.p,t.m=!0}return e||{}}function qn(){return!0}const Ml=["touchstart","touchmove"];function Ul(e){return Ml.includes(e)}function ql(e,t){if(t){const r=document.body;e.autofocus=!0,Sr(()=>{document.activeElement===r&&e.focus()})}}let jn=!1;function Bn(){jn||(jn=!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 Hn(e){var t=D,r=L;Se(null),Be(null);try{return e()}finally{Se(t),Be(r)}}function jl(e,t,r,i=r){e.addEventListener(t,()=>Hn(r));const o=e.__on_r;o?e.__on_r=()=>{o(),i(!0)}:e.__on_r=()=>i(!0),Bn()}const Yn=new Set,Lr=new Set;function Bl(e,t,r,i={}){function o(l){if(i.capture||Dt.call(t,l),!l.cancelBubble)return Hn(()=>r==null?void 0:r.call(this,l))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Sr(()=>{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=Bl(e,t,r,l);(t===document.body||t===window||t===document)&&Ar(()=>{t.removeEventListener(e,u,l)})}function Hl(e){for(var t=0;t<e.length;t++)Yn.add(e[t]);for(var r of Lr)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(tn(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 Pr(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&Ki)!==0,i=(t&zi)!==0,o,l=!e.startsWith("<!>");return()=>{if(F)return Te(V,null),V;o===void 0&&(o=Pr(l?e:"<!>"+e),r||(o=me(o)));var u=i||fn?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=Pr(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 Yl(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 Gn(e,t){return Zn(e,t)}function Gl(e,t){Er(),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!==mr);)l=qe(l);if(!l)throw st;ct(!0),Me(l),dt();const u=Zn(e,{...t,anchor:l});if(V===null||V.nodeType!==8||V.data!==Xr)throw Jt(),st;return ct(!1),u}catch(u){if(u===st)return t.recover===!1&&dl(),Er(),wl(r),ct(!1),Gn(e,t);throw u}finally{ct(i),Me(o)}}const ht=new Map;function Zn(e,{target:t,anchor:r,props:i={},events:o,context:l,intro:u=!0}){Er();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=Ul(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(el(Yn)),Lr.add(c);var d=void 0,m=Il(()=>{var h=r??t.appendChild(Kt());return kr(()=>{if(l){Mn({});var g=le;g.c=l}o&&(i.$$events=o),F&&Te(h,null),d=e(h,i)||{},F&&(L.nodes_end=V),l&&Un()}),()=>{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)}Lr.delete(c),h!==r&&((N=h.parentNode)==null||N.removeChild(h))}});return Or.set(d,m),d}let Or=new WeakMap;function Zl(e,t){const r=Or.get(e);return r?(Or.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?wr: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===mr?i=0:q===zr?i=1/0:(i=parseInt(q.substring(1)),i!==i&&(i=s?1/0:-1))}const E=i>r;!!s===E&&(o=ml(),Me(o),ct(!1),N=!0,i=-1)}s?(l?An(l):y&&(l=kr(()=>y(o))),u&&xr(u,()=>{u=null})):(u?An(u):y&&(u=kr(()=>y(o,[r+1,i]))),l&&xr(l,()=>{l=null})),N&&ct(!0)};bn(()=>{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&&(yn(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=Pr(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 Wl(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 Wn=[...`
|
||
\r\f \v\uFEFF`];function Jl(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||Wn.includes(i[u-1]))&&(s===i.length||Wn.includes(i[s]))?i=(u===0?"":i.substring(0,u))+i.substring(s+1):u=s}}return i===""?null:i}function Kl(e,t,r,i,o,l){var u=e.__className;if(F||u!==r||u===void 0){var s=Jl(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 zl=Symbol("is custom element"),Xl=Symbol("is html");function Jn(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,xl(r),Bn()}}function Ql(e,t){var r=Kn(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=Kn(e);F&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=r)&&(t==="loading"&&(e[al]=r),r==null?e.removeAttribute(t):typeof r!="string"&&eo(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Kn(e){return e.__attributes??(e.__attributes={[zl]:e.nodeName.includes("-"),[Xl]:e.namespaceURI===Xi})}var zn=new Map;function eo(e){var t=zn.get(e.nodeName);if(t)return t;zn.set(e.nodeName,t=[]);for(var r,i=e,o=Element.prototype;o!==i;){r=tl(i);for(var l in r)r[l].set&&t.push(l);i=rn(i)}return t}function to(e,t,r=t){jl(e,"change",i=>{var o=i?e.defaultChecked:e.checked;r(o)}),(F&&e.defaultChecked!==e.checked||rt(t)==null)&&r(e.checked),$r(()=>{var i=t();e.checked=!!i})}function Xn(e,t){return e===t||(e==null?void 0:e[At])===t}function ar(e={},t,r,i){return Rr(()=>{var o,l;return $r(()=>{o=l,l=[],rt(()=>{e!==r(...l)&&(t(e,...l),o&&Xn(r(...o),e)&&t(null,...o))})}),()=>{Sr(()=>{l&&Xn(r(...l),e)&&t(null,...l)})}}),e}function Qn(e){le===null&&en(),Ir(()=>{const t=rt(e);if(typeof t=="function")return t})}function ro(e){le===null&&en(),Qn(()=>()=>rt(e))}function ei(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 no(e,t=ut){let r=null;const i=new Set;function o(s){if(vn(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 ei(e,r=>t=r)(),t}let ur=!1,Fr=Symbol();function io(e,t,r){const i=r[t]??(r[t]={store:null,source:Dr(void 0),unsubscribe:ut});if(i.store!==e&&!(Fr 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=ei(e,l=>{o?i.source.v=l:w(i.source,l)}),o=!1}return e&&Fr in r?sr(e):a(i.source)}function lo(){const e={};function t(){Ar(()=>{for(var r in e)e[r].unsubscribe();Ct(e,Fr,{enumerable:!1,value:!0})})}return[e,t]}function oo(e){var t=ur;try{return ur=!1,[e(),ur]}finally{ur=t}}function ti(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&Wi)!==0,s=(r&Ji)!==0,c=!1,d;u?[d,c]=oo(()=>e[t]):d=e[t];var m=At in e||sn 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&&hl(),d=E(),h&&h(d));var q;if(q=()=>{var B=e[t];return B===void 0?E():(y=!0,N=!1,B)},(r&Zi)===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=Dr(d),te=zt(()=>{var B=q(),ce=a(oe);return ee?(ee=!1,ce):oe.v=B});return u&&a(te),o||(te.equals=Cr),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),ti(te))return B;rt(()=>a(te))}return B}return ti(te)?te.v:a(te)}}function ao(e){return new so(e)}class so{constructor(t){Jr(this,Oe);Jr(this,we);var l;var r=new Map,i=(u,s)=>{var c=Dr(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===sn?!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)}});Kr(this,we,(t.hydrate?Gl:Gn)(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(),Kr(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=()=>{Zl(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 ri;typeof HTMLElement=="function"&&(ri=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=uo(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=ao({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=Al(()=>{$r(()=>{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 uo(e){const t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function fo(e,t,r,i,o,l){let u=class extends ri{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 ni=new TextEncoder;function co(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function ho(e,t="SHA-256",r=1e5){const i=Date.now().toString(16);e||(e=Math.round(Math.random()*r));const o=await ii(i,e,t);return{algorithm:t,challenge:o,salt:i,signature:""}}async function ii(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 co(await crypto.subtle.digest(r.toUpperCase(),ni.encode(e+t)))}function vo(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 ii(t,c,r)===e)return{number:c,took:Date.now()-u}}return null})(),controller:l}}function li(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function go(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 _o(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 mo(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:_o(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=go(e);const m=await crypto.subtle.digest("SHA-256",ni.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:no({})};const bo={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",bo);const Vr=(e,t)=>{let r=pl(()=>il(t==null?void 0:t(),24));var i=Eo();ke(()=>{P(i,"width",a(r)),P(i,"height",a(r))}),j(e,i)};function wo(e,t){e.code==="Space"&&(e.preventDefault(),e.stopImmediatePropagation(),t())}function po(e,t){e.preventDefault(),t()}function yo(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 Eo=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>'),Co=Ce('<input type="hidden">'),Ao=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>'),Io=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>'),Ro=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>'),$o=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>'),ko=Ce('<button type="button" class="altcha-code-challenge-audio"><!></button>'),xo=Ce("<audio hidden autoplay><source></audio>"),So=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>'),To=Ce("<div><!></div>"),No=Ce("<div><!></div>"),Do=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>'),Lo=Ce('<div class="altcha-footer"><div><!></div></div>'),Po=Ce('<div class="altcha-anchor-arrow"></div>'),Oo=Ce('<!> <div class="altcha"><div class="altcha-main"><div><!> <input type="checkbox"></div> <label class="altcha-label"><!></label> <!> <!> <!></div> <!> <!> <!></div>',1);function oi(e,t){var Bi,Hi;Mn(t,!0);const[r,i]=lo(),o=()=>io(Vo,"$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:Fo}=globalThis,Vo=Fo.store,si=["SHA-256","SHA-384","SHA-512"],Mo="https://altcha.org/",Ze=(n,f)=>{t.$$host.dispatchEvent(new CustomEvent(n,{detail:f}))},ui=(Hi=(Bi=document.documentElement.lang)==null?void 0:Bi.split("-"))==null?void 0:Hi[0],Mr=Rt(()=>{var n;return s()&&new URL(s(),location.origin).host.endsWith(".altcha.org")&&!!((n=s())!=null&&n.includes("apiKey=ckey_"))}),Ur=Rt(()=>c()?Ai(c()):void 0),Uo=Rt(()=>_t()?Ai(_t()):{}),M=Rt(()=>({...hi(o()),...a(Uo)})),fi=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),qr=U(null),bt=U(null),O=U(null),lt=U(null),De=null,z=U(null),ot=U(!1),Je=[],jr=U(!1),Fe=U(null);Ir(()=>{Qo(a(lt))}),Ir(()=>{ea(a(k))}),ro(()=>{qo(),a(O)&&(a(O).removeEventListener("submit",wi),a(O).removeEventListener("reset",pi),a(O).removeEventListener("focusin",bi),w(O,null)),De&&(clearTimeout(De),De=null),document.removeEventListener("click",_i),document.removeEventListener("scroll",mi),window.removeEventListener("resize",Ci)}),Qn(()=>{var n;x("mounted","2.0.0-beta.12"),x("workers",mt()),Yo(),x("plugins",Je.length?Je.map(f=>f.constructor.pluginName).join(", "):"none"),pe()&&x("using test mode"),N()&&Br(N()),l()!==void 0&&x("auto",l()),E()!==void 0&&Ri(E()),w(O,(n=a(se))==null?void 0:n.closest("form"),!0),a(O)&&(a(O).addEventListener("submit",wi,{capture:!0}),a(O).addEventListener("reset",pi),(l()==="onfocus"||ee()==="focus")&&a(O).addEventListener("focusin",bi)),l()==="onload"&&(Ge()?Mt():Ve()),a(Mr)&&(oe()||te())&&x("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."),requestAnimationFrame(()=>{Ze("load")})});function dr(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 qo(){for(const n of Je)n.destroy()}function ci(){s()&&Pt()&&a(k)===C.VERIFIED?Ve():wt(C.EXPIRED,a(M).expired)}async function jo(){var n;if(Lt())throw x("mocking error"),new Error("Mocked error.");if(a(Ur))return x("using provided json data"),a(Ur);if(pe())return x("generating test challenge",{test:pe()}),ho(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 di()(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&&Br(H)}if(b)try{const I=JSON.parse(b);I&&typeof I=="object"&&(I.verifyurl&&!I.verifyurl.startsWith("javascript:")&&(I.verifyurl=gi(I.verifyurl)),xi(I))}catch(I){x("unable to configure from X-Altcha-Config",I)}return _}}function Bo(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 di(){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 hi(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 Ho(){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 vi(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
|
||
`):p),b},{})}function gi(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 Yo(){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:Si,getFloatingAnchor:Ti,getState:Ni,log:x,reset:wt,solve:ki,setState:Le,setFloatingAnchor:Li,verify:Ve}))}function x(...n){(h()||n.some(f=>f instanceof Error))&&console[n[0]instanceof Error?"error":"log"]("ALTCHA",`[name=${ce()}]`,...n)}function Go(){w(z,Q.PAUSED,!0)}function Zo(n){w(z,Q.ERROR,!0)}function Wo(){w(z,Q.READY,!0)}function Jo(){w(z,Q.LOADING,!0)}function Ko(){w(z,Q.PLAYING,!0)}function zo(){w(z,Q.PAUSED,!0)}function Xo(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("javascript:")){const _=ae().replace(/^javascript:/,"");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),Ii(dr(a(Y).challenge,a(Y).solution),b).then(({reason:_,verified:A})=>{A?(w(Y,null),Le(C.VERIFIED),x("verified"),Nr().then(()=>{var p;(p=a(qr))==null||p.focus(),Ze("verified",{payload:a(Fe)})})):(wt(),w(lt,_||"Verification failed",!0))}).catch(_=>{w(Y,null),Le(C.ERROR,_),x("sentinel verification failed:",_)}).finally(()=>{w(ot,!1)})}}function _i(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)&&Di()}function mi(){E()&&a(k)!==C.UNVERIFIED&&Ut()}function Qo(n){for(const f of Je)typeof f.onErrorChange=="function"&&f.onErrorChange(a(lt))}function bi(n){a(k)===C.UNVERIFIED?Ve():E()&&ee()==="focus"&&a(k)===C.VERIFIED&&Hr()}function wi(n){const f=n.target,v=n.submitter;f!=null&&f.hasAttribute("data-code-challenge-form")||(a(O)&&l()==="onsubmit"?a(k)===C.UNVERIFIED?(n.preventDefault(),n.stopPropagation(),Ve().then(()=>{ra(v)})):a(k)!==C.VERIFIED&&(n.preventDefault(),n.stopPropagation(),a(k)===C.VERIFYING&&yi()):a(O)&&E()&&l()==="off"&&a(k)===C.UNVERIFIED&&(n.preventDefault(),n.stopPropagation(),Hr()))}function pi(){wt()}function yi(){a(k)===C.VERIFYING&&a(M).waitAlert&&alert(a(M).waitAlert)}function Ei(){a(We)?a(We).paused?(a(We).currentTime=0,a(We).play()):a(We).pause():(w(jr,!0),requestAnimationFrame(()=>{var n;(n=a(We))==null||n.play()}))}function ea(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 Ci(){E()&&Ut()}function Ai(n){return JSON.parse(n)}async function ta(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:Gr,timeZone:gr}=Ho();f.blockedCountries=_,f.classifier=A,f.disableRules=p,f.email=I===!1?void 0:Bo(I),f.expectedCountries=re,f.expectedLanguages=H||(ui?[ui]:void 0),f.fields=de===!1?void 0:vi(de),f.ipAddress=Ke===!1?void 0:Ke||"auto",f.text=Gr,f.timeZone=gr===!1?void 0:gr||li()}const v=await di()(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 Ii(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?vi():void 0,v.timeZone=it().timeZone?li():void 0);const b=await fetch(ae(),{body:JSON.stringify(v),headers:{"content-type":"application/json"},method:"POST"});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 ra(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 Br(n){x("expire",n),De&&(clearTimeout(De),De=null),n<1?ci():De=setTimeout(ci,n)}function Ri(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",mi),document.addEventListener("click",_i),window.addEventListener("resize",Ci)):l()==="onsubmit"&&l(void 0)}function $i(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(!si.includes(n.algorithm.toUpperCase()))throw new Error(`Unknown algorithm value. Allowed values: ${si.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 ki(n){let f=null;if("Worker"in window){try{f=await na(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 mo(n.obfuscated,n.key,n.maxNumber||n.maxnumber);return{data:n,solution:await v.promise}}return{data:n,solution:await vo(n.challenge,n.salt,n.algorithm,n.maxNumber||n.maxnumber||Ae()).promise}}async function na(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 xi(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&&Ri(n.floating),n.expire!==void 0&&(Br(n.expire),N(n.expire)),n.challenge&&(c(typeof n.challenge=="string"?n.challenge:JSON.stringify(n.challenge)),$i(a(Ur))),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(hi(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 Si(){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 Ti(){return a(bt)}function ia(n){return Je.find(f=>f.constructor.pluginName===n)}function Ni(){return a(k)}function Di(){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(jr,!1),w(z,null),Le(n,f)}function Li(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 Hr(){a(se).style.display="block",E()&&Ut()}async function Ve(){return wt(C.VERIFYING),await new Promise(n=>setTimeout(n,g()||0)),jo().then(n=>($i(n),x("challenge",n),ki(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)((v=document.activeElement)==null?void 0:v.tagName)==="INPUT"&&y()===!1&&document.activeElement.blur(),w(Y,{challenge:n,solution:f},!0);else{if(ae()&&it()!==void 0)return Ii(dr(n,f));if(ae())return ta(dr(n,f));w(Fe,dr(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),Nr().then(()=>{Ze("code",{codeChallenge:a(Y)})})):(Le(C.VERIFIED),x("verified"),Nr().then(()=>{Ze("verified",{payload:a(Fe)})}))}).catch(n=>{x(n),Le(C.ERROR,n.message)})}var Pi=Oo(),Oi=It(Pi);Wl(Oi,t,"default",{});var qt=J(Oi,2),Yr=W(qt),hr=W(Yr);let Fi;var Vi=W(hr);{var la=n=>{Vr(n)};K(Vi,n=>{a(k)===C.VERIFYING&&n(la)})}var at=J(Vi,2);Jn(at),at.__change=[yo,k,Ne,O,Ft,Ge,Mt,Ve],ar(at,n=>w(qr,n),()=>a(qr)),Z(hr);var vr=J(hr,2),oa=W(vr);{var aa=n=>{var f=or(),v=It(f);nt(v,()=>a(M).verified),j(n,f)},sa=(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(oa,n=>{a(k)===C.VERIFIED?n(aa):n(sa,!1)})}Z(vr);var Mi=J(vr,2);{var ua=n=>{var f=Co();Jn(f),ke(()=>{P(f,"name",ce()),Ql(f,a(Fe))}),j(n,f)};K(Mi,n=>{a(k)===C.VERIFIED&&n(ua)})}var Ui=J(Mi,2);{var fa=n=>{var f=Ao(),v=W(f);P(v,"href",Mo),Z(f),ke(()=>P(v,"aria-label",a(M).ariaLinkLabel)),j(n,f)};K(Ui,n=>{(te()!==!0||a(Mr))&&n(fa)})}var ca=J(Ui,2);{var da=n=>{var f=So(),v=J(W(f),2),b=W(v),_=J(b,2);ql(_,!y()),_.__keydown=[wo,Ei];var A=J(_,2),p=W(A),I=W(p);{var H=Ie=>{var X=ko();X.__click=Ei;var _r=W(X);{var jt=pt=>{Vr(pt,()=>20)},pa=(pt,ya)=>{{var Ea=yt=>{var Zr=Io();j(yt,Zr)},Ca=(yt,Zr)=>{{var Aa=Et=>{var Wr=Ro();j(Et,Wr)},Ia=Et=>{var Wr=$o();j(Et,Wr)};K(yt,Et=>{a(z)===Q.PLAYING?Et(Aa):Et(Ia,!1)},Zr)}};K(pt,yt=>{a(z)===Q.ERROR?yt(Ea):yt(Ca,!1)},ya)}};K(_r,pt=>{a(z)===Q.LOADING?pt(jt):pt(pa,!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=[po,Ve],Z(p);var de=J(p,2),Ke=W(de);{var Gr=Ie=>{Vr(Ie,()=>16)};K(Ke,Ie=>{a(ot)&&Ie(Gr)})}var gr=J(Ke);Z(de),Z(A);var ba=J(A,2);{var wa=Ie=>{var X=xo(),_r=W(X);Z(X),ar(X,jt=>w(We,jt),()=>a(We)),ke(jt=>P(_r,"src",jt),[()=>gi(a(Y).challenge.codeChallenge.audio,{language:B()})]),Ye("loadstart",X,Jo),Ye("canplay",X,Wo),Ye("pause",X,zo),Ye("playing",X,Ko),Ye("ended",X,Go),Ye("error",_r,Zo),j(Ie,X)};K(ba,Ie=>{a(Y).challenge.codeChallenge.audio&&a(jr)&&Ie(wa)})}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),Yl(gr,` ${a(M).verify??""}`)}),Ye("submit",v,Xo,!0),j(n,f)};K(ca,n=>{var f;(f=a(Y))!=null&&f.challenge.codeChallenge&&n(da)})}Z(Yr);var qi=J(Yr,2);{var ha=n=>{var f=Do(),v=J(W(f),2);{var b=A=>{var p=To(),I=W(p);nt(I,()=>a(M).expired),Z(p),ke(()=>P(p,"title",a(lt))),j(A,p)},_=A=>{var p=No(),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(qi,n=>{(a(lt)||a(k)===C.EXPIRED)&&n(ha)})}var ji=J(qi,2);{var va=n=>{var f=Lo(),v=W(f),b=W(v);nt(b,()=>a(M).footer),Z(v),Z(f),j(n,f)};K(ji,n=>{a(M).footer&&(oe()!==!0||a(Mr))&&n(va)})}var ga=J(ji,2);{var _a=n=>{var f=Po();ar(f,v=>w(Vt,v),()=>a(Vt)),j(n,f)};K(ga,n=>{E()&&n(_a)})}Z(qt),ar(qt,n=>w(se,n),()=>a(se)),ke(n=>{P(qt,"data-state",a(k)),P(qt,"data-floating",E()),Fi=Kl(hr,1,"altcha-checkbox",null,Fi,n),P(at,"id",a(fi)),at.required=l()!=="onsubmit"&&(!E()||l()!=="off"),P(vr,"for",a(fi))},[()=>({"altcha-checkbox-verifying":a(k)===C.VERIFYING})]),Ye("invalid",at,yi),to(at,()=>a(Ft),n=>w(Ft,n)),j(e,Pi);var ma=Un({clarify:Mt,configure:xi,getConfiguration:Si,getFloatingAnchor:Ti,getPlugin:ia,getState:Ni,hide:Di,repositionFloating:Ut,reset:wt,setFloatingAnchor:Li,setState:Le,show:Hr,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(),ma}Hl(["change","keydown","click"]),customElements.define("altcha-widget",fo(oi,{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=oi,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|