@botpoison/browser 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +79 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare global {
|
|
|
12
12
|
__BOTPOISON_VERSION__: string | undefined;
|
|
13
13
|
__BOTPOISON_SUBMIT_LISTENER__: boolean | undefined;
|
|
14
14
|
__BOTPOISON_SESSION_OPENED__: boolean | undefined;
|
|
15
|
+
__BOTPOISON_HONEYPOT_INSTALLED__: boolean | undefined;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
type BotpoisonOptions = {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var __botpoison=(()=>{var F0=Object.create;var SF=Object.defineProperty;var t0=Object.getOwnPropertyDescriptor;var h0=Object.getOwnPropertyNames;var x0=Object.getPrototypeOf,e0=Object.prototype.hasOwnProperty;var i0=(s,n)=>()=>(n||s((n={exports:{}}).exports,n),n.exports),s0=(s,n)=>{for(var a in n)SF(s,a,{get:n[a],enumerable:!0})},LF=(s,n,a,C)=>{if(n&&typeof n=="object"||typeof n=="function")for(let w of h0(n))!e0.call(s,w)&&w!==a&&SF(s,w,{get:()=>n[w],enumerable:!(C=t0(n,w))||C.enumerable});return s};var n0=(s,n,a)=>(a=s!=null?F0(x0(s)):{},LF(n||!s||!s.__esModule?SF(a,"default",{value:s,enumerable:!0}):a,s)),r0=s=>LF(SF({},"__esModule",{value:!0}),s);var HF=i0((_0,yF)=>{"use strict";(function(){"use strict";var s="input is invalid type",n="finalize already called",a=typeof window=="object",C=a?window:{};C.JS_SHA512_NO_WINDOW&&(a=!1);var w=!a&&typeof self=="object",tF=!C.JS_SHA512_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;tF?C=global:w&&(C=self);var nF=!C.JS_SHA512_NO_COMMON_JS&&typeof yF=="object"&&yF.exports,oF=typeof define=="function"&&define.amd,cF=!C.JS_SHA512_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",F="0123456789abcdef".split(""),ZF=[-2147483648,8388608,32768,128],sF=[24,16,8,0],rF=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],BF=["hex","array","digest","arrayBuffer"],d=[];(C.JS_SHA512_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),cF&&(C.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var UF=function(t,r){return function(o){return new g(r,!0).update(o)[t]()}},CF=function(t){var r=UF("hex",t);r.create=function(){return new g(t)},r.update=function(A){return r.create().update(A)};for(var o=0;o<BF.length;++o){var E=BF[o];r[E]=UF(E,t)}return r},kF=function(t,r){return function(o,E){return new lF(o,r,!0).update(E)[t]()}},dF=function(t){var r=kF("hex",t);r.create=function(A){return new lF(A,t)},r.update=function(A,l){return r.create(A).update(l)};for(var o=0;o<BF.length;++o){var E=BF[o];r[E]=kF(E,t)}return r};function g(t,r){r?(d[0]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=d[16]=d[17]=d[18]=d[19]=d[20]=d[21]=d[22]=d[23]=d[24]=d[25]=d[26]=d[27]=d[28]=d[29]=d[30]=d[31]=d[32]=0,this.blocks=d):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t==384?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):t==256?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):t==224?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=t,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}g.prototype.update=function(t){if(this.finalized)throw new Error(n);var r,o=typeof t;if(o!=="string"){if(o==="object"){if(t===null)throw new Error(s);if(cF&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!cF||!ArrayBuffer.isView(t)))throw new Error(s)}else throw new Error(s);r=!0}for(var E,A=0,l,_=t.length,i=this.blocks;A<_;){if(this.hashed&&(this.hashed=!1,i[0]=this.block,i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=i[16]=i[17]=i[18]=i[19]=i[20]=i[21]=i[22]=i[23]=i[24]=i[25]=i[26]=i[27]=i[28]=i[29]=i[30]=i[31]=i[32]=0),r)for(l=this.start;A<_&&l<128;++A)i[l>>2]|=t[A]<<sF[l++&3];else for(l=this.start;A<_&&l<128;++A)E=t.charCodeAt(A),E<128?i[l>>2]|=E<<sF[l++&3]:E<2048?(i[l>>2]|=(192|E>>6)<<sF[l++&3],i[l>>2]|=(128|E&63)<<sF[l++&3]):E<55296||E>=57344?(i[l>>2]|=(224|E>>12)<<sF[l++&3],i[l>>2]|=(128|E>>6&63)<<sF[l++&3],i[l>>2]|=(128|E&63)<<sF[l++&3]):(E=65536+((E&1023)<<10|t.charCodeAt(++A)&1023),i[l>>2]|=(240|E>>18)<<sF[l++&3],i[l>>2]|=(128|E>>12&63)<<sF[l++&3],i[l>>2]|=(128|E>>6&63)<<sF[l++&3],i[l>>2]|=(128|E&63)<<sF[l++&3]);this.lastByteIndex=l,this.bytes+=l-this.start,l>=128?(this.block=i[32],this.start=l-128,this.hash(),this.hashed=!0):this.start=l}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},g.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex;t[32]=this.block,t[r>>2]|=ZF[r&3],this.block=t[32],r>=112&&(this.hashed||this.hash(),t[0]=this.block,t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=t[16]=t[17]=t[18]=t[19]=t[20]=t[21]=t[22]=t[23]=t[24]=t[25]=t[26]=t[27]=t[28]=t[29]=t[30]=t[31]=t[32]=0),t[30]=this.hBytes<<3|this.bytes>>>29,t[31]=this.bytes<<3,this.hash()}},g.prototype.hash=function(){var t=this.h0h,r=this.h0l,o=this.h1h,E=this.h1l,A=this.h2h,l=this.h2l,_=this.h3h,i=this.h3l,B=this.h4h,D=this.h4l,O=this.h5h,v=this.h5l,b=this.h6h,T=this.h6l,I=this.h7h,N=this.h7l,y=this.blocks,p,M,H,K,z,h,x,e,f,bF,wF,TF,IF,NF,PF,_F,DF,hF,xF,c,u,S,m,eF,iF;for(p=32;p<160;p+=2)c=y[p-30],u=y[p-29],M=(c>>>1|u<<31)^(c>>>8|u<<24)^c>>>7,H=(u>>>1|c<<31)^(u>>>8|c<<24)^(u>>>7|c<<25),c=y[p-4],u=y[p-3],K=(c>>>19|u<<13)^(u>>>29|c<<3)^c>>>6,z=(u>>>19|c<<13)^(c>>>29|u<<3)^(u>>>6|c<<26),c=y[p-32],u=y[p-31],S=y[p-14],m=y[p-13],h=(m&65535)+(u&65535)+(H&65535)+(z&65535),x=(m>>>16)+(u>>>16)+(H>>>16)+(z>>>16)+(h>>>16),e=(S&65535)+(c&65535)+(M&65535)+(K&65535)+(x>>>16),f=(S>>>16)+(c>>>16)+(M>>>16)+(K>>>16)+(e>>>16),y[p]=f<<16|e&65535,y[p+1]=x<<16|h&65535;var j=t,J=r,P=o,R=E,U=A,k=l,V=_,$=i,W=B,G=D,Y=O,q=v,Q=b,X=T,Z=I,FF=N;for(_F=P&U,DF=R&k,p=0;p<160;p+=8)M=(j>>>28|J<<4)^(J>>>2|j<<30)^(J>>>7|j<<25),H=(J>>>28|j<<4)^(j>>>2|J<<30)^(j>>>7|J<<25),K=(W>>>14|G<<18)^(W>>>18|G<<14)^(G>>>9|W<<23),z=(G>>>14|W<<18)^(G>>>18|W<<14)^(W>>>9|G<<23),bF=j&P,wF=J&R,hF=bF^j&U^_F,xF=wF^J&k^DF,eF=W&Y^~W&Q,iF=G&q^~G&X,c=y[p],u=y[p+1],S=rF[p],m=rF[p+1],h=(m&65535)+(u&65535)+(iF&65535)+(z&65535)+(FF&65535),x=(m>>>16)+(u>>>16)+(iF>>>16)+(z>>>16)+(FF>>>16)+(h>>>16),e=(S&65535)+(c&65535)+(eF&65535)+(K&65535)+(Z&65535)+(x>>>16),f=(S>>>16)+(c>>>16)+(eF>>>16)+(K>>>16)+(Z>>>16)+(e>>>16),c=f<<16|e&65535,u=x<<16|h&65535,h=(xF&65535)+(H&65535),x=(xF>>>16)+(H>>>16)+(h>>>16),e=(hF&65535)+(M&65535)+(x>>>16),f=(hF>>>16)+(M>>>16)+(e>>>16),S=f<<16|e&65535,m=x<<16|h&65535,h=($&65535)+(u&65535),x=($>>>16)+(u>>>16)+(h>>>16),e=(V&65535)+(c&65535)+(x>>>16),f=(V>>>16)+(c>>>16)+(e>>>16),Z=f<<16|e&65535,FF=x<<16|h&65535,h=(m&65535)+(u&65535),x=(m>>>16)+(u>>>16)+(h>>>16),e=(S&65535)+(c&65535)+(x>>>16),f=(S>>>16)+(c>>>16)+(e>>>16),V=f<<16|e&65535,$=x<<16|h&65535,M=(V>>>28|$<<4)^($>>>2|V<<30)^($>>>7|V<<25),H=($>>>28|V<<4)^(V>>>2|$<<30)^(V>>>7|$<<25),K=(Z>>>14|FF<<18)^(Z>>>18|FF<<14)^(FF>>>9|Z<<23),z=(FF>>>14|Z<<18)^(FF>>>18|Z<<14)^(Z>>>9|FF<<23),TF=V&j,IF=$&J,hF=TF^V&P^bF,xF=IF^$&R^wF,eF=Z&W^~Z&Y,iF=FF&G^~FF&q,c=y[p+2],u=y[p+3],S=rF[p+2],m=rF[p+3],h=(m&65535)+(u&65535)+(iF&65535)+(z&65535)+(X&65535),x=(m>>>16)+(u>>>16)+(iF>>>16)+(z>>>16)+(X>>>16)+(h>>>16),e=(S&65535)+(c&65535)+(eF&65535)+(K&65535)+(Q&65535)+(x>>>16),f=(S>>>16)+(c>>>16)+(eF>>>16)+(K>>>16)+(Q>>>16)+(e>>>16),c=f<<16|e&65535,u=x<<16|h&65535,h=(xF&65535)+(H&65535),x=(xF>>>16)+(H>>>16)+(h>>>16),e=(hF&65535)+(M&65535)+(x>>>16),f=(hF>>>16)+(M>>>16)+(e>>>16),S=f<<16|e&65535,m=x<<16|h&65535,h=(k&65535)+(u&65535),x=(k>>>16)+(u>>>16)+(h>>>16),e=(U&65535)+(c&65535)+(x>>>16),f=(U>>>16)+(c>>>16)+(e>>>16),Q=f<<16|e&65535,X=x<<16|h&65535,h=(m&65535)+(u&65535),x=(m>>>16)+(u>>>16)+(h>>>16),e=(S&65535)+(c&65535)+(x>>>16),f=(S>>>16)+(c>>>16)+(e>>>16),U=f<<16|e&65535,k=x<<16|h&65535,M=(U>>>28|k<<4)^(k>>>2|U<<30)^(k>>>7|U<<25),H=(k>>>28|U<<4)^(U>>>2|k<<30)^(U>>>7|k<<25),K=(Q>>>14|X<<18)^(Q>>>18|X<<14)^(X>>>9|Q<<23),z=(X>>>14|Q<<18)^(X>>>18|Q<<14)^(Q>>>9|X<<23),NF=U&V,PF=k&$,hF=NF^U&j^TF,xF=PF^k&J^IF,eF=Q&Z^~Q&W,iF=X&FF^~X&G,c=y[p+4],u=y[p+5],S=rF[p+4],m=rF[p+5],h=(m&65535)+(u&65535)+(iF&65535)+(z&65535)+(q&65535),x=(m>>>16)+(u>>>16)+(iF>>>16)+(z>>>16)+(q>>>16)+(h>>>16),e=(S&65535)+(c&65535)+(eF&65535)+(K&65535)+(Y&65535)+(x>>>16),f=(S>>>16)+(c>>>16)+(eF>>>16)+(K>>>16)+(Y>>>16)+(e>>>16),c=f<<16|e&65535,u=x<<16|h&65535,h=(xF&65535)+(H&65535),x=(xF>>>16)+(H>>>16)+(h>>>16),e=(hF&65535)+(M&65535)+(x>>>16),f=(hF>>>16)+(M>>>16)+(e>>>16),S=f<<16|e&65535,m=x<<16|h&65535,h=(R&65535)+(u&65535),x=(R>>>16)+(u>>>16)+(h>>>16),e=(P&65535)+(c&65535)+(x>>>16),f=(P>>>16)+(c>>>16)+(e>>>16),Y=f<<16|e&65535,q=x<<16|h&65535,h=(m&65535)+(u&65535),x=(m>>>16)+(u>>>16)+(h>>>16),e=(S&65535)+(c&65535)+(x>>>16),f=(S>>>16)+(c>>>16)+(e>>>16),P=f<<16|e&65535,R=x<<16|h&65535,M=(P>>>28|R<<4)^(R>>>2|P<<30)^(R>>>7|P<<25),H=(R>>>28|P<<4)^(P>>>2|R<<30)^(P>>>7|R<<25),K=(Y>>>14|q<<18)^(Y>>>18|q<<14)^(q>>>9|Y<<23),z=(q>>>14|Y<<18)^(q>>>18|Y<<14)^(Y>>>9|q<<23),_F=P&U,DF=R&k,hF=_F^P&V^NF,xF=DF^R&$^PF,eF=Y&Q^~Y&Z,iF=q&X^~q&FF,c=y[p+6],u=y[p+7],S=rF[p+6],m=rF[p+7],h=(m&65535)+(u&65535)+(iF&65535)+(z&65535)+(G&65535),x=(m>>>16)+(u>>>16)+(iF>>>16)+(z>>>16)+(G>>>16)+(h>>>16),e=(S&65535)+(c&65535)+(eF&65535)+(K&65535)+(W&65535)+(x>>>16),f=(S>>>16)+(c>>>16)+(eF>>>16)+(K>>>16)+(W>>>16)+(e>>>16),c=f<<16|e&65535,u=x<<16|h&65535,h=(xF&65535)+(H&65535),x=(xF>>>16)+(H>>>16)+(h>>>16),e=(hF&65535)+(M&65535)+(x>>>16),f=(hF>>>16)+(M>>>16)+(e>>>16),S=f<<16|e&65535,m=x<<16|h&65535,h=(J&65535)+(u&65535),x=(J>>>16)+(u>>>16)+(h>>>16),e=(j&65535)+(c&65535)+(x>>>16),f=(j>>>16)+(c>>>16)+(e>>>16),W=f<<16|e&65535,G=x<<16|h&65535,h=(m&65535)+(u&65535),x=(m>>>16)+(u>>>16)+(h>>>16),e=(S&65535)+(c&65535)+(x>>>16),f=(S>>>16)+(c>>>16)+(e>>>16),j=f<<16|e&65535,J=x<<16|h&65535;h=(r&65535)+(J&65535),x=(r>>>16)+(J>>>16)+(h>>>16),e=(t&65535)+(j&65535)+(x>>>16),f=(t>>>16)+(j>>>16)+(e>>>16),this.h0h=f<<16|e&65535,this.h0l=x<<16|h&65535,h=(E&65535)+(R&65535),x=(E>>>16)+(R>>>16)+(h>>>16),e=(o&65535)+(P&65535)+(x>>>16),f=(o>>>16)+(P>>>16)+(e>>>16),this.h1h=f<<16|e&65535,this.h1l=x<<16|h&65535,h=(l&65535)+(k&65535),x=(l>>>16)+(k>>>16)+(h>>>16),e=(A&65535)+(U&65535)+(x>>>16),f=(A>>>16)+(U>>>16)+(e>>>16),this.h2h=f<<16|e&65535,this.h2l=x<<16|h&65535,h=(i&65535)+($&65535),x=(i>>>16)+($>>>16)+(h>>>16),e=(_&65535)+(V&65535)+(x>>>16),f=(_>>>16)+(V>>>16)+(e>>>16),this.h3h=f<<16|e&65535,this.h3l=x<<16|h&65535,h=(D&65535)+(G&65535),x=(D>>>16)+(G>>>16)+(h>>>16),e=(B&65535)+(W&65535)+(x>>>16),f=(B>>>16)+(W>>>16)+(e>>>16),this.h4h=f<<16|e&65535,this.h4l=x<<16|h&65535,h=(v&65535)+(q&65535),x=(v>>>16)+(q>>>16)+(h>>>16),e=(O&65535)+(Y&65535)+(x>>>16),f=(O>>>16)+(Y>>>16)+(e>>>16),this.h5h=f<<16|e&65535,this.h5l=x<<16|h&65535,h=(T&65535)+(X&65535),x=(T>>>16)+(X>>>16)+(h>>>16),e=(b&65535)+(Q&65535)+(x>>>16),f=(b>>>16)+(Q>>>16)+(e>>>16),this.h6h=f<<16|e&65535,this.h6l=x<<16|h&65535,h=(N&65535)+(FF&65535),x=(N>>>16)+(FF>>>16)+(h>>>16),e=(I&65535)+(Z&65535)+(x>>>16),f=(I>>>16)+(Z>>>16)+(e>>>16),this.h7h=f<<16|e&65535,this.h7l=x<<16|h&65535},g.prototype.hex=function(){this.finalize();var t=this.h0h,r=this.h0l,o=this.h1h,E=this.h1l,A=this.h2h,l=this.h2l,_=this.h3h,i=this.h3l,B=this.h4h,D=this.h4l,O=this.h5h,v=this.h5l,b=this.h6h,T=this.h6l,I=this.h7h,N=this.h7l,y=this.bits,p=F[t>>28&15]+F[t>>24&15]+F[t>>20&15]+F[t>>16&15]+F[t>>12&15]+F[t>>8&15]+F[t>>4&15]+F[t&15]+F[r>>28&15]+F[r>>24&15]+F[r>>20&15]+F[r>>16&15]+F[r>>12&15]+F[r>>8&15]+F[r>>4&15]+F[r&15]+F[o>>28&15]+F[o>>24&15]+F[o>>20&15]+F[o>>16&15]+F[o>>12&15]+F[o>>8&15]+F[o>>4&15]+F[o&15]+F[E>>28&15]+F[E>>24&15]+F[E>>20&15]+F[E>>16&15]+F[E>>12&15]+F[E>>8&15]+F[E>>4&15]+F[E&15]+F[A>>28&15]+F[A>>24&15]+F[A>>20&15]+F[A>>16&15]+F[A>>12&15]+F[A>>8&15]+F[A>>4&15]+F[A&15]+F[l>>28&15]+F[l>>24&15]+F[l>>20&15]+F[l>>16&15]+F[l>>12&15]+F[l>>8&15]+F[l>>4&15]+F[l&15]+F[_>>28&15]+F[_>>24&15]+F[_>>20&15]+F[_>>16&15]+F[_>>12&15]+F[_>>8&15]+F[_>>4&15]+F[_&15];return y>=256&&(p+=F[i>>28&15]+F[i>>24&15]+F[i>>20&15]+F[i>>16&15]+F[i>>12&15]+F[i>>8&15]+F[i>>4&15]+F[i&15]),y>=384&&(p+=F[B>>28&15]+F[B>>24&15]+F[B>>20&15]+F[B>>16&15]+F[B>>12&15]+F[B>>8&15]+F[B>>4&15]+F[B&15]+F[D>>28&15]+F[D>>24&15]+F[D>>20&15]+F[D>>16&15]+F[D>>12&15]+F[D>>8&15]+F[D>>4&15]+F[D&15]+F[O>>28&15]+F[O>>24&15]+F[O>>20&15]+F[O>>16&15]+F[O>>12&15]+F[O>>8&15]+F[O>>4&15]+F[O&15]+F[v>>28&15]+F[v>>24&15]+F[v>>20&15]+F[v>>16&15]+F[v>>12&15]+F[v>>8&15]+F[v>>4&15]+F[v&15]),y==512&&(p+=F[b>>28&15]+F[b>>24&15]+F[b>>20&15]+F[b>>16&15]+F[b>>12&15]+F[b>>8&15]+F[b>>4&15]+F[b&15]+F[T>>28&15]+F[T>>24&15]+F[T>>20&15]+F[T>>16&15]+F[T>>12&15]+F[T>>8&15]+F[T>>4&15]+F[T&15]+F[I>>28&15]+F[I>>24&15]+F[I>>20&15]+F[I>>16&15]+F[I>>12&15]+F[I>>8&15]+F[I>>4&15]+F[I&15]+F[N>>28&15]+F[N>>24&15]+F[N>>20&15]+F[N>>16&15]+F[N>>12&15]+F[N>>8&15]+F[N>>4&15]+F[N&15]),p},g.prototype.toString=g.prototype.hex,g.prototype.digest=function(){this.finalize();var t=this.h0h,r=this.h0l,o=this.h1h,E=this.h1l,A=this.h2h,l=this.h2l,_=this.h3h,i=this.h3l,B=this.h4h,D=this.h4l,O=this.h5h,v=this.h5l,b=this.h6h,T=this.h6l,I=this.h7h,N=this.h7l,y=this.bits,p=[t>>24&255,t>>16&255,t>>8&255,t&255,r>>24&255,r>>16&255,r>>8&255,r&255,o>>24&255,o>>16&255,o>>8&255,o&255,E>>24&255,E>>16&255,E>>8&255,E&255,A>>24&255,A>>16&255,A>>8&255,A&255,l>>24&255,l>>16&255,l>>8&255,l&255,_>>24&255,_>>16&255,_>>8&255,_&255];return y>=256&&p.push(i>>24&255,i>>16&255,i>>8&255,i&255),y>=384&&p.push(B>>24&255,B>>16&255,B>>8&255,B&255,D>>24&255,D>>16&255,D>>8&255,D&255,O>>24&255,O>>16&255,O>>8&255,O&255,v>>24&255,v>>16&255,v>>8&255,v&255),y==512&&p.push(b>>24&255,b>>16&255,b>>8&255,b&255,T>>24&255,T>>16&255,T>>8&255,T&255,I>>24&255,I>>16&255,I>>8&255,I&255,N>>24&255,N>>16&255,N>>8&255,N&255),p},g.prototype.array=g.prototype.digest,g.prototype.arrayBuffer=function(){this.finalize();var t=this.bits,r=new ArrayBuffer(t/8),o=new DataView(r);return o.setUint32(0,this.h0h),o.setUint32(4,this.h0l),o.setUint32(8,this.h1h),o.setUint32(12,this.h1l),o.setUint32(16,this.h2h),o.setUint32(20,this.h2l),o.setUint32(24,this.h3h),t>=256&&o.setUint32(28,this.h3l),t>=384&&(o.setUint32(32,this.h4h),o.setUint32(36,this.h4l),o.setUint32(40,this.h5h),o.setUint32(44,this.h5l)),t==512&&(o.setUint32(48,this.h6h),o.setUint32(52,this.h6l),o.setUint32(56,this.h7h),o.setUint32(60,this.h7l)),r},g.prototype.clone=function(){var t=new g(this.bits,!1);return this.copyTo(t),t},g.prototype.copyTo=function(t){var r=0,o=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(r=0;r<o.length;++r)t[o[r]]=this[o[r]];for(r=0;r<this.blocks.length;++r)t.blocks[r]=this.blocks[r]};function lF(t,r,o){var E,A=typeof t;if(A!=="string"){if(A==="object"){if(t===null)throw new Error(s);if(cF&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!cF||!ArrayBuffer.isView(t)))throw new Error(s)}else throw new Error(s);E=!0}var l=t.length;if(!E){for(var _=[],l=t.length,i=0,B,D=0;D<l;++D)B=t.charCodeAt(D),B<128?_[i++]=B:B<2048?(_[i++]=192|B>>6,_[i++]=128|B&63):B<55296||B>=57344?(_[i++]=224|B>>12,_[i++]=128|B>>6&63,_[i++]=128|B&63):(B=65536+((B&1023)<<10|t.charCodeAt(++D)&1023),_[i++]=240|B>>18,_[i++]=128|B>>12&63,_[i++]=128|B>>6&63,_[i++]=128|B&63);t=_}t.length>128&&(t=new g(r,!0).update(t).array());for(var O=[],v=[],D=0;D<128;++D){var b=t[D]||0;O[D]=92^b,v[D]=54^b}g.call(this,r,o),this.update(v),this.oKeyPad=O,this.inner=!0,this.sharedMemory=o}lF.prototype=new g,lF.prototype.finalize=function(){if(g.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();g.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(t),g.prototype.finalize.call(this)}},lF.prototype.clone=function(){var t=new lF([],this.bits,!1);this.copyTo(t),t.inner=this.inner;for(var r=0;r<this.oKeyPad.length;++r)t.oKeyPad[r]=this.oKeyPad[r];return t};var L=CF(512);L.sha512=L,L.sha384=CF(384),L.sha512_256=CF(256),L.sha512_224=CF(224),L.sha512.hmac=dF(512),L.sha384.hmac=dF(384),L.sha512_256.hmac=dF(256),L.sha512_224.hmac=dF(224),nF?yF.exports=L:(C.sha512=L.sha512,C.sha384=L.sha384,C.sha512_256=L.sha512_256,C.sha512_224=L.sha512_224,oF&&define(function(){return L}))})()});var p0={};s0(p0,{default:()=>vF});var aF="https://api.botpoison.com",uF="_botpoison",EF={"Content-Type":"text/plain",Accept:"application/json"};var MF=({formElement:s,value:n})=>{let a=s.querySelector(`input[name="${uF}"]`);if(!a){let C=s.ownerDocument;a=C.createElement("input"),a.setAttribute("type","hidden"),a.setAttribute("name",uF),C.getElementById(uF)||a.setAttribute("id",uF),s.appendChild(a)}return a.setAttribute("value",n),a},mF=({formElement:s,name:n})=>{s.dispatchEvent(new CustomEvent(`botpoison-challenge-${n}`))};var KF=n0(HF()),o0=async({input:s,expected:n})=>{let a=0;for(;;){let C=(0,KF.sha512)(`${s}:${a}`);if(a%4e4===0&&await zF(0),C.substring(0,n.length)===n)return a.toString();a++}},zF=s=>new Promise(n=>setTimeout(n,s)),l0=async({challenge:s,onProgress:n})=>{let{nonce:a,difficulty:C,hardness:w}=s.payload,tF=[];n==null||n(0);for(let nF=0;nF<w;nF++){let oF=await o0({input:`${a}:${nF}`,expected:"0".repeat(C)});tF.push(oF),n==null||n(tF.length/w),await zF(0)}return tF},jF=l0;var JF="_botpoison.v2.session.",fF,RF=new Map,VF=()=>{if(fF!==void 0)return fF;try{let s=window.sessionStorage,n=`${JF}probe`;s.setItem(n,"1"),s.removeItem(n),fF=s}catch(s){fF=null}return fF},pF=s=>`${JF}${s}`,gF=s=>{var a;let n=VF();if(!n)return RF.get(pF(s));try{return(a=n.getItem(pF(s)))!=null?a:void 0}catch(C){return RF.get(pF(s))}},$F=(s,n)=>{let a=VF();if(a)try{a.setItem(pF(s),n);return}catch(C){fF=null}RF.set(pF(s),n)};var AF,WF=(s=aF)=>gF(s),GF=(s,n)=>{let a=n==null?void 0:n.token;typeof a=="string"&&$F(s,a)},YF=({baseUrl:s=aF}={})=>gF(s)?Promise.resolve():AF||(AF=fetch(`${s}/session`,{method:"POST",headers:EF,body:"{}"}).then(async n=>{n.ok&&GF(s,await n.json())}).catch(()=>{}).finally(()=>{AF=void 0}),AF),qF=({challenge:s,solutions:n,baseUrl:a=aF})=>fetch(`${a}/session`,{method:"POST",headers:EF,body:JSON.stringify({challenge:s,solutions:n,token:gF(a)})}).then(async C=>{C.ok&&GF(a,await C.json())}).catch(()=>{});var a0=()=>typeof location=="undefined"?void 0:location.hostname,OF=async({publicKey:s,baseUrl:n=aF,onProgress:a})=>{let w=await(await fetch(`${n}/challenge`,{method:"POST",headers:EF,body:JSON.stringify({publicKey:s,hostname:a0(),version:"0.2.1",token:WF(n)})})).json(),tF=await jF({challenge:w,onProgress:a});return qF({challenge:w,solutions:tF,baseUrl:n}),{solution:btoa(JSON.stringify({challenge:w,solutions:tF}))}};var f0=s=>{if(!s||!s.tagName)return;let n=s;if(n.tagName!=="FORM")return;let a=n,C=a.dataset.botpoisonPublicKey;return C?{formElement:a,publicKey:C}:void 0},QF=({documentRef:s,baseUrl:n})=>{let a=C=>{try{let w=f0(C.target);if(!w)return;let{formElement:tF,publicKey:nF}=w;C.preventDefault(),mF({formElement:tF,name:"start"}),OF({publicKey:nF,baseUrl:n}).then(({solution:oF})=>{mF({formElement:tF,name:"success"}),MF({formElement:tF,value:oF}),HTMLFormElement.prototype.submit.call(tF)}).catch(oF=>{console.error(oF),mF({formElement:tF,name:"error"})})}catch(w){console.error(w)}};return s.addEventListener("submit",a),{dispose:()=>{s.removeEventListener("submit",a)}}};var XF=()=>{c0(),u0(),E0()},vF=class{constructor({publicKey:n,baseUrl:a}){this.publicKey=n,this.baseUrl=a}static init(){XF()}async challenge(n){let{onProgress:a}=n||{};return OF({publicKey:this.publicKey,baseUrl:this.baseUrl,onProgress:a})}},c0=()=>{typeof document!="undefined"&&(window.__BOTPOISON_VERSION__="0.2.1")},u0=()=>{typeof document!="undefined"&&(window.__BOTPOISON_SUBMIT_LISTENER__||(window.__BOTPOISON_SUBMIT_LISTENER__=!0,QF({documentRef:document})))},E0=()=>{if(typeof document=="undefined"||window.__BOTPOISON_SESSION_OPENED__)return;window.__BOTPOISON_SESSION_OPENED__=!0;let s=()=>{YF()};typeof requestIdleCallback=="function"?requestIdleCallback(s,{timeout:2e3}):setTimeout(s,0)};XF();return r0(p0);})();
|
|
1
|
+
"use strict";var __botpoison=(()=>{var t0=Object.create;var yF=Object.defineProperty;var e0=Object.getOwnPropertyDescriptor;var h0=Object.getOwnPropertyNames;var i0=Object.getPrototypeOf,x0=Object.prototype.hasOwnProperty;var s0=(e,s)=>()=>(s||e((s={exports:{}}).exports,s),s.exports),n0=(e,s)=>{for(var r in s)yF(e,r,{get:s[r],enumerable:!0})},MF=(e,s,r,p)=>{if(s&&typeof s=="object"||typeof s=="function")for(let m of h0(s))!x0.call(e,m)&&m!==r&&yF(e,m,{get:()=>s[m],enumerable:!(p=e0(s,m))||p.enumerable});return e};var r0=(e,s,r)=>(r=e!=null?t0(i0(e)):{},MF(s||!e||!e.__esModule?yF(r,"default",{value:e,enumerable:!0}):r,e)),o0=e=>MF(yF({},"__esModule",{value:!0}),e);var jF=s0((S0,OF)=>{"use strict";(function(){"use strict";var e="input is invalid type",s="finalize already called",r=typeof window=="object",p=r?window:{};p.JS_SHA512_NO_WINDOW&&(r=!1);var m=!r&&typeof self=="object",b=!p.JS_SHA512_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;b?p=global:m&&(p=self);var nF=!p.JS_SHA512_NO_COMMON_JS&&typeof OF=="object"&&OF.exports,lF=typeof define=="function"&&define.amd,EF=!p.JS_SHA512_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",F="0123456789abcdef".split(""),F0=[-2147483648,8388608,32768,128],sF=[24,16,8,0],rF=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],BF=["hex","array","digest","arrayBuffer"],C=[];(p.JS_SHA512_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),EF&&(p.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var kF=function(t,o){return function(l){return new g(o,!0).update(l)[t]()}},CF=function(t){var o=kF("hex",t);o.create=function(){return new g(t)},o.update=function(A){return o.create().update(A)};for(var l=0;l<BF.length;++l){var E=BF[l];o[E]=kF(E,t)}return o},HF=function(t,o){return function(l,E){return new fF(l,o,!0).update(E)[t]()}},_F=function(t){var o=HF("hex",t);o.create=function(A){return new fF(A,t)},o.update=function(A,a){return o.create(A).update(a)};for(var l=0;l<BF.length;++l){var E=BF[l];o[E]=HF(E,t)}return o};function g(t,o){o?(C[0]=C[1]=C[2]=C[3]=C[4]=C[5]=C[6]=C[7]=C[8]=C[9]=C[10]=C[11]=C[12]=C[13]=C[14]=C[15]=C[16]=C[17]=C[18]=C[19]=C[20]=C[21]=C[22]=C[23]=C[24]=C[25]=C[26]=C[27]=C[28]=C[29]=C[30]=C[31]=C[32]=0,this.blocks=C):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t==384?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):t==256?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):t==224?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=t,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}g.prototype.update=function(t){if(this.finalized)throw new Error(s);var o,l=typeof t;if(l!=="string"){if(l==="object"){if(t===null)throw new Error(e);if(EF&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!EF||!ArrayBuffer.isView(t)))throw new Error(e)}else throw new Error(e);o=!0}for(var E,A=0,a,_=t.length,n=this.blocks;A<_;){if(this.hashed&&(this.hashed=!1,n[0]=this.block,n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=n[16]=n[17]=n[18]=n[19]=n[20]=n[21]=n[22]=n[23]=n[24]=n[25]=n[26]=n[27]=n[28]=n[29]=n[30]=n[31]=n[32]=0),o)for(a=this.start;A<_&&a<128;++A)n[a>>2]|=t[A]<<sF[a++&3];else for(a=this.start;A<_&&a<128;++A)E=t.charCodeAt(A),E<128?n[a>>2]|=E<<sF[a++&3]:E<2048?(n[a>>2]|=(192|E>>6)<<sF[a++&3],n[a>>2]|=(128|E&63)<<sF[a++&3]):E<55296||E>=57344?(n[a>>2]|=(224|E>>12)<<sF[a++&3],n[a>>2]|=(128|E>>6&63)<<sF[a++&3],n[a>>2]|=(128|E&63)<<sF[a++&3]):(E=65536+((E&1023)<<10|t.charCodeAt(++A)&1023),n[a>>2]|=(240|E>>18)<<sF[a++&3],n[a>>2]|=(128|E>>12&63)<<sF[a++&3],n[a>>2]|=(128|E>>6&63)<<sF[a++&3],n[a>>2]|=(128|E&63)<<sF[a++&3]);this.lastByteIndex=a,this.bytes+=a-this.start,a>=128?(this.block=n[32],this.start=a-128,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},g.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,o=this.lastByteIndex;t[32]=this.block,t[o>>2]|=F0[o&3],this.block=t[32],o>=112&&(this.hashed||this.hash(),t[0]=this.block,t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=t[16]=t[17]=t[18]=t[19]=t[20]=t[21]=t[22]=t[23]=t[24]=t[25]=t[26]=t[27]=t[28]=t[29]=t[30]=t[31]=t[32]=0),t[30]=this.hBytes<<3|this.bytes>>>29,t[31]=this.bytes<<3,this.hash()}},g.prototype.hash=function(){var t=this.h0h,o=this.h0l,l=this.h1h,E=this.h1l,A=this.h2h,a=this.h2l,_=this.h3h,n=this.h3l,B=this.h4h,D=this.h4l,v=this.h5h,w=this.h5l,T=this.h6h,I=this.h6l,N=this.h7h,P=this.h7l,O=this.blocks,d,M,K,j,z,h,i,x,f,TF,IF,NF,PF,RF,LF,mF,DF,eF,hF,c,u,y,S,iF,xF;for(d=32;d<160;d+=2)c=O[d-30],u=O[d-29],M=(c>>>1|u<<31)^(c>>>8|u<<24)^c>>>7,K=(u>>>1|c<<31)^(u>>>8|c<<24)^(u>>>7|c<<25),c=O[d-4],u=O[d-3],j=(c>>>19|u<<13)^(u>>>29|c<<3)^c>>>6,z=(u>>>19|c<<13)^(c>>>29|u<<3)^(u>>>6|c<<26),c=O[d-32],u=O[d-31],y=O[d-14],S=O[d-13],h=(S&65535)+(u&65535)+(K&65535)+(z&65535),i=(S>>>16)+(u>>>16)+(K>>>16)+(z>>>16)+(h>>>16),x=(y&65535)+(c&65535)+(M&65535)+(j&65535)+(i>>>16),f=(y>>>16)+(c>>>16)+(M>>>16)+(j>>>16)+(x>>>16),O[d]=f<<16|x&65535,O[d+1]=i<<16|h&65535;var J=t,V=o,R=l,L=E,U=A,k=a,$=_,W=n,Y=B,q=D,G=v,Q=w,X=T,Z=I,FF=N,tF=P;for(mF=R&U,DF=L&k,d=0;d<160;d+=8)M=(J>>>28|V<<4)^(V>>>2|J<<30)^(V>>>7|J<<25),K=(V>>>28|J<<4)^(J>>>2|V<<30)^(J>>>7|V<<25),j=(Y>>>14|q<<18)^(Y>>>18|q<<14)^(q>>>9|Y<<23),z=(q>>>14|Y<<18)^(q>>>18|Y<<14)^(Y>>>9|q<<23),TF=J&R,IF=V&L,eF=TF^J&U^mF,hF=IF^V&k^DF,iF=Y&G^~Y&X,xF=q&Q^~q&Z,c=O[d],u=O[d+1],y=rF[d],S=rF[d+1],h=(S&65535)+(u&65535)+(xF&65535)+(z&65535)+(tF&65535),i=(S>>>16)+(u>>>16)+(xF>>>16)+(z>>>16)+(tF>>>16)+(h>>>16),x=(y&65535)+(c&65535)+(iF&65535)+(j&65535)+(FF&65535)+(i>>>16),f=(y>>>16)+(c>>>16)+(iF>>>16)+(j>>>16)+(FF>>>16)+(x>>>16),c=f<<16|x&65535,u=i<<16|h&65535,h=(hF&65535)+(K&65535),i=(hF>>>16)+(K>>>16)+(h>>>16),x=(eF&65535)+(M&65535)+(i>>>16),f=(eF>>>16)+(M>>>16)+(x>>>16),y=f<<16|x&65535,S=i<<16|h&65535,h=(W&65535)+(u&65535),i=(W>>>16)+(u>>>16)+(h>>>16),x=($&65535)+(c&65535)+(i>>>16),f=($>>>16)+(c>>>16)+(x>>>16),FF=f<<16|x&65535,tF=i<<16|h&65535,h=(S&65535)+(u&65535),i=(S>>>16)+(u>>>16)+(h>>>16),x=(y&65535)+(c&65535)+(i>>>16),f=(y>>>16)+(c>>>16)+(x>>>16),$=f<<16|x&65535,W=i<<16|h&65535,M=($>>>28|W<<4)^(W>>>2|$<<30)^(W>>>7|$<<25),K=(W>>>28|$<<4)^($>>>2|W<<30)^($>>>7|W<<25),j=(FF>>>14|tF<<18)^(FF>>>18|tF<<14)^(tF>>>9|FF<<23),z=(tF>>>14|FF<<18)^(tF>>>18|FF<<14)^(FF>>>9|tF<<23),NF=$&J,PF=W&V,eF=NF^$&R^TF,hF=PF^W&L^IF,iF=FF&Y^~FF&G,xF=tF&q^~tF&Q,c=O[d+2],u=O[d+3],y=rF[d+2],S=rF[d+3],h=(S&65535)+(u&65535)+(xF&65535)+(z&65535)+(Z&65535),i=(S>>>16)+(u>>>16)+(xF>>>16)+(z>>>16)+(Z>>>16)+(h>>>16),x=(y&65535)+(c&65535)+(iF&65535)+(j&65535)+(X&65535)+(i>>>16),f=(y>>>16)+(c>>>16)+(iF>>>16)+(j>>>16)+(X>>>16)+(x>>>16),c=f<<16|x&65535,u=i<<16|h&65535,h=(hF&65535)+(K&65535),i=(hF>>>16)+(K>>>16)+(h>>>16),x=(eF&65535)+(M&65535)+(i>>>16),f=(eF>>>16)+(M>>>16)+(x>>>16),y=f<<16|x&65535,S=i<<16|h&65535,h=(k&65535)+(u&65535),i=(k>>>16)+(u>>>16)+(h>>>16),x=(U&65535)+(c&65535)+(i>>>16),f=(U>>>16)+(c>>>16)+(x>>>16),X=f<<16|x&65535,Z=i<<16|h&65535,h=(S&65535)+(u&65535),i=(S>>>16)+(u>>>16)+(h>>>16),x=(y&65535)+(c&65535)+(i>>>16),f=(y>>>16)+(c>>>16)+(x>>>16),U=f<<16|x&65535,k=i<<16|h&65535,M=(U>>>28|k<<4)^(k>>>2|U<<30)^(k>>>7|U<<25),K=(k>>>28|U<<4)^(U>>>2|k<<30)^(U>>>7|k<<25),j=(X>>>14|Z<<18)^(X>>>18|Z<<14)^(Z>>>9|X<<23),z=(Z>>>14|X<<18)^(Z>>>18|X<<14)^(X>>>9|Z<<23),RF=U&$,LF=k&W,eF=RF^U&J^NF,hF=LF^k&V^PF,iF=X&FF^~X&Y,xF=Z&tF^~Z&q,c=O[d+4],u=O[d+5],y=rF[d+4],S=rF[d+5],h=(S&65535)+(u&65535)+(xF&65535)+(z&65535)+(Q&65535),i=(S>>>16)+(u>>>16)+(xF>>>16)+(z>>>16)+(Q>>>16)+(h>>>16),x=(y&65535)+(c&65535)+(iF&65535)+(j&65535)+(G&65535)+(i>>>16),f=(y>>>16)+(c>>>16)+(iF>>>16)+(j>>>16)+(G>>>16)+(x>>>16),c=f<<16|x&65535,u=i<<16|h&65535,h=(hF&65535)+(K&65535),i=(hF>>>16)+(K>>>16)+(h>>>16),x=(eF&65535)+(M&65535)+(i>>>16),f=(eF>>>16)+(M>>>16)+(x>>>16),y=f<<16|x&65535,S=i<<16|h&65535,h=(L&65535)+(u&65535),i=(L>>>16)+(u>>>16)+(h>>>16),x=(R&65535)+(c&65535)+(i>>>16),f=(R>>>16)+(c>>>16)+(x>>>16),G=f<<16|x&65535,Q=i<<16|h&65535,h=(S&65535)+(u&65535),i=(S>>>16)+(u>>>16)+(h>>>16),x=(y&65535)+(c&65535)+(i>>>16),f=(y>>>16)+(c>>>16)+(x>>>16),R=f<<16|x&65535,L=i<<16|h&65535,M=(R>>>28|L<<4)^(L>>>2|R<<30)^(L>>>7|R<<25),K=(L>>>28|R<<4)^(R>>>2|L<<30)^(R>>>7|L<<25),j=(G>>>14|Q<<18)^(G>>>18|Q<<14)^(Q>>>9|G<<23),z=(Q>>>14|G<<18)^(Q>>>18|G<<14)^(G>>>9|Q<<23),mF=R&U,DF=L&k,eF=mF^R&$^RF,hF=DF^L&W^LF,iF=G&X^~G&FF,xF=Q&Z^~Q&tF,c=O[d+6],u=O[d+7],y=rF[d+6],S=rF[d+7],h=(S&65535)+(u&65535)+(xF&65535)+(z&65535)+(q&65535),i=(S>>>16)+(u>>>16)+(xF>>>16)+(z>>>16)+(q>>>16)+(h>>>16),x=(y&65535)+(c&65535)+(iF&65535)+(j&65535)+(Y&65535)+(i>>>16),f=(y>>>16)+(c>>>16)+(iF>>>16)+(j>>>16)+(Y>>>16)+(x>>>16),c=f<<16|x&65535,u=i<<16|h&65535,h=(hF&65535)+(K&65535),i=(hF>>>16)+(K>>>16)+(h>>>16),x=(eF&65535)+(M&65535)+(i>>>16),f=(eF>>>16)+(M>>>16)+(x>>>16),y=f<<16|x&65535,S=i<<16|h&65535,h=(V&65535)+(u&65535),i=(V>>>16)+(u>>>16)+(h>>>16),x=(J&65535)+(c&65535)+(i>>>16),f=(J>>>16)+(c>>>16)+(x>>>16),Y=f<<16|x&65535,q=i<<16|h&65535,h=(S&65535)+(u&65535),i=(S>>>16)+(u>>>16)+(h>>>16),x=(y&65535)+(c&65535)+(i>>>16),f=(y>>>16)+(c>>>16)+(x>>>16),J=f<<16|x&65535,V=i<<16|h&65535;h=(o&65535)+(V&65535),i=(o>>>16)+(V>>>16)+(h>>>16),x=(t&65535)+(J&65535)+(i>>>16),f=(t>>>16)+(J>>>16)+(x>>>16),this.h0h=f<<16|x&65535,this.h0l=i<<16|h&65535,h=(E&65535)+(L&65535),i=(E>>>16)+(L>>>16)+(h>>>16),x=(l&65535)+(R&65535)+(i>>>16),f=(l>>>16)+(R>>>16)+(x>>>16),this.h1h=f<<16|x&65535,this.h1l=i<<16|h&65535,h=(a&65535)+(k&65535),i=(a>>>16)+(k>>>16)+(h>>>16),x=(A&65535)+(U&65535)+(i>>>16),f=(A>>>16)+(U>>>16)+(x>>>16),this.h2h=f<<16|x&65535,this.h2l=i<<16|h&65535,h=(n&65535)+(W&65535),i=(n>>>16)+(W>>>16)+(h>>>16),x=(_&65535)+($&65535)+(i>>>16),f=(_>>>16)+($>>>16)+(x>>>16),this.h3h=f<<16|x&65535,this.h3l=i<<16|h&65535,h=(D&65535)+(q&65535),i=(D>>>16)+(q>>>16)+(h>>>16),x=(B&65535)+(Y&65535)+(i>>>16),f=(B>>>16)+(Y>>>16)+(x>>>16),this.h4h=f<<16|x&65535,this.h4l=i<<16|h&65535,h=(w&65535)+(Q&65535),i=(w>>>16)+(Q>>>16)+(h>>>16),x=(v&65535)+(G&65535)+(i>>>16),f=(v>>>16)+(G>>>16)+(x>>>16),this.h5h=f<<16|x&65535,this.h5l=i<<16|h&65535,h=(I&65535)+(Z&65535),i=(I>>>16)+(Z>>>16)+(h>>>16),x=(T&65535)+(X&65535)+(i>>>16),f=(T>>>16)+(X>>>16)+(x>>>16),this.h6h=f<<16|x&65535,this.h6l=i<<16|h&65535,h=(P&65535)+(tF&65535),i=(P>>>16)+(tF>>>16)+(h>>>16),x=(N&65535)+(FF&65535)+(i>>>16),f=(N>>>16)+(FF>>>16)+(x>>>16),this.h7h=f<<16|x&65535,this.h7l=i<<16|h&65535},g.prototype.hex=function(){this.finalize();var t=this.h0h,o=this.h0l,l=this.h1h,E=this.h1l,A=this.h2h,a=this.h2l,_=this.h3h,n=this.h3l,B=this.h4h,D=this.h4l,v=this.h5h,w=this.h5l,T=this.h6h,I=this.h6l,N=this.h7h,P=this.h7l,O=this.bits,d=F[t>>28&15]+F[t>>24&15]+F[t>>20&15]+F[t>>16&15]+F[t>>12&15]+F[t>>8&15]+F[t>>4&15]+F[t&15]+F[o>>28&15]+F[o>>24&15]+F[o>>20&15]+F[o>>16&15]+F[o>>12&15]+F[o>>8&15]+F[o>>4&15]+F[o&15]+F[l>>28&15]+F[l>>24&15]+F[l>>20&15]+F[l>>16&15]+F[l>>12&15]+F[l>>8&15]+F[l>>4&15]+F[l&15]+F[E>>28&15]+F[E>>24&15]+F[E>>20&15]+F[E>>16&15]+F[E>>12&15]+F[E>>8&15]+F[E>>4&15]+F[E&15]+F[A>>28&15]+F[A>>24&15]+F[A>>20&15]+F[A>>16&15]+F[A>>12&15]+F[A>>8&15]+F[A>>4&15]+F[A&15]+F[a>>28&15]+F[a>>24&15]+F[a>>20&15]+F[a>>16&15]+F[a>>12&15]+F[a>>8&15]+F[a>>4&15]+F[a&15]+F[_>>28&15]+F[_>>24&15]+F[_>>20&15]+F[_>>16&15]+F[_>>12&15]+F[_>>8&15]+F[_>>4&15]+F[_&15];return O>=256&&(d+=F[n>>28&15]+F[n>>24&15]+F[n>>20&15]+F[n>>16&15]+F[n>>12&15]+F[n>>8&15]+F[n>>4&15]+F[n&15]),O>=384&&(d+=F[B>>28&15]+F[B>>24&15]+F[B>>20&15]+F[B>>16&15]+F[B>>12&15]+F[B>>8&15]+F[B>>4&15]+F[B&15]+F[D>>28&15]+F[D>>24&15]+F[D>>20&15]+F[D>>16&15]+F[D>>12&15]+F[D>>8&15]+F[D>>4&15]+F[D&15]+F[v>>28&15]+F[v>>24&15]+F[v>>20&15]+F[v>>16&15]+F[v>>12&15]+F[v>>8&15]+F[v>>4&15]+F[v&15]+F[w>>28&15]+F[w>>24&15]+F[w>>20&15]+F[w>>16&15]+F[w>>12&15]+F[w>>8&15]+F[w>>4&15]+F[w&15]),O==512&&(d+=F[T>>28&15]+F[T>>24&15]+F[T>>20&15]+F[T>>16&15]+F[T>>12&15]+F[T>>8&15]+F[T>>4&15]+F[T&15]+F[I>>28&15]+F[I>>24&15]+F[I>>20&15]+F[I>>16&15]+F[I>>12&15]+F[I>>8&15]+F[I>>4&15]+F[I&15]+F[N>>28&15]+F[N>>24&15]+F[N>>20&15]+F[N>>16&15]+F[N>>12&15]+F[N>>8&15]+F[N>>4&15]+F[N&15]+F[P>>28&15]+F[P>>24&15]+F[P>>20&15]+F[P>>16&15]+F[P>>12&15]+F[P>>8&15]+F[P>>4&15]+F[P&15]),d},g.prototype.toString=g.prototype.hex,g.prototype.digest=function(){this.finalize();var t=this.h0h,o=this.h0l,l=this.h1h,E=this.h1l,A=this.h2h,a=this.h2l,_=this.h3h,n=this.h3l,B=this.h4h,D=this.h4l,v=this.h5h,w=this.h5l,T=this.h6h,I=this.h6l,N=this.h7h,P=this.h7l,O=this.bits,d=[t>>24&255,t>>16&255,t>>8&255,t&255,o>>24&255,o>>16&255,o>>8&255,o&255,l>>24&255,l>>16&255,l>>8&255,l&255,E>>24&255,E>>16&255,E>>8&255,E&255,A>>24&255,A>>16&255,A>>8&255,A&255,a>>24&255,a>>16&255,a>>8&255,a&255,_>>24&255,_>>16&255,_>>8&255,_&255];return O>=256&&d.push(n>>24&255,n>>16&255,n>>8&255,n&255),O>=384&&d.push(B>>24&255,B>>16&255,B>>8&255,B&255,D>>24&255,D>>16&255,D>>8&255,D&255,v>>24&255,v>>16&255,v>>8&255,v&255,w>>24&255,w>>16&255,w>>8&255,w&255),O==512&&d.push(T>>24&255,T>>16&255,T>>8&255,T&255,I>>24&255,I>>16&255,I>>8&255,I&255,N>>24&255,N>>16&255,N>>8&255,N&255,P>>24&255,P>>16&255,P>>8&255,P&255),d},g.prototype.array=g.prototype.digest,g.prototype.arrayBuffer=function(){this.finalize();var t=this.bits,o=new ArrayBuffer(t/8),l=new DataView(o);return l.setUint32(0,this.h0h),l.setUint32(4,this.h0l),l.setUint32(8,this.h1h),l.setUint32(12,this.h1l),l.setUint32(16,this.h2h),l.setUint32(20,this.h2l),l.setUint32(24,this.h3h),t>=256&&l.setUint32(28,this.h3l),t>=384&&(l.setUint32(32,this.h4h),l.setUint32(36,this.h4l),l.setUint32(40,this.h5h),l.setUint32(44,this.h5l)),t==512&&(l.setUint32(48,this.h6h),l.setUint32(52,this.h6l),l.setUint32(56,this.h7h),l.setUint32(60,this.h7l)),o},g.prototype.clone=function(){var t=new g(this.bits,!1);return this.copyTo(t),t},g.prototype.copyTo=function(t){var o=0,l=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(o=0;o<l.length;++o)t[l[o]]=this[l[o]];for(o=0;o<this.blocks.length;++o)t.blocks[o]=this.blocks[o]};function fF(t,o,l){var E,A=typeof t;if(A!=="string"){if(A==="object"){if(t===null)throw new Error(e);if(EF&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!EF||!ArrayBuffer.isView(t)))throw new Error(e)}else throw new Error(e);E=!0}var a=t.length;if(!E){for(var _=[],a=t.length,n=0,B,D=0;D<a;++D)B=t.charCodeAt(D),B<128?_[n++]=B:B<2048?(_[n++]=192|B>>6,_[n++]=128|B&63):B<55296||B>=57344?(_[n++]=224|B>>12,_[n++]=128|B>>6&63,_[n++]=128|B&63):(B=65536+((B&1023)<<10|t.charCodeAt(++D)&1023),_[n++]=240|B>>18,_[n++]=128|B>>12&63,_[n++]=128|B>>6&63,_[n++]=128|B&63);t=_}t.length>128&&(t=new g(o,!0).update(t).array());for(var v=[],w=[],D=0;D<128;++D){var T=t[D]||0;v[D]=92^T,w[D]=54^T}g.call(this,o,l),this.update(w),this.oKeyPad=v,this.inner=!0,this.sharedMemory=l}fF.prototype=new g,fF.prototype.finalize=function(){if(g.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();g.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(t),g.prototype.finalize.call(this)}},fF.prototype.clone=function(){var t=new fF([],this.bits,!1);this.copyTo(t),t.inner=this.inner;for(var o=0;o<this.oKeyPad.length;++o)t.oKeyPad[o]=this.oKeyPad[o];return t};var H=CF(512);H.sha512=H,H.sha384=CF(384),H.sha512_256=CF(256),H.sha512_224=CF(224),H.sha512.hmac=_F(512),H.sha384.hmac=_F(384),H.sha512_256.hmac=_F(256),H.sha512_224.hmac=_F(224),nF?OF.exports=H:(p.sha512=H.sha512,p.sha384=H.sha384,p.sha512_256=H.sha512_256,p.sha512_224=H.sha512_224,lF&&define(function(){return H}))})()});var C0={};n0(C0,{default:()=>wF});var oF="https://api.botpoison.com",pF="_botpoison",aF={"Content-Type":"text/plain",Accept:"application/json"};var KF=({formElement:e,value:s})=>{let r=e.querySelector(`input[name="${pF}"]`);if(!r){let p=e.ownerDocument;r=p.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",pF),p.getElementById(pF)||r.setAttribute("id",pF),e.appendChild(r)}return r.setAttribute("value",s),r},SF=({formElement:e,name:s})=>{e.dispatchEvent(new CustomEvent(`botpoison-challenge-${s}`))};var zF=r0(jF()),l0=async({input:e,expected:s})=>{let r=0;for(;;){let p=(0,zF.sha512)(`${e}:${r}`);if(r%4e4===0&&await JF(0),p.substring(0,s.length)===s)return r.toString();r++}},JF=e=>new Promise(s=>setTimeout(s,e)),a0=async({challenge:e,onProgress:s})=>{let{nonce:r,difficulty:p,hardness:m}=e.payload,b=[];s==null||s(0);for(let nF=0;nF<m;nF++){let lF=await l0({input:`${r}:${nF}`,expected:"0".repeat(p)});b.push(lF),s==null||s(b.length/m),await JF(0)}return b},VF=a0;var $F="_botpoison.v2.session.",cF,UF=new Map,WF=()=>{if(cF!==void 0)return cF;try{let e=window.sessionStorage,s=`${$F}probe`;e.setItem(s,"1"),e.removeItem(s),cF=e}catch(e){cF=null}return cF},dF=e=>`${$F}${e}`,gF=e=>{var r;let s=WF();if(!s)return UF.get(dF(e));try{return(r=s.getItem(dF(e)))!=null?r:void 0}catch(p){return UF.get(dF(e))}},YF=(e,s)=>{let r=WF();if(r)try{r.setItem(dF(e),s);return}catch(p){cF=null}UF.set(dF(e),s)};var AF,uF=(e=oF)=>gF(e),qF=(e,s)=>{let r=s==null?void 0:s.token;typeof r=="string"&&YF(e,r)},bF=({baseUrl:e=oF}={})=>gF(e)?Promise.resolve():AF||(AF=fetch(`${e}/session`,{method:"POST",headers:aF,body:"{}"}).then(async s=>{s.ok&&qF(e,await s.json())}).catch(()=>{}).finally(()=>{AF=void 0}),AF),GF=({challenge:e,solutions:s,baseUrl:r=oF})=>fetch(`${r}/session`,{method:"POST",headers:aF,body:JSON.stringify({challenge:e,solutions:s,token:gF(r)})}).then(async p=>{p.ok&&qF(r,await p.json())}).catch(()=>{});var f0=()=>typeof location=="undefined"?void 0:location.hostname,vF=async({publicKey:e,baseUrl:s=oF,onProgress:r})=>{let m=await(await fetch(`${s}/challenge`,{method:"POST",headers:aF,body:JSON.stringify({publicKey:e,hostname:f0(),version:"0.3.0",token:uF(s)})})).json(),b=await VF({challenge:m,onProgress:r});return GF({challenge:m,solutions:b,baseUrl:s}),{solution:btoa(JSON.stringify({challenge:m,solutions:b}))}};var c0=e=>{if(!e||!e.tagName)return;let s=e;if(s.tagName!=="FORM")return;let r=s,p=r.dataset.botpoisonPublicKey;return p?{formElement:r,publicKey:p}:void 0},QF=({documentRef:e,baseUrl:s})=>{let r=p=>{try{let m=c0(p.target);if(!m)return;let{formElement:b,publicKey:nF}=m;p.preventDefault(),SF({formElement:b,name:"start"}),vF({publicKey:nF,baseUrl:s}).then(({solution:lF})=>{SF({formElement:b,name:"success"}),KF({formElement:b,value:lF}),HTMLFormElement.prototype.submit.call(b)}).catch(lF=>{console.error(lF),SF({formElement:b,name:"error"})})}catch(m){console.error(m)}};return e.addEventListener("submit",r),{dispose:()=>{e.removeEventListener("submit",r)}}};var u0=({documentRef:e,baseUrl:s})=>{var b;let r=e.createElement("form");r.setAttribute("method","post"),r.setAttribute("aria-hidden","true"),r.setAttribute("style","position:absolute;left:-9999px;top:-9999px;width:1px;height:1px;visibility:hidden;"),Object.defineProperty(r,"action",{get:()=>`${s}/honeypot`,enumerable:!1,configurable:!0});let p=e.createElement("input");p.setAttribute("type","email"),p.setAttribute("name","newsletter"),p.setAttribute("tabindex","-1"),p.setAttribute("autocomplete","off"),r.appendChild(p);let m=e.createElement("input");return m.setAttribute("type","hidden"),m.setAttribute("name","token"),m.setAttribute("value",(b=uF(s))!=null?b:""),r.appendChild(m),r.addEventListener("submit",nF=>{nF.preventDefault(),fetch(`${s}/honeypot`,{method:"POST",headers:aF,body:JSON.stringify({token:uF(s)})}).catch(()=>{})}),e.body.appendChild(r),m},E0=()=>typeof navigator!="undefined"&&navigator.webdriver===!0||typeof window!="undefined"&&"Cypress"in window,XF=({documentRef:e,baseUrl:s=oF})=>{if(typeof e.createElement!="function"||E0())return;let r=()=>{let p=u0({documentRef:e,baseUrl:s}),m=()=>{bF({baseUrl:s}).then(()=>{var b;p.setAttribute("value",(b=uF(s))!=null?b:"")})};typeof requestIdleCallback=="function"?requestIdleCallback(m,{timeout:2e3}):setTimeout(m,0)};e.readyState==="loading"?e.addEventListener("DOMContentLoaded",r):r()};var ZF=()=>{p0(),d0(),B0(),A0()},wF=class{constructor({publicKey:s,baseUrl:r}){this.publicKey=s,this.baseUrl=r}static init(){ZF()}async challenge(s){let{onProgress:r}=s||{};return vF({publicKey:this.publicKey,baseUrl:this.baseUrl,onProgress:r})}},p0=()=>{typeof document!="undefined"&&(window.__BOTPOISON_VERSION__="0.3.0")},d0=()=>{typeof document!="undefined"&&(window.__BOTPOISON_SUBMIT_LISTENER__||(window.__BOTPOISON_SUBMIT_LISTENER__=!0,QF({documentRef:document})))},A0=()=>{typeof document=="undefined"||window.__BOTPOISON_HONEYPOT_INSTALLED__||(window.__BOTPOISON_HONEYPOT_INSTALLED__=!0,XF({documentRef:document}))},B0=()=>{if(typeof document=="undefined"||window.__BOTPOISON_SESSION_OPENED__)return;window.__BOTPOISON_SESSION_OPENED__=!0;let e=()=>{bF()};typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:2e3}):setTimeout(e,0)};ZF();return o0(C0);})();
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
js-sha512/src/sha512.js:
|
package/dist/index.mjs
CHANGED
|
@@ -182,7 +182,7 @@ var runChallenge = async ({
|
|
|
182
182
|
hostname: hostname(),
|
|
183
183
|
// Copies of this bundle stay embedded in sites for years, so the API
|
|
184
184
|
// has to start collecting this long before it can act on it.
|
|
185
|
-
version: "0.
|
|
185
|
+
version: "0.3.0",
|
|
186
186
|
token: getSessionToken(baseUrl)
|
|
187
187
|
})
|
|
188
188
|
});
|
|
@@ -249,11 +249,81 @@ var createAutoSubmit = ({
|
|
|
249
249
|
};
|
|
250
250
|
};
|
|
251
251
|
|
|
252
|
+
// src/honeypot.ts
|
|
253
|
+
var injectHoneypot = ({
|
|
254
|
+
documentRef,
|
|
255
|
+
baseUrl
|
|
256
|
+
}) => {
|
|
257
|
+
var _a;
|
|
258
|
+
const formElement = documentRef.createElement("form");
|
|
259
|
+
formElement.setAttribute("method", "post");
|
|
260
|
+
formElement.setAttribute("aria-hidden", "true");
|
|
261
|
+
formElement.setAttribute(
|
|
262
|
+
"style",
|
|
263
|
+
"position:absolute;left:-9999px;top:-9999px;width:1px;height:1px;visibility:hidden;"
|
|
264
|
+
);
|
|
265
|
+
Object.defineProperty(formElement, "action", {
|
|
266
|
+
get: () => `${baseUrl}/honeypot`,
|
|
267
|
+
enumerable: false,
|
|
268
|
+
configurable: true
|
|
269
|
+
});
|
|
270
|
+
const emailField = documentRef.createElement("input");
|
|
271
|
+
emailField.setAttribute("type", "email");
|
|
272
|
+
emailField.setAttribute("name", "newsletter");
|
|
273
|
+
emailField.setAttribute("tabindex", "-1");
|
|
274
|
+
emailField.setAttribute("autocomplete", "off");
|
|
275
|
+
formElement.appendChild(emailField);
|
|
276
|
+
const tokenField = documentRef.createElement("input");
|
|
277
|
+
tokenField.setAttribute("type", "hidden");
|
|
278
|
+
tokenField.setAttribute("name", "token");
|
|
279
|
+
tokenField.setAttribute("value", (_a = getSessionToken(baseUrl)) != null ? _a : "");
|
|
280
|
+
formElement.appendChild(tokenField);
|
|
281
|
+
formElement.addEventListener("submit", (event) => {
|
|
282
|
+
event.preventDefault();
|
|
283
|
+
fetch(`${baseUrl}/honeypot`, {
|
|
284
|
+
method: "POST",
|
|
285
|
+
headers: SIMPLE_REQUEST_HEADERS,
|
|
286
|
+
body: JSON.stringify({ token: getSessionToken(baseUrl) })
|
|
287
|
+
}).catch(() => void 0);
|
|
288
|
+
});
|
|
289
|
+
documentRef.body.appendChild(formElement);
|
|
290
|
+
return tokenField;
|
|
291
|
+
};
|
|
292
|
+
var isUnderTestAutomation = () => typeof navigator !== "undefined" && navigator.webdriver === true || typeof window !== "undefined" && "Cypress" in window;
|
|
293
|
+
var installHoneypot = ({
|
|
294
|
+
documentRef,
|
|
295
|
+
baseUrl = DEFAULT_BASE_URL
|
|
296
|
+
}) => {
|
|
297
|
+
if (typeof documentRef.createElement !== "function" || isUnderTestAutomation()) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const inject = () => {
|
|
301
|
+
const tokenField = injectHoneypot({ documentRef, baseUrl });
|
|
302
|
+
const refresh = () => {
|
|
303
|
+
void openSession({ baseUrl }).then(() => {
|
|
304
|
+
var _a;
|
|
305
|
+
tokenField.setAttribute("value", (_a = getSessionToken(baseUrl)) != null ? _a : "");
|
|
306
|
+
});
|
|
307
|
+
};
|
|
308
|
+
if (typeof requestIdleCallback === "function") {
|
|
309
|
+
requestIdleCallback(refresh, { timeout: 2e3 });
|
|
310
|
+
} else {
|
|
311
|
+
setTimeout(refresh, 0);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
if (documentRef.readyState === "loading") {
|
|
315
|
+
documentRef.addEventListener("DOMContentLoaded", inject);
|
|
316
|
+
} else {
|
|
317
|
+
inject();
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
|
|
252
321
|
// src/index.ts
|
|
253
322
|
var init = () => {
|
|
254
323
|
addVersion();
|
|
255
324
|
addSubmitListener();
|
|
256
325
|
startSession();
|
|
326
|
+
startHoneypot();
|
|
257
327
|
};
|
|
258
328
|
var Botpoison = class {
|
|
259
329
|
constructor({ publicKey, baseUrl }) {
|
|
@@ -274,7 +344,7 @@ var Botpoison = class {
|
|
|
274
344
|
};
|
|
275
345
|
var addVersion = () => {
|
|
276
346
|
if (typeof document !== "undefined") {
|
|
277
|
-
window.__BOTPOISON_VERSION__ = "0.
|
|
347
|
+
window.__BOTPOISON_VERSION__ = "0.3.0";
|
|
278
348
|
}
|
|
279
349
|
};
|
|
280
350
|
var addSubmitListener = () => {
|
|
@@ -285,6 +355,13 @@ var addSubmitListener = () => {
|
|
|
285
355
|
}
|
|
286
356
|
}
|
|
287
357
|
};
|
|
358
|
+
var startHoneypot = () => {
|
|
359
|
+
if (typeof document === "undefined" || window.__BOTPOISON_HONEYPOT_INSTALLED__) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
window.__BOTPOISON_HONEYPOT_INSTALLED__ = true;
|
|
363
|
+
installHoneypot({ documentRef: document });
|
|
364
|
+
};
|
|
288
365
|
var startSession = () => {
|
|
289
366
|
if (typeof document === "undefined" || window.__BOTPOISON_SESSION_OPENED__) {
|
|
290
367
|
return;
|