@bygd/gd-sdk-pes 1.19.2 → 1.19.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/newArrowCheck"),t=require("@babel/runtime/helpers/typeof"),n=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/asyncToGenerator"),a=require("@babel/runtime/helpers/classCallCheck"),i=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/regenerator"),o=require("@babel/runtime/helpers/objectWithoutProperties"),d=require("@bygd/gd-sdk-era/dist/default"),u=require("url-parse"),c=require("can-autoplay"),l=require("is-plain-object"),h=require("lodash.clonedeep"),p=require("querystringify"),f=require("lodash.merge"),m=require("js-base64");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=g(e),y=g(t),b=g(n),_=g(r),w=g(a),A=g(i),E=g(s),k=g(o),T=g(u),x=g(c),S=g(h),D=g(p),R=g(f),O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},I=function(e){return e&&e.Math==Math&&e},C=I("object"==typeof globalThis&&globalThis)||I("object"==typeof window&&window)||I("object"==typeof self&&self)||I("object"==typeof O&&O)||function(){return this}()||Function("return this")(),P={},L=function(e){try{return!!e()}catch(e){return!0}},j=!L((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),M={},U={}.propertyIsEnumerable,B=Object.getOwnPropertyDescriptor,N=B&&!U.call({1:2},1);M.f=N?function(e){var t=B(this,e);return!!t&&t.enumerable}:U;var q,G,V=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},F={}.toString,K=function(e){return F.call(e).slice(8,-1)},W=K,z="".split,H=L((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==W(e)?z.call(e,""):Object(e)}:Object,$=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},Q=H,Y=$,J=function(e){return Q(Y(e))},X=function(e){return"object"==typeof e?null!==e:"function"==typeof e},Z=C,ee=function(e){return"function"==typeof e?e:void 0},te=function(e,t){return arguments.length<2?ee(Z[e]):Z[e]&&Z[e][t]},ne=te("navigator","userAgent")||"",re=C,ae=ne,ie=re.process,se=re.Deno,oe=ie&&ie.versions||se&&se.version,de=oe&&oe.v8;de?G=(q=de.split("."))[0]<4?1:q[0]+q[1]:ae&&(!(q=ae.match(/Edge\/(\d+)/))||q[1]>=74)&&(q=ae.match(/Chrome\/(\d+)/))&&(G=q[1]);var ue=G&&+G,ce=ue,le=L,he=!!Object.getOwnPropertySymbols&&!le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ce&&ce<41})),pe=he&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,fe=te,me=pe?function(e){return"symbol"==typeof e}:function(e){var t=fe("Symbol");return"function"==typeof t&&Object(e)instanceof t},ge=X,ve={exports:{}},ye=C,be=function(e,t){try{Object.defineProperty(ye,e,{value:t,configurable:!0,writable:!0})}catch(n){ye[e]=t}return t},_e=be,we=C["__core-js_shared__"]||_e("__core-js_shared__",{}),Ae=we;(ve.exports=function(e,t){return Ae[e]||(Ae[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.17.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var Ee=$,ke=function(e){return Object(Ee(e))},Te=ke,xe={}.hasOwnProperty,Se=Object.hasOwn||function(e,t){return xe.call(Te(e),t)},De=0,Re=Math.random(),Oe=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++De+Re).toString(36)},Ie=C,Ce=ve.exports,Pe=Se,Le=Oe,je=he,Me=pe,Ue=Ce("wks"),Be=Ie.Symbol,Ne=Me?Be:Be&&Be.withoutSetter||Le,qe=function(e){return Pe(Ue,e)&&(je||"string"==typeof Ue[e])||(je&&Pe(Be,e)?Ue[e]=Be[e]:Ue[e]=Ne("Symbol."+e)),Ue[e]},Ge=X,Ve=me,Fe=function(e,t){var n,r;if("string"===t&&"function"==typeof(n=e.toString)&&!ge(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!ge(r=n.call(e)))return r;if("string"!==t&&"function"==typeof(n=e.toString)&&!ge(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Ke=qe("toPrimitive"),We=function(e,t){if(!Ge(e)||Ve(e))return e;var n,r=e[Ke];if(void 0!==r){if(void 0===t&&(t="default"),n=r.call(e,t),!Ge(n)||Ve(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),Fe(e,t)},ze=me,He=function(e){var t=We(e,"string");return ze(t)?t:String(t)},$e=X,Qe=C.document,Ye=$e(Qe)&&$e(Qe.createElement),Je=function(e){return Ye?Qe.createElement(e):{}},Xe=Je,Ze=!j&&!L((function(){return 7!=Object.defineProperty(Xe("div"),"a",{get:function(){return 7}}).a})),et=j,tt=M,nt=V,rt=J,at=He,it=Se,st=Ze,ot=Object.getOwnPropertyDescriptor;P.f=et?ot:function(e,t){if(e=rt(e),t=at(t),st)try{return ot(e,t)}catch(e){}if(it(e,t))return nt(!tt.f.call(e,t),e[t])};var dt={},ut=X,ct=function(e){if(!ut(e))throw TypeError(String(e)+" is not an object");return e},lt=j,ht=Ze,pt=ct,ft=He,mt=Object.defineProperty;dt.f=lt?mt:function(e,t,n){if(pt(e),t=ft(t),pt(n),ht)try{return mt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var gt=dt,vt=V,yt=j?function(e,t,n){return gt.f(e,t,vt(1,n))}:function(e,t,n){return e[t]=n,e},bt={exports:{}},_t=we,wt=Function.toString;"function"!=typeof _t.inspectSource&&(_t.inspectSource=function(e){return wt.call(e)});var At,Et,kt,Tt=_t.inspectSource,xt=Tt,St=C.WeakMap,Dt="function"==typeof St&&/native code/.test(xt(St)),Rt=ve.exports,Ot=Oe,It=Rt("keys"),Ct=function(e){return It[e]||(It[e]=Ot(e))},Pt={},Lt=Dt,jt=X,Mt=yt,Ut=Se,Bt=we,Nt=Ct,qt=Pt,Gt=C.WeakMap;if(Lt||Bt.state){var Vt=Bt.state||(Bt.state=new Gt),Ft=Vt.get,Kt=Vt.has,Wt=Vt.set;At=function(e,t){if(Kt.call(Vt,e))throw new TypeError("Object already initialized");return t.facade=e,Wt.call(Vt,e,t),t},Et=function(e){return Ft.call(Vt,e)||{}},kt=function(e){return Kt.call(Vt,e)}}else{var zt=Nt("state");qt[zt]=!0,At=function(e,t){if(Ut(e,zt))throw new TypeError("Object already initialized");return t.facade=e,Mt(e,zt,t),t},Et=function(e){return Ut(e,zt)?e[zt]:{}},kt=function(e){return Ut(e,zt)}}var Ht={set:At,get:Et,has:kt,enforce:function(e){return kt(e)?Et(e):At(e,{})},getterFor:function(e){return function(t){var n;if(!jt(t)||(n=Et(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},$t=C,Qt=yt,Yt=Se,Jt=be,Xt=Tt,Zt=Ht.get,en=Ht.enforce,tn=String(String).split("String");(bt.exports=function(e,t,n,r){var a,i=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||Yt(n,"name")||Qt(n,"name",t),(a=en(n)).source||(a.source=tn.join("string"==typeof t?t:""))),e!==$t?(i?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:Qt(e,t,n)):s?e[t]=n:Jt(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Zt(this).source||Xt(this)}));var nn={},rn=Math.ceil,an=Math.floor,sn=function(e){return isNaN(e=+e)?0:(e>0?an:rn)(e)},on=sn,dn=Math.min,un=function(e){return e>0?dn(on(e),9007199254740991):0},cn=sn,ln=Math.max,hn=Math.min,pn=function(e,t){var n=cn(e);return n<0?ln(n+t,0):hn(n,t)},fn=J,mn=un,gn=pn,vn=function(e){return function(t,n,r){var a,i=fn(t),s=mn(i.length),o=gn(r,s);if(e&&n!=n){for(;s>o;)if((a=i[o++])!=a)return!0}else for(;s>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},yn={includes:vn(!0),indexOf:vn(!1)},bn=Se,_n=J,wn=yn.indexOf,An=Pt,En=function(e,t){var n,r=_n(e),a=0,i=[];for(n in r)!bn(An,n)&&bn(r,n)&&i.push(n);for(;t.length>a;)bn(r,n=t[a++])&&(~wn(i,n)||i.push(n));return i},kn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Tn=En,xn=kn.concat("length","prototype");nn.f=Object.getOwnPropertyNames||function(e){return Tn(e,xn)};var Sn={};Sn.f=Object.getOwnPropertySymbols;var Dn=nn,Rn=Sn,On=ct,In=te("Reflect","ownKeys")||function(e){var t=Dn.f(On(e)),n=Rn.f;return n?t.concat(n(e)):t},Cn=Se,Pn=In,Ln=P,jn=dt,Mn=function(e,t){for(var n=Pn(t),r=jn.f,a=Ln.f,i=0;i<n.length;i++){var s=n[i];Cn(e,s)||r(e,s,a(t,s))}},Un=L,Bn=/#|\.prototype\./,Nn=function(e,t){var n=Gn[qn(e)];return n==Fn||n!=Vn&&("function"==typeof t?Un(t):!!t)},qn=Nn.normalize=function(e){return String(e).replace(Bn,".").toLowerCase()},Gn=Nn.data={},Vn=Nn.NATIVE="N",Fn=Nn.POLYFILL="P",Kn=Nn,Wn=C,zn=P.f,Hn=yt,$n=bt.exports,Qn=be,Yn=Mn,Jn=Kn,Xn=function(e,t){var n,r,a,i,s,o=e.target,d=e.global,u=e.stat;if(n=d?Wn:u?Wn[o]||Qn(o,{}):(Wn[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=zn(n,r))&&s.value:n[r],!Jn(d?r:o+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;Yn(i,a)}(e.sham||a&&a.sham)&&Hn(i,"sham",!0),$n(n,r,i,e)}},Zn=En,er=kn,tr=Object.keys||function(e){return Zn(e,er)},nr=ke,rr=tr;Xn({target:"Object",stat:!0,forced:L((function(){rr(1)}))},{keys:function(e){return rr(nr(e))}});var ar=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},ir=ar,sr=function(e,t,n){if(ir(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}},or=K,dr=Array.isArray||function(e){return"Array"==or(e)},ur=X,cr=dr,lr=qe("species"),hr=function(e){var t;return cr(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!cr(t.prototype)?ur(t)&&null===(t=t[lr])&&(t=void 0):t=void 0),void 0===t?Array:t},pr=function(e,t){return new(hr(e))(0===t?0:t)},fr=sr,mr=H,gr=ke,vr=un,yr=pr,br=[].push,_r=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=7==e,o=5==e||i;return function(d,u,c,l){for(var h,p,f=gr(d),m=mr(f),g=fr(u,c,3),v=vr(m.length),y=0,b=l||yr,_=t?b(d,v):n||s?b(d,0):void 0;v>y;y++)if((o||y in m)&&(p=g(h=m[y],y,f),e))if(t)_[y]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:br.call(_,h)}else switch(e){case 4:return!1;case 7:br.call(_,h)}return i?-1:r||a?a:_}},wr={forEach:_r(0),map:_r(1),filter:_r(2),some:_r(3),every:_r(4),find:_r(5),findIndex:_r(6),filterReject:_r(7)},Ar=L,Er=ue,kr=qe("species"),Tr=function(e){return Er>=51||!Ar((function(){var t=[];return(t.constructor={})[kr]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},xr=wr.filter;Xn({target:"Array",proto:!0,forced:!Tr("filter")},{filter:function(e){return xr(this,e,arguments.length>1?arguments[1]:void 0)}});var Sr=Xn,Dr=L,Rr=J,Or=P.f,Ir=j,Cr=Dr((function(){Or(1)}));Sr({target:"Object",stat:!0,forced:!Ir||Cr,sham:!Ir},{getOwnPropertyDescriptor:function(e,t){return Or(Rr(e),t)}});var Pr=He,Lr=dt,jr=V,Mr=function(e,t,n){var r=Pr(t);r in e?Lr.f(e,r,jr(0,n)):e[r]=n},Ur=In,Br=J,Nr=P,qr=Mr;Xn({target:"Object",stat:!0,sham:!j},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Br(e),a=Nr.f,i=Ur(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&qr(s,t,n);return s}});var Gr={};Gr[qe("toStringTag")]="z";var Vr="[object z]"===String(Gr),Fr=Vr,Kr=K,Wr=qe("toStringTag"),zr="Arguments"==Kr(function(){return arguments}()),Hr=Fr?Kr:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Wr))?n:zr?Kr(t):"Object"==(r=Kr(t))&&"function"==typeof t.callee?"Arguments":r},$r=Hr,Qr=Vr?{}.toString:function(){return"[object "+$r(this)+"]"},Yr=Vr,Jr=bt.exports,Xr=Qr;Yr||Jr(Object.prototype,"toString",Xr,{unsafe:!0});var Zr=C.Promise,ea=bt.exports,ta=X,na=ct,ra=function(e){if(!ta(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},aa=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return na(n),ra(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),ia=dt.f,sa=Se,oa=qe("toStringTag"),da=function(e,t,n){e&&!sa(e=n?e:e.prototype,oa)&&ia(e,oa,{configurable:!0,value:t})},ua=te,ca=dt,la=j,ha=qe("species"),pa=function(e){var t=ua(e),n=ca.f;la&&t&&!t[ha]&&n(t,ha,{configurable:!0,get:function(){return this}})},fa={},ma=fa,ga=qe("iterator"),va=Array.prototype,ya=function(e){return void 0!==e&&(ma.Array===e||va[ga]===e)},ba=Hr,_a=fa,wa=qe("iterator"),Aa=function(e){if(null!=e)return e[wa]||e["@@iterator"]||_a[ba(e)]},Ea=ct,ka=Aa,Ta=function(e,t){var n=arguments.length<2?ka(e):t;if("function"!=typeof n)throw TypeError(String(e)+" is not iterable");return Ea(n.call(e))},xa=ct,Sa=function(e,t,n){var r,a;xa(e);try{if(void 0===(r=e.return)){if("throw"===t)throw n;return n}r=r.call(e)}catch(e){a=!0,r=e}if("throw"===t)throw n;if(a)throw r;return xa(r),n},Da=ct,Ra=ya,Oa=un,Ia=sr,Ca=Ta,Pa=Aa,La=Sa,ja=function(e,t){this.stopped=e,this.result=t},Ma=qe("iterator"),Ua=!1;try{var Ba=0,Na={next:function(){return{done:!!Ba++}},return:function(){Ua=!0}};Na[Ma]=function(){return this},Array.from(Na,(function(){throw 2}))}catch(e){}var qa,Ga,Va,Fa,Ka=function(e,t){if(!t&&!Ua)return!1;var n=!1;try{var r={};r[Ma]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Wa=ct,za=ar,Ha=qe("species"),$a=function(e,t){var n,r=Wa(e).constructor;return void 0===r||null==(n=Wa(r)[Ha])?t:za(n)},Qa=te("document","documentElement"),Ya=/(?:ipad|iphone|ipod).*applewebkit/i.test(ne),Ja="process"==K(C.process),Xa=C,Za=L,ei=sr,ti=Qa,ni=Je,ri=Ya,ai=Ja,ii=Xa.setImmediate,si=Xa.clearImmediate,oi=Xa.process,di=Xa.MessageChannel,ui=Xa.Dispatch,ci=0,li={};try{qa=Xa.location}catch(e){}var hi=function(e){if(li.hasOwnProperty(e)){var t=li[e];delete li[e],t()}},pi=function(e){return function(){hi(e)}},fi=function(e){hi(e.data)},mi=function(e){Xa.postMessage(String(e),qa.protocol+"//"+qa.host)};ii&&si||(ii=function(e){for(var t=[],n=arguments.length,r=1;n>r;)t.push(arguments[r++]);return li[++ci]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Ga(ci),ci},si=function(e){delete li[e]},ai?Ga=function(e){oi.nextTick(pi(e))}:ui&&ui.now?Ga=function(e){ui.now(pi(e))}:di&&!ri?(Fa=(Va=new di).port2,Va.port1.onmessage=fi,Ga=ei(Fa.postMessage,Fa,1)):Xa.addEventListener&&"function"==typeof postMessage&&!Xa.importScripts&&qa&&"file:"!==qa.protocol&&!Za(mi)?(Ga=mi,Xa.addEventListener("message",fi,!1)):Ga="onreadystatechange"in ni("script")?function(e){ti.appendChild(ni("script")).onreadystatechange=function(){ti.removeChild(this),hi(e)}}:function(e){setTimeout(pi(e),0)});var gi,vi,yi,bi,_i,wi,Ai,Ei,ki={set:ii,clear:si},Ti=C,xi=/ipad|iphone|ipod/i.test(ne)&&void 0!==Ti.Pebble,Si=/web0s(?!.*chrome)/i.test(ne),Di=C,Ri=P.f,Oi=ki.set,Ii=Ya,Ci=xi,Pi=Si,Li=Ja,ji=Di.MutationObserver||Di.WebKitMutationObserver,Mi=Di.document,Ui=Di.process,Bi=Di.Promise,Ni=Ri(Di,"queueMicrotask"),qi=Ni&&Ni.value;qi||(gi=function(){var e,t;for(Li&&(e=Ui.domain)&&e.exit();vi;){t=vi.fn,vi=vi.next;try{t()}catch(e){throw vi?bi():yi=void 0,e}}yi=void 0,e&&e.enter()},Ii||Li||Pi||!ji||!Mi?!Ci&&Bi&&Bi.resolve?((Ai=Bi.resolve(void 0)).constructor=Bi,Ei=Ai.then,bi=function(){Ei.call(Ai,gi)}):bi=Li?function(){Ui.nextTick(gi)}:function(){Oi.call(Di,gi)}:(_i=!0,wi=Mi.createTextNode(""),new ji(gi).observe(wi,{characterData:!0}),bi=function(){wi.data=_i=!_i}));var Gi=qi||function(e){var t={fn:e,next:void 0};yi&&(yi.next=t),vi||(vi=t,bi()),yi=t},Vi={},Fi=ar,Ki=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=Fi(t),this.reject=Fi(n)};Vi.f=function(e){return new Ki(e)};var Wi,zi,Hi,$i,Qi=ct,Yi=X,Ji=Vi,Xi=function(e,t){if(Qi(e),Yi(t)&&t.constructor===e)return t;var n=Ji.f(e);return(0,n.resolve)(t),n.promise},Zi=C,es="object"==typeof window,ts=Xn,ns=C,rs=te,as=Zr,is=bt.exports,ss=function(e,t,n){for(var r in t)ea(e,r,t[r],n);return e},os=aa,ds=da,us=pa,cs=X,ls=ar,hs=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},ps=Tt,fs=function(e,t,n){var r,a,i,s,o,d,u,c=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=Ia(t,c,1+l+p),m=function(e){return r&&La(r,"normal",e),new ja(!0,e)},g=function(e){return l?(Da(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if("function"!=typeof(a=Pa(e)))throw TypeError("Target is not iterable");if(Ra(a)){for(i=0,s=Oa(e.length);s>i;i++)if((o=g(e[i]))&&o instanceof ja)return o;return new ja(!1)}r=Ca(e,a)}for(d=r.next;!(u=d.call(r)).done;){try{o=g(u.value)}catch(e){La(r,"throw",e)}if("object"==typeof o&&o&&o instanceof ja)return o}return new ja(!1)},ms=Ka,gs=$a,vs=ki.set,ys=Gi,bs=Xi,_s=function(e,t){var n=Zi.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},ws=Vi,As=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Es=Ht,ks=Kn,Ts=es,xs=Ja,Ss=ue,Ds=qe("species"),Rs="Promise",Os=Es.get,Is=Es.set,Cs=Es.getterFor(Rs),Ps=as&&as.prototype,Ls=as,js=Ps,Ms=ns.TypeError,Us=ns.document,Bs=ns.process,Ns=ws.f,qs=Ns,Gs=!!(Us&&Us.createEvent&&ns.dispatchEvent),Vs="function"==typeof PromiseRejectionEvent,Fs=!1,Ks=ks(Rs,(function(){var e=ps(Ls),t=e!==String(Ls);if(!t&&66===Ss)return!0;if(Ss>=51&&/native code/.test(e))return!1;var n=new Ls((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Ds]=r,!(Fs=n.then((function(){}))instanceof r)||!t&&Ts&&!Vs})),Ws=Ks||!ms((function(e){Ls.all(e).catch((function(){}))})),zs=function(e){var t;return!(!cs(e)||"function"!=typeof(t=e.then))&&t},Hs=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;ys((function(){for(var r=e.value,a=1==e.state,i=0;n.length>i;){var s,o,d,u=n[i++],c=a?u.ok:u.fail,l=u.resolve,h=u.reject,p=u.domain;try{c?(a||(2===e.rejection&&Js(e),e.rejection=1),!0===c?s=r:(p&&p.enter(),s=c(r),p&&(p.exit(),d=!0)),s===u.promise?h(Ms("Promise-chain cycle")):(o=zs(s))?o.call(s,l,h):l(s)):h(r)}catch(e){p&&!d&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Qs(e)}))}},$s=function(e,t,n){var r,a;Gs?((r=Us.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),ns.dispatchEvent(r)):r={promise:t,reason:n},!Vs&&(a=ns["on"+e])?a(r):"unhandledrejection"===e&&_s("Unhandled promise rejection",n)},Qs=function(e){vs.call(ns,(function(){var t,n=e.facade,r=e.value;if(Ys(e)&&(t=As((function(){xs?Bs.emit("unhandledRejection",r,n):$s("unhandledrejection",n,r)})),e.rejection=xs||Ys(e)?2:1,t.error))throw t.value}))},Ys=function(e){return 1!==e.rejection&&!e.parent},Js=function(e){vs.call(ns,(function(){var t=e.facade;xs?Bs.emit("rejectionHandled",t):$s("rejectionhandled",t,e.value)}))},Xs=function(e,t,n){return function(r){e(t,r,n)}},Zs=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Hs(e,!0))},eo=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Ms("Promise can't be resolved itself");var r=zs(t);r?ys((function(){var n={done:!1};try{r.call(t,Xs(eo,n,e),Xs(Zs,n,e))}catch(t){Zs(n,t,e)}})):(e.value=t,e.state=1,Hs(e,!1))}catch(t){Zs({done:!1},t,e)}}};if(Ks&&(js=(Ls=function(e){hs(this,Ls,Rs),ls(e),Wi.call(this);var t=Os(this);try{e(Xs(eo,t),Xs(Zs,t))}catch(e){Zs(t,e)}}).prototype,(Wi=function(e){Is(this,{type:Rs,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=ss(js,{then:function(e,t){var n=Cs(this),r=Ns(gs(this,Ls));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=xs?Bs.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Hs(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),zi=function(){var e=new Wi,t=Os(e);this.promise=e,this.resolve=Xs(eo,t),this.reject=Xs(Zs,t)},ws.f=Ns=function(e){return e===Ls||e===Hi?new zi(e):qs(e)},"function"==typeof as&&Ps!==Object.prototype)){$i=Ps.then,Fs||(is(Ps,"then",(function(e,t){var n=this;return new Ls((function(e,t){$i.call(n,e,t)})).then(e,t)}),{unsafe:!0}),is(Ps,"catch",js.catch,{unsafe:!0}));try{delete Ps.constructor}catch(e){}os&&os(Ps,js)}ts({global:!0,wrap:!0,forced:Ks},{Promise:Ls}),ds(Ls,Rs,!1),us(Rs),Hi=rs(Rs),ts({target:Rs,stat:!0,forced:Ks},{reject:function(e){var t=Ns(this);return t.reject.call(void 0,e),t.promise}}),ts({target:Rs,stat:!0,forced:Ks},{resolve:function(e){return bs(this,e)}}),ts({target:Rs,stat:!0,forced:Ws},{all:function(e){var t=this,n=Ns(t),r=n.resolve,a=n.reject,i=As((function(){var n=ls(t.resolve),i=[],s=0,o=1;fs(e,(function(e){var d=s++,u=!1;i.push(void 0),o++,n.call(t,e).then((function(e){u||(u=!0,i[d]=e,--o||r(i))}),a)})),--o||r(i)}));return i.error&&a(i.value),n.promise},race:function(e){var t=this,n=Ns(t),r=n.reject,a=As((function(){var a=ls(t.resolve);fs(e,(function(e){a.call(t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var to=Xn,no=Zr,ro=L,ao=te,io=$a,so=Xi,oo=bt.exports;if(to({target:"Promise",proto:!0,real:!0,forced:!!no&&ro((function(){no.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=io(this,ao("Promise")),n="function"==typeof e;return this.then(n?function(n){return so(t,e()).then((function(){return n}))}:e,n?function(n){return so(t,e()).then((function(){throw n}))}:e)}}),"function"==typeof no){var uo=ao("Promise").prototype.finally;no.prototype.finally!==uo&&oo(no.prototype,"finally",uo,{unsafe:!0})}var co=me,lo=function(e){if(co(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},ho=ct,po=function(){var e=ho(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},fo={},mo=L,go=C.RegExp;fo.UNSUPPORTED_Y=mo((function(){var e=go("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),fo.BROKEN_CARET=mo((function(){var e=go("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var vo,yo=dt,bo=ct,_o=tr,wo=j?Object.defineProperties:function(e,t){bo(e);for(var n,r=_o(t),a=r.length,i=0;a>i;)yo.f(e,n=r[i++],t[n]);return e},Ao=ct,Eo=wo,ko=kn,To=Pt,xo=Qa,So=Je,Do=Ct("IE_PROTO"),Ro=function(){},Oo=function(e){return"<script>"+e+"<\/script>"},Io=function(e){e.write(Oo("")),e.close();var t=e.parentWindow.Object;return e=null,t},Co=function(){try{vo=new ActiveXObject("htmlfile")}catch(e){}var e,t;Co="undefined"!=typeof document?document.domain&&vo?Io(vo):((t=So("iframe")).style.display="none",xo.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Oo("document.F=Object")),e.close(),e.F):Io(vo);for(var n=ko.length;n--;)delete Co.prototype[ko[n]];return Co()};To[Do]=!0;var Po=Object.create||function(e,t){var n;return null!==e?(Ro.prototype=Ao(e),n=new Ro,Ro.prototype=null,n[Do]=e):n=Co(),void 0===t?n:Eo(n,t)},Lo=L,jo=C.RegExp,Mo=Lo((function(){var e=jo(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Uo=L,Bo=C.RegExp,No=Uo((function(){var e=Bo("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),qo=lo,Go=po,Vo=fo,Fo=ve.exports,Ko=Po,Wo=Ht.get,zo=Mo,Ho=No,$o=RegExp.prototype.exec,Qo=Fo("native-string-replace",String.prototype.replace),Yo=$o,Jo=function(){var e=/a/,t=/b*/g;return $o.call(e,"a"),$o.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Xo=Vo.UNSUPPORTED_Y||Vo.BROKEN_CARET,Zo=void 0!==/()??/.exec("")[1];(Jo||Zo||Xo||zo||Ho)&&(Yo=function(e){var t,n,r,a,i,s,o,d=this,u=Wo(d),c=qo(e),l=u.raw;if(l)return l.lastIndex=d.lastIndex,t=Yo.call(l,c),d.lastIndex=l.lastIndex,t;var h=u.groups,p=Xo&&d.sticky,f=Go.call(d),m=d.source,g=0,v=c;if(p&&(-1===(f=f.replace("y","")).indexOf("g")&&(f+="g"),v=c.slice(d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==c.charAt(d.lastIndex-1))&&(m="(?: "+m+")",v=" "+v,g++),n=new RegExp("^(?:"+m+")",f)),Zo&&(n=new RegExp("^"+m+"$(?!\\s)",f)),Jo&&(r=d.lastIndex),a=$o.call(p?n:d,v),p?a?(a.input=a.input.slice(g),a[0]=a[0].slice(g),a.index=d.lastIndex,d.lastIndex+=a[0].length):d.lastIndex=0:Jo&&a&&(d.lastIndex=d.global?a.index+a[0].length:r),Zo&&a&&a.length>1&&Qo.call(a[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(a[i]=void 0)})),a&&h)for(a.groups=s=Ko(null),i=0;i<h.length;i++)s[(o=h[i])[0]]=a[o[1]];return a});var ed=Yo;Xn({target:"RegExp",proto:!0,forced:/./.exec!==ed},{exec:ed});var td=bt.exports,nd=ed,rd=L,ad=qe,id=yt,sd=ad("species"),od=RegExp.prototype,dd=function(e,t,n,r){var a=ad(e),i=!rd((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!rd((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[sd]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||n){var o=/./[a],d=t(a,""[e],(function(e,t,n,r,a){var s=t.exec;return s===nd||s===od.exec?i&&!a?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}));td(String.prototype,e,d[0]),td(od,a,d[1])}r&&id(od[a],"sham",!0)},ud=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},cd=K,ld=ed,hd=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==cd(e))throw TypeError("RegExp#exec called on incompatible receiver");return ld.call(e,t)},pd=ct,fd=$,md=ud,gd=lo,vd=hd;dd("search",(function(e,t,n){return[function(t){var n=fd(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](gd(n))},function(e){var r=pd(this),a=gd(e),i=n(t,r,a);if(i.done)return i.value;var s=r.lastIndex;md(s,0)||(r.lastIndex=0);var o=vd(r,a);return md(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var yd=$,bd=lo,_d="[\t\n\v\f\r \u2028\u2029\ufeff]",wd=RegExp("^"+_d+_d+"*"),Ad=RegExp(_d+_d+"*$"),Ed=function(e){return function(t){var n=bd(yd(t));return 1&e&&(n=n.replace(wd,"")),2&e&&(n=n.replace(Ad,"")),n}},kd={start:Ed(1),end:Ed(2),trim:Ed(3)},Td=L,xd="\t\n\v\f\r \u2028\u2029\ufeff",Sd=kd.trim;Xn({target:"String",proto:!0,forced:function(e){return Td((function(){return!!xd[e]()||"
"!="
"[e]()||xd[e].name!==e}))}("trim")},{trim:function(){return Sd(this)}});var Dd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Rd=Je("span").classList,Od=Rd&&Rd.constructor&&Rd.constructor.prototype,Id=Od===Object.prototype?void 0:Od,Cd=L,Pd=wr.forEach,Ld=function(e,t){var n=[][e];return!!n&&Cd((function(){n.call(null,t||function(){throw 1},1)}))},jd=C,Md=Dd,Ud=Id,Bd=Ld("forEach")?[].forEach:function(e){return Pd(this,e,arguments.length>1?arguments[1]:void 0)},Nd=yt,qd=function(e){if(e&&e.forEach!==Bd)try{Nd(e,"forEach",Bd)}catch(t){e.forEach=Bd}};for(var Gd in Md)qd(jd[Gd]&&jd[Gd].prototype);qd(Ud);var Vd=X,Fd=aa,Kd=X,Wd=K,zd=qe("match"),Hd=function(e){var t;return Kd(e)&&(void 0!==(t=e[zd])?!!t:"RegExp"==Wd(e))},$d=j,Qd=C,Yd=Kn,Jd=function(e,t,n){var r,a;return Fd&&"function"==typeof(r=t.constructor)&&r!==n&&Vd(a=r.prototype)&&a!==n.prototype&&Fd(e,a),e},Xd=yt,Zd=dt.f,eu=nn.f,tu=Hd,nu=lo,ru=po,au=fo,iu=bt.exports,su=L,ou=Se,du=Ht.enforce,uu=pa,cu=Mo,lu=No,hu=qe("match"),pu=Qd.RegExp,fu=pu.prototype,mu=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,gu=/a/g,vu=/a/g,yu=new pu(gu)!==gu,bu=au.UNSUPPORTED_Y,_u=$d&&(!yu||bu||cu||lu||su((function(){return vu[hu]=!1,pu(gu)!=gu||pu(vu)==vu||"/a/i"!=pu(gu,"i")})));if(Yd("RegExp",_u)){for(var wu=function(e,t){var n,r,a,i,s,o,d=this instanceof wu,u=tu(e),c=void 0===t,l=[],h=e;if(!d&&u&&c&&e.constructor===wu)return e;if((u||e instanceof wu)&&(e=e.source,c&&(t="flags"in h?h.flags:ru.call(h))),e=void 0===e?"":nu(e),t=void 0===t?"":nu(t),h=e,cu&&"dotAll"in gu&&(r=!!t&&t.indexOf("s")>-1)&&(t=t.replace(/s/g,"")),n=t,bu&&"sticky"in gu&&(a=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,"")),lu&&(i=function(e){for(var t,n=e.length,r=0,a="",i=[],s={},o=!1,d=!1,u=0,c="";r<=n;r++){if("\\"===(t=e.charAt(r)))t+=e.charAt(++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:mu.test(e.slice(r+1))&&(r+=2,d=!0),a+=t,u++;continue;case">"===t&&d:if(""===c||ou(s,c))throw new SyntaxError("Invalid capture group name");s[c]=!0,i.push([c,u]),d=!1,c="";continue}d?c+=t:a+=t}return[a,i]}(e),e=i[0],l=i[1]),s=Jd(pu(e,t),d?this:fu,wu),(r||a||l.length)&&(o=du(s),r&&(o.dotAll=!0,o.raw=wu(function(e){for(var t,n=e.length,r=0,a="",i=!1;r<=n;r++)"\\"!==(t=e.charAt(r))?i||"."!==t?("["===t?i=!0:"]"===t&&(i=!1),a+=t):a+="[\\s\\S]":a+=t+e.charAt(++r);return a}(e),n)),a&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{Xd(s,"source",""===h?"(?:)":h)}catch(e){}return s},Au=function(e){e in wu||Zd(wu,e,{configurable:!0,get:function(){return pu[e]},set:function(t){pu[e]=t}})},Eu=eu(pu),ku=0;Eu.length>ku;)Au(Eu[ku++]);fu.constructor=wu,wu.prototype=fu,iu(Qd,"RegExp",wu)}uu("RegExp");var Tu=bt.exports,xu=ct,Su=lo,Du=L,Ru=po,Ou=RegExp.prototype,Iu=Ou.toString,Cu=Du((function(){return"/a/b"!=Iu.call({source:"a",flags:"b"})})),Pu="toString"!=Iu.name;(Cu||Pu)&&Tu(RegExp.prototype,"toString",(function(){var e=xu(this),t=Su(e.source),n=e.flags;return"/"+t+"/"+Su(void 0===n&&e instanceof RegExp&&!("flags"in Ou)?Ru.call(e):n)}),{unsafe:!0});var Lu=Xn,ju=L,Mu=dr,Uu=X,Bu=ke,Nu=un,qu=Mr,Gu=pr,Vu=Tr,Fu=ue,Ku=qe("isConcatSpreadable"),Wu=Fu>=51||!ju((function(){var e=[];return e[Ku]=!1,e.concat()[0]!==e})),zu=Vu("concat"),Hu=function(e){if(!Uu(e))return!1;var t=e[Ku];return void 0!==t?!!t:Mu(e)};Lu({target:"Array",proto:!0,forced:!Wu||!zu},{concat:function(e){var t,n,r,a,i,s=Bu(this),o=Gu(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Hu(i=-1===t?s:arguments[t])){if(d+(a=Nu(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,d++)n in i&&qu(o,d,i[n])}else{if(d>=9007199254740991)throw TypeError("Maximum allowed index exceeded");qu(o,d++,i)}return o.length=d,o}});var $u,Qu=Hd,Yu=function(e){if(Qu(e))throw TypeError("The method doesn't accept regular expressions");return e},Ju=qe("match"),Xu=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Ju]=!1,"/./"[e](t)}catch(e){}}return!1},Zu=Xn,ec=P.f,tc=un,nc=lo,rc=Yu,ac=$,ic=Xu,sc="".startsWith,oc=Math.min,dc=ic("startsWith");Zu({target:"String",proto:!0,forced:!!(dc||($u=ec(String.prototype,"startsWith"),!$u||$u.writable))&&!dc},{startsWith:function(e){var t=nc(ac(this));rc(e);var n=tc(oc(arguments.length>1?arguments[1]:void 0,t.length)),r=nc(e);return sc?sc.call(t,r,n):t.slice(n,n+r.length)===r}});var uc=sn,cc=lo,lc=$,hc=function(e){return function(t,n){var r,a,i=cc(lc(t)),s=uc(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=i.charCodeAt(s))<55296||r>56319||s+1===o||(a=i.charCodeAt(s+1))<56320||a>57343?e?i.charAt(s):r:e?i.slice(s,s+2):a-56320+(r-55296<<10)+65536}},pc={codeAt:hc(!1),charAt:hc(!0)},fc=pc.charAt,mc=function(e,t,n){return t+(n?fc(e,t).length:1)},gc=ke,vc=Math.floor,yc="".replace,bc=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,_c=/\$([$&'`]|\d{1,2})/g,wc=dd,Ac=L,Ec=ct,kc=sn,Tc=un,xc=lo,Sc=$,Dc=mc,Rc=function(e,t,n,r,a,i){var s=n+e.length,o=r.length,d=_c;return void 0!==a&&(a=gc(a),d=bc),yc.call(i,d,(function(i,d){var u;switch(d.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(s);case"<":u=a[d.slice(1,-1)];break;default:var c=+d;if(0===c)return i;if(c>o){var l=vc(c/10);return 0===l?i:l<=o?void 0===r[l-1]?d.charAt(1):r[l-1]+d.charAt(1):i}u=r[c-1]}return void 0===u?"":u}))},Oc=hd,Ic=qe("replace"),Cc=Math.max,Pc=Math.min,Lc="$0"==="a".replace(/./,"$0"),jc=!!/./[Ic]&&""===/./[Ic]("a","$0");wc("replace",(function(e,t,n){var r=jc?"$":"$0";return[function(e,n){var r=Sc(this),a=null==e?void 0:e[Ic];return void 0!==a?a.call(e,r,n):t.call(xc(r),e,n)},function(e,a){var i=Ec(this),s=xc(e);if("string"==typeof a&&-1===a.indexOf(r)&&-1===a.indexOf("$<")){var o=n(t,i,s,a);if(o.done)return o.value}var d="function"==typeof a;d||(a=xc(a));var u=i.global;if(u){var c=i.unicode;i.lastIndex=0}for(var l=[];;){var h=Oc(i,s);if(null===h)break;if(l.push(h),!u)break;""===xc(h[0])&&(i.lastIndex=Dc(s,Tc(i.lastIndex),c))}for(var p,f="",m=0,g=0;g<l.length;g++){h=l[g];for(var v=xc(h[0]),y=Cc(Pc(kc(h.index),s.length),0),b=[],_=1;_<h.length;_++)b.push(void 0===(p=h[_])?p:String(p));var w=h.groups;if(d){var A=[v].concat(b,y,s);void 0!==w&&A.push(w);var E=xc(a.apply(void 0,A))}else E=Rc(v,s,y,b,w,a);y>=m&&(f+=s.slice(m,y)+E,m=y+v.length)}return f+s.slice(m)}]}),!!Ac((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Lc||jc);var Mc=j,Uc=dt.f,Bc=Function.prototype,Nc=Bc.toString,qc=/^\s*function ([^ (]*)/;Mc&&!("name"in Bc)&&Uc(Bc,"name",{configurable:!0,get:function(){try{return Nc.call(this).match(qc)[1]}catch(e){return""}}});var Gc={},Vc=J,Fc=nn.f,Kc={}.toString,Wc="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Gc.f=function(e){return Wc&&"[object Window]"==Kc.call(e)?function(e){try{return Fc(e)}catch(e){return Wc.slice()}}(e):Fc(Vc(e))};var zc={},Hc=qe;zc.f=Hc;var $c=C,Qc=Se,Yc=zc,Jc=dt.f,Xc=function(e){var t=$c.Symbol||($c.Symbol={});Qc(t,e)||Jc(t,e,{value:Yc.f(e)})},Zc=Xn,el=C,tl=te,nl=j,rl=he,al=L,il=Se,sl=dr,ol=X,dl=me,ul=ct,cl=ke,ll=J,hl=He,pl=lo,fl=V,ml=Po,gl=tr,vl=nn,yl=Gc,bl=Sn,_l=P,wl=dt,Al=M,El=yt,kl=bt.exports,Tl=ve.exports,xl=Pt,Sl=Oe,Dl=qe,Rl=zc,Ol=Xc,Il=da,Cl=Ht,Pl=wr.forEach,Ll=Ct("hidden"),jl=Dl("toPrimitive"),Ml=Cl.set,Ul=Cl.getterFor("Symbol"),Bl=Object.prototype,Nl=el.Symbol,ql=tl("JSON","stringify"),Gl=_l.f,Vl=wl.f,Fl=yl.f,Kl=Al.f,Wl=Tl("symbols"),zl=Tl("op-symbols"),Hl=Tl("string-to-symbol-registry"),$l=Tl("symbol-to-string-registry"),Ql=Tl("wks"),Yl=el.QObject,Jl=!Yl||!Yl.prototype||!Yl.prototype.findChild,Xl=nl&&al((function(){return 7!=ml(Vl({},"a",{get:function(){return Vl(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Gl(Bl,t);r&&delete Bl[t],Vl(e,t,n),r&&e!==Bl&&Vl(Bl,t,r)}:Vl,Zl=function(e,t){var n=Wl[e]=ml(Nl.prototype);return Ml(n,{type:"Symbol",tag:e,description:t}),nl||(n.description=t),n},eh=function(e,t,n){e===Bl&&eh(zl,t,n),ul(e);var r=hl(t);return ul(n),il(Wl,r)?(n.enumerable?(il(e,Ll)&&e[Ll][r]&&(e[Ll][r]=!1),n=ml(n,{enumerable:fl(0,!1)})):(il(e,Ll)||Vl(e,Ll,fl(1,{})),e[Ll][r]=!0),Xl(e,r,n)):Vl(e,r,n)},th=function(e,t){ul(e);var n=ll(t),r=gl(n).concat(ih(n));return Pl(r,(function(t){nl&&!nh.call(n,t)||eh(e,t,n[t])})),e},nh=function(e){var t=hl(e),n=Kl.call(this,t);return!(this===Bl&&il(Wl,t)&&!il(zl,t))&&(!(n||!il(this,t)||!il(Wl,t)||il(this,Ll)&&this[Ll][t])||n)},rh=function(e,t){var n=ll(e),r=hl(t);if(n!==Bl||!il(Wl,r)||il(zl,r)){var a=Gl(n,r);return!a||!il(Wl,r)||il(n,Ll)&&n[Ll][r]||(a.enumerable=!0),a}},ah=function(e){var t=Fl(ll(e)),n=[];return Pl(t,(function(e){il(Wl,e)||il(xl,e)||n.push(e)})),n},ih=function(e){var t=e===Bl,n=Fl(t?zl:ll(e)),r=[];return Pl(n,(function(e){!il(Wl,e)||t&&!il(Bl,e)||r.push(Wl[e])})),r};(rl||(kl((Nl=function(){if(this instanceof Nl)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?pl(arguments[0]):void 0,t=Sl(e),n=function(e){this===Bl&&n.call(zl,e),il(this,Ll)&&il(this[Ll],t)&&(this[Ll][t]=!1),Xl(this,t,fl(1,e))};return nl&&Jl&&Xl(Bl,t,{configurable:!0,set:n}),Zl(t,e)}).prototype,"toString",(function(){return Ul(this).tag})),kl(Nl,"withoutSetter",(function(e){return Zl(Sl(e),e)})),Al.f=nh,wl.f=eh,_l.f=rh,vl.f=yl.f=ah,bl.f=ih,Rl.f=function(e){return Zl(Dl(e),e)},nl&&(Vl(Nl.prototype,"description",{configurable:!0,get:function(){return Ul(this).description}}),kl(Bl,"propertyIsEnumerable",nh,{unsafe:!0}))),Zc({global:!0,wrap:!0,forced:!rl,sham:!rl},{Symbol:Nl}),Pl(gl(Ql),(function(e){Ol(e)})),Zc({target:"Symbol",stat:!0,forced:!rl},{for:function(e){var t=pl(e);if(il(Hl,t))return Hl[t];var n=Nl(t);return Hl[t]=n,$l[n]=t,n},keyFor:function(e){if(!dl(e))throw TypeError(e+" is not a symbol");if(il($l,e))return $l[e]},useSetter:function(){Jl=!0},useSimple:function(){Jl=!1}}),Zc({target:"Object",stat:!0,forced:!rl,sham:!nl},{create:function(e,t){return void 0===t?ml(e):th(ml(e),t)},defineProperty:eh,defineProperties:th,getOwnPropertyDescriptor:rh}),Zc({target:"Object",stat:!0,forced:!rl},{getOwnPropertyNames:ah,getOwnPropertySymbols:ih}),Zc({target:"Object",stat:!0,forced:al((function(){bl.f(1)}))},{getOwnPropertySymbols:function(e){return bl.f(cl(e))}}),ql)&&Zc({target:"JSON",stat:!0,forced:!rl||al((function(){var e=Nl();return"[null]"!=ql([e])||"{}"!=ql({a:e})||"{}"!=ql(Object(e))}))},{stringify:function(e,t,n){for(var r,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(r=t,(ol(t)||void 0!==e)&&!dl(e))return sl(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!dl(t))return t}),a[1]=t,ql.apply(null,a)}});Nl.prototype[jl]||El(Nl.prototype,jl,Nl.prototype.valueOf),Il(Nl,"Symbol"),xl[Ll]=!0;var sh=Xn,oh=j,dh=C,uh=Se,ch=X,lh=dt.f,hh=Mn,ph=dh.Symbol;if(oh&&"function"==typeof ph&&(!("description"in ph.prototype)||void 0!==ph().description)){var fh={},mh=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof mh?new ph(e):void 0===e?ph():ph(e);return""===e&&(fh[t]=!0),t};hh(mh,ph);var gh=mh.prototype=ph.prototype;gh.constructor=mh;var vh=gh.toString,yh="Symbol(test)"==String(ph("test")),bh=/^Symbol\((.*)\)[^)]+$/;lh(gh,"description",{configurable:!0,get:function(){var e=ch(this)?this.valueOf():this,t=vh.call(e);if(uh(fh,e))return"";var n=yh?t.slice(7,-1):t.replace(bh,"$1");return""===n?void 0:n}}),sh({global:!0,forced:!0},{Symbol:mh})}var _h=Po,wh=dt,Ah=qe("unscopables"),Eh=Array.prototype;null==Eh[Ah]&&wh.f(Eh,Ah,{configurable:!0,value:_h(null)});var kh=function(e){Eh[Ah][e]=!0},Th=yn.includes,xh=kh;Xn({target:"Array",proto:!0},{includes:function(e){return Th(this,e,arguments.length>1?arguments[1]:void 0)}}),xh("includes");var Sh=Yu,Dh=$,Rh=lo;Xn({target:"String",proto:!0,forced:!Xu("includes")},{includes:function(e){return!!~Rh(Dh(this)).indexOf(Rh(Sh(e)),arguments.length>1?arguments[1]:void 0)}});var Oh=Xn,Ih=wr.find,Ch=kh,Ph=!0;"find"in[]&&Array(1).find((function(){Ph=!1})),Oh({target:"Array",proto:!0,forced:Ph},{find:function(e){return Ih(this,e,arguments.length>1?arguments[1]:void 0)}}),Ch("find");var Lh="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Lh&&Lh,jh="URLSearchParams"in Lh,Mh="Symbol"in Lh&&"iterator"in Symbol,Uh="FileReader"in Lh&&"Blob"in Lh&&function(){try{return new Blob,!0}catch(e){return!1}}(),Bh="FormData"in Lh,Nh="ArrayBuffer"in Lh;if(Nh)var qh=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Gh=ArrayBuffer.isView||function(e){return e&&qh.indexOf(Object.prototype.toString.call(e))>-1};function Vh(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Fh(e){return"string"!=typeof e&&(e=String(e)),e}function Kh(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Mh&&(t[Symbol.iterator]=function(){return t}),t}function Wh(e){this.map={},e instanceof Wh?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function zh(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Hh(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function $h(e){var t=new FileReader,n=Hh(t);return t.readAsArrayBuffer(e),n}function Qh(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Yh(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Uh&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Bh&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:jh&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Nh&&Uh&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Qh(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Nh&&(ArrayBuffer.prototype.isPrototypeOf(e)||Gh(e))?this._bodyArrayBuffer=Qh(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):jh&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Uh&&(this.blob=function(){var e=zh(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=zh(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then($h)}),this.text=function(){var e=zh(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Hh(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Bh&&(this.formData=function(){return this.text().then(Zh)}),this.json=function(){return this.text().then(JSON.parse)},this}Wh.prototype.append=function(e,t){e=Vh(e),t=Fh(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Wh.prototype.delete=function(e){delete this.map[Vh(e)]},Wh.prototype.get=function(e){return e=Vh(e),this.has(e)?this.map[e]:null},Wh.prototype.has=function(e){return this.map.hasOwnProperty(Vh(e))},Wh.prototype.set=function(e,t){this.map[Vh(e)]=Fh(t)},Wh.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Wh.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Kh(e)},Wh.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Kh(e)},Wh.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Kh(e)},Mh&&(Wh.prototype[Symbol.iterator]=Wh.prototype.entries);var Jh=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Xh(e,t){if(!(this instanceof Xh))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof Xh){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Wh(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Wh(t.headers)),this.method=function(e){var t=e.toUpperCase();return Jh.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Zh(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(a))}})),t}function ep(e,t){if(!(this instanceof ep))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Wh(t.headers),this.url=t.url||"",this._initBody(e)}Xh.prototype.clone=function(){return new Xh(this,{body:this._bodyInit})},Yh.call(Xh.prototype),Yh.call(ep.prototype),ep.prototype.clone=function(){return new ep(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Wh(this.headers),url:this.url})},ep.error=function(){var e=new ep(null,{status:0,statusText:""});return e.type="error",e};var tp=[301,302,303,307,308];ep.redirect=function(e,t){if(-1===tp.indexOf(t))throw new RangeError("Invalid status code");return new ep(null,{status:t,headers:{location:e}})};var np=Lh.DOMException;try{new np}catch(e){np=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},np.prototype=Object.create(Error.prototype),np.prototype.constructor=np}function rp(e,t){return new Promise((function(n,r){var a=new Xh(e,t);if(a.signal&&a.signal.aborted)return r(new np("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new Wh,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){n(new ep(a,r))}),0)},i.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.onabort=function(){setTimeout((function(){r(new np("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&Lh.location.href?Lh.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&(Uh?i.responseType="blob":Nh&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(i.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Wh?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,Fh(t.headers[e]))})),a.signal&&(a.signal.addEventListener("abort",s),i.onreadystatechange=function(){4===i.readyState&&a.signal.removeEventListener("abort",s)}),i.send(void 0===a._bodyInit?null:a._bodyInit)}))}rp.polyfill=!0,Lh.fetch||(Lh.fetch=rp,Lh.Headers=Wh,Lh.Request=Xh,Lh.Response=ep);var ap={name:"@bygd/gd-sdk-pes",version:"1.19.2",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.2","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7"}},ip=ct,sp=un,op=lo,dp=$,up=mc,cp=hd;dd("match",(function(e,t,n){return[function(t){var n=dp(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](op(n))},function(e){var r=ip(this),a=op(e),i=n(t,r,a);if(i.done)return i.value;if(!r.global)return cp(r,a);var s=r.unicode;r.lastIndex=0;for(var o,d=[],u=0;null!==(o=cp(r,a));){var c=op(o[0]);d[u]=c,""===c&&(r.lastIndex=up(a,sp(r.lastIndex),s)),u++}return 0===u?null:d}]}));var lp=dd,hp=Hd,pp=ct,fp=$,mp=$a,gp=mc,vp=un,yp=lo,bp=hd,_p=ed,wp=L,Ap=fo.UNSUPPORTED_Y,Ep=[].push,kp=Math.min;lp("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=yp(fp(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!hp(e))return t.call(r,e,a);for(var i,s,o,d=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,l=new RegExp(e.source,u+"g");(i=_p.call(l,r))&&!((s=l.lastIndex)>c&&(d.push(r.slice(c,i.index)),i.length>1&&i.index<r.length&&Ep.apply(d,i.slice(1)),o=i[0].length,c=s,d.length>=a));)l.lastIndex===i.index&&l.lastIndex++;return c===r.length?!o&&l.test("")||d.push(""):d.push(r.slice(c)),d.length>a?d.slice(0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var a=fp(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,a,n):r.call(yp(a),t,n)},function(e,a){var i=pp(this),s=yp(e),o=n(r,i,s,a,r!==t);if(o.done)return o.value;var d=mp(i,RegExp),u=i.unicode,c=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(Ap?"g":"y"),l=new d(Ap?"^(?:"+i.source+")":i,c),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===s.length)return null===bp(l,s)?[s]:[];for(var p=0,f=0,m=[];f<s.length;){l.lastIndex=Ap?0:f;var g,v=bp(l,Ap?s.slice(f):s);if(null===v||(g=kp(vp(l.lastIndex+(Ap?f:0)),s.length))===p)f=gp(s,f,u);else{if(m.push(s.slice(p,f)),m.length===h)return m;for(var y=1;y<=v.length-1;y++)if(m.push(v[y]),m.length===h)return m;f=p=g}}return m.push(s.slice(p)),m}]}),!!wp((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Ap);var Tp=function(){function e(t){w.default(this,e),this.gameData=t}return A.default(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){try{var e={};if(this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled){var t=new T.default(location.href,!0);for(var n in t.query)e[n]=t.query[n];Object.keys(e).length;return e}}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),xp=function(){function e(t,n){w.default(this,e),this.adContainer=t,this.onResume=n}return A.default(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var t=document.createElement("div");this.adResumeButton=t,t.id="gd__resume__button",t.setAttribute("title","Resume"),this.addStyles(),t.classList.add("gd__resume__button"),t.addEventListener("click",function(){v.default(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(t);var n=document.createElement("div");this.adResumeButtonOverlay=n,n.id="gd__resume__button__overlay",n.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(n)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),Sp=function(e){if(!e)return!1;var t=Dp.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Dp=Object.prototype.toString;function Rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Op(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rp(Object(n),!0).forEach((function(t){b.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ip(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}var Cp=["bidFloor","isDfpBidding"];function Pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pp(Object(n),!0).forEach((function(t){b.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var jp=null,Mp=function(){function e(t,n,r){var a=this;if(w.default(this,e),jp)return jp;jp=this;var i={debug:!1,width:640,height:360,locale:"en"};this.options=n?d.extendDefaults(i,n):i,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new d.EventBus,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=r.parentDomain,this.topDomain=r.topDomain,this.parentURL=r.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=d.getIMASampleTags(),this.atom_display,this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==t?document.getElementById(t):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:s,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:o,this.gameId="0",this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){v.default(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){v.default(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,a,i,s,o,u,c,h,p,f,g,y,O,I,C,P,L;return A.default(e,[{key:"start",value:(L=_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),e.next=14;break;case 11:throw e.prev=11,e.t0=e.catch(0),new Error(e.t0);case 14:case"end":return e.stop()}}),e,this,[[0,11]])}))),function(){return L.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=_.default(E.default.mark((function r(a){var i,s,o,u,c,h,p,f,m,g,y=this;return E.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(d.Ls.available&&d.Ls.getBoolean("gd_debug_ex")&&d.Ls.getBoolean("gd_tag"))){r.next=6;break}return i=n.IMASampleTags[e],s=Math.floor(Math.random()*i.length),o=i[s],a({url:o}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,r.next=11,n._getTunnlKeys(e);case 11:if(u=r.sent,c=u.data,h=c.nsid?c.nsid:"TNL_T-17102571517",p=c.tid?c.tid:"TNL_NS-18101700058",f="".concat(h,"/").concat(p),delete c.nsid,delete c.tid,R.default(c,{tnl_system:"1",tnl_content_category:n.category.toLowerCase()}),n.eventBus.broadcast("AD_REQUEST",{message:c.tnl_ad_pos}),m=n.options,"preroll"===c.tnl_ad_pos&&l.isPlainObject(m.preroll)?m=m.preroll:"midroll"===c.tnl_ad_pos&&l.isPlainObject(m.midroll)?m=m.midroll:"rewarded"===c.tnl_ad_pos&&l.isPlainObject(m.rewarded)&&(m=m.rewarded),!(t&&t.retry_on_success&&l.isPlainObject(m.retry_on_success)&&l.isPlainObject(m.retry_on_success.vast))){r.next=26;break}return r.abrupt("return",a(n._createCustomAdVastUrl(m.retry_on_success.vast,{tnl_keys:c})));case 26:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&l.isPlainObject(m.retry_on_failure.vast))){r.next=30;break}return r.abrupt("return",a(n._createCustomAdVastUrl(m.retry_on_failure.vast,{tnl_keys:c})));case 30:if(!l.isPlainObject(m.vast)){r.next=32;break}return r.abrupt("return",a(n._createCustomAdVastUrl(m.vast,{tnl_keys:c})));case 32:return r.next=34,n._create_dp_context(c.tnl_ad_pos);case 34:g=r.sent,window.idhb.que.push(function(){var e=this;v.default(this,y),window.idhb.setRefererUrl(encodeURIComponent(n.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(n.userAllowedPersonalizedAds));var t="rewarded"===c.tnl_ad_pos?"rewardedVideo":"gdbanner"===c.tnl_ad_pos?"gd__banner":"midroll"===c.tnl_ad_pos?"midroll":"video1";window.idhb.setDfpAdUnitCodeForAdSlot(t,f),window.idhb.setAdserverTargetingForAdSlot(t,c),window.idhb.requestAds({slots:b.default({},t,{bidFloor:null!=g&&g.floor_price?g.floor_price:void 0}),callback:function(t,n){var r=this;v.default(this,e),g&&!n.bidFloorApplied&&fetch(g.skip_url).catch(function(e){v.default(this,r)}.bind(this)),a({tnl_keys:c,url:t,dp:g,hl:n})}.bind(this)})}.bind(this)),r.next=41;break;case 38:throw r.prev=38,r.t0=r.catch(8),new Error(r.t0);case 41:case"end":return r.stop()}}),r,this,[[8,38]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===d.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===d.AdType.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===d.AdType.Rewarded?"rewarded":e===d.AdType.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_getTunnlKeys",value:function(e){var t=this;return new Promise(function(n){var r=this;v.default(this,t);var a="";a=!navigator.userAgent.match(/Crosswalk/i)&&void 0===window.cordova||"m.hopy.com"!==this.parentDomain?"page_url=".concat(encodeURIComponent(this.topDomain||this.parentDomain)):"bundle=com.hopy.frivgames";var i=this.nextAdPosition(e),s=d.getQueryString("ch",window.location.href),o=d.getQueryString("ch_date",window.location.href),u=s?"&ch=".concat(s):"",c=o?"&ch_date=".concat(o):"",l="https://pub.headerlift.com/opphb?".concat(a,"&player_width=").concat(this.options.width,"&player_height=").concat(this.options.height,"&ad_type=video_image&game_id=").concat(this.gameId,"&ad_position=").concat(i).concat(u).concat(c,"&correlator=").concat(Date.now()),h=new Request(l,{method:"GET"});fetch(h).then(function(e){v.default(this,r);var t=e.headers.get("content-type");if(t&&-1!==t.indexOf("application/json"))return e.json();throw new TypeError("Oops, we didn't get JSON!")}.bind(this)).then(function(e){v.default(this,r),d.isObjectEmpty(e)&&(e=this._createTunnlReportingFallbackKeys(i),this.eventBus.broadcast("AD_REQUEST_KEYS_EMPTY",{message:"Tunnl returned empty response.",details:l})),n({data:e,url:l})}.bind(this)).catch(function(e){v.default(this,r);var t=this._createTunnlReportingFallbackKeys(i);this.eventBus.broadcast("AD_REQUEST_KEYS_FALLBACK",{message:e.message,details:l}),n({data:t,url:l})}.bind(this))}.bind(this))}},{key:"_createTunnlReportingFallbackKeys",value:function(e){return{tid:"TNL_T-17102571517",nsid:"TNL_NS-18101700058",tnl_tid:"T-17102571517",tnl_nsid:"NS-18101700058",tnl_pw:this.options.width,tnl_ph:this.options.height,tnl_pt:"22",tnl_pid:"P-17101800031",tnl_paid:"17",tnl_ad_type:"video_image",tnl_asset_id:this.gameId.toString(),tnl_ad_pos:e,tnl_skippable:"1",tnl_cp1:"",tnl_cp2:"",tnl_cp3:"",tnl_cp4:"",tnl_cp5:"",tnl_cp6:"",tnl_campaign:"2",tnl_gdpr:"0",tnl_gdpr_consent:"1",consent_string:"BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA",tnl_content_category:this.category.toLowerCase()}}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(r){if(v.default(this,n),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,i=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var s=new google.ima.AdsRequest,o=this._transformVast(e,t),d=Lp(Lp({},t),{},{adTag:o,tnl_ad_pos:i});this.adCounter[i]=this.adCounter[i]||0,this.adCounter[i]++;var u=e.dp,c=e.hl;if(u&&(u.adtag_url=o.url,this._extend_dp_with_adsense(u,c,null==e?void 0:e.tnl_keys)),this._isVMAP(i)){var l=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,a=Date.now(),i=new T.default(e.adtag_url_1,!0);i.query=Op(Op({},i.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:a,output:"xml_vast3"});var s=i.toString(),o=new T.default(e.adtag_url_2,!0);o.query=Op(Op({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++a,output:"xml_vast3"});var d=o.toString(),u=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Ip({id:u++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Ip({id:u++,adtag_url:d,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.impression_url}),'\n </vmap:AdSource>\n <vmap:Extensions>\n <vmap:Extension type="bumper" suppress_bumper="true"></vmap:Extension>\n </vmap:Extensions>\n</vmap:AdBreak>\n</vmap:VMAP>').trim()}(this._get_vmap_context({dp:u,adtag:o,position:"preroll"===d.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(i)}));s.adsResponse=l}else if(u&&c.bidFloorApplied){var h=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(u);s.adsResponse=h}else if(u&&u.fallback_url){var p=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(u);s.adsResponse=p}else s.adTagUrl=o.url;s.linearAdSlotWidth=this.options.width,s.linearAdSlotHeight=this.options.height,s.nonLinearAdSlotWidth=this.options.width,s.nonLinearAdSlotHeight=this.options.height,s.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(s.vastLoadTimeout=this.options.vast_load_timeout),s.setAdWillAutoPlay(t.autoplayAllowed),s.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(s,d);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:d})}catch(e){}r(s)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameId}})}}},{key:"_checkAutoPlay",value:(P=_.default(E.default.mark((function e(){var t=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=this;v.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):x.default.video({inline:!0,muted:!1}).then(function(t){v.default(this,r);var n=t.result;t.error,e(!0===n?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return P.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(C=_.default(E.default.mark((function e(){var t;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"startAd",value:(I=_.default(E.default.mark((function e(t){var n,r,a,i,s;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!1===(null===(n=this.gameData.sdk)||void 0===n||null===(r=n.afg)||void 0===r?void 0:r.enabled),i=t.adType,s=t.params,i!==d.AdType.Interstitial){e.next=22;break}if(!a){e.next=7;break}return e.abrupt("return",this._startInterstitialAd(s));case 7:if("preroll"!==(null==s?void 0:s.position)){e.next=11;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 11:if(!this._isAdPlacementNext(t)){e.next=15;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 15:if(!this._isAdPlacementStart(t)){e.next=19;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 19:return e.abrupt("return",this._startInterstitialAd(s));case 20:e.next=31;break;case 22:if(i!==d.AdType.Rewarded){e.next=30;break}if(!a){e.next=27;break}return e.abrupt("return",this._startRewardedAd(s));case 27:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 28:e.next=31;break;case 30:throw new Error("Unsupported ad type");case 31:case"end":return e.stop()}}),e,this)}))),function(e){return I.apply(this,arguments)})},{key:"preloadAd",value:(O=_.default(E.default.mark((function e(t){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==d.AdType.Interstitial){e.next=4;break}return e.abrupt("return",this._preloadInterstitialAd());case 4:if(t!==d.AdType.Rewarded){e.next=8;break}return e.abrupt("return",this._preloadRewardedAd());case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){v.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new xp(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(y=_.default(E.default.mark((function e(t){var n=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=_.default(E.default.mark((function e(r,a){var i,s,o,u,c,l,h=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(i=t?t.containerId:null)||a("Container id is not specified"),s=document.getElementById(i),document.getElementById(i)||a("No container is found with this id - ".concat(i)),void 0===window.idhb.requestAds&&a("Prebid.js wrapper script hit an error or didn't exist!"),o=t.slotId?t.slotId:"gd__banner@".concat(i),document.getElementById(o)||(u="\n .gd__banner{\n z-index: ".concat(d.Layers.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((c=document.createElement("style")).type="text/css",c.id="gd__banner__style",c.styleSheet?c.styleSheet.cssText=u:c.appendChild(document.createTextNode(u)),s.appendChild(c)),(l=document.createElement("div")).id=o,l.classList.add("gd__banner"),s.appendChild(l)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,window.idhb.que.push(function(){var e,t,r=this;v.default(this,h),window.idhb.setRefererUrl(encodeURIComponent(n.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(n.userAllowedPersonalizedAds)),window.idhb.setDefaultGdprConsentString("BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA"),null!==(e=n.atom_display)&&void 0!==e&&e.params&&window.idhb.setAdserverTargeting(null===(t=n.atom_display)||void 0===t?void 0:t.params);var a={};a[o]={maxSize:[s.offsetWidth,s.offsetHeight]},window.idhb.requestAds({slots:a,callback:function(e){v.default(this,r)}.bind(this)})}.bind(this)),r(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),a(e.t0.message||e.t0);case 18:case"end":return e.stop()}}),e,this,[[0,15]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return y.apply(this,arguments)})},{key:"_startInterstitialAd",value:(g=_.default(E.default.mark((function e(t){var n;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadInterstitialAd(Lp(Lp({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return g.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(f=_.default(E.default.mark((function e(t){var n,r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(d.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,Lp({adType:d.AdType.Interstitial},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;v.default(this,a);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var i=function(t){v.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){v.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return f.apply(this,arguments)})},{key:"_startRewardedAd",value:(p=_.default(E.default.mark((function e(t){var n;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadRewardedAd(Lp(Lp({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return p.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=_.default(E.default.mark((function e(t){var n,r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(d.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,Lp({adType:d.AdType.Rewarded},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;v.default(this,a);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var i=function(t){v.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){v.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return h.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(c=_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(d.AdType.Interstitial);case 3:return this.preloadedInterstitialAdVast=e.sent,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return c.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(u=_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(d.AdType.Rewarded);case 3:return this.preloadedRewardedAdVast=e.sent,e.abrupt("return",this.preloadedRewardedAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return u.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player.src="",this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var t=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var n=null==e?void 0:e.mode,r=this._isT4R(e),a=this._getT4ROptions();"loaded"===n?(this.activeAdContainer.style.opacity=r?.001:1,r&&this.eventBus.broadcast("AD_T4R"),r&&setTimeout(function(){v.default(this,t),this.activeAdContainer.style.opacity=1}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210))):"click"!==n&&"first_quartile"!==n||(this.activeAdContainer.style.opacity=1)}}},{key:"_createPlayer",value:function(){var e=this,t=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=d.Layers.AdsContainer.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var n=document.createElement("video");n.setAttribute("playsinline",!0),n.setAttribute("webkit-playsinline",!0),n.id="".concat(this.prefix,"advertisement_video"),n.style.position="absolute",n.style.backgroundColor="#000000",n.style.top="0",n.style.left="0",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px",this.video_ad_player=n,this.adContainer.appendChild(n);var r=document.createElement("div");r.id="".concat(this.prefix,"advertisement_slot"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.adContainerInner=r,this.activeAdContainer=this.adContainer,this.thirdPartyContainer?(this.adContainer.appendChild(r),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(r),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){v.default(this,e);var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:t,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var t=this,n=new google.ima.AdsRenderingSettings;n.autoAlign=!1,n.enablePreloading=!1,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.useStyledNonLinearAds=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,n),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){v.default(this,t),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var r=new Date,a=r.getHours(),i=r.getDate(),s=r.getMonth(),o=r.getFullYear(),d="AD_SDK_MANAGER_READY";this.eventBus.broadcast(d,{name:d,message:"AD SDK is ready",status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(o)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t=new Date,n=t.getHours(),r=t.getDate(),a=t.getMonth(),i=t.getFullYear(),s=d.getKeyByValue(google.ima.AdEvent.Type,e.type),o=!1,u=e.getAd().getContentType()||"",c=!u.startsWith("image")&&!u.startsWith("text");this._sendIMAEventsToHB(e);var l="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:l="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:l="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:o=!0,l="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:l="Fired when the ad is clicked.";var h=e.getAd().getContentType();this._show({mode:"click",contentType:h});break;case google.ima.AdEvent.Type.COMPLETE:o=this._is_completed(e.getAd()),l="Fired when the ad completes playing.";break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:l="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:l="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",o=!0;break;case google.ima.AdEvent.Type.DURATION_CHANGE:l="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:l="Fired when the ad playhead crosses first quartile.";var p=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:p});break;case google.ima.AdEvent.Type.IMPRESSION:l="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:l="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:l="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var f=e.getAd().getContentType();l=f,this._show({mode:"loaded",contentType:f});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(l=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:l="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:c&&this.adResume.show(),l="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:l="Fired when the ad is resumed.",c&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:l="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:o=this._is_completed(e.getAd()),l="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:l="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:l="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:o=this._is_completed(e.getAd()),l="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:l="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:l="Fired when the ad volume has been muted."}""!==s&&""!==l&&this.eventBus.broadcast(s,{name:s,message:l,status:"success",analytics:{category:s,action:this.parentDomain,label:"h".concat(n," d").concat(r," m").concat(a," y").concat(i)}}),o&&!this.adSuccess&&(this.adSuccess=!0,this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.resetForNext(e))}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),a=this._getInnerErrorCode(n);this.eventBus.broadcast(t,{message:r,details:a,status:"warning",analytics:{category:t,action:a,label:r}})}catch(e){}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent(e)}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,t){var n=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){v.default(this,n),this.cancel(),this._clearSafetyTimer(t)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/gameDistributionV1.3.min.js","http://hb.improvedigital.com/pbw/gameDistributionV1.3.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(Sp(e.getInnerError)){var t=e.getInnerError();if(t)return Sp(t.getErrorCode)&&Sp(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,t){var n=this;if(e){var r=this.macros.transform(e,{get:function(e){if(v.default(this,n),t&&t.tnl_keys)return t.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in r.query||{}){var i=r.query[a];l.isPlainObject(i)&&(r.query[a]=D.default.stringify(i))}var s=new T.default(r.url,!0);return R.default(s.query,r.query||{}),Lp({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new T.default(e.url,!0),a=this._transformQuery(e,t,r);a&&(n.url=r.toString());var i=a?r:new T.default(e.url,!0);if(i.query.cust_params){var s=D.default.parse(i.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=i}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,t,n){var r=this;if(e&&t&&e.tnl_keys){var a=this.options.vast_query;if(t.retry_on_success&&this.options.retry_on_success&&l.isPlainObject(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:t.retry_on_failure&&this.options.retry_on_failure&&l.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=S.default(a),l.isPlainObject(a)){var i=n.query;if(a.$$remove){for(var s in i){new RegExp(a.$$remove,"i").test(s)&&delete i[s]}delete a.$$remove}var o=D.default.parse(i.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var d in o){new RegExp(a.cust_params.$$remove,"i").test(d)&&delete o[d]}delete a.cust_params.$$remove}var u=this.macros.transform(a,{get:function(t){return v.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,R.default(i,u),i.cust_params=D.default.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;return h&&((null==e||null===(n=e.contentType)||void 0===n?void 0:n.startsWith("image/"))||"text"===(null==e?void 0:e.contentType))&&("preroll"===h&&(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.t4r)||void 0===i?void 0:i.enabled)||"midroll"===h&&(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o||null===(d=o.t4r)||void 0===d?void 0:d.enabled)||"rewarded"===h&&(null===(u=this.gameData)||void 0===u||null===(c=u.rAds)||void 0===c||null===(l=c.t4r)||void 0===l?void 0:l.enabled))}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h,p,f,m;if(!e)return!1;var g="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.vmap)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(d=this.gameData)||void 0===d||null===(u=d.mAds)||void 0===u||null===(c=u.vmap)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!g)return!1;var v=this._get_vmap_config(e),y=this.adCounter[e];return void 0!==(null==v?void 0:v.start)?y>=(null==v?void 0:v.start):g}},{key:"_getT4ROptions",value:function(){var e,t,n,r,a,i,s;switch(null===(e=this._adrequest_user_context)||void 0===e?void 0:e.tnl_ad_pos){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.t4r;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.t4r;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.t4r}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,a=e.dp,i=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:a,d=null!=r&&r.vast_2?void 0:a;return{adtag_url_1:null==i?void 0:i.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:d}}},{key:"_get_vmap_config",value:function(e){var t,n,r,a,i,s,o,d;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.vmap;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(d=o.pAds)||void 0===d?void 0:d.vmap}}},{key:"_isDP",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h,p,f,m;return!!e&&("preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.dp)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.dp)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.dp)||!0===(null===(d=this.gameData)||void 0===d||null===(u=d.mAds)||void 0===u||null===(c=u.dp)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.dp)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.dp)||void 0===m?void 0:m.enabled)))}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(t){var n=this;v.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Tp(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(m.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return v.default(this,n),e.json()}.bind(this)).then(function(e){if(v.default(this,n),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),t();this.msgrt.send("dp.fp",{message:e.p/100}),t({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(i),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(i)})}.bind(this)).catch(function(e){v.default(this,n),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}}.bind(this))}},{key:"_create_dp_context",value:function(e){var t=this;return new Promise(function(){var n=_.default(E.default.mark((function n(r){var a,i,s,o,d,u=this;return E.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,t._isDP(e)){n.next=5;break}return t.msgrt.send("dp.na",{message:"rule"}),n.abrupt("return",r());case 5:i={id:t.topDomain||t.parentDomain,au:e||"unknown",ty:"video",aid:t.gameData.gameId,pgu:t.parentURL},(s=new Tp(t.gameData).checkCustomParams())&&(i.cp=s),o=encodeURIComponent(m.Base64.encode(JSON.stringify(i))),d=null===(a=t.gameData.promo)||void 0===a?void 0:a.rainbow,fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(o)).then(function(e){return v.default(this,u),e.json()}.bind(this)).then(function(e){if(v.default(this,u),!e||!e.p)return t.msgrt.send("dp.na",{message:"atom"}),r();var n=e.p/100;r({id:Date.now(),floor_price:n,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(o,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(o),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(o),promo_url:null!=d&&d.enabled?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(o):void 0,promo_imp_blue_url:null!=d&&d.enabled?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:null!=d&&d.enabled?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){v.default(this,u),t.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),r()}.bind(this)),n.next=17;break;case 13:n.prev=13,n.t0=n.catch(0),t.msgrt.send("dp.err",{message:(null===n.t0||void 0===n.t0?void 0:n.t0.message)||n.t0}),r();case 17:case"end":return n.stop()}}),n,this,[[0,13]])})));return function(e){return n.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t,n){if(e&&t&&n)try{var r,a=new T.default(t.vastUrl,!0);if(null===(r=a.query)||void 0===r||!r.cust_params)return;if(!D.default.parse(a.query.cust_params).tnl_asset_id)return;n.bidFloor,n.isDfpBidding;var i=k.default(n,Cp);a.query.cust_params=D.default.stringify(Lp(Lp({},i),{},{adsense:1}),!1),e.fallback_url=a.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(o=_.default(E.default.mark((function e(t){var n,r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),r=n[0],window.HB_OPTIONSgd={gameId:this.gameId},e.next=5,d.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return v.default(this,a),window.idhb}.bind(this)});case 5:window.idhb=window.idhb||{},window.idhb.que=window.idhb.que||[],window.idhb.que.push(function(){var e=this;v.default(this,a),window.idhb.addEventListener("slotRenderEnded",function(t){var n=this;v.default(this,e);try{var r,a=t.slotId.split("@");a=1===a.length?a[0]:a[1],t.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){v.default(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:a,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){v.default(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:a,status:"success"}))}catch(e){}}.bind(this))}.bind(this));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_ima_script",value:(s=_.default(E.default.mark((function e(t){var n,r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],r=this.options.debug?n[0]:n[1],e.next=4,d.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return v.default(this,a),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"_init_afg_script",value:(i=_.default(E.default.mark((function e(t){var n,r,a,i,s,o,u=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==(null===(n=this.gameData.sdk)||void 0===n||null===(r=n.afg)||void 0===r?void 0:r.enabled)){e.next=3;break}return e.abrupt("return");case 3:return(o={}).crossorigin="anonymous",o["data-ad-client"]=(null==t||null===(a=t.adsense_client)||void 0===a?void 0:a.length)>0?t.adsense_client:"ca-pub-2316275586951220",(null==t||null===(i=t.adsense_channel)||void 0===i?void 0:i.length)>0&&(o["data-ad-channel"]=t.adsense_channel),(null==t||null===(s=t.adsense_host)||void 0===s?void 0:s.length)>0&&(o["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(o["data-adbreak-test"]="on"),e.next=12,d.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return v.default(this,u),!!window.adsbygoogle}.bind(this),attrs:o});case 12:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"auto"});case 14:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementRewardedAd",value:(a=_.default(E.default.mark((function e(t){var n,r,a,i,s,o,d=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),n=function(){v.default(this,d),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){v.default(this,d),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){v.default(this,d),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){v.default(this,d),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){v.default(this,d),e()}.bind(this),o=function(e){v.default(this,d),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),t={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:r,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:o},window.adsbygoogle.push(t),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var t}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=_.default(E.default.mark((function e(t){var n,r=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(e){v.default(this,r),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"}),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),t={type:"preroll",adBreakDone:n},window.adsbygoogle.push(t),e.next=16;break;case 12:throw e.prev=12,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 16:case"end":return e.stop()}var t}),e,this,[[1,12]])}))),function(e){return r.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(n=_.default(E.default.mark((function e(t){var n,r,a,i=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(){v.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){v.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){v.default(this,i),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),t={type:"start",name:"start-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var t}),e,this,[[1,14]])}))),function(e){return n.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(t=_.default(E.default.mark((function e(t){var n,r,a,i=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),n=function(){v.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){v.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){v.default(this,i),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),t={type:"next",name:"next-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var t}),e,this,[[1,14]])}))),function(e){return t.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,a=n._ua,i={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:a.browser.name,brvs:a.browser.version,osnm:a.os.name,osvs:a.os.version,dvmd:a.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(m.Base64.encode(JSON.stringify(i)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t})}},{key:"_isAdPlacementNext",value:function(e){return e.adType,e.params,void 0!==e.adTimestamp}},{key:"_isAdPlacementStart",value:function(e){if(e.adType,e.params,void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}}]),e}(),Up=Array.isArray,Bp=Object.prototype.toString,Np=Up||function(e){return!!e&&"[object Array]"==Bp.call(e)},qp=Xn,Gp=X,Vp=dr,Fp=pn,Kp=un,Wp=J,zp=Mr,Hp=qe,$p=Tr("slice"),Qp=Hp("species"),Yp=[].slice,Jp=Math.max;qp({target:"Array",proto:!0,forced:!$p},{slice:function(e,t){var n,r,a,i=Wp(this),s=Kp(i.length),o=Fp(e,s),d=Fp(void 0===t?s:t,s);if(Vp(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Vp(n.prototype)?Gp(n)&&null===(n=n[Qp])&&(n=void 0):n=void 0,n===Array||void 0===n))return Yp.call(i,o,d);for(r=new(void 0===n?Array:n)(Jp(d-o,0)),a=0;o<d;o++,a++)o in i&&zp(r,a,i[o]);return r.length=a,r}});var Xp=ct,Zp=Sa,ef=sr,tf=ke,nf=function(e,t,n,r){try{return r?t(Xp(n)[0],n[1]):t(n)}catch(t){Zp(e,"throw",t)}},rf=ya,af=un,sf=Mr,of=Ta,df=Aa,uf=function(e){var t,n,r,a,i,s,o=tf(e),d="function"==typeof this?this:Array,u=arguments.length,c=u>1?arguments[1]:void 0,l=void 0!==c,h=df(o),p=0;if(l&&(c=ef(c,u>2?arguments[2]:void 0,2)),null==h||d==Array&&rf(h))for(n=new d(t=af(o.length));t>p;p++)s=l?c(o[p],p):o[p],sf(n,p,s);else for(i=(a=of(o,h)).next,n=new d;!(r=i.call(a)).done;p++)s=l?nf(a,c,[r.value,p],!0):r.value,sf(n,p,s);return n.length=p,n};Xn({target:"Array",stat:!0,forced:!Ka((function(e){Array.from(e)}))},{from:uf});var cf,lf,hf,pf=!L((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ff=Se,mf=ke,gf=pf,vf=Ct("IE_PROTO"),yf=Object.prototype,bf=gf?Object.getPrototypeOf:function(e){return e=mf(e),ff(e,vf)?e[vf]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?yf:null},_f=L,wf=bf,Af=yt,Ef=qe("iterator"),kf=!1;[].keys&&("next"in(hf=[].keys())?(lf=wf(wf(hf)))!==Object.prototype&&(cf=lf):kf=!0);var Tf=null==cf||_f((function(){var e={};return cf[Ef].call(e)!==e}));Tf&&(cf={}),"function"!=typeof cf[Ef]&&Af(cf,Ef,(function(){return this}));var xf={IteratorPrototype:cf,BUGGY_SAFARI_ITERATORS:kf},Sf=xf.IteratorPrototype,Df=Po,Rf=V,Of=da,If=fa,Cf=function(){return this},Pf=Xn,Lf=function(e,t,n){var r=t+" Iterator";return e.prototype=Df(Sf,{next:Rf(1,n)}),Of(e,r,!1),If[r]=Cf,e},jf=bf,Mf=aa,Uf=da,Bf=yt,Nf=bt.exports,qf=fa,Gf=xf.IteratorPrototype,Vf=xf.BUGGY_SAFARI_ITERATORS,Ff=qe("iterator"),Kf=function(){return this},Wf=function(e,t,n,r,a,i,s){Lf(n,t,r);var o,d,u,c=function(e){if(e===a&&m)return m;if(!Vf&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,p=e.prototype,f=p[Ff]||p["@@iterator"]||a&&p[a],m=!Vf&&f||c(a),g="Array"==t&&p.entries||f;if(g&&(o=jf(g.call(new e)))!==Object.prototype&&o.next&&(jf(o)!==Gf&&(Mf?Mf(o,Gf):"function"!=typeof o[Ff]&&Bf(o,Ff,Kf)),Uf(o,l,!0)),"values"==a&&f&&"values"!==f.name&&(h=!0,m=function(){return f.call(this)}),p[Ff]!==m&&Bf(p,Ff,m),qf[t]=m,a)if(d={values:c("values"),keys:i?m:c("keys"),entries:c("entries")},s)for(u in d)(Vf||h||!(u in p))&&Nf(p,u,d[u]);else Pf({target:t,proto:!0,forced:Vf||h},d);return d},zf=pc.charAt,Hf=lo,$f=Ht,Qf=Wf,Yf=$f.set,Jf=$f.getterFor("String Iterator");Qf(String,"String",(function(e){Yf(this,{type:"String Iterator",string:Hf(e),index:0})}),(function(){var e,t=Jf(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=zf(n,r),t.index+=e.length,{value:e,done:!1})})),Xc("iterator");var Xf=J,Zf=kh,em=fa,tm=Ht,nm=Wf,rm=tm.set,am=tm.getterFor("Array Iterator"),im=nm(Array,"Array",(function(e,t){rm(this,{type:"Array Iterator",target:Xf(e),index:0,kind:t})}),(function(){var e=am(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");em.Arguments=em.Array,Zf("keys"),Zf("values"),Zf("entries");var sm=C,om=Dd,dm=Id,um=im,cm=yt,lm=qe,hm=lm("iterator"),pm=lm("toStringTag"),fm=um.values,mm=function(e,t){if(e){if(e[hm]!==fm)try{cm(e,hm,fm)}catch(t){e[hm]=fm}if(e[pm]||cm(e,pm,t),om[t])for(var n in um)if(e[n]!==um[n])try{cm(e,n,um[n])}catch(t){e[n]=um[n]}}};for(var gm in om)mm(sm[gm]&&sm[gm].prototype,gm);function vm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ym(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ym(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function ym(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bm(Object(n),!0).forEach((function(t){b.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}mm(dm,"DOMTokenList");var wm={react:{src:"https://pm.gamedistribution.com/react/16.14.0/umd/react.production.min.js",name:"React"},"react-dom":{src:"https://pm.gamedistribution.com/react-dom/16.14.0/umd/react-dom.production.min.js",name:"ReactDOM"},redux:{src:"https://pm.gamedistribution.com/redux/4.0.5/dist/redux.min.js",name:"Redux"},"react-redux":{src:"https://pm.gamedistribution.com/react-redux/7.2.1/dist/react-redux.min.js",name:"ReactRedux"},"material-ui-core":{src:"https://pm.gamedistribution.com/@material-ui/core/4.11.3/umd/material-ui.production.min.js",name:"MaterialUI"}},Am={},Em=function(e,t){Am[e]=_m(_m({},t),{},{isLoading:!1})},km=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(v.default(this,t),document.getElementById(n))e();else{var i=document.createElement("script");i.onload=function(){e()},i.id=n,i.setAttribute("crossorigin",!0),i.src=r,document.head.appendChild(i)}}.bind(this))},Tm=function(){var e=_.default(E.default.mark((function e(t){var n,r,a,i,s,o,d,u;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(r=Am[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=vm(r.dependencies),e.prev=8,a.s();case 10:if((i=a.n()).done){e.next=26;break}if(s=i.value,e.prev=12,o=wm[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,km({id:s,src:wm[s].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),d=s.id,u=s.src,console.log("Could not load external script ".concat(d," ").concat(u),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,km({id:t,src:r.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(r.source,"."),e.t2);case 43:return r.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(t){return e.apply(this,arguments)}}(),xm=function e(t){var n=this;w.default(this,e),b.default(this,"load",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),b.default(this,"promo",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-stone-dynamic",a=t.package_version||"1.1.1",i=t.template||"puzzle",s=t.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},Em(this.moduleName,this.moduleConfig)},Sm=function e(t){var n=this;w.default(this,e),b.default(this,"load",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),b.default(this,"splash",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-air-dynamic",a=t.package_version||"1.2.0",i=t.template||"pluto",s=t.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},Em(this.moduleName,this.moduleConfig)},Dm=function(e,t){console.log(e,t)},Rm={},Om={},Im=null;function Cm(){for(var e,t=window,n=null,r=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(r=2,n=t.__tcfapi):(r=1,n=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){r=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){r=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return Rm.version=r,Rm.frame=e,Rm.function=n,Rm.version}function Pm(e){var t=this;return Im||(Im=new Promise(function(n){function r(t,r){if(Dm("Received a response from CMP",t),r){var a,i;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(i=(a=t)&&"boolean"==typeof a.gdprApplies?a.gdprApplies:e.defaultGdprScope)||!0===i&&"string"!=typeof a.tcString)&&n({result:"cmpUnexpectedResponse",cmp:Rm,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}v.default(this,t),Cm(),Rm.frame?2===Rm.version?(Dm("TCF v2 CMP found. Fetching the consent."),Rm.function?(Dm("CMP API is directly accessible, calling it now..."),Rm.function("addEventListener",Rm.version,r)):(Dm("CMP API is outside the current iframe, calling it now..."),function(e,t,n){var r=this,a="__tcfapi";function i(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==Om[r.callId]&&Om[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){v.default(this,r);var o=Math.random()+"",d="".concat(a,"Call"),u=b.default({},d,{command:e,parameter:s,callId:o,version:n});Om[o]=i,t.postMessage(u,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,Rm.version,n)}("addEventListener",Rm.frame,r))):n({result:"cmpVersionNotV2",cmp:Rm}):n({result:"cmpNotFound"})}.bind(this)),Im)}var Lm=new(function(){function e(){w.default(this,e),this.productName="Game Distribution"}var t;return A.default(e,[{key:"track",value:(t=_.default(E.default.mark((function e(t){var n,r,a,i,s,o;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null==t||null===(n=t.visitor)||void 0===n?void 0:n.visitorId){e.next=3;break}return e.abrupt("return");case 3:return a=encodeURIComponent(this.productName),i=encodeURIComponent(r),e.prev=5,s="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(a,"/user_id/").concat(i),e.next=9,fetch(s,{method:"POST"});case 9:e.next=25;break;case 12:return e.prev=12,e.t0=e.catch(5),console.log("GAME_DOCK. fail v4",e.t0),e.prev=15,o="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(a,"/user_id/").concat(i),e.next=19,fetch(o,{method:"POST"});case 19:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(15),console.log("GAME_DOCK. fail v6",e.t1);case 25:case"end":return e.stop()}}),e,this,[[5,12],[15,22]])}))),function(e){return t.apply(this,arguments)})}]),e}());function jm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jm(Object(n),!0).forEach((function(t){b.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Um=null,Bm=function(){function e(t){var n=this;if(w.default(this,e),Um)return Um;Um=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._parentURL=this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){v.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){v.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e=this;v.default(this,n),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),window.addEventListener("DOMNodeInserted",function(){if(v.default(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var t=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];t&&t.setAttribute("style","display:none")}}.bind(this)),this._checkFullscreen()}.bind(this))}var t,n,r,a,i,s,o,u,c,l;return A.default(e,[{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var e=Cm();console.log("CMP found",e),_.default(E.default.mark((function e(){var t;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm({});case 2:t=e.sent,console.log("After lookup IAB consent",t);case 4:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),n=this._isMasterGameURL();this._isLoaded=(e||t&&!n)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"}),this._initGamedockTracker(window.GamedockSDK,"gameplay")}catch(e){}}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(l=_.default(E.default.mark((function e(t,n){var r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:this._gameData=e.sent,this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(r=this._gameData.enableAds)||void 0===r?void 0:r.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){return v.default(this,a),console.error(e.message||e)}.bind(this))),this._sendSDKReady(),t(this._gameData),e.next=20;break;case 15:e.prev=15,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),n(e.t0);case 20:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e,t){return l.apply(this,arguments)})},{key:"_getDefaultOptions",value:function(){return{debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",onEvent:function(e){},onLoaderEvent:function(e){},flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onInit:function(e){},onError:function(e){},loader:{}}}},{key:"_extendDefaultOptions",value:function(e,t){var n=S.default(e);this.options=t?d.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=ap.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var t={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(D.default.stringify(t)))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=d.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,d.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!d.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(d.Ls.set("gd_debug_ex",!0),d.Ls.set("gd_disable_midroll_timer",!0),d.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(d.Ls.set("gd_debug_ex",!0),d.Ls.set("gd_disable_midroll_timer",!0)),d.Ls.getBoolean("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new d.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:d.getIframeDepth(),version:ap.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:d.getMobilePlatform(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var t=["https://cdn.gamedock.io/gamedock-web-tracker/4.3.0/script/gamedock-sdk.min.js"];d.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){v.default(this,e);var t=this._initGamedockTracker(window.GamedockSDK,"pageview");Lm.track(t)}.bind(this)).catch(function(t){v.default(this,e),this._sendSDKError(t)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e,t){if(!this._bridge.isCoreSDKMode){var n=e.initialize("gd",this._parentDomain);return n.tracking.trackEvent(t,{pageId:this.options.gameId,pageType:"game"}),n}}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var t=["https://ext.minijuegosgratis.com/external-host/main.js"];d.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){v.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];d.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return v.default(this,e),window.ga}.bind(this)}).then(function(){v.default(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(t){v.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new d.EventBus,d.SDKEvents.forEach(function(t){var n=this;return v.default(this,e),this.eventBus.subscribe(t,function(e){return v.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),d.IMAEvents.forEach(function(t){var n=this;return v.default(this,e),this.eventBus.subscribe(t,function(e){return v.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(v.default(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var t=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(t,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(t,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return v.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){v.default(this,e),this.msgrt.send("ad.impression")}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){v.default(this,e),this.msgrt.send("ad.error",{message:t.message,details:t.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(t){v.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){v.default(this,e),t.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:t.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:t.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(t){v.default(this,e),this.msgrt.send("tunnl.keys.empty",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(t){v.default(this,e),this.msgrt.send("tunnl.keys.fallback",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(t){return v.default(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(ap.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(c=_.default(E.default.mark((function e(){var t,n,r=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this._gameData,t=void 0===this._gameData.dmain||this._gameData.dmain,(n.bloc_gard&&!0===n.bloc_gard.enabled||!t)&&(this.msgrt.send("blocked"),setTimeout(function(){v.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(D.default.stringify({domain:this._parentDomain,id:n.gameId,img:this._get_game_thumbnail_url(),title:n.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){v.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;d.Ls.available&&d.Ls.getBoolean("gd_debug_ex")&&(d.Ls.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r=this._gameData,a=r.gdpr&&!0===r.gdpr.consent,i=r.loader,s=null===(e=r.promo)||void 0===e?void 0:e[null===(t=r.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];r.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled?null!=s&&s.enabled?this._createPromoBeforeSplash(r,a):i.enabled?this._createSplash(r,a):this.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"):i.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=s&&s.enabled?this._createPromoBeforeSplash(r,a):!1!==i.enabled&&this._createSplash(r,a):null!=s&&s.enabled&&this._createPromo(r,a))}},{key:"_initializeVideoAd",value:(u=_.default(E.default.mark((function e(){var t;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=d.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new d.Macros({game:t,bridge:this._bridge}),this.adInstance=new Mp(this.options.flashSettings.adContainerId,this.options.advertisementSettings,{parentURL:this._parentURL,parentDomain:this._parentDomain,topDomain:this._topDomain}),this.adInstance.gameId=t.gameId,this.adInstance.category=t.category,this.adInstance.tags=t.tags,this.adInstance.noPreroll=this._bridge.noPreroll,this.adInstance.macros=this.macros,this.adInstance.gameData=t,this.adInstance.msgrt=this.msgrt,this.adInstance.PackageJSON=ap,e.next=16,this.adInstance.start();case 16:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){d.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var e=this;return new Promise(function(t){var n=this;v.default(this,e);var r=this._getDefaultGameData(),a=this._getGameDataUrl();fetch(a).then(function(e){return v.default(this,n),e.json()}.bind(this)).then(function(e){if(v.default(this,n),e.success){var a,i=e.result.game,s={gameId:i.gameMd5,slug:i.slug,pname:i.pname,dname:i.dname,status:i.status,description:i.description,enableAds:!0===i.enableAds||!0===(null===(a=i.enableAds)||void 0===a?void 0:a.enabled),preroll:i.preRoll,midroll:6e4*i.timeAds,rewardedAds:i.rewardedAds,title:i.title,tags:i.tags,category:i.category,assets:i.assets,disp_2nd_prer:i.disp_2nd_prer,ctry_vst:i.ctry_vst,ctry:i.ctry,crtv:i.crtv,dmain:i.dmain,block_exts:this._parseAndSelectRandomOne(i.push_cuda),bloc_gard:this._parseAndSelectRandomOne(i.bloc_gard),cookie:this._parseAndSelectRandomOne(i.cookie),gdpr:this._parseAndSelectRandomOne(i.gdpr),diagnostic:this._parseAndSelectRandomOne(i.diagnostic),sdk:this._parseAndSelectRandomOne(i.sdk)||{},loader:this._parseAndSelectRandomOne(i.loader)||{},splash:this._parseAndSelectRandomOne(i.splash)||{},promo:this._parseAndSelectRandomOne(i.promo)||{},dAds:this._parseAndSelectRandomOne(i.dads)||{},pAds:this._parseAndSelectRandomOne(i.pads)||{},mAds:this._parseAndSelectRandomOne(i.mads)||{},rAds:this._parseAndSelectRandomOne(i.rads)||{}},o=d.extendDefaults(S.default(r),s);this._bridge.noPreroll=(!this._getisMobile()||!1!==o.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(o),d.setDankLog(o.diagnostic),t(o)}else r.failed=!0,t(r)}.bind(this)).catch(function(e){v.default(this,n),r.failed=!0,t(r)}.bind(this))}.bind(this))}},{key:"_createSplash",value:(o=_.default(E.default.mark((function e(t,n){var r,a,i=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:r=e.sent,(a=new r(Mm(Mm({},this.options),{},{isConsentDomain:n,version:ap.version}),t,this._parentDomain)).on("playClick",function(){var e=this;if(v.default(this,i),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this.showAd(d.AdType.Interstitial,{position:"preroll"}).catch(function(t){v.default(this,e)}.bind(this))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){v.default(this,i),a.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){v.default(this,i),a.hide()}.bind(this));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(s=_.default(E.default.mark((function e(t,n){var r,a,i,s,o=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Mm(Mm({},this.options),{},{isConsentDomain:n,version:ap.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){v.default(this,o),s.hide(),this._createSplash(t,n)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(t,n);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return s.apply(this,arguments)})},{key:"_createPromo",value:(i=_.default(E.default.mark((function e(t,n){var r,a,i,s,o=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Mm(Mm({},this.options),{},{isConsentDomain:n,version:ap.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){v.default(this,o),s.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return i.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(d.AdType.Interstitial).catch(function(){v.default(this,e)}.bind(this))}},{key:"showAd",value:(a=_.default(E.default.mark((function e(t,n){var r=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=_.default(E.default.mark((function e(a,i){var s,o,d,u,c,l=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s={adType:t,params:n,adTimestamp:r.adRequestTimer},e.next=4,r.sdkReady;case 4:return o=e.sent,e.next=7,r.videoAdReady;case 7:return r._sendLoadedEvent(),r.rejectAdIfGameBlocked({gameData:o,adRequest:s}),r.rejectAdIfAdDisabled({gameData:o,adRequest:s}),r.rejectAdIfUnsupportedType({adRequest:s}),r.rejectAdIfRewardedDisabled({gameData:o,adRequest:s}),r.rejectAdIfAdRateHits({gameData:o,adRequest:s}),d="main.showad",u=function(e){v.default(this,l),r.eventBus.unsubscribeScope(d),r.onResumeGame(e.message,"warning"),i(e.message)}.bind(this),c=function(e){v.default(this,l),r.eventBus.unsubscribeScope(d),r.adRequestTimer=Date.now(),r.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),a(e.message)}.bind(this),r.eventBus.subscribe("AD_ERROR",u,d),r.eventBus.subscribe("AD_SDK_CANCELED",u,d),r.eventBus.subscribe("AD_SUCCESS",c,d),e.next=21,r.adInstance.startAd(s);case 21:r._post_message({topic:"adrequest.instream"}),e.next=28;break;case 24:e.prev=24,e.t0=e.catch(0),r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 28:case"end":return e.stop()}}),e,this,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return a.apply(this,arguments)})},{key:"rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==d.AdType.Interstitial&&t.adType!==d.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=d.AdType.Interstitial}},{key:"rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===d.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"rejectAdIfAdRateHits",value:function(e){var t=e.gameData;if(e.adRequest.adType===d.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<t.midroll)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=_.default(E.default.mark((function e(t){var n=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=_.default(E.default.mark((function e(r,a){var i,s;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return i=e.sent,e.next=6,n.videoAdReady;case 6:if(!i.bloc_gard||!0!==i.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(i.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=d.AdType.Rewarded,e.next=16;break;case 14:if(t===d.AdType.Interstitial||t===d.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==d.AdType.Rewarded||i.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:s=e.sent,r(s),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"cancelAd",value:(n=_.default(E.default.mark((function e(){var t=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=_.default(E.default.mark((function e(n,r){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.adInstance.cancel(),t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),r()}catch(e){t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var t=this;return new Promise(function(){var n=_.default(E.default.mark((function n(r,a){var i;return E.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return i=n.sent,n.next=6,t.videoAdReady;case 6:if(!i.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:a("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),a(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_START";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"onPauseGame",value:function(e,t){this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_PAUSE";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"openConsole",value:function(){try{new d.ImplementationTest(this).start(),d.Ls.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var t=this._gameData;t.sdk.fullscreen&&"auto"===t.sdk.fullscreen&&document.addEventListener("click",function(){if(v.default(this,e),!this._isFullScreen){var t=document.body,n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullscreen;if(n)n.call(t);else if(void 0!==window.ActiveXObject){var r=new ActiveXObject("WScript.Shell");null!==r&&r.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var t=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){v.default(this,t),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var t=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var n=this;v.default(this,t);var r=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),r||(e.onclick=function(e){return v.default(this,n),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var a=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:d.getParentUrl()),i=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:d.getParentDomain()),s=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:d.getTopDomain()),o=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:o,noLoadedEvent:u,noBlockerEvent:c,noPreroll:m,parentURL:a,parentDomain:i,topDomain:s&&s.length?s:i,noGAPageView:l,noLotamePageView:h,noGamedockSDK:p,noMinijuegosSDK:f,version:r.version,pauseGameOnStartup:g,depth:d.getIframeDepth(),domainMatched:i===s,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new T.default(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new T.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new T.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(m.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Sm(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=_.default(E.default.mark((function e(t){var n,r,a,i,s;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null===(n=t.promo)||void 0===n?void 0:n[null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll],s=new xm(i),e.abrupt("return",s.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(m.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new T.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(D.default.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new T.default(e,!0);return n.query=Mm(Mm({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return m.Base64.encode(JSON.stringify(e))}},{key:"_parseAndSelectRandomOne",value:function(e){var t=this._selectRandomOne("object"===y.default(e)?e:d.parseJSON(e));return t&&t.version?ap.version>=t.version?t:void 0:t}},{key:"_selectRandomOne",value:function(e){var t=this;if(!Np(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){v.default(this,t),e.weight=e.weight||1,n+=e.weight}.bind(this));var r=Math.floor(Math.random()*Math.floor(n));n=0;for(var a=0;a<e.length;a++){var i=e[a];if(r<(n+=i.weight))return i}}},{key:"session",value:function(){var e=this;return new Promise(function(){var t=_.default(E.default.mark((function t(n,r){var a;return E.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sdkReady;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:a=e._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:e._bridge.parentDomain,topDomain:e._bridge.topDomain,parentURL:e._bridge.parentURL,depth:e._bridge.depth,loadedByGameZone:e._bridge.isTokenGameURL}});case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,n){return t.apply(this,arguments)}}())}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,t=this._gameData,n=t.assets.find(function(t){return v.default(this,e),t.hasOwnProperty("name")&&512===t.width&&512===t.height}.bind(this));return n||(n=t.assets.length>0?t.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(n.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,a=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var i=window.top||window.parent;i&&i.postMessage({source:"gdsdk",topic:n,data:r},a)}catch(e){console.error((null==e?void 0:e.message)||e)}}}]),e}(),Nm=new function e(){var t=this;w.default(this,e),b.default(this,"load",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tm("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),b.default(this,"showLeaderboard",function(){var e=_.default(E.default.mark((function e(n){var r;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=window.GD_OPTIONS.gameId,t.leaderboard){e.next=4;break}return e.next=4,t.load();case 4:t.leaderboard.showLeaderBoard(r,n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),b.default(this,"addScore",function(){var e=_.default(E.default.mark((function e(n){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.leaderboard){e.next=3;break}return e.next=3,t.load();case 3:t.leaderboard.addScore(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Em(this.moduleName,this.moduleConfig)},qm=new Bm(function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":y.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===y.default(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}());function Gm(){var e=this;this.AdType=d.AdType,this.preloadAd=function(e){return qm.preloadAd(e)},this.showAd=function(e,t){return e===d.AdType.Display?qm.showDisplayAd(t):qm.showAd(e)},this.cancelAd=function(){return qm.cancelAd()},this.openConsole=function(){qm.openConsole()},this.getSession=function(){return qm.session()},this.leaderboard={show:function(){v.default(this,e),Nm.showLeaderboard()}.bind(this),addScore:function(t){v.default(this,e),Nm.addScore(t)}.bind(this)}}Gm.prototype=new function(){this.showBanner=function(){qm.showBanner()},this.play=function(){},this.customLog=function(){}},window.gdsdk=new Gm,window.gdApi=window.gdsdk;
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/newArrowCheck"),t=require("@babel/runtime/helpers/typeof"),n=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/asyncToGenerator"),a=require("@babel/runtime/helpers/classCallCheck"),i=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/regenerator"),o=require("@babel/runtime/helpers/objectWithoutProperties"),d=require("@bygd/gd-sdk-era/dist/default"),u=require("url-parse"),c=require("can-autoplay"),l=require("is-plain-object"),h=require("lodash.clonedeep"),p=require("querystringify"),f=require("lodash.merge"),m=require("js-base64");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=g(e),y=g(t),b=g(n),_=g(r),w=g(a),A=g(i),E=g(s),k=g(o),T=g(u),x=g(c),S=g(h),D=g(p),R=g(f),O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},I=function(e){return e&&e.Math==Math&&e},C=I("object"==typeof globalThis&&globalThis)||I("object"==typeof window&&window)||I("object"==typeof self&&self)||I("object"==typeof O&&O)||function(){return this}()||Function("return this")(),P={},L=function(e){try{return!!e()}catch(e){return!0}},j=!L((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),M={},U={}.propertyIsEnumerable,B=Object.getOwnPropertyDescriptor,N=B&&!U.call({1:2},1);M.f=N?function(e){var t=B(this,e);return!!t&&t.enumerable}:U;var q,G,V=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},F={}.toString,K=function(e){return F.call(e).slice(8,-1)},W=K,z="".split,H=L((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==W(e)?z.call(e,""):Object(e)}:Object,$=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},Q=H,Y=$,J=function(e){return Q(Y(e))},X=function(e){return"object"==typeof e?null!==e:"function"==typeof e},Z=C,ee=function(e){return"function"==typeof e?e:void 0},te=function(e,t){return arguments.length<2?ee(Z[e]):Z[e]&&Z[e][t]},ne=te("navigator","userAgent")||"",re=C,ae=ne,ie=re.process,se=re.Deno,oe=ie&&ie.versions||se&&se.version,de=oe&&oe.v8;de?G=(q=de.split("."))[0]<4?1:q[0]+q[1]:ae&&(!(q=ae.match(/Edge\/(\d+)/))||q[1]>=74)&&(q=ae.match(/Chrome\/(\d+)/))&&(G=q[1]);var ue=G&&+G,ce=ue,le=L,he=!!Object.getOwnPropertySymbols&&!le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ce&&ce<41})),pe=he&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,fe=te,me=pe?function(e){return"symbol"==typeof e}:function(e){var t=fe("Symbol");return"function"==typeof t&&Object(e)instanceof t},ge=X,ve={exports:{}},ye=C,be=function(e,t){try{Object.defineProperty(ye,e,{value:t,configurable:!0,writable:!0})}catch(n){ye[e]=t}return t},_e=be,we=C["__core-js_shared__"]||_e("__core-js_shared__",{}),Ae=we;(ve.exports=function(e,t){return Ae[e]||(Ae[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.17.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var Ee=$,ke=function(e){return Object(Ee(e))},Te=ke,xe={}.hasOwnProperty,Se=Object.hasOwn||function(e,t){return xe.call(Te(e),t)},De=0,Re=Math.random(),Oe=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++De+Re).toString(36)},Ie=C,Ce=ve.exports,Pe=Se,Le=Oe,je=he,Me=pe,Ue=Ce("wks"),Be=Ie.Symbol,Ne=Me?Be:Be&&Be.withoutSetter||Le,qe=function(e){return Pe(Ue,e)&&(je||"string"==typeof Ue[e])||(je&&Pe(Be,e)?Ue[e]=Be[e]:Ue[e]=Ne("Symbol."+e)),Ue[e]},Ge=X,Ve=me,Fe=function(e,t){var n,r;if("string"===t&&"function"==typeof(n=e.toString)&&!ge(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!ge(r=n.call(e)))return r;if("string"!==t&&"function"==typeof(n=e.toString)&&!ge(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Ke=qe("toPrimitive"),We=function(e,t){if(!Ge(e)||Ve(e))return e;var n,r=e[Ke];if(void 0!==r){if(void 0===t&&(t="default"),n=r.call(e,t),!Ge(n)||Ve(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),Fe(e,t)},ze=me,He=function(e){var t=We(e,"string");return ze(t)?t:String(t)},$e=X,Qe=C.document,Ye=$e(Qe)&&$e(Qe.createElement),Je=function(e){return Ye?Qe.createElement(e):{}},Xe=Je,Ze=!j&&!L((function(){return 7!=Object.defineProperty(Xe("div"),"a",{get:function(){return 7}}).a})),et=j,tt=M,nt=V,rt=J,at=He,it=Se,st=Ze,ot=Object.getOwnPropertyDescriptor;P.f=et?ot:function(e,t){if(e=rt(e),t=at(t),st)try{return ot(e,t)}catch(e){}if(it(e,t))return nt(!tt.f.call(e,t),e[t])};var dt={},ut=X,ct=function(e){if(!ut(e))throw TypeError(String(e)+" is not an object");return e},lt=j,ht=Ze,pt=ct,ft=He,mt=Object.defineProperty;dt.f=lt?mt:function(e,t,n){if(pt(e),t=ft(t),pt(n),ht)try{return mt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var gt=dt,vt=V,yt=j?function(e,t,n){return gt.f(e,t,vt(1,n))}:function(e,t,n){return e[t]=n,e},bt={exports:{}},_t=we,wt=Function.toString;"function"!=typeof _t.inspectSource&&(_t.inspectSource=function(e){return wt.call(e)});var At,Et,kt,Tt=_t.inspectSource,xt=Tt,St=C.WeakMap,Dt="function"==typeof St&&/native code/.test(xt(St)),Rt=ve.exports,Ot=Oe,It=Rt("keys"),Ct=function(e){return It[e]||(It[e]=Ot(e))},Pt={},Lt=Dt,jt=X,Mt=yt,Ut=Se,Bt=we,Nt=Ct,qt=Pt,Gt=C.WeakMap;if(Lt||Bt.state){var Vt=Bt.state||(Bt.state=new Gt),Ft=Vt.get,Kt=Vt.has,Wt=Vt.set;At=function(e,t){if(Kt.call(Vt,e))throw new TypeError("Object already initialized");return t.facade=e,Wt.call(Vt,e,t),t},Et=function(e){return Ft.call(Vt,e)||{}},kt=function(e){return Kt.call(Vt,e)}}else{var zt=Nt("state");qt[zt]=!0,At=function(e,t){if(Ut(e,zt))throw new TypeError("Object already initialized");return t.facade=e,Mt(e,zt,t),t},Et=function(e){return Ut(e,zt)?e[zt]:{}},kt=function(e){return Ut(e,zt)}}var Ht={set:At,get:Et,has:kt,enforce:function(e){return kt(e)?Et(e):At(e,{})},getterFor:function(e){return function(t){var n;if(!jt(t)||(n=Et(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},$t=C,Qt=yt,Yt=Se,Jt=be,Xt=Tt,Zt=Ht.get,en=Ht.enforce,tn=String(String).split("String");(bt.exports=function(e,t,n,r){var a,i=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||Yt(n,"name")||Qt(n,"name",t),(a=en(n)).source||(a.source=tn.join("string"==typeof t?t:""))),e!==$t?(i?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:Qt(e,t,n)):s?e[t]=n:Jt(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Zt(this).source||Xt(this)}));var nn={},rn=Math.ceil,an=Math.floor,sn=function(e){return isNaN(e=+e)?0:(e>0?an:rn)(e)},on=sn,dn=Math.min,un=function(e){return e>0?dn(on(e),9007199254740991):0},cn=sn,ln=Math.max,hn=Math.min,pn=function(e,t){var n=cn(e);return n<0?ln(n+t,0):hn(n,t)},fn=J,mn=un,gn=pn,vn=function(e){return function(t,n,r){var a,i=fn(t),s=mn(i.length),o=gn(r,s);if(e&&n!=n){for(;s>o;)if((a=i[o++])!=a)return!0}else for(;s>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},yn={includes:vn(!0),indexOf:vn(!1)},bn=Se,_n=J,wn=yn.indexOf,An=Pt,En=function(e,t){var n,r=_n(e),a=0,i=[];for(n in r)!bn(An,n)&&bn(r,n)&&i.push(n);for(;t.length>a;)bn(r,n=t[a++])&&(~wn(i,n)||i.push(n));return i},kn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Tn=En,xn=kn.concat("length","prototype");nn.f=Object.getOwnPropertyNames||function(e){return Tn(e,xn)};var Sn={};Sn.f=Object.getOwnPropertySymbols;var Dn=nn,Rn=Sn,On=ct,In=te("Reflect","ownKeys")||function(e){var t=Dn.f(On(e)),n=Rn.f;return n?t.concat(n(e)):t},Cn=Se,Pn=In,Ln=P,jn=dt,Mn=function(e,t){for(var n=Pn(t),r=jn.f,a=Ln.f,i=0;i<n.length;i++){var s=n[i];Cn(e,s)||r(e,s,a(t,s))}},Un=L,Bn=/#|\.prototype\./,Nn=function(e,t){var n=Gn[qn(e)];return n==Fn||n!=Vn&&("function"==typeof t?Un(t):!!t)},qn=Nn.normalize=function(e){return String(e).replace(Bn,".").toLowerCase()},Gn=Nn.data={},Vn=Nn.NATIVE="N",Fn=Nn.POLYFILL="P",Kn=Nn,Wn=C,zn=P.f,Hn=yt,$n=bt.exports,Qn=be,Yn=Mn,Jn=Kn,Xn=function(e,t){var n,r,a,i,s,o=e.target,d=e.global,u=e.stat;if(n=d?Wn:u?Wn[o]||Qn(o,{}):(Wn[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=zn(n,r))&&s.value:n[r],!Jn(d?r:o+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;Yn(i,a)}(e.sham||a&&a.sham)&&Hn(i,"sham",!0),$n(n,r,i,e)}},Zn=En,er=kn,tr=Object.keys||function(e){return Zn(e,er)},nr=ke,rr=tr;Xn({target:"Object",stat:!0,forced:L((function(){rr(1)}))},{keys:function(e){return rr(nr(e))}});var ar=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},ir=ar,sr=function(e,t,n){if(ir(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}},or=K,dr=Array.isArray||function(e){return"Array"==or(e)},ur=X,cr=dr,lr=qe("species"),hr=function(e){var t;return cr(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!cr(t.prototype)?ur(t)&&null===(t=t[lr])&&(t=void 0):t=void 0),void 0===t?Array:t},pr=function(e,t){return new(hr(e))(0===t?0:t)},fr=sr,mr=H,gr=ke,vr=un,yr=pr,br=[].push,_r=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=7==e,o=5==e||i;return function(d,u,c,l){for(var h,p,f=gr(d),m=mr(f),g=fr(u,c,3),v=vr(m.length),y=0,b=l||yr,_=t?b(d,v):n||s?b(d,0):void 0;v>y;y++)if((o||y in m)&&(p=g(h=m[y],y,f),e))if(t)_[y]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:br.call(_,h)}else switch(e){case 4:return!1;case 7:br.call(_,h)}return i?-1:r||a?a:_}},wr={forEach:_r(0),map:_r(1),filter:_r(2),some:_r(3),every:_r(4),find:_r(5),findIndex:_r(6),filterReject:_r(7)},Ar=L,Er=ue,kr=qe("species"),Tr=function(e){return Er>=51||!Ar((function(){var t=[];return(t.constructor={})[kr]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},xr=wr.filter;Xn({target:"Array",proto:!0,forced:!Tr("filter")},{filter:function(e){return xr(this,e,arguments.length>1?arguments[1]:void 0)}});var Sr=Xn,Dr=L,Rr=J,Or=P.f,Ir=j,Cr=Dr((function(){Or(1)}));Sr({target:"Object",stat:!0,forced:!Ir||Cr,sham:!Ir},{getOwnPropertyDescriptor:function(e,t){return Or(Rr(e),t)}});var Pr=He,Lr=dt,jr=V,Mr=function(e,t,n){var r=Pr(t);r in e?Lr.f(e,r,jr(0,n)):e[r]=n},Ur=In,Br=J,Nr=P,qr=Mr;Xn({target:"Object",stat:!0,sham:!j},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Br(e),a=Nr.f,i=Ur(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&qr(s,t,n);return s}});var Gr={};Gr[qe("toStringTag")]="z";var Vr="[object z]"===String(Gr),Fr=Vr,Kr=K,Wr=qe("toStringTag"),zr="Arguments"==Kr(function(){return arguments}()),Hr=Fr?Kr:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Wr))?n:zr?Kr(t):"Object"==(r=Kr(t))&&"function"==typeof t.callee?"Arguments":r},$r=Hr,Qr=Vr?{}.toString:function(){return"[object "+$r(this)+"]"},Yr=Vr,Jr=bt.exports,Xr=Qr;Yr||Jr(Object.prototype,"toString",Xr,{unsafe:!0});var Zr=C.Promise,ea=bt.exports,ta=X,na=ct,ra=function(e){if(!ta(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},aa=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return na(n),ra(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),ia=dt.f,sa=Se,oa=qe("toStringTag"),da=function(e,t,n){e&&!sa(e=n?e:e.prototype,oa)&&ia(e,oa,{configurable:!0,value:t})},ua=te,ca=dt,la=j,ha=qe("species"),pa=function(e){var t=ua(e),n=ca.f;la&&t&&!t[ha]&&n(t,ha,{configurable:!0,get:function(){return this}})},fa={},ma=fa,ga=qe("iterator"),va=Array.prototype,ya=function(e){return void 0!==e&&(ma.Array===e||va[ga]===e)},ba=Hr,_a=fa,wa=qe("iterator"),Aa=function(e){if(null!=e)return e[wa]||e["@@iterator"]||_a[ba(e)]},Ea=ct,ka=Aa,Ta=function(e,t){var n=arguments.length<2?ka(e):t;if("function"!=typeof n)throw TypeError(String(e)+" is not iterable");return Ea(n.call(e))},xa=ct,Sa=function(e,t,n){var r,a;xa(e);try{if(void 0===(r=e.return)){if("throw"===t)throw n;return n}r=r.call(e)}catch(e){a=!0,r=e}if("throw"===t)throw n;if(a)throw r;return xa(r),n},Da=ct,Ra=ya,Oa=un,Ia=sr,Ca=Ta,Pa=Aa,La=Sa,ja=function(e,t){this.stopped=e,this.result=t},Ma=qe("iterator"),Ua=!1;try{var Ba=0,Na={next:function(){return{done:!!Ba++}},return:function(){Ua=!0}};Na[Ma]=function(){return this},Array.from(Na,(function(){throw 2}))}catch(e){}var qa,Ga,Va,Fa,Ka=function(e,t){if(!t&&!Ua)return!1;var n=!1;try{var r={};r[Ma]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Wa=ct,za=ar,Ha=qe("species"),$a=function(e,t){var n,r=Wa(e).constructor;return void 0===r||null==(n=Wa(r)[Ha])?t:za(n)},Qa=te("document","documentElement"),Ya=/(?:ipad|iphone|ipod).*applewebkit/i.test(ne),Ja="process"==K(C.process),Xa=C,Za=L,ei=sr,ti=Qa,ni=Je,ri=Ya,ai=Ja,ii=Xa.setImmediate,si=Xa.clearImmediate,oi=Xa.process,di=Xa.MessageChannel,ui=Xa.Dispatch,ci=0,li={};try{qa=Xa.location}catch(e){}var hi=function(e){if(li.hasOwnProperty(e)){var t=li[e];delete li[e],t()}},pi=function(e){return function(){hi(e)}},fi=function(e){hi(e.data)},mi=function(e){Xa.postMessage(String(e),qa.protocol+"//"+qa.host)};ii&&si||(ii=function(e){for(var t=[],n=arguments.length,r=1;n>r;)t.push(arguments[r++]);return li[++ci]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Ga(ci),ci},si=function(e){delete li[e]},ai?Ga=function(e){oi.nextTick(pi(e))}:ui&&ui.now?Ga=function(e){ui.now(pi(e))}:di&&!ri?(Fa=(Va=new di).port2,Va.port1.onmessage=fi,Ga=ei(Fa.postMessage,Fa,1)):Xa.addEventListener&&"function"==typeof postMessage&&!Xa.importScripts&&qa&&"file:"!==qa.protocol&&!Za(mi)?(Ga=mi,Xa.addEventListener("message",fi,!1)):Ga="onreadystatechange"in ni("script")?function(e){ti.appendChild(ni("script")).onreadystatechange=function(){ti.removeChild(this),hi(e)}}:function(e){setTimeout(pi(e),0)});var gi,vi,yi,bi,_i,wi,Ai,Ei,ki={set:ii,clear:si},Ti=C,xi=/ipad|iphone|ipod/i.test(ne)&&void 0!==Ti.Pebble,Si=/web0s(?!.*chrome)/i.test(ne),Di=C,Ri=P.f,Oi=ki.set,Ii=Ya,Ci=xi,Pi=Si,Li=Ja,ji=Di.MutationObserver||Di.WebKitMutationObserver,Mi=Di.document,Ui=Di.process,Bi=Di.Promise,Ni=Ri(Di,"queueMicrotask"),qi=Ni&&Ni.value;qi||(gi=function(){var e,t;for(Li&&(e=Ui.domain)&&e.exit();vi;){t=vi.fn,vi=vi.next;try{t()}catch(e){throw vi?bi():yi=void 0,e}}yi=void 0,e&&e.enter()},Ii||Li||Pi||!ji||!Mi?!Ci&&Bi&&Bi.resolve?((Ai=Bi.resolve(void 0)).constructor=Bi,Ei=Ai.then,bi=function(){Ei.call(Ai,gi)}):bi=Li?function(){Ui.nextTick(gi)}:function(){Oi.call(Di,gi)}:(_i=!0,wi=Mi.createTextNode(""),new ji(gi).observe(wi,{characterData:!0}),bi=function(){wi.data=_i=!_i}));var Gi=qi||function(e){var t={fn:e,next:void 0};yi&&(yi.next=t),vi||(vi=t,bi()),yi=t},Vi={},Fi=ar,Ki=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=Fi(t),this.reject=Fi(n)};Vi.f=function(e){return new Ki(e)};var Wi,zi,Hi,$i,Qi=ct,Yi=X,Ji=Vi,Xi=function(e,t){if(Qi(e),Yi(t)&&t.constructor===e)return t;var n=Ji.f(e);return(0,n.resolve)(t),n.promise},Zi=C,es="object"==typeof window,ts=Xn,ns=C,rs=te,as=Zr,is=bt.exports,ss=function(e,t,n){for(var r in t)ea(e,r,t[r],n);return e},os=aa,ds=da,us=pa,cs=X,ls=ar,hs=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},ps=Tt,fs=function(e,t,n){var r,a,i,s,o,d,u,c=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=Ia(t,c,1+l+p),m=function(e){return r&&La(r,"normal",e),new ja(!0,e)},g=function(e){return l?(Da(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if("function"!=typeof(a=Pa(e)))throw TypeError("Target is not iterable");if(Ra(a)){for(i=0,s=Oa(e.length);s>i;i++)if((o=g(e[i]))&&o instanceof ja)return o;return new ja(!1)}r=Ca(e,a)}for(d=r.next;!(u=d.call(r)).done;){try{o=g(u.value)}catch(e){La(r,"throw",e)}if("object"==typeof o&&o&&o instanceof ja)return o}return new ja(!1)},ms=Ka,gs=$a,vs=ki.set,ys=Gi,bs=Xi,_s=function(e,t){var n=Zi.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},ws=Vi,As=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Es=Ht,ks=Kn,Ts=es,xs=Ja,Ss=ue,Ds=qe("species"),Rs="Promise",Os=Es.get,Is=Es.set,Cs=Es.getterFor(Rs),Ps=as&&as.prototype,Ls=as,js=Ps,Ms=ns.TypeError,Us=ns.document,Bs=ns.process,Ns=ws.f,qs=Ns,Gs=!!(Us&&Us.createEvent&&ns.dispatchEvent),Vs="function"==typeof PromiseRejectionEvent,Fs=!1,Ks=ks(Rs,(function(){var e=ps(Ls),t=e!==String(Ls);if(!t&&66===Ss)return!0;if(Ss>=51&&/native code/.test(e))return!1;var n=new Ls((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Ds]=r,!(Fs=n.then((function(){}))instanceof r)||!t&&Ts&&!Vs})),Ws=Ks||!ms((function(e){Ls.all(e).catch((function(){}))})),zs=function(e){var t;return!(!cs(e)||"function"!=typeof(t=e.then))&&t},Hs=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;ys((function(){for(var r=e.value,a=1==e.state,i=0;n.length>i;){var s,o,d,u=n[i++],c=a?u.ok:u.fail,l=u.resolve,h=u.reject,p=u.domain;try{c?(a||(2===e.rejection&&Js(e),e.rejection=1),!0===c?s=r:(p&&p.enter(),s=c(r),p&&(p.exit(),d=!0)),s===u.promise?h(Ms("Promise-chain cycle")):(o=zs(s))?o.call(s,l,h):l(s)):h(r)}catch(e){p&&!d&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Qs(e)}))}},$s=function(e,t,n){var r,a;Gs?((r=Us.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),ns.dispatchEvent(r)):r={promise:t,reason:n},!Vs&&(a=ns["on"+e])?a(r):"unhandledrejection"===e&&_s("Unhandled promise rejection",n)},Qs=function(e){vs.call(ns,(function(){var t,n=e.facade,r=e.value;if(Ys(e)&&(t=As((function(){xs?Bs.emit("unhandledRejection",r,n):$s("unhandledrejection",n,r)})),e.rejection=xs||Ys(e)?2:1,t.error))throw t.value}))},Ys=function(e){return 1!==e.rejection&&!e.parent},Js=function(e){vs.call(ns,(function(){var t=e.facade;xs?Bs.emit("rejectionHandled",t):$s("rejectionhandled",t,e.value)}))},Xs=function(e,t,n){return function(r){e(t,r,n)}},Zs=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Hs(e,!0))},eo=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Ms("Promise can't be resolved itself");var r=zs(t);r?ys((function(){var n={done:!1};try{r.call(t,Xs(eo,n,e),Xs(Zs,n,e))}catch(t){Zs(n,t,e)}})):(e.value=t,e.state=1,Hs(e,!1))}catch(t){Zs({done:!1},t,e)}}};if(Ks&&(js=(Ls=function(e){hs(this,Ls,Rs),ls(e),Wi.call(this);var t=Os(this);try{e(Xs(eo,t),Xs(Zs,t))}catch(e){Zs(t,e)}}).prototype,(Wi=function(e){Is(this,{type:Rs,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=ss(js,{then:function(e,t){var n=Cs(this),r=Ns(gs(this,Ls));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=xs?Bs.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Hs(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),zi=function(){var e=new Wi,t=Os(e);this.promise=e,this.resolve=Xs(eo,t),this.reject=Xs(Zs,t)},ws.f=Ns=function(e){return e===Ls||e===Hi?new zi(e):qs(e)},"function"==typeof as&&Ps!==Object.prototype)){$i=Ps.then,Fs||(is(Ps,"then",(function(e,t){var n=this;return new Ls((function(e,t){$i.call(n,e,t)})).then(e,t)}),{unsafe:!0}),is(Ps,"catch",js.catch,{unsafe:!0}));try{delete Ps.constructor}catch(e){}os&&os(Ps,js)}ts({global:!0,wrap:!0,forced:Ks},{Promise:Ls}),ds(Ls,Rs,!1),us(Rs),Hi=rs(Rs),ts({target:Rs,stat:!0,forced:Ks},{reject:function(e){var t=Ns(this);return t.reject.call(void 0,e),t.promise}}),ts({target:Rs,stat:!0,forced:Ks},{resolve:function(e){return bs(this,e)}}),ts({target:Rs,stat:!0,forced:Ws},{all:function(e){var t=this,n=Ns(t),r=n.resolve,a=n.reject,i=As((function(){var n=ls(t.resolve),i=[],s=0,o=1;fs(e,(function(e){var d=s++,u=!1;i.push(void 0),o++,n.call(t,e).then((function(e){u||(u=!0,i[d]=e,--o||r(i))}),a)})),--o||r(i)}));return i.error&&a(i.value),n.promise},race:function(e){var t=this,n=Ns(t),r=n.reject,a=As((function(){var a=ls(t.resolve);fs(e,(function(e){a.call(t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var to=Xn,no=Zr,ro=L,ao=te,io=$a,so=Xi,oo=bt.exports;if(to({target:"Promise",proto:!0,real:!0,forced:!!no&&ro((function(){no.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=io(this,ao("Promise")),n="function"==typeof e;return this.then(n?function(n){return so(t,e()).then((function(){return n}))}:e,n?function(n){return so(t,e()).then((function(){throw n}))}:e)}}),"function"==typeof no){var uo=ao("Promise").prototype.finally;no.prototype.finally!==uo&&oo(no.prototype,"finally",uo,{unsafe:!0})}var co=me,lo=function(e){if(co(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},ho=ct,po=function(){var e=ho(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},fo={},mo=L,go=C.RegExp;fo.UNSUPPORTED_Y=mo((function(){var e=go("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),fo.BROKEN_CARET=mo((function(){var e=go("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var vo,yo=dt,bo=ct,_o=tr,wo=j?Object.defineProperties:function(e,t){bo(e);for(var n,r=_o(t),a=r.length,i=0;a>i;)yo.f(e,n=r[i++],t[n]);return e},Ao=ct,Eo=wo,ko=kn,To=Pt,xo=Qa,So=Je,Do=Ct("IE_PROTO"),Ro=function(){},Oo=function(e){return"<script>"+e+"<\/script>"},Io=function(e){e.write(Oo("")),e.close();var t=e.parentWindow.Object;return e=null,t},Co=function(){try{vo=new ActiveXObject("htmlfile")}catch(e){}var e,t;Co="undefined"!=typeof document?document.domain&&vo?Io(vo):((t=So("iframe")).style.display="none",xo.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Oo("document.F=Object")),e.close(),e.F):Io(vo);for(var n=ko.length;n--;)delete Co.prototype[ko[n]];return Co()};To[Do]=!0;var Po=Object.create||function(e,t){var n;return null!==e?(Ro.prototype=Ao(e),n=new Ro,Ro.prototype=null,n[Do]=e):n=Co(),void 0===t?n:Eo(n,t)},Lo=L,jo=C.RegExp,Mo=Lo((function(){var e=jo(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Uo=L,Bo=C.RegExp,No=Uo((function(){var e=Bo("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),qo=lo,Go=po,Vo=fo,Fo=ve.exports,Ko=Po,Wo=Ht.get,zo=Mo,Ho=No,$o=RegExp.prototype.exec,Qo=Fo("native-string-replace",String.prototype.replace),Yo=$o,Jo=function(){var e=/a/,t=/b*/g;return $o.call(e,"a"),$o.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Xo=Vo.UNSUPPORTED_Y||Vo.BROKEN_CARET,Zo=void 0!==/()??/.exec("")[1];(Jo||Zo||Xo||zo||Ho)&&(Yo=function(e){var t,n,r,a,i,s,o,d=this,u=Wo(d),c=qo(e),l=u.raw;if(l)return l.lastIndex=d.lastIndex,t=Yo.call(l,c),d.lastIndex=l.lastIndex,t;var h=u.groups,p=Xo&&d.sticky,f=Go.call(d),m=d.source,g=0,v=c;if(p&&(-1===(f=f.replace("y","")).indexOf("g")&&(f+="g"),v=c.slice(d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==c.charAt(d.lastIndex-1))&&(m="(?: "+m+")",v=" "+v,g++),n=new RegExp("^(?:"+m+")",f)),Zo&&(n=new RegExp("^"+m+"$(?!\\s)",f)),Jo&&(r=d.lastIndex),a=$o.call(p?n:d,v),p?a?(a.input=a.input.slice(g),a[0]=a[0].slice(g),a.index=d.lastIndex,d.lastIndex+=a[0].length):d.lastIndex=0:Jo&&a&&(d.lastIndex=d.global?a.index+a[0].length:r),Zo&&a&&a.length>1&&Qo.call(a[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(a[i]=void 0)})),a&&h)for(a.groups=s=Ko(null),i=0;i<h.length;i++)s[(o=h[i])[0]]=a[o[1]];return a});var ed=Yo;Xn({target:"RegExp",proto:!0,forced:/./.exec!==ed},{exec:ed});var td=bt.exports,nd=ed,rd=L,ad=qe,id=yt,sd=ad("species"),od=RegExp.prototype,dd=function(e,t,n,r){var a=ad(e),i=!rd((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!rd((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[sd]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||n){var o=/./[a],d=t(a,""[e],(function(e,t,n,r,a){var s=t.exec;return s===nd||s===od.exec?i&&!a?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}));td(String.prototype,e,d[0]),td(od,a,d[1])}r&&id(od[a],"sham",!0)},ud=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},cd=K,ld=ed,hd=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==cd(e))throw TypeError("RegExp#exec called on incompatible receiver");return ld.call(e,t)},pd=ct,fd=$,md=ud,gd=lo,vd=hd;dd("search",(function(e,t,n){return[function(t){var n=fd(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](gd(n))},function(e){var r=pd(this),a=gd(e),i=n(t,r,a);if(i.done)return i.value;var s=r.lastIndex;md(s,0)||(r.lastIndex=0);var o=vd(r,a);return md(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var yd=$,bd=lo,_d="[\t\n\v\f\r \u2028\u2029\ufeff]",wd=RegExp("^"+_d+_d+"*"),Ad=RegExp(_d+_d+"*$"),Ed=function(e){return function(t){var n=bd(yd(t));return 1&e&&(n=n.replace(wd,"")),2&e&&(n=n.replace(Ad,"")),n}},kd={start:Ed(1),end:Ed(2),trim:Ed(3)},Td=L,xd="\t\n\v\f\r \u2028\u2029\ufeff",Sd=kd.trim;Xn({target:"String",proto:!0,forced:function(e){return Td((function(){return!!xd[e]()||"
"!="
"[e]()||xd[e].name!==e}))}("trim")},{trim:function(){return Sd(this)}});var Dd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Rd=Je("span").classList,Od=Rd&&Rd.constructor&&Rd.constructor.prototype,Id=Od===Object.prototype?void 0:Od,Cd=L,Pd=wr.forEach,Ld=function(e,t){var n=[][e];return!!n&&Cd((function(){n.call(null,t||function(){throw 1},1)}))},jd=C,Md=Dd,Ud=Id,Bd=Ld("forEach")?[].forEach:function(e){return Pd(this,e,arguments.length>1?arguments[1]:void 0)},Nd=yt,qd=function(e){if(e&&e.forEach!==Bd)try{Nd(e,"forEach",Bd)}catch(t){e.forEach=Bd}};for(var Gd in Md)qd(jd[Gd]&&jd[Gd].prototype);qd(Ud);var Vd=X,Fd=aa,Kd=X,Wd=K,zd=qe("match"),Hd=function(e){var t;return Kd(e)&&(void 0!==(t=e[zd])?!!t:"RegExp"==Wd(e))},$d=j,Qd=C,Yd=Kn,Jd=function(e,t,n){var r,a;return Fd&&"function"==typeof(r=t.constructor)&&r!==n&&Vd(a=r.prototype)&&a!==n.prototype&&Fd(e,a),e},Xd=yt,Zd=dt.f,eu=nn.f,tu=Hd,nu=lo,ru=po,au=fo,iu=bt.exports,su=L,ou=Se,du=Ht.enforce,uu=pa,cu=Mo,lu=No,hu=qe("match"),pu=Qd.RegExp,fu=pu.prototype,mu=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,gu=/a/g,vu=/a/g,yu=new pu(gu)!==gu,bu=au.UNSUPPORTED_Y,_u=$d&&(!yu||bu||cu||lu||su((function(){return vu[hu]=!1,pu(gu)!=gu||pu(vu)==vu||"/a/i"!=pu(gu,"i")})));if(Yd("RegExp",_u)){for(var wu=function(e,t){var n,r,a,i,s,o,d=this instanceof wu,u=tu(e),c=void 0===t,l=[],h=e;if(!d&&u&&c&&e.constructor===wu)return e;if((u||e instanceof wu)&&(e=e.source,c&&(t="flags"in h?h.flags:ru.call(h))),e=void 0===e?"":nu(e),t=void 0===t?"":nu(t),h=e,cu&&"dotAll"in gu&&(r=!!t&&t.indexOf("s")>-1)&&(t=t.replace(/s/g,"")),n=t,bu&&"sticky"in gu&&(a=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,"")),lu&&(i=function(e){for(var t,n=e.length,r=0,a="",i=[],s={},o=!1,d=!1,u=0,c="";r<=n;r++){if("\\"===(t=e.charAt(r)))t+=e.charAt(++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:mu.test(e.slice(r+1))&&(r+=2,d=!0),a+=t,u++;continue;case">"===t&&d:if(""===c||ou(s,c))throw new SyntaxError("Invalid capture group name");s[c]=!0,i.push([c,u]),d=!1,c="";continue}d?c+=t:a+=t}return[a,i]}(e),e=i[0],l=i[1]),s=Jd(pu(e,t),d?this:fu,wu),(r||a||l.length)&&(o=du(s),r&&(o.dotAll=!0,o.raw=wu(function(e){for(var t,n=e.length,r=0,a="",i=!1;r<=n;r++)"\\"!==(t=e.charAt(r))?i||"."!==t?("["===t?i=!0:"]"===t&&(i=!1),a+=t):a+="[\\s\\S]":a+=t+e.charAt(++r);return a}(e),n)),a&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{Xd(s,"source",""===h?"(?:)":h)}catch(e){}return s},Au=function(e){e in wu||Zd(wu,e,{configurable:!0,get:function(){return pu[e]},set:function(t){pu[e]=t}})},Eu=eu(pu),ku=0;Eu.length>ku;)Au(Eu[ku++]);fu.constructor=wu,wu.prototype=fu,iu(Qd,"RegExp",wu)}uu("RegExp");var Tu=bt.exports,xu=ct,Su=lo,Du=L,Ru=po,Ou=RegExp.prototype,Iu=Ou.toString,Cu=Du((function(){return"/a/b"!=Iu.call({source:"a",flags:"b"})})),Pu="toString"!=Iu.name;(Cu||Pu)&&Tu(RegExp.prototype,"toString",(function(){var e=xu(this),t=Su(e.source),n=e.flags;return"/"+t+"/"+Su(void 0===n&&e instanceof RegExp&&!("flags"in Ou)?Ru.call(e):n)}),{unsafe:!0});var Lu=Xn,ju=L,Mu=dr,Uu=X,Bu=ke,Nu=un,qu=Mr,Gu=pr,Vu=Tr,Fu=ue,Ku=qe("isConcatSpreadable"),Wu=Fu>=51||!ju((function(){var e=[];return e[Ku]=!1,e.concat()[0]!==e})),zu=Vu("concat"),Hu=function(e){if(!Uu(e))return!1;var t=e[Ku];return void 0!==t?!!t:Mu(e)};Lu({target:"Array",proto:!0,forced:!Wu||!zu},{concat:function(e){var t,n,r,a,i,s=Bu(this),o=Gu(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Hu(i=-1===t?s:arguments[t])){if(d+(a=Nu(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,d++)n in i&&qu(o,d,i[n])}else{if(d>=9007199254740991)throw TypeError("Maximum allowed index exceeded");qu(o,d++,i)}return o.length=d,o}});var $u,Qu=Hd,Yu=function(e){if(Qu(e))throw TypeError("The method doesn't accept regular expressions");return e},Ju=qe("match"),Xu=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Ju]=!1,"/./"[e](t)}catch(e){}}return!1},Zu=Xn,ec=P.f,tc=un,nc=lo,rc=Yu,ac=$,ic=Xu,sc="".startsWith,oc=Math.min,dc=ic("startsWith");Zu({target:"String",proto:!0,forced:!!(dc||($u=ec(String.prototype,"startsWith"),!$u||$u.writable))&&!dc},{startsWith:function(e){var t=nc(ac(this));rc(e);var n=tc(oc(arguments.length>1?arguments[1]:void 0,t.length)),r=nc(e);return sc?sc.call(t,r,n):t.slice(n,n+r.length)===r}});var uc=sn,cc=lo,lc=$,hc=function(e){return function(t,n){var r,a,i=cc(lc(t)),s=uc(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=i.charCodeAt(s))<55296||r>56319||s+1===o||(a=i.charCodeAt(s+1))<56320||a>57343?e?i.charAt(s):r:e?i.slice(s,s+2):a-56320+(r-55296<<10)+65536}},pc={codeAt:hc(!1),charAt:hc(!0)},fc=pc.charAt,mc=function(e,t,n){return t+(n?fc(e,t).length:1)},gc=ke,vc=Math.floor,yc="".replace,bc=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,_c=/\$([$&'`]|\d{1,2})/g,wc=dd,Ac=L,Ec=ct,kc=sn,Tc=un,xc=lo,Sc=$,Dc=mc,Rc=function(e,t,n,r,a,i){var s=n+e.length,o=r.length,d=_c;return void 0!==a&&(a=gc(a),d=bc),yc.call(i,d,(function(i,d){var u;switch(d.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(s);case"<":u=a[d.slice(1,-1)];break;default:var c=+d;if(0===c)return i;if(c>o){var l=vc(c/10);return 0===l?i:l<=o?void 0===r[l-1]?d.charAt(1):r[l-1]+d.charAt(1):i}u=r[c-1]}return void 0===u?"":u}))},Oc=hd,Ic=qe("replace"),Cc=Math.max,Pc=Math.min,Lc="$0"==="a".replace(/./,"$0"),jc=!!/./[Ic]&&""===/./[Ic]("a","$0");wc("replace",(function(e,t,n){var r=jc?"$":"$0";return[function(e,n){var r=Sc(this),a=null==e?void 0:e[Ic];return void 0!==a?a.call(e,r,n):t.call(xc(r),e,n)},function(e,a){var i=Ec(this),s=xc(e);if("string"==typeof a&&-1===a.indexOf(r)&&-1===a.indexOf("$<")){var o=n(t,i,s,a);if(o.done)return o.value}var d="function"==typeof a;d||(a=xc(a));var u=i.global;if(u){var c=i.unicode;i.lastIndex=0}for(var l=[];;){var h=Oc(i,s);if(null===h)break;if(l.push(h),!u)break;""===xc(h[0])&&(i.lastIndex=Dc(s,Tc(i.lastIndex),c))}for(var p,f="",m=0,g=0;g<l.length;g++){h=l[g];for(var v=xc(h[0]),y=Cc(Pc(kc(h.index),s.length),0),b=[],_=1;_<h.length;_++)b.push(void 0===(p=h[_])?p:String(p));var w=h.groups;if(d){var A=[v].concat(b,y,s);void 0!==w&&A.push(w);var E=xc(a.apply(void 0,A))}else E=Rc(v,s,y,b,w,a);y>=m&&(f+=s.slice(m,y)+E,m=y+v.length)}return f+s.slice(m)}]}),!!Ac((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Lc||jc);var Mc=j,Uc=dt.f,Bc=Function.prototype,Nc=Bc.toString,qc=/^\s*function ([^ (]*)/;Mc&&!("name"in Bc)&&Uc(Bc,"name",{configurable:!0,get:function(){try{return Nc.call(this).match(qc)[1]}catch(e){return""}}});var Gc={},Vc=J,Fc=nn.f,Kc={}.toString,Wc="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Gc.f=function(e){return Wc&&"[object Window]"==Kc.call(e)?function(e){try{return Fc(e)}catch(e){return Wc.slice()}}(e):Fc(Vc(e))};var zc={},Hc=qe;zc.f=Hc;var $c=C,Qc=Se,Yc=zc,Jc=dt.f,Xc=function(e){var t=$c.Symbol||($c.Symbol={});Qc(t,e)||Jc(t,e,{value:Yc.f(e)})},Zc=Xn,el=C,tl=te,nl=j,rl=he,al=L,il=Se,sl=dr,ol=X,dl=me,ul=ct,cl=ke,ll=J,hl=He,pl=lo,fl=V,ml=Po,gl=tr,vl=nn,yl=Gc,bl=Sn,_l=P,wl=dt,Al=M,El=yt,kl=bt.exports,Tl=ve.exports,xl=Pt,Sl=Oe,Dl=qe,Rl=zc,Ol=Xc,Il=da,Cl=Ht,Pl=wr.forEach,Ll=Ct("hidden"),jl=Dl("toPrimitive"),Ml=Cl.set,Ul=Cl.getterFor("Symbol"),Bl=Object.prototype,Nl=el.Symbol,ql=tl("JSON","stringify"),Gl=_l.f,Vl=wl.f,Fl=yl.f,Kl=Al.f,Wl=Tl("symbols"),zl=Tl("op-symbols"),Hl=Tl("string-to-symbol-registry"),$l=Tl("symbol-to-string-registry"),Ql=Tl("wks"),Yl=el.QObject,Jl=!Yl||!Yl.prototype||!Yl.prototype.findChild,Xl=nl&&al((function(){return 7!=ml(Vl({},"a",{get:function(){return Vl(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Gl(Bl,t);r&&delete Bl[t],Vl(e,t,n),r&&e!==Bl&&Vl(Bl,t,r)}:Vl,Zl=function(e,t){var n=Wl[e]=ml(Nl.prototype);return Ml(n,{type:"Symbol",tag:e,description:t}),nl||(n.description=t),n},eh=function(e,t,n){e===Bl&&eh(zl,t,n),ul(e);var r=hl(t);return ul(n),il(Wl,r)?(n.enumerable?(il(e,Ll)&&e[Ll][r]&&(e[Ll][r]=!1),n=ml(n,{enumerable:fl(0,!1)})):(il(e,Ll)||Vl(e,Ll,fl(1,{})),e[Ll][r]=!0),Xl(e,r,n)):Vl(e,r,n)},th=function(e,t){ul(e);var n=ll(t),r=gl(n).concat(ih(n));return Pl(r,(function(t){nl&&!nh.call(n,t)||eh(e,t,n[t])})),e},nh=function(e){var t=hl(e),n=Kl.call(this,t);return!(this===Bl&&il(Wl,t)&&!il(zl,t))&&(!(n||!il(this,t)||!il(Wl,t)||il(this,Ll)&&this[Ll][t])||n)},rh=function(e,t){var n=ll(e),r=hl(t);if(n!==Bl||!il(Wl,r)||il(zl,r)){var a=Gl(n,r);return!a||!il(Wl,r)||il(n,Ll)&&n[Ll][r]||(a.enumerable=!0),a}},ah=function(e){var t=Fl(ll(e)),n=[];return Pl(t,(function(e){il(Wl,e)||il(xl,e)||n.push(e)})),n},ih=function(e){var t=e===Bl,n=Fl(t?zl:ll(e)),r=[];return Pl(n,(function(e){!il(Wl,e)||t&&!il(Bl,e)||r.push(Wl[e])})),r};(rl||(kl((Nl=function(){if(this instanceof Nl)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?pl(arguments[0]):void 0,t=Sl(e),n=function(e){this===Bl&&n.call(zl,e),il(this,Ll)&&il(this[Ll],t)&&(this[Ll][t]=!1),Xl(this,t,fl(1,e))};return nl&&Jl&&Xl(Bl,t,{configurable:!0,set:n}),Zl(t,e)}).prototype,"toString",(function(){return Ul(this).tag})),kl(Nl,"withoutSetter",(function(e){return Zl(Sl(e),e)})),Al.f=nh,wl.f=eh,_l.f=rh,vl.f=yl.f=ah,bl.f=ih,Rl.f=function(e){return Zl(Dl(e),e)},nl&&(Vl(Nl.prototype,"description",{configurable:!0,get:function(){return Ul(this).description}}),kl(Bl,"propertyIsEnumerable",nh,{unsafe:!0}))),Zc({global:!0,wrap:!0,forced:!rl,sham:!rl},{Symbol:Nl}),Pl(gl(Ql),(function(e){Ol(e)})),Zc({target:"Symbol",stat:!0,forced:!rl},{for:function(e){var t=pl(e);if(il(Hl,t))return Hl[t];var n=Nl(t);return Hl[t]=n,$l[n]=t,n},keyFor:function(e){if(!dl(e))throw TypeError(e+" is not a symbol");if(il($l,e))return $l[e]},useSetter:function(){Jl=!0},useSimple:function(){Jl=!1}}),Zc({target:"Object",stat:!0,forced:!rl,sham:!nl},{create:function(e,t){return void 0===t?ml(e):th(ml(e),t)},defineProperty:eh,defineProperties:th,getOwnPropertyDescriptor:rh}),Zc({target:"Object",stat:!0,forced:!rl},{getOwnPropertyNames:ah,getOwnPropertySymbols:ih}),Zc({target:"Object",stat:!0,forced:al((function(){bl.f(1)}))},{getOwnPropertySymbols:function(e){return bl.f(cl(e))}}),ql)&&Zc({target:"JSON",stat:!0,forced:!rl||al((function(){var e=Nl();return"[null]"!=ql([e])||"{}"!=ql({a:e})||"{}"!=ql(Object(e))}))},{stringify:function(e,t,n){for(var r,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(r=t,(ol(t)||void 0!==e)&&!dl(e))return sl(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!dl(t))return t}),a[1]=t,ql.apply(null,a)}});Nl.prototype[jl]||El(Nl.prototype,jl,Nl.prototype.valueOf),Il(Nl,"Symbol"),xl[Ll]=!0;var sh=Xn,oh=j,dh=C,uh=Se,ch=X,lh=dt.f,hh=Mn,ph=dh.Symbol;if(oh&&"function"==typeof ph&&(!("description"in ph.prototype)||void 0!==ph().description)){var fh={},mh=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof mh?new ph(e):void 0===e?ph():ph(e);return""===e&&(fh[t]=!0),t};hh(mh,ph);var gh=mh.prototype=ph.prototype;gh.constructor=mh;var vh=gh.toString,yh="Symbol(test)"==String(ph("test")),bh=/^Symbol\((.*)\)[^)]+$/;lh(gh,"description",{configurable:!0,get:function(){var e=ch(this)?this.valueOf():this,t=vh.call(e);if(uh(fh,e))return"";var n=yh?t.slice(7,-1):t.replace(bh,"$1");return""===n?void 0:n}}),sh({global:!0,forced:!0},{Symbol:mh})}var _h=Po,wh=dt,Ah=qe("unscopables"),Eh=Array.prototype;null==Eh[Ah]&&wh.f(Eh,Ah,{configurable:!0,value:_h(null)});var kh=function(e){Eh[Ah][e]=!0},Th=yn.includes,xh=kh;Xn({target:"Array",proto:!0},{includes:function(e){return Th(this,e,arguments.length>1?arguments[1]:void 0)}}),xh("includes");var Sh=Yu,Dh=$,Rh=lo;Xn({target:"String",proto:!0,forced:!Xu("includes")},{includes:function(e){return!!~Rh(Dh(this)).indexOf(Rh(Sh(e)),arguments.length>1?arguments[1]:void 0)}});var Oh=Xn,Ih=wr.find,Ch=kh,Ph=!0;"find"in[]&&Array(1).find((function(){Ph=!1})),Oh({target:"Array",proto:!0,forced:Ph},{find:function(e){return Ih(this,e,arguments.length>1?arguments[1]:void 0)}}),Ch("find");var Lh="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Lh&&Lh,jh="URLSearchParams"in Lh,Mh="Symbol"in Lh&&"iterator"in Symbol,Uh="FileReader"in Lh&&"Blob"in Lh&&function(){try{return new Blob,!0}catch(e){return!1}}(),Bh="FormData"in Lh,Nh="ArrayBuffer"in Lh;if(Nh)var qh=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Gh=ArrayBuffer.isView||function(e){return e&&qh.indexOf(Object.prototype.toString.call(e))>-1};function Vh(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Fh(e){return"string"!=typeof e&&(e=String(e)),e}function Kh(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Mh&&(t[Symbol.iterator]=function(){return t}),t}function Wh(e){this.map={},e instanceof Wh?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function zh(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Hh(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function $h(e){var t=new FileReader,n=Hh(t);return t.readAsArrayBuffer(e),n}function Qh(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Yh(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Uh&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Bh&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:jh&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Nh&&Uh&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Qh(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Nh&&(ArrayBuffer.prototype.isPrototypeOf(e)||Gh(e))?this._bodyArrayBuffer=Qh(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):jh&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Uh&&(this.blob=function(){var e=zh(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=zh(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then($h)}),this.text=function(){var e=zh(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=Hh(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Bh&&(this.formData=function(){return this.text().then(Zh)}),this.json=function(){return this.text().then(JSON.parse)},this}Wh.prototype.append=function(e,t){e=Vh(e),t=Fh(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Wh.prototype.delete=function(e){delete this.map[Vh(e)]},Wh.prototype.get=function(e){return e=Vh(e),this.has(e)?this.map[e]:null},Wh.prototype.has=function(e){return this.map.hasOwnProperty(Vh(e))},Wh.prototype.set=function(e,t){this.map[Vh(e)]=Fh(t)},Wh.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Wh.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Kh(e)},Wh.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Kh(e)},Wh.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Kh(e)},Mh&&(Wh.prototype[Symbol.iterator]=Wh.prototype.entries);var Jh=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Xh(e,t){if(!(this instanceof Xh))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof Xh){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Wh(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Wh(t.headers)),this.method=function(e){var t=e.toUpperCase();return Jh.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Zh(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(a))}})),t}function ep(e,t){if(!(this instanceof ep))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Wh(t.headers),this.url=t.url||"",this._initBody(e)}Xh.prototype.clone=function(){return new Xh(this,{body:this._bodyInit})},Yh.call(Xh.prototype),Yh.call(ep.prototype),ep.prototype.clone=function(){return new ep(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Wh(this.headers),url:this.url})},ep.error=function(){var e=new ep(null,{status:0,statusText:""});return e.type="error",e};var tp=[301,302,303,307,308];ep.redirect=function(e,t){if(-1===tp.indexOf(t))throw new RangeError("Invalid status code");return new ep(null,{status:t,headers:{location:e}})};var np=Lh.DOMException;try{new np}catch(e){np=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},np.prototype=Object.create(Error.prototype),np.prototype.constructor=np}function rp(e,t){return new Promise((function(n,r){var a=new Xh(e,t);if(a.signal&&a.signal.aborted)return r(new np("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}i.onload=function(){var e,t,r={status:i.status,statusText:i.statusText,headers:(e=i.getAllResponseHeaders()||"",t=new Wh,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){n(new ep(a,r))}),0)},i.onerror=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){r(new TypeError("Network request failed"))}),0)},i.onabort=function(){setTimeout((function(){r(new np("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&Lh.location.href?Lh.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?i.withCredentials=!0:"omit"===a.credentials&&(i.withCredentials=!1),"responseType"in i&&(Uh?i.responseType="blob":Nh&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(i.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof Wh?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,Fh(t.headers[e]))})),a.signal&&(a.signal.addEventListener("abort",s),i.onreadystatechange=function(){4===i.readyState&&a.signal.removeEventListener("abort",s)}),i.send(void 0===a._bodyInit?null:a._bodyInit)}))}rp.polyfill=!0,Lh.fetch||(Lh.fetch=rp,Lh.Headers=Wh,Lh.Request=Xh,Lh.Response=ep);var ap={name:"@bygd/gd-sdk-pes",version:"1.19.3",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.2","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","js-base64":"^3.6.1","leaderboard-lib":"0.1.11","lodash.clonedeep":"^4.5.0","lodash.merge":"^4.6.2",querystringify:"^2.2.0","set-value":"^4.1.0","url-parse":"^1.4.7"}},ip=ct,sp=un,op=lo,dp=$,up=mc,cp=hd;dd("match",(function(e,t,n){return[function(t){var n=dp(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](op(n))},function(e){var r=ip(this),a=op(e),i=n(t,r,a);if(i.done)return i.value;if(!r.global)return cp(r,a);var s=r.unicode;r.lastIndex=0;for(var o,d=[],u=0;null!==(o=cp(r,a));){var c=op(o[0]);d[u]=c,""===c&&(r.lastIndex=up(a,sp(r.lastIndex),s)),u++}return 0===u?null:d}]}));var lp=dd,hp=Hd,pp=ct,fp=$,mp=$a,gp=mc,vp=un,yp=lo,bp=hd,_p=ed,wp=L,Ap=fo.UNSUPPORTED_Y,Ep=[].push,kp=Math.min;lp("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=yp(fp(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!hp(e))return t.call(r,e,a);for(var i,s,o,d=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,l=new RegExp(e.source,u+"g");(i=_p.call(l,r))&&!((s=l.lastIndex)>c&&(d.push(r.slice(c,i.index)),i.length>1&&i.index<r.length&&Ep.apply(d,i.slice(1)),o=i[0].length,c=s,d.length>=a));)l.lastIndex===i.index&&l.lastIndex++;return c===r.length?!o&&l.test("")||d.push(""):d.push(r.slice(c)),d.length>a?d.slice(0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var a=fp(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,a,n):r.call(yp(a),t,n)},function(e,a){var i=pp(this),s=yp(e),o=n(r,i,s,a,r!==t);if(o.done)return o.value;var d=mp(i,RegExp),u=i.unicode,c=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(Ap?"g":"y"),l=new d(Ap?"^(?:"+i.source+")":i,c),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===s.length)return null===bp(l,s)?[s]:[];for(var p=0,f=0,m=[];f<s.length;){l.lastIndex=Ap?0:f;var g,v=bp(l,Ap?s.slice(f):s);if(null===v||(g=kp(vp(l.lastIndex+(Ap?f:0)),s.length))===p)f=gp(s,f,u);else{if(m.push(s.slice(p,f)),m.length===h)return m;for(var y=1;y<=v.length-1;y++)if(m.push(v[y]),m.length===h)return m;f=p=g}}return m.push(s.slice(p)),m}]}),!!wp((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Ap);var Tp=function(){function e(t){w.default(this,e),this.gameData=t}return A.default(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){try{var e={};if(this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled){var t=new T.default(location.href,!0);for(var n in t.query)e[n]=t.query[n];Object.keys(e).length;return e}}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),xp=function(){function e(t,n){w.default(this,e),this.adContainer=t,this.onResume=n}return A.default(e,[{key:"show",value:function(){this.adResumeButton.style.display="block",this.adResumeButtonOverlay.style.display="block"}},{key:"hide",value:function(){this.adResumeButton.style.display="none",this.adResumeButtonOverlay.style.display="none"}},{key:"add",value:function(){var e=this;try{var t=document.createElement("div");this.adResumeButton=t,t.id="gd__resume__button",t.setAttribute("title","Resume"),this.addStyles(),t.classList.add("gd__resume__button"),t.addEventListener("click",function(){v.default(this,e),this.onResume()}.bind(this)),this.adContainer.appendChild(t);var n=document.createElement("div");this.adResumeButtonOverlay=n,n.id="gd__resume__button__overlay",n.classList.add("gd__resume__button__overlay"),this.adContainer.appendChild(n)}catch(e){console.log("Resume button add error",e)}}},{key:"addStyles",value:function(){var e=document.body||document.getElementsByTagName("body")[0];this.addStylesheet("gd__resume__button__style",e,'\n .gd__resume__button{\n background-image: url("https://img.gamedistribution.com/play-black.svg");\n background-color:white; \n width: 120px;\n height: 120px;\n position: absolute;\n display: none;\n z-index: 2000;\n cursor: pointer;\n top: calc(50% - 60px);\n left: calc(50% - 60px);\n margin: 0;\n border-radius: 50%;\n border: 2px solid white;\n animation: play-button 1s ease-in-out infinite alternate;\n -webkit-animation: play-button 1s ease-in-out infinite alternate;\n }\n \n .gd__resume__button__overlay {\n position: fixed;\n display: none;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.5);\n z-index: 1999;\n cursor: pointer;\n }\n @keyframes play-button {\n 0% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n 100% {\n transform: scale(1.1);\n -webkit-transform: scale(1.1);\n }\n }\n .gd__resume__button:hover{\n filter: invert(100%) sepia(51%) saturate(0%) hue-rotate(346deg) brightness(104%) contrast(100%); \n }\n ')}},{key:"addStylesheet",value:function(e,t,n){if(!document.getElementById(e)){var r=document.createElement("style");r.type="text/css",r.id=e,r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),t.appendChild(r)}}}]),e}(),Sp=function(e){if(!e)return!1;var t=Dp.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Dp=Object.prototype.toString;function Rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Op(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rp(Object(n),!0).forEach((function(t){b.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ip(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}var Cp=["bidFloor","isDfpBidding"];function Pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pp(Object(n),!0).forEach((function(t){b.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var jp=null,Mp=function(){function e(t,n,r){var a=this;if(w.default(this,e),jp)return jp;jp=this;var i={debug:!1,width:640,height:360,locale:"en"};this.options=n?d.extendDefaults(i,n):i,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new d.EventBus,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=r.parentDomain,this.topDomain=r.topDomain,this.parentURL=r.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=d.getIMASampleTags(),this.atom_display,this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==t?document.getElementById(t):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:s,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:o,this.gameId="0",this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){v.default(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){v.default(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,a,i,s,o,u,c,h,p,f,g,y,O,I,C,P,L;return A.default(e,[{key:"start",value:(L=_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),e.next=14;break;case 11:throw e.prev=11,e.t0=e.catch(0),new Error(e.t0);case 14:case"end":return e.stop()}}),e,this,[[0,11]])}))),function(){return L.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=_.default(E.default.mark((function r(a){var i,s,o,u,c,h,p,f,m,g,y=this;return E.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(d.Ls.available&&d.Ls.getBoolean("gd_debug_ex")&&d.Ls.getBoolean("gd_tag"))){r.next=6;break}return i=n.IMASampleTags[e],s=Math.floor(Math.random()*i.length),o=i[s],a({url:o}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,r.next=11,n._getTunnlKeys(e);case 11:if(u=r.sent,c=u.data,h=c.nsid?c.nsid:"TNL_T-17102571517",p=c.tid?c.tid:"TNL_NS-18101700058",f="".concat(h,"/").concat(p),delete c.nsid,delete c.tid,R.default(c,{tnl_system:"1",tnl_content_category:n.category.toLowerCase()}),n.eventBus.broadcast("AD_REQUEST",{message:c.tnl_ad_pos}),m=n.options,"preroll"===c.tnl_ad_pos&&l.isPlainObject(m.preroll)?m=m.preroll:"midroll"===c.tnl_ad_pos&&l.isPlainObject(m.midroll)?m=m.midroll:"rewarded"===c.tnl_ad_pos&&l.isPlainObject(m.rewarded)&&(m=m.rewarded),!(t&&t.retry_on_success&&l.isPlainObject(m.retry_on_success)&&l.isPlainObject(m.retry_on_success.vast))){r.next=26;break}return r.abrupt("return",a(n._createCustomAdVastUrl(m.retry_on_success.vast,{tnl_keys:c})));case 26:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&l.isPlainObject(m.retry_on_failure.vast))){r.next=30;break}return r.abrupt("return",a(n._createCustomAdVastUrl(m.retry_on_failure.vast,{tnl_keys:c})));case 30:if(!l.isPlainObject(m.vast)){r.next=32;break}return r.abrupt("return",a(n._createCustomAdVastUrl(m.vast,{tnl_keys:c})));case 32:return r.next=34,n._create_dp_context(c.tnl_ad_pos);case 34:g=r.sent,window.idhb.que.push(function(){var e=this;v.default(this,y),window.idhb.setRefererUrl(encodeURIComponent(n.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(n.userAllowedPersonalizedAds));var t="rewarded"===c.tnl_ad_pos?"rewardedVideo":"gdbanner"===c.tnl_ad_pos?"gd__banner":"midroll"===c.tnl_ad_pos?"midroll":"video1";window.idhb.setDfpAdUnitCodeForAdSlot(t,f),window.idhb.setAdserverTargetingForAdSlot(t,c),window.idhb.requestAds({slots:b.default({},t,{bidFloor:null!=g&&g.floor_price?g.floor_price:void 0}),callback:function(t,n){var r=this;v.default(this,e),g&&!n.bidFloorApplied&&fetch(g.skip_url).catch(function(e){v.default(this,r)}.bind(this)),a({tnl_keys:c,url:t,dp:g,hl:n})}.bind(this)})}.bind(this)),r.next=41;break;case 38:throw r.prev=38,r.t0=r.catch(8),new Error(r.t0);case 41:case"end":return r.stop()}}),r,this,[[8,38]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===d.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===d.AdType.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===d.AdType.Rewarded?"rewarded":e===d.AdType.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_getTunnlKeys",value:function(e){var t=this;return new Promise(function(n){var r=this;v.default(this,t);var a="";a=!navigator.userAgent.match(/Crosswalk/i)&&void 0===window.cordova||"m.hopy.com"!==this.parentDomain?"page_url=".concat(encodeURIComponent(this.topDomain||this.parentDomain)):"bundle=com.hopy.frivgames";var i=this.nextAdPosition(e),s=d.getQueryString("ch",window.location.href),o=d.getQueryString("ch_date",window.location.href),u=s?"&ch=".concat(s):"",c=o?"&ch_date=".concat(o):"",l="https://pub.headerlift.com/opphb?".concat(a,"&player_width=").concat(this.options.width,"&player_height=").concat(this.options.height,"&ad_type=video_image&game_id=").concat(this.gameId,"&ad_position=").concat(i).concat(u).concat(c,"&correlator=").concat(Date.now()),h=new Request(l,{method:"GET"});fetch(h).then(function(e){v.default(this,r);var t=e.headers.get("content-type");if(t&&-1!==t.indexOf("application/json"))return e.json();throw new TypeError("Oops, we didn't get JSON!")}.bind(this)).then(function(e){v.default(this,r),d.isObjectEmpty(e)&&(e=this._createTunnlReportingFallbackKeys(i),this.eventBus.broadcast("AD_REQUEST_KEYS_EMPTY",{message:"Tunnl returned empty response.",details:l})),n({data:e,url:l})}.bind(this)).catch(function(e){v.default(this,r);var t=this._createTunnlReportingFallbackKeys(i);this.eventBus.broadcast("AD_REQUEST_KEYS_FALLBACK",{message:e.message,details:l}),n({data:t,url:l})}.bind(this))}.bind(this))}},{key:"_createTunnlReportingFallbackKeys",value:function(e){return{tid:"TNL_T-17102571517",nsid:"TNL_NS-18101700058",tnl_tid:"T-17102571517",tnl_nsid:"NS-18101700058",tnl_pw:this.options.width,tnl_ph:this.options.height,tnl_pt:"22",tnl_pid:"P-17101800031",tnl_paid:"17",tnl_ad_type:"video_image",tnl_asset_id:this.gameId.toString(),tnl_ad_pos:e,tnl_skippable:"1",tnl_cp1:"",tnl_cp2:"",tnl_cp3:"",tnl_cp4:"",tnl_cp5:"",tnl_cp6:"",tnl_campaign:"2",tnl_gdpr:"0",tnl_gdpr_consent:"1",consent_string:"BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA",tnl_content_category:this.category.toLowerCase()}}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(r){if(v.default(this,n),"undefined"==typeof google)throw new Error("Unable to load ad, google IMA SDK not defined.");try{var a,i=null==e||null===(a=e.tnl_keys)||void 0===a?void 0:a.tnl_ad_pos;this.adSuccess=!1;var s=new google.ima.AdsRequest,o=this._transformVast(e,t),d=Lp(Lp({},t),{},{adTag:o,tnl_ad_pos:i});this.adCounter[i]=this.adCounter[i]||0,this.adCounter[i]++;var u=e.dp,c=e.hl;if(u&&(u.adtag_url=o.url,this._extend_dp_with_adsense(u,c,null==e?void 0:e.tnl_keys)),this._isVMAP(i)){var l=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,a=Date.now(),i=new T.default(e.adtag_url_1,!0);i.query=Op(Op({},i.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:a,output:"xml_vast3"});var s=i.toString(),o=new T.default(e.adtag_url_2,!0);o.query=Op(Op({},o.query),{},{ad_rule:0,vpos:t,pod:1,correlator:++a,output:"xml_vast3"});var d=o.toString(),u=Date.now();return'<?xml version="1.0" encoding="UTF-8"?>\n<vmap:VMAP xmlns:vmap="http://www.iab.net/videosuite/vmap" version="1.0">\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-1">\n <vmap:AdSource id="'.concat(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Ip({id:u++,adtag_url:s,error_url:null==n?void 0:n.error_url,impression_url:null==n?void 0:n.impression_url}),'\n </vmap:AdSource>\n</vmap:AdBreak>\n<vmap:AdBreak timeOffset="start" breakType="linear,nonlinear" breakId="break-2">\n <vmap:AdSource id="').concat(u++,'" allowMultipleAds="false" followRedirects="true">\n ').concat(Ip({id:u++,adtag_url:d,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.impression_url}),'\n </vmap:AdSource>\n <vmap:Extensions>\n <vmap:Extension type="bumper" suppress_bumper="true"></vmap:Extension>\n </vmap:Extensions>\n</vmap:AdBreak>\n</vmap:VMAP>').trim()}(this._get_vmap_context({dp:u,adtag:o,position:"preroll"===d.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(i)}));s.adsResponse=l}else if(u&&c.bidFloorApplied){var h=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(u);s.adsResponse=h}else if(u&&u.fallback_url){var p=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(u);s.adsResponse=p}else s.adTagUrl=o.url;s.linearAdSlotWidth=this.options.width,s.linearAdSlotHeight=this.options.height,s.nonLinearAdSlotWidth=this.options.width,s.nonLinearAdSlotHeight=this.options.height,s.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(s.vastLoadTimeout=this.options.vast_load_timeout),s.setAdWillAutoPlay(t.autoplayAllowed),s.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(s,d);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:d})}catch(e){}r(s)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameId}})}}},{key:"_checkAutoPlay",value:(P=_.default(E.default.mark((function e(){var t=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=this;v.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):x.default.video({inline:!0,muted:!1}).then(function(t){v.default(this,r);var n=t.result;t.error,e(!0===n?{autoplayAllowed:!0,autoplayRequiresMute:!1}:{autoplayAllowed:!0,autoplayRequiresMute:!0})}.bind(this))}.bind(this)));case 1:case"end":return e.stop()}}),e,this)}))),function(){return P.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(C=_.default(E.default.mark((function e(){var t;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"startAd",value:(I=_.default(E.default.mark((function e(t){var n,r,a,i,s;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!1===(null===(n=this.gameData.sdk)||void 0===n||null===(r=n.afg)||void 0===r?void 0:r.enabled),i=t.adType,s=t.params,i!==d.AdType.Interstitial){e.next=14;break}if(!a){e.next=7;break}return e.abrupt("return",this._startInterstitialAd(s));case 7:if("preroll"!==(null==s?void 0:s.position)){e.next=11;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 11:return e.abrupt("return",this._startInterstitialAd(s));case 12:e.next=23;break;case 14:if(i!==d.AdType.Rewarded){e.next=22;break}if(!a){e.next=19;break}return e.abrupt("return",this._startRewardedAd(s));case 19:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 20:e.next=23;break;case 22:throw new Error("Unsupported ad type");case 23:case"end":return e.stop()}}),e,this)}))),function(e){return I.apply(this,arguments)})},{key:"preloadAd",value:(O=_.default(E.default.mark((function e(t){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==d.AdType.Interstitial){e.next=4;break}return e.abrupt("return",this._preloadInterstitialAd());case 4:if(t!==d.AdType.Rewarded){e.next=8;break}return e.abrupt("return",this._preloadRewardedAd());case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){v.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new xp(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(y=_.default(E.default.mark((function e(t){var n=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=_.default(E.default.mark((function e(r,a){var i,s,o,u,c,l,h=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(i=t?t.containerId:null)||a("Container id is not specified"),s=document.getElementById(i),document.getElementById(i)||a("No container is found with this id - ".concat(i)),void 0===window.idhb.requestAds&&a("Prebid.js wrapper script hit an error or didn't exist!"),o=t.slotId?t.slotId:"gd__banner@".concat(i),document.getElementById(o)||(u="\n .gd__banner{\n z-index: ".concat(d.Layers.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((c=document.createElement("style")).type="text/css",c.id="gd__banner__style",c.styleSheet?c.styleSheet.cssText=u:c.appendChild(document.createTextNode(u)),s.appendChild(c)),(l=document.createElement("div")).id=o,l.classList.add("gd__banner"),s.appendChild(l)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,window.idhb.que.push(function(){var e,t,r=this;v.default(this,h),window.idhb.setRefererUrl(encodeURIComponent(n.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(n.userAllowedPersonalizedAds)),window.idhb.setDefaultGdprConsentString("BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA"),null!==(e=n.atom_display)&&void 0!==e&&e.params&&window.idhb.setAdserverTargeting(null===(t=n.atom_display)||void 0===t?void 0:t.params);var a={};a[o]={maxSize:[s.offsetWidth,s.offsetHeight]},window.idhb.requestAds({slots:a,callback:function(e){v.default(this,r)}.bind(this)})}.bind(this)),r(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),a(e.t0.message||e.t0);case 18:case"end":return e.stop()}}),e,this,[[0,15]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return y.apply(this,arguments)})},{key:"_startInterstitialAd",value:(g=_.default(E.default.mark((function e(t){var n;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadInterstitialAd(Lp(Lp({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return g.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(f=_.default(E.default.mark((function e(t){var n,r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(d.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,Lp({adType:d.AdType.Interstitial},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;v.default(this,a);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var i=function(t){v.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){v.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return f.apply(this,arguments)})},{key:"_startRewardedAd",value:(p=_.default(E.default.mark((function e(t){var n;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadRewardedAd(Lp(Lp({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return p.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=_.default(E.default.mark((function e(t){var n,r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(d.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,Lp({adType:d.AdType.Rewarded},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;v.default(this,a);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var i=function(t){v.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){v.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return h.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(c=_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(d.AdType.Interstitial);case 3:return this.preloadedInterstitialAdVast=e.sent,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return c.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(u=_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(d.AdType.Rewarded);case 3:return this.preloadedRewardedAdVast=e.sent,e.abrupt("return",this.preloadedRewardedAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return u.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player.src="",this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var t=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var n=null==e?void 0:e.mode,r=this._isT4R(e),a=this._getT4ROptions();"loaded"===n?(this.activeAdContainer.style.opacity=r?.001:1,r&&this.eventBus.broadcast("AD_T4R"),r&&setTimeout(function(){v.default(this,t),this.activeAdContainer.style.opacity=1}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210))):"click"!==n&&"first_quartile"!==n||(this.activeAdContainer.style.opacity=1)}}},{key:"_createPlayer",value:function(){var e=this,t=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=d.Layers.AdsContainer.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var n=document.createElement("video");n.setAttribute("playsinline",!0),n.setAttribute("webkit-playsinline",!0),n.id="".concat(this.prefix,"advertisement_video"),n.style.position="absolute",n.style.backgroundColor="#000000",n.style.top="0",n.style.left="0",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px",this.video_ad_player=n,this.adContainer.appendChild(n);var r=document.createElement("div");r.id="".concat(this.prefix,"advertisement_slot"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.adContainerInner=r,this.activeAdContainer=this.adContainer,this.thirdPartyContainer?(this.adContainer.appendChild(r),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(r),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){v.default(this,e);var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:t,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var t=this,n=new google.ima.AdsRenderingSettings;n.autoAlign=!1,n.enablePreloading=!1,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.useStyledNonLinearAds=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,n),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){v.default(this,t),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var r=new Date,a=r.getHours(),i=r.getDate(),s=r.getMonth(),o=r.getFullYear(),d="AD_SDK_MANAGER_READY";this.eventBus.broadcast(d,{name:d,message:"AD SDK is ready",status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(o)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t=new Date,n=t.getHours(),r=t.getDate(),a=t.getMonth(),i=t.getFullYear(),s=d.getKeyByValue(google.ima.AdEvent.Type,e.type),o=!1,u=e.getAd().getContentType()||"",c=!u.startsWith("image")&&!u.startsWith("text");this._sendIMAEventsToHB(e);var l="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:l="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:l="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:o=!0,l="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:l="Fired when the ad is clicked.";var h=e.getAd().getContentType();this._show({mode:"click",contentType:h});break;case google.ima.AdEvent.Type.COMPLETE:o=this._is_completed(e.getAd()),l="Fired when the ad completes playing.";break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:l="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:l="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",o=!0;break;case google.ima.AdEvent.Type.DURATION_CHANGE:l="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:l="Fired when the ad playhead crosses first quartile.";var p=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:p});break;case google.ima.AdEvent.Type.IMPRESSION:l="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:l="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:l="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var f=e.getAd().getContentType();l=f,this._show({mode:"loaded",contentType:f});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(l=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:l="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:c&&this.adResume.show(),l="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:l="Fired when the ad is resumed.",c&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:l="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:o=this._is_completed(e.getAd()),l="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:l="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:l="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:o=this._is_completed(e.getAd()),l="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:l="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:l="Fired when the ad volume has been muted."}""!==s&&""!==l&&this.eventBus.broadcast(s,{name:s,message:l,status:"success",analytics:{category:s,action:this.parentDomain,label:"h".concat(n," d").concat(r," m").concat(a," y").concat(i)}}),o&&!this.adSuccess&&(this.adSuccess=!0,this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.resetForNext(e))}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),a=this._getInnerErrorCode(n);this.eventBus.broadcast(t,{message:r,details:a,status:"warning",analytics:{category:t,action:a,label:r}})}catch(e){}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent(e)}catch(e){}}},{key:"_resetAdsLoader",value:function(){this.adsManager&&(this.adsManager.destroy(),this.adsManager=null,this._adrequest_user_context=null),this.adsLoader&&this.adsLoader.contentComplete()}},{key:"_startSafetyTimer",value:function(e,t){var n=this;this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=window.setTimeout(function(){v.default(this,n),this.cancel(),this._clearSafetyTimer(t)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/gameDistributionV1.3.min.js","http://hb.improvedigital.com/pbw/gameDistributionV1.3.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(Sp(e.getInnerError)){var t=e.getInnerError();if(t)return Sp(t.getErrorCode)&&Sp(t.getVastErrorCode)?t.getErrorCode().toString()||t.getVastErrorCode().toString():t.message}}},{key:"resetForNext",value:function(){this.requestRunning=!1,this._hide("resetForNext")}},{key:"_createCustomAdVastUrl",value:function(e,t){var n=this;if(e){var r=this.macros.transform(e,{get:function(e){if(v.default(this,n),t&&t.tnl_keys)return t.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in r.query||{}){var i=r.query[a];l.isPlainObject(i)&&(r.query[a]=D.default.stringify(i))}var s=new T.default(r.url,!0);return R.default(s.query,r.query||{}),Lp({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new T.default(e.url,!0),a=this._transformQuery(e,t,r);a&&(n.url=r.toString());var i=a?r:new T.default(e.url,!0);if(i.query.cust_params){var s=D.default.parse(i.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=i}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,t,n){var r=this;if(e&&t&&e.tnl_keys){var a=this.options.vast_query;if(t.retry_on_success&&this.options.retry_on_success&&l.isPlainObject(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:t.retry_on_failure&&this.options.retry_on_failure&&l.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=S.default(a),l.isPlainObject(a)){var i=n.query;if(a.$$remove){for(var s in i){new RegExp(a.$$remove,"i").test(s)&&delete i[s]}delete a.$$remove}var o=D.default.parse(i.cust_params);if(a.cust_params&&a.cust_params.$$remove){for(var d in o){new RegExp(a.cust_params.$$remove,"i").test(d)&&delete o[d]}delete a.cust_params.$$remove}var u=this.macros.transform(a,{get:function(t){return v.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,R.default(i,u),i.cust_params=D.default.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;return h&&((null==e||null===(n=e.contentType)||void 0===n?void 0:n.startsWith("image/"))||"text"===(null==e?void 0:e.contentType))&&("preroll"===h&&(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.t4r)||void 0===i?void 0:i.enabled)||"midroll"===h&&(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o||null===(d=o.t4r)||void 0===d?void 0:d.enabled)||"rewarded"===h&&(null===(u=this.gameData)||void 0===u||null===(c=u.rAds)||void 0===c||null===(l=c.t4r)||void 0===l?void 0:l.enabled))}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h,p,f,m;if(!e)return!1;var g="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.vmap)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(d=this.gameData)||void 0===d||null===(u=d.mAds)||void 0===u||null===(c=u.vmap)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!g)return!1;var v=this._get_vmap_config(e),y=this.adCounter[e];return void 0!==(null==v?void 0:v.start)?y>=(null==v?void 0:v.start):g}},{key:"_getT4ROptions",value:function(){var e,t,n,r,a,i,s;switch(null===(e=this._adrequest_user_context)||void 0===e?void 0:e.tnl_ad_pos){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.t4r;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.t4r;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.t4r}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,a=e.dp,i=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:a,d=null!=r&&r.vast_2?void 0:a;return{adtag_url_1:null==i?void 0:i.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:d}}},{key:"_get_vmap_config",value:function(e){var t,n,r,a,i,s,o,d;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.vmap;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(d=o.pAds)||void 0===d?void 0:d.vmap}}},{key:"_isDP",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h,p,f,m;return!!e&&("preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.dp)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.dp)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.dp)||!0===(null===(d=this.gameData)||void 0===d||null===(u=d.mAds)||void 0===u||null===(c=u.dp)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.dp)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.dp)||void 0===m?void 0:m.enabled)))}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(t){var n=this;v.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Tp(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(m.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return v.default(this,n),e.json()}.bind(this)).then(function(e){if(v.default(this,n),!e||!e.p)return this.msgrt.send("dp.na",{message:"atom"}),t();this.msgrt.send("dp.fp",{message:e.p/100}),t({params:{fp:e.p/100},error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(i),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(i)})}.bind(this)).catch(function(e){v.default(this,n),this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}.bind(this))}catch(e){this.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),t()}}.bind(this))}},{key:"_create_dp_context",value:function(e){var t=this;return new Promise(function(){var n=_.default(E.default.mark((function n(r){var a,i,s,o,d,u=this;return E.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,t._isDP(e)){n.next=5;break}return t.msgrt.send("dp.na",{message:"rule"}),n.abrupt("return",r());case 5:i={id:t.topDomain||t.parentDomain,au:e||"unknown",ty:"video",aid:t.gameData.gameId,pgu:t.parentURL},(s=new Tp(t.gameData).checkCustomParams())&&(i.cp=s),o=encodeURIComponent(m.Base64.encode(JSON.stringify(i))),d=null===(a=t.gameData.promo)||void 0===a?void 0:a.rainbow,fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(o)).then(function(e){return v.default(this,u),e.json()}.bind(this)).then(function(e){if(v.default(this,u),!e||!e.p)return t.msgrt.send("dp.na",{message:"atom"}),r();var n=e.p/100;r({id:Date.now(),floor_price:n,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(o,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(o),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(o),promo_url:null!=d&&d.enabled?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(o):void 0,promo_imp_blue_url:null!=d&&d.enabled?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:null!=d&&d.enabled?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){v.default(this,u),t.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),r()}.bind(this)),n.next=17;break;case 13:n.prev=13,n.t0=n.catch(0),t.msgrt.send("dp.err",{message:(null===n.t0||void 0===n.t0?void 0:n.t0.message)||n.t0}),r();case 17:case"end":return n.stop()}}),n,this,[[0,13]])})));return function(e){return n.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t,n){if(e&&t&&n)try{var r,a=new T.default(t.vastUrl,!0);if(null===(r=a.query)||void 0===r||!r.cust_params)return;if(!D.default.parse(a.query.cust_params).tnl_asset_id)return;n.bidFloor,n.isDfpBidding;var i=k.default(n,Cp);a.query.cust_params=D.default.stringify(Lp(Lp({},i),{},{adsense:1}),!1),e.fallback_url=a.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(o=_.default(E.default.mark((function e(t){var n,r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),r=n[0],window.HB_OPTIONSgd={gameId:this.gameId},e.next=5,d.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return v.default(this,a),window.idhb}.bind(this)});case 5:window.idhb=window.idhb||{},window.idhb.que=window.idhb.que||[],window.idhb.que.push(function(){var e=this;v.default(this,a),window.idhb.addEventListener("slotRenderEnded",function(t){var n=this;v.default(this,e);try{var r,a=t.slotId.split("@");a=1===a.length?a[0]:a[1],t.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){v.default(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:a,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){v.default(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:a,status:"success"}))}catch(e){}}.bind(this))}.bind(this));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_ima_script",value:(s=_.default(E.default.mark((function e(t){var n,r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],r=this.options.debug?n[0]:n[1],e.next=4,d.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return v.default(this,a),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"_init_afg_script",value:(i=_.default(E.default.mark((function e(t){var n,r,a,i,s,o,u=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==(null===(n=this.gameData.sdk)||void 0===n||null===(r=n.afg)||void 0===r?void 0:r.enabled)){e.next=3;break}return e.abrupt("return");case 3:return(o={}).crossorigin="anonymous",o["data-ad-client"]=(null==t||null===(a=t.adsense_client)||void 0===a?void 0:a.length)>0?t.adsense_client:"ca-pub-2316275586951220",(null==t||null===(i=t.adsense_channel)||void 0===i?void 0:i.length)>0&&(o["data-ad-channel"]=t.adsense_channel),(null==t||null===(s=t.adsense_host)||void 0===s?void 0:s.length)>0&&(o["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(o["data-adbreak-test"]="on"),e.next=12,d.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return v.default(this,u),!!window.adsbygoogle}.bind(this),attrs:o});case 12:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"auto"});case 14:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementRewardedAd",value:(a=_.default(E.default.mark((function e(t){var n,r,a,i,s,o,d=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),n=function(){v.default(this,d),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){v.default(this,d),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){v.default(this,d),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){v.default(this,d),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){v.default(this,d),e()}.bind(this),o=function(e){v.default(this,d),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),t={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:r,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:o},window.adsbygoogle.push(t),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var t}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=_.default(E.default.mark((function e(t){var n,r=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(e){v.default(this,r),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"}),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),t={type:"preroll",adBreakDone:n},window.adsbygoogle.push(t),e.next=16;break;case 12:throw e.prev=12,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 16:case"end":return e.stop()}var t}),e,this,[[1,12]])}))),function(e){return r.apply(this,arguments)})},{key:"_startAdsensePlacementStart",value:(n=_.default(E.default.mark((function e(t){var n,r,a,i=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(){v.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){v.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){v.default(this,i),this.resetForNext(),this.adCounter.preroll=this.adCounter.preroll||0,this.adCounter.preroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.pr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.pr",e))}.bind(this),t={type:"start",name:"start-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var t}),e,this,[[1,14]])}))),function(e){return n.apply(this,arguments)})},{key:"_startAdsensePlacementNext",value:(t=_.default(E.default.mark((function e(t){var n,r,a,i=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),n=function(){v.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){v.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){v.default(this,i),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),t={type:"next",name:"next-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var t}),e,this,[[1,14]])}))),function(e){return t.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,a=n._ua,i={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:a.browser.name,brvs:a.browser.version,osnm:a.os.name,osvs:a.os.version,dvmd:a.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(m.Base64.encode(JSON.stringify(i)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t})}},{key:"_isAdPlacementNext",value:function(e){return e.adType,e.params,void 0!==e.adTimestamp}},{key:"_isAdPlacementStart",value:function(e){if(e.adType,e.params,void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}}]),e}(),Up=Array.isArray,Bp=Object.prototype.toString,Np=Up||function(e){return!!e&&"[object Array]"==Bp.call(e)},qp=Xn,Gp=X,Vp=dr,Fp=pn,Kp=un,Wp=J,zp=Mr,Hp=qe,$p=Tr("slice"),Qp=Hp("species"),Yp=[].slice,Jp=Math.max;qp({target:"Array",proto:!0,forced:!$p},{slice:function(e,t){var n,r,a,i=Wp(this),s=Kp(i.length),o=Fp(e,s),d=Fp(void 0===t?s:t,s);if(Vp(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Vp(n.prototype)?Gp(n)&&null===(n=n[Qp])&&(n=void 0):n=void 0,n===Array||void 0===n))return Yp.call(i,o,d);for(r=new(void 0===n?Array:n)(Jp(d-o,0)),a=0;o<d;o++,a++)o in i&&zp(r,a,i[o]);return r.length=a,r}});var Xp=ct,Zp=Sa,ef=sr,tf=ke,nf=function(e,t,n,r){try{return r?t(Xp(n)[0],n[1]):t(n)}catch(t){Zp(e,"throw",t)}},rf=ya,af=un,sf=Mr,of=Ta,df=Aa,uf=function(e){var t,n,r,a,i,s,o=tf(e),d="function"==typeof this?this:Array,u=arguments.length,c=u>1?arguments[1]:void 0,l=void 0!==c,h=df(o),p=0;if(l&&(c=ef(c,u>2?arguments[2]:void 0,2)),null==h||d==Array&&rf(h))for(n=new d(t=af(o.length));t>p;p++)s=l?c(o[p],p):o[p],sf(n,p,s);else for(i=(a=of(o,h)).next,n=new d;!(r=i.call(a)).done;p++)s=l?nf(a,c,[r.value,p],!0):r.value,sf(n,p,s);return n.length=p,n};Xn({target:"Array",stat:!0,forced:!Ka((function(e){Array.from(e)}))},{from:uf});var cf,lf,hf,pf=!L((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ff=Se,mf=ke,gf=pf,vf=Ct("IE_PROTO"),yf=Object.prototype,bf=gf?Object.getPrototypeOf:function(e){return e=mf(e),ff(e,vf)?e[vf]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?yf:null},_f=L,wf=bf,Af=yt,Ef=qe("iterator"),kf=!1;[].keys&&("next"in(hf=[].keys())?(lf=wf(wf(hf)))!==Object.prototype&&(cf=lf):kf=!0);var Tf=null==cf||_f((function(){var e={};return cf[Ef].call(e)!==e}));Tf&&(cf={}),"function"!=typeof cf[Ef]&&Af(cf,Ef,(function(){return this}));var xf={IteratorPrototype:cf,BUGGY_SAFARI_ITERATORS:kf},Sf=xf.IteratorPrototype,Df=Po,Rf=V,Of=da,If=fa,Cf=function(){return this},Pf=Xn,Lf=function(e,t,n){var r=t+" Iterator";return e.prototype=Df(Sf,{next:Rf(1,n)}),Of(e,r,!1),If[r]=Cf,e},jf=bf,Mf=aa,Uf=da,Bf=yt,Nf=bt.exports,qf=fa,Gf=xf.IteratorPrototype,Vf=xf.BUGGY_SAFARI_ITERATORS,Ff=qe("iterator"),Kf=function(){return this},Wf=function(e,t,n,r,a,i,s){Lf(n,t,r);var o,d,u,c=function(e){if(e===a&&m)return m;if(!Vf&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,p=e.prototype,f=p[Ff]||p["@@iterator"]||a&&p[a],m=!Vf&&f||c(a),g="Array"==t&&p.entries||f;if(g&&(o=jf(g.call(new e)))!==Object.prototype&&o.next&&(jf(o)!==Gf&&(Mf?Mf(o,Gf):"function"!=typeof o[Ff]&&Bf(o,Ff,Kf)),Uf(o,l,!0)),"values"==a&&f&&"values"!==f.name&&(h=!0,m=function(){return f.call(this)}),p[Ff]!==m&&Bf(p,Ff,m),qf[t]=m,a)if(d={values:c("values"),keys:i?m:c("keys"),entries:c("entries")},s)for(u in d)(Vf||h||!(u in p))&&Nf(p,u,d[u]);else Pf({target:t,proto:!0,forced:Vf||h},d);return d},zf=pc.charAt,Hf=lo,$f=Ht,Qf=Wf,Yf=$f.set,Jf=$f.getterFor("String Iterator");Qf(String,"String",(function(e){Yf(this,{type:"String Iterator",string:Hf(e),index:0})}),(function(){var e,t=Jf(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=zf(n,r),t.index+=e.length,{value:e,done:!1})})),Xc("iterator");var Xf=J,Zf=kh,em=fa,tm=Ht,nm=Wf,rm=tm.set,am=tm.getterFor("Array Iterator"),im=nm(Array,"Array",(function(e,t){rm(this,{type:"Array Iterator",target:Xf(e),index:0,kind:t})}),(function(){var e=am(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");em.Arguments=em.Array,Zf("keys"),Zf("values"),Zf("entries");var sm=C,om=Dd,dm=Id,um=im,cm=yt,lm=qe,hm=lm("iterator"),pm=lm("toStringTag"),fm=um.values,mm=function(e,t){if(e){if(e[hm]!==fm)try{cm(e,hm,fm)}catch(t){e[hm]=fm}if(e[pm]||cm(e,pm,t),om[t])for(var n in um)if(e[n]!==um[n])try{cm(e,n,um[n])}catch(t){e[n]=um[n]}}};for(var gm in om)mm(sm[gm]&&sm[gm].prototype,gm);function vm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ym(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ym(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function ym(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bm(Object(n),!0).forEach((function(t){b.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}mm(dm,"DOMTokenList");var wm={react:{src:"https://pm.gamedistribution.com/react/16.14.0/umd/react.production.min.js",name:"React"},"react-dom":{src:"https://pm.gamedistribution.com/react-dom/16.14.0/umd/react-dom.production.min.js",name:"ReactDOM"},redux:{src:"https://pm.gamedistribution.com/redux/4.0.5/dist/redux.min.js",name:"Redux"},"react-redux":{src:"https://pm.gamedistribution.com/react-redux/7.2.1/dist/react-redux.min.js",name:"ReactRedux"},"material-ui-core":{src:"https://pm.gamedistribution.com/@material-ui/core/4.11.3/umd/material-ui.production.min.js",name:"MaterialUI"}},Am={},Em=function(e,t){Am[e]=_m(_m({},t),{},{isLoading:!1})},km=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(v.default(this,t),document.getElementById(n))e();else{var i=document.createElement("script");i.onload=function(){e()},i.id=n,i.setAttribute("crossorigin",!0),i.src=r,document.head.appendChild(i)}}.bind(this))},Tm=function(){var e=_.default(E.default.mark((function e(t){var n,r,a,i,s,o,d,u;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(r=Am[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=vm(r.dependencies),e.prev=8,a.s();case 10:if((i=a.n()).done){e.next=26;break}if(s=i.value,e.prev=12,o=wm[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,km({id:s,src:wm[s].src});case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),d=s.id,u=s.src,console.log("Could not load external script ".concat(d," ").concat(u),e.t0);case 24:e.next=10;break;case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(8),a.e(e.t1);case 31:return e.prev=31,a.f(),e.finish(31);case 34:return e.prev=34,e.next=37,km({id:t,src:r.source});case 37:n=window[t],e.next=43;break;case 40:e.prev=40,e.t2=e.catch(34),console.log("Could not load module ".concat(t," ").concat(r.source,"."),e.t2);case 43:return r.isLoading=!1,e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,null,[[8,28,31,34],[12,20],[34,40]])})));return function(t){return e.apply(this,arguments)}}(),xm=function e(t){var n=this;w.default(this,e),b.default(this,"load",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),b.default(this,"promo",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-stone-dynamic",a=t.package_version||"1.1.1",i=t.template||"puzzle",s=t.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},Em(this.moduleName,this.moduleConfig)},Sm=function e(t){var n=this;w.default(this,e),b.default(this,"load",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),b.default(this,"splash",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-air-dynamic",a=t.package_version||"1.2.0",i=t.template||"pluto",s=t.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},Em(this.moduleName,this.moduleConfig)},Dm=function(e,t){console.log(e,t)},Rm={},Om={},Im=null;function Cm(){for(var e,t=window,n=null,r=null;!e;){try{if("function"==typeof t.__tcfapi||"function"==typeof t.__cmp){"function"==typeof t.__tcfapi?(r=2,n=t.__tcfapi):(r=1,n=t.__cmp),e=t;break}}catch(e){}try{if(t.frames.__tcfapiLocator){r=2,e=t;break}}catch(e){}try{if(t.frames.__cmpLocator){r=1,e=t;break}}catch(e){}if(t===window.top)break;t=t.parent}return Rm.version=r,Rm.frame=e,Rm.function=n,Rm.version}function Pm(e){var t=this;return Im||(Im=new Promise(function(n){function r(t,r){if(Dm("Received a response from CMP",t),r){var a,i;if(!1!==t.gdprApplies)return"tcloaded"===t.eventStatus||"useractioncomplete"===t.eventStatus?(("boolean"!=typeof(i=(a=t)&&"boolean"==typeof a.gdprApplies?a.gdprApplies:e.defaultGdprScope)||!0===i&&"string"!=typeof a.tcString)&&n({result:"cmpUnexpectedResponse",cmp:Rm,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}v.default(this,t),Cm(),Rm.frame?2===Rm.version?(Dm("TCF v2 CMP found. Fetching the consent."),Rm.function?(Dm("CMP API is directly accessible, calling it now..."),Rm.function("addEventListener",Rm.version,r)):(Dm("CMP API is outside the current iframe, calling it now..."),function(e,t,n){var r=this,a="__tcfapi";function i(e){var t="".concat(a,"Return"),n="string"==typeof e.data&&e.data.indexOf(t)>=0?JSON.parse(e.data):e.data;if(n[t]&&n[t].callId){var r=n[t];void 0!==Om[r.callId]&&Om[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){v.default(this,r);var o=Math.random()+"",d="".concat(a,"Call"),u=b.default({},d,{command:e,parameter:s,callId:o,version:n});Om[o]=i,t.postMessage(u,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,Rm.version,n)}("addEventListener",Rm.frame,r))):n({result:"cmpVersionNotV2",cmp:Rm}):n({result:"cmpNotFound"})}.bind(this)),Im)}var Lm=new(function(){function e(){w.default(this,e),this.productName="Game Distribution"}var t;return A.default(e,[{key:"track",value:(t=_.default(E.default.mark((function e(t){var n,r,a,i,s,o;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null==t||null===(n=t.visitor)||void 0===n?void 0:n.visitorId){e.next=3;break}return e.abrupt("return");case 3:return a=encodeURIComponent(this.productName),i=encodeURIComponent(r),e.prev=5,s="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(a,"/user_id/").concat(i),e.next=9,fetch(s,{method:"POST"});case 9:e.next=25;break;case 12:return e.prev=12,e.t0=e.catch(5),console.log("GAME_DOCK. fail v4",e.t0),e.prev=15,o="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(a,"/user_id/").concat(i),e.next=19,fetch(o,{method:"POST"});case 19:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(15),console.log("GAME_DOCK. fail v6",e.t1);case 25:case"end":return e.stop()}}),e,this,[[5,12],[15,22]])}))),function(e){return t.apply(this,arguments)})}]),e}());function jm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jm(Object(n),!0).forEach((function(t){b.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Um=null,Bm=function(){function e(t){var n=this;if(w.default(this,e),Um)return Um;Um=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._parentURL=this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){v.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){v.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e=this;v.default(this,n),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),window.addEventListener("DOMNodeInserted",function(){if(v.default(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var t=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];t&&t.setAttribute("style","display:none")}}.bind(this)),this._checkFullscreen()}.bind(this))}var t,n,r,a,i,s,o,u,c,l;return A.default(e,[{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var e=Cm();console.log("CMP found",e),_.default(E.default.mark((function e(){var t;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm({});case 2:t=e.sent,console.log("After lookup IAB consent",t);case 4:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),n=this._isMasterGameURL();this._isLoaded=(e||t&&!n)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"}),this._initGamedockTracker(window.GamedockSDK,"gameplay")}catch(e){}}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(l=_.default(E.default.mark((function e(t,n){var r,a=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:this._gameData=e.sent,this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(r=this._gameData.enableAds)||void 0===r?void 0:r.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){return v.default(this,a),console.error(e.message||e)}.bind(this))),this._sendSDKReady(),t(this._gameData),e.next=20;break;case 15:e.prev=15,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),n(e.t0);case 20:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e,t){return l.apply(this,arguments)})},{key:"_getDefaultOptions",value:function(){return{debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",onEvent:function(e){},onLoaderEvent:function(e){},flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onInit:function(e){},onError:function(e){},loader:{}}}},{key:"_extendDefaultOptions",value:function(e,t){var n=S.default(e);this.options=t?d.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=ap.version,t=console.log("%c %c %c GameDistribution.com HTML5 SDK | Version: "+e+" %c %c %c","background: #9854d8","background: #6c2ca7","color: #fff; background: #450f78;","background: #6c2ca7","background: #9854d8","background: #ffffff");console.log.apply(console,t)}}},{key:"_sendTunnlEvent",value:function(e){var t={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(D.default.stringify(t)))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=d.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,d.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!d.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(d.Ls.set("gd_debug_ex",!0),d.Ls.set("gd_disable_midroll_timer",!0),d.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(d.Ls.set("gd_debug_ex",!0),d.Ls.set("gd_disable_midroll_timer",!0)),d.Ls.getBoolean("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new d.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:d.getIframeDepth(),version:ap.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:d.getMobilePlatform(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var t=["https://cdn.gamedock.io/gamedock-web-tracker/4.3.0/script/gamedock-sdk.min.js"];d.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){v.default(this,e);var t=this._initGamedockTracker(window.GamedockSDK,"pageview");Lm.track(t)}.bind(this)).catch(function(t){v.default(this,e),this._sendSDKError(t)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e,t){if(!this._bridge.isCoreSDKMode){var n=e.initialize("gd",this._parentDomain);return n.tracking.trackEvent(t,{pageId:this.options.gameId,pageType:"game"}),n}}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var t=["https://ext.minijuegosgratis.com/external-host/main.js"];d.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){v.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];d.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return v.default(this,e),window.ga}.bind(this)}).then(function(){v.default(this,e),window.ga("create","UA-60359297-49",{name:"gd",cookieExpires:7776e3,sampleRate:5},"auto"),this._bridge.noGAPageView||window.ga("gd.send","pageview"),this._userDeclinedTracking||window.ga("gd.set","anonymizeIp",!0)}.bind(this)).catch(function(t){v.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new d.EventBus,d.SDKEvents.forEach(function(t){var n=this;return v.default(this,e),this.eventBus.subscribe(t,function(e){return v.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),d.IMAEvents.forEach(function(t){var n=this;return v.default(this,e),this.eventBus.subscribe(t,function(e){return v.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(v.default(this,e),"developer.gamedistribution.com"===this._parentDomain||!0===new RegExp("^localhost").test(this._parentDomain)){fetch("https://game.api.gamedistribution.com/game/v2/hasapi/".concat(this.options.gameId,"?timestamp=").concat((new Date).valueOf()));try{var t=JSON.stringify({type:"GD_SDK_IMPLEMENTED",gameID:this.options.gameId});window.location!==window.top.location?window.top.postMessage(t,"*"):null!==window.opener&&window.opener.location!==window.location&&window.opener.postMessage(t,"*")}catch(e){}}}.bind(this),"ima"),this.eventBus.subscribe("CONTENT_PAUSE_REQUESTED",function(){return v.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){v.default(this,e),this.msgrt.send("ad.impression")}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){v.default(this,e),this.msgrt.send("ad.error",{message:t.message,details:t.details})}.bind(this),"ima"),this.eventBus.subscribe("AD_SDK_REQUEST",function(t){v.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){v.default(this,e),t.message.startsWith("Blocked:")?this._bridge.noBlockerEvent||(this.msgrt.send("error",{message:t.message}),this._hasBlocker||(this._hasBlocker=!0,this._sendTunnlEvent(3))):this.msgrt.send("error",{message:t.message})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_EMPTY",function(t){v.default(this,e),this.msgrt.send("tunnl.keys.empty",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_REQUEST_KEYS_FALLBACK",function(t){v.default(this,e),this.msgrt.send("tunnl.keys.fallback",{message:t.message,details:t.details})}.bind(this),"sdk"),this.eventBus.subscribe("AD_T4R",function(t){return v.default(this,e),this.msgrt.send("adt4r")}.bind(this),"sdk")}},{key:"_checkGameId",value:function(){this.options.gameId===this._defaults.gameId&&this._sendSDKError("Check correctness of your GAME ID. Otherwise, no revenue will be recorded.")}},{key:"_getDefaultGameData",value:function(){return{gameId:this.options.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}},{key:"_getGameDataUrl",value:function(){var e=void 0!==this._topDomain&&"undefined"!==this._topDomain?this._topDomain:this._parentDomain;return"https://game.api.gamedistribution.com/game/v4/get/".concat(this.options.gameId.replace(/-/g,""),"/?domain=").concat(e,"&v=").concat(ap.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(c=_.default(E.default.mark((function e(){var t,n,r=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this._gameData,t=void 0===this._gameData.dmain||this._gameData.dmain,(n.bloc_gard&&!0===n.bloc_gard.enabled||!t)&&(this.msgrt.send("blocked"),setTimeout(function(){v.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(D.default.stringify({domain:this._parentDomain,id:n.gameId,img:this._get_game_thumbnail_url(),title:n.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){v.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;d.Ls.available&&d.Ls.getBoolean("gd_debug_ex")&&(d.Ls.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r=this._gameData,a=r.gdpr&&!0===r.gdpr.consent,i=r.loader,s=null===(e=r.promo)||void 0===e?void 0:e[null===(t=r.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];r.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled?null!=s&&s.enabled?this._createPromoBeforeSplash(r,a):i.enabled?this._createSplash(r,a):this.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"):i.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||a?null!=s&&s.enabled?this._createPromoBeforeSplash(r,a):!1!==i.enabled&&this._createSplash(r,a):null!=s&&s.enabled&&this._createPromo(r,a))}},{key:"_initializeVideoAd",value:(u=_.default(E.default.mark((function e(){var t;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=d.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new d.Macros({game:t,bridge:this._bridge}),this.adInstance=new Mp(this.options.flashSettings.adContainerId,this.options.advertisementSettings,{parentURL:this._parentURL,parentDomain:this._parentDomain,topDomain:this._topDomain}),this.adInstance.gameId=t.gameId,this.adInstance.category=t.category,this.adInstance.tags=t.tags,this.adInstance.noPreroll=this._bridge.noPreroll,this.adInstance.macros=this.macros,this.adInstance.gameData=t,this.adInstance.msgrt=this.msgrt,this.adInstance.PackageJSON=ap,e.next=16,this.adInstance.start();case 16:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"_sendSDKReady",value:function(){var e="Everything is ready.";this.eventBus.broadcast("SDK_READY",{message:e,status:"success"});try{this.options.onInit(e)}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){d.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var e=this;return new Promise(function(t){var n=this;v.default(this,e);var r=this._getDefaultGameData(),a=this._getGameDataUrl();fetch(a).then(function(e){return v.default(this,n),e.json()}.bind(this)).then(function(e){if(v.default(this,n),e.success){var a,i=e.result.game,s={gameId:i.gameMd5,slug:i.slug,pname:i.pname,dname:i.dname,status:i.status,description:i.description,enableAds:!0===i.enableAds||!0===(null===(a=i.enableAds)||void 0===a?void 0:a.enabled),preroll:i.preRoll,midroll:6e4*i.timeAds,rewardedAds:i.rewardedAds,title:i.title,tags:i.tags,category:i.category,assets:i.assets,disp_2nd_prer:i.disp_2nd_prer,ctry_vst:i.ctry_vst,ctry:i.ctry,crtv:i.crtv,dmain:i.dmain,block_exts:this._parseAndSelectRandomOne(i.push_cuda),bloc_gard:this._parseAndSelectRandomOne(i.bloc_gard),cookie:this._parseAndSelectRandomOne(i.cookie),gdpr:this._parseAndSelectRandomOne(i.gdpr),diagnostic:this._parseAndSelectRandomOne(i.diagnostic),sdk:this._parseAndSelectRandomOne(i.sdk)||{},loader:this._parseAndSelectRandomOne(i.loader)||{},splash:this._parseAndSelectRandomOne(i.splash)||{},promo:this._parseAndSelectRandomOne(i.promo)||{},dAds:this._parseAndSelectRandomOne(i.dads)||{},pAds:this._parseAndSelectRandomOne(i.pads)||{},mAds:this._parseAndSelectRandomOne(i.mads)||{},rAds:this._parseAndSelectRandomOne(i.rads)||{}},o=d.extendDefaults(S.default(r),s);this._bridge.noPreroll=(!this._getisMobile()||!1!==o.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(o),d.setDankLog(o.diagnostic),t(o)}else r.failed=!0,t(r)}.bind(this)).catch(function(e){v.default(this,n),r.failed=!0,t(r)}.bind(this))}.bind(this))}},{key:"_createSplash",value:(o=_.default(E.default.mark((function e(t,n){var r,a,i=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:r=e.sent,(a=new r(Mm(Mm({},this.options),{},{isConsentDomain:n,version:ap.version}),t,this._parentDomain)).on("playClick",function(){var e=this;if(v.default(this,i),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this.showAd(d.AdType.Interstitial,{position:"preroll"}).catch(function(t){v.default(this,e)}.bind(this))}.bind(this)),this.onPauseGame("Pause the game and wait for a user gesture","success"),this.eventBus.subscribe("SDK_GAME_PAUSE",function(){v.default(this,i),a.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){v.default(this,i),a.hide()}.bind(this));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(s=_.default(E.default.mark((function e(t,n){var r,a,i,s,o=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Mm(Mm({},this.options),{},{isConsentDomain:n,version:ap.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){v.default(this,o),s.hide(),this._createSplash(t,n)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(t,n);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return s.apply(this,arguments)})},{key:"_createPromo",value:(i=_.default(E.default.mark((function e(t,n){var r,a,i,s,o=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Mm(Mm({},this.options),{},{isConsentDomain:n,version:ap.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){v.default(this,o),s.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return i.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(d.AdType.Interstitial).catch(function(){v.default(this,e)}.bind(this))}},{key:"showAd",value:(a=_.default(E.default.mark((function e(t,n){var r=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=_.default(E.default.mark((function e(a,i){var s,o,d,u,c,l=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s={adType:t,params:n,adTimestamp:r.adRequestTimer},e.next=4,r.sdkReady;case 4:return o=e.sent,e.next=7,r.videoAdReady;case 7:return r._sendLoadedEvent(),r.rejectAdIfGameBlocked({gameData:o,adRequest:s}),r.rejectAdIfAdDisabled({gameData:o,adRequest:s}),r.rejectAdIfUnsupportedType({adRequest:s}),r.rejectAdIfRewardedDisabled({gameData:o,adRequest:s}),r.rejectAdIfAdRateHits({gameData:o,adRequest:s}),d="main.showad",u=function(e){v.default(this,l),r.eventBus.unsubscribeScope(d),r.onResumeGame(e.message,"warning"),i(e.message)}.bind(this),c=function(e){v.default(this,l),r.eventBus.unsubscribeScope(d),r.adRequestTimer=Date.now(),r.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),a(e.message)}.bind(this),r.eventBus.subscribe("AD_ERROR",u,d),r.eventBus.subscribe("AD_SDK_CANCELED",u,d),r.eventBus.subscribe("AD_SUCCESS",c,d),e.next=21,r.adInstance.startAd(s);case 21:r._post_message({topic:"adrequest.instream"}),e.next=28;break;case 24:e.prev=24,e.t0=e.catch(0),r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 28:case"end":return e.stop()}}),e,this,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return a.apply(this,arguments)})},{key:"rejectAdIfGameBlocked",value:function(e){var t=e.gameData;if(t.bloc_gard&&!0===t.bloc_gard.enabled)throw new Error("Game or domain is blocked.")}},{key:"rejectAdIfAdDisabled",value:function(e){if(!e.gameData.enableAds||this._whitelabelPartner)throw new Error("Advertisements are disabled.")}},{key:"rejectAdIfUnsupportedType",value:function(e){var t=e.adRequest;if(t.adType){if(t.adType!==d.AdType.Interstitial&&t.adType!==d.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=d.AdType.Interstitial}},{key:"rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===d.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"rejectAdIfAdRateHits",value:function(e){var t=e.gameData;if(e.adRequest.adType===d.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<t.midroll)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=_.default(E.default.mark((function e(t){var n=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=_.default(E.default.mark((function e(r,a){var i,s;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return i=e.sent,e.next=6,n.videoAdReady;case 6:if(!i.bloc_gard||!0!==i.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(i.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=d.AdType.Rewarded,e.next=16;break;case 14:if(t===d.AdType.Interstitial||t===d.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==d.AdType.Rewarded||i.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:s=e.sent,r(s),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"cancelAd",value:(n=_.default(E.default.mark((function e(){var t=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=_.default(E.default.mark((function e(n,r){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.adInstance.cancel(),t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),r()}catch(e){t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var t=this;return new Promise(function(){var n=_.default(E.default.mark((function n(r,a){var i;return E.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return i=n.sent,n.next=6,t.videoAdReady;case 6:if(!i.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:a("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),a(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_START";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"onPauseGame",value:function(e,t){this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_PAUSE";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"openConsole",value:function(){try{new d.ImplementationTest(this).start(),d.Ls.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var t=this._gameData;t.sdk.fullscreen&&"auto"===t.sdk.fullscreen&&document.addEventListener("click",function(){if(v.default(this,e),!this._isFullScreen){var t=document.body,n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullscreen;if(n)n.call(t);else if(void 0!==window.ActiveXObject){var r=new ActiveXObject("WScript.Shell");null!==r&&r.SendKeys("{F11}")}this._isFullScreen=!0}}.bind(this))}catch(e){console.log("Fullscreen error handled...",e)}}},{key:"_allowExternals",value:function(e){var t=this;void 0!==this.window_open&&(!1===e.enabled?window.open=function(e){v.default(this,t),this.msgrt.send("external",{message:"C> ".concat(e)}),(e.startsWith("https://play.google.com")||e.startsWith("https://itunes.apple.com"))&&this.window_open.call(null,e)}.bind(this):window.open=this.window_open)}},{key:"_removeExternalsInHtml",value:function(e){var t=this;!1===e.enabled&&window.document.querySelectorAll("a").forEach(function(e){var n=this;v.default(this,t);var r=!!(e.innerText.toLowerCase().includes("start")||e.innerText.toLowerCase().includes("play")||e.innerText.toLowerCase().includes("continue")),a=e.getAttribute("href");e.removeAttribute("href"),r||(e.onclick=function(e){return v.default(this,n),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var a=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:d.getParentUrl()),i=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:d.getParentDomain()),s=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:d.getTopDomain()),o=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:o,noLoadedEvent:u,noBlockerEvent:c,noPreroll:m,parentURL:a,parentDomain:i,topDomain:s&&s.length?s:i,noGAPageView:l,noLotamePageView:h,noGamedockSDK:p,noMinijuegosSDK:f,version:r.version,pauseGameOnStartup:g,depth:d.getIframeDepth(),domainMatched:i===s,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new T.default(location.href,!0);if(!n.query.gd_zone_config)return;e=n.query.gd_zone_config}else if(t.test(document.referrer)){var r=new T.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new T.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(m.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Sm(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=_.default(E.default.mark((function e(t){var n,r,a,i,s;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null===(n=t.promo)||void 0===n?void 0:n[null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll],s=new xm(i),e.abrupt("return",s.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(m.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new T.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(D.default.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new T.default(e,!0);return n.query=Mm(Mm({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return m.Base64.encode(JSON.stringify(e))}},{key:"_parseAndSelectRandomOne",value:function(e){var t=this._selectRandomOne("object"===y.default(e)?e:d.parseJSON(e));return t&&t.version?ap.version>=t.version?t:void 0:t}},{key:"_selectRandomOne",value:function(e){var t=this;if(!Np(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){v.default(this,t),e.weight=e.weight||1,n+=e.weight}.bind(this));var r=Math.floor(Math.random()*Math.floor(n));n=0;for(var a=0;a<e.length;a++){var i=e[a];if(r<(n+=i.weight))return i}}},{key:"session",value:function(){var e=this;return new Promise(function(){var t=_.default(E.default.mark((function t(n,r){var a;return E.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sdkReady;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:a=e._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:e._bridge.parentDomain,topDomain:e._bridge.topDomain,parentURL:e._bridge.parentURL,depth:e._bridge.depth,loadedByGameZone:e._bridge.isTokenGameURL}});case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,n){return t.apply(this,arguments)}}())}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,t=this._gameData,n=t.assets.find(function(t){return v.default(this,e),t.hasOwnProperty("name")&&512===t.width&&512===t.height}.bind(this));return n||(n=t.assets.length>0?t.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(n.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,a=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var i=window.top||window.parent;i&&i.postMessage({source:"gdsdk",topic:n,data:r},a)}catch(e){console.error((null==e?void 0:e.message)||e)}}}]),e}(),Nm=new function e(){var t=this;w.default(this,e),b.default(this,"load",_.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tm("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),b.default(this,"showLeaderboard",function(){var e=_.default(E.default.mark((function e(n){var r;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=window.GD_OPTIONS.gameId,t.leaderboard){e.next=4;break}return e.next=4,t.load();case 4:t.leaderboard.showLeaderBoard(r,n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),b.default(this,"addScore",function(){var e=_.default(E.default.mark((function e(n){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.leaderboard){e.next=3;break}return e.next=3,t.load();case 3:t.leaderboard.addScore(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},Em(this.moduleName,this.moduleConfig)},qm=new Bm(function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":y.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===y.default(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}());function Gm(){var e=this;this.AdType=d.AdType,this.preloadAd=function(e){return qm.preloadAd(e)},this.showAd=function(e,t){return e===d.AdType.Display?qm.showDisplayAd(t):qm.showAd(e)},this.cancelAd=function(){return qm.cancelAd()},this.openConsole=function(){qm.openConsole()},this.getSession=function(){return qm.session()},this.leaderboard={show:function(){v.default(this,e),Nm.showLeaderboard()}.bind(this),addScore:function(t){v.default(this,e),Nm.addScore(t)}.bind(this)}}Gm.prototype=new function(){this.showBanner=function(){qm.showBanner()},this.play=function(){},this.customLog=function(){}},window.gdsdk=new Gm,window.gdApi=window.gdsdk;
|