@bygd/gd-sdk-pes 1.27.13 → 1.27.16

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/asyncToGenerator"),t=require("@babel/runtime/helpers/newArrowCheck"),n=require("@babel/runtime/helpers/typeof"),r=require("@babel/runtime/regenerator"),a=require("@bygd/gd-sdk-era/dist/default"),i=require("@babel/runtime/helpers/classCallCheck"),s=require("@babel/runtime/helpers/defineProperty"),o=require("url-parse"),d=require("validator"),u=require("is-valid-domain"),l=require("get-value"),c=require("set-value"),h=require("lodash.clonedeep"),f=require("@babel/runtime/helpers/createClass"),p=require("can-autoplay"),m=require("is-plain-object"),v=require("querystringify"),g=require("lodash.merge"),y=require("js-base64"),b=require("events");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var w=_(e),A=_(t),k=_(n),E=_(r),x=_(i),S=_(s),D=_(o),T=_(d),R=_(u),I=_(l),O=_(c),P=_(h),C=_(f),L=_(p),M=_(v),U=_(g),j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},B=function(e){return e&&e.Math==Math&&e},N=B("object"==typeof globalThis&&globalThis)||B("object"==typeof window&&window)||B("object"==typeof self&&self)||B("object"==typeof j&&j)||function(){return this}()||Function("return this")(),G={},q=function(e){try{return!!e()}catch(e){return!0}},F=!q((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),V=Function.prototype.call,K=V.bind?V.bind(V):function(){return V.apply(V,arguments)},W={},H={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,$=z&&!H.call({1:2},1);W.f=$?function(e){var t=z(this,e);return!!t&&t.enumerable}:H;var Q,Y,J=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},X=Function.prototype,Z=X.bind,ee=X.call,te=Z&&Z.bind(ee),ne=Z?function(e){return e&&te(ee,e)}:function(e){return e&&function(){return ee.apply(e,arguments)}},re=ne,ae=re({}.toString),ie=re("".slice),se=function(e){return ie(ae(e),8,-1)},oe=ne,de=q,ue=se,le=N.Object,ce=oe("".split),he=de((function(){return!le("z").propertyIsEnumerable(0)}))?function(e){return"String"==ue(e)?ce(e,""):le(e)}:le,fe=N.TypeError,pe=function(e){if(null==e)throw fe("Can't call method on "+e);return e},me=he,ve=pe,ge=function(e){return me(ve(e))},ye=function(e){return"function"==typeof e},be=ye,_e=function(e){return"object"==typeof e?null!==e:be(e)},we=N,Ae=ye,ke=function(e){return Ae(e)?e:void 0},Ee=function(e,t){return arguments.length<2?ke(we[e]):we[e]&&we[e][t]},xe=ne({}.isPrototypeOf),Se=Ee("navigator","userAgent")||"",De=N,Te=Se,Re=De.process,Ie=De.Deno,Oe=Re&&Re.versions||Ie&&Ie.version,Pe=Oe&&Oe.v8;Pe&&(Y=(Q=Pe.split("."))[0]>0&&Q[0]<4?1:+(Q[0]+Q[1])),!Y&&Te&&(!(Q=Te.match(/Edge\/(\d+)/))||Q[1]>=74)&&(Q=Te.match(/Chrome\/(\d+)/))&&(Y=+Q[1]);var Ce=Y,Le=Ce,Me=q,Ue=!!Object.getOwnPropertySymbols&&!Me((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41})),je=Ue&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Be=Ee,Ne=ye,Ge=xe,qe=je,Fe=N.Object,Ve=qe?function(e){return"symbol"==typeof e}:function(e){var t=Be("Symbol");return Ne(t)&&Ge(t.prototype,Fe(e))},Ke=N.String,We=function(e){try{return Ke(e)}catch(e){return"Object"}},He=ye,ze=We,$e=N.TypeError,Qe=function(e){if(He(e))return e;throw $e(ze(e)+" is not a function")},Ye=Qe,Je=function(e,t){var n=e[t];return null==n?void 0:Ye(n)},Xe=K,Ze=ye,et=_e,tt=N.TypeError,nt={exports:{}},rt=N,at=Object.defineProperty,it=function(e,t){try{at(rt,e,{value:t,configurable:!0,writable:!0})}catch(n){rt[e]=t}return t},st=it,ot=N["__core-js_shared__"]||st("__core-js_shared__",{}),dt=ot;(nt.exports=function(e,t){return dt[e]||(dt[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var ut=pe,lt=N.Object,ct=function(e){return lt(ut(e))},ht=ct,ft=ne({}.hasOwnProperty),pt=Object.hasOwn||function(e,t){return ft(ht(e),t)},mt=ne,vt=0,gt=Math.random(),yt=mt(1..toString),bt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+yt(++vt+gt,36)},_t=N,wt=nt.exports,At=pt,kt=bt,Et=Ue,xt=je,St=wt("wks"),Dt=_t.Symbol,Tt=Dt&&Dt.for,Rt=xt?Dt:Dt&&Dt.withoutSetter||kt,It=function(e){if(!At(St,e)||!Et&&"string"!=typeof St[e]){var t="Symbol."+e;Et&&At(Dt,e)?St[e]=Dt[e]:St[e]=xt&&Tt?Tt(t):Rt(t)}return St[e]},Ot=K,Pt=_e,Ct=Ve,Lt=Je,Mt=function(e,t){var n,r;if("string"===t&&Ze(n=e.toString)&&!et(r=Xe(n,e)))return r;if(Ze(n=e.valueOf)&&!et(r=Xe(n,e)))return r;if("string"!==t&&Ze(n=e.toString)&&!et(r=Xe(n,e)))return r;throw tt("Can't convert object to primitive value")},Ut=It,jt=N.TypeError,Bt=Ut("toPrimitive"),Nt=function(e,t){if(!Pt(e)||Ct(e))return e;var n,r=Lt(e,Bt);if(r){if(void 0===t&&(t="default"),n=Ot(r,e,t),!Pt(n)||Ct(n))return n;throw jt("Can't convert object to primitive value")}return void 0===t&&(t="number"),Mt(e,t)},Gt=Ve,qt=function(e){var t=Nt(e,"string");return Gt(t)?t:t+""},Ft=_e,Vt=N.document,Kt=Ft(Vt)&&Ft(Vt.createElement),Wt=function(e){return Kt?Vt.createElement(e):{}},Ht=Wt,zt=!F&&!q((function(){return 7!=Object.defineProperty(Ht("div"),"a",{get:function(){return 7}}).a})),$t=F,Qt=K,Yt=W,Jt=J,Xt=ge,Zt=qt,en=pt,tn=zt,nn=Object.getOwnPropertyDescriptor;G.f=$t?nn:function(e,t){if(e=Xt(e),t=Zt(t),tn)try{return nn(e,t)}catch(e){}if(en(e,t))return Jt(!Qt(Yt.f,e,t),e[t])};var rn={},an=N,sn=_e,on=an.String,dn=an.TypeError,un=function(e){if(sn(e))return e;throw dn(on(e)+" is not an object")},ln=F,cn=zt,hn=un,fn=qt,pn=N.TypeError,mn=Object.defineProperty;rn.f=ln?mn:function(e,t,n){if(hn(e),t=fn(t),hn(n),cn)try{return mn(e,t,n)}catch(e){}if("get"in n||"set"in n)throw pn("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var vn=rn,gn=J,yn=F?function(e,t,n){return vn.f(e,t,gn(1,n))}:function(e,t,n){return e[t]=n,e},bn={exports:{}},_n=ye,wn=ot,An=ne(Function.toString);_n(wn.inspectSource)||(wn.inspectSource=function(e){return An(e)});var kn,En,xn,Sn=wn.inspectSource,Dn=ye,Tn=Sn,Rn=N.WeakMap,In=Dn(Rn)&&/native code/.test(Tn(Rn)),On=nt.exports,Pn=bt,Cn=On("keys"),Ln=function(e){return Cn[e]||(Cn[e]=Pn(e))},Mn={},Un=In,jn=N,Bn=ne,Nn=_e,Gn=yn,qn=pt,Fn=ot,Vn=Ln,Kn=Mn,Wn=jn.TypeError,Hn=jn.WeakMap;if(Un||Fn.state){var zn=Fn.state||(Fn.state=new Hn),$n=Bn(zn.get),Qn=Bn(zn.has),Yn=Bn(zn.set);kn=function(e,t){if(Qn(zn,e))throw new Wn("Object already initialized");return t.facade=e,Yn(zn,e,t),t},En=function(e){return $n(zn,e)||{}},xn=function(e){return Qn(zn,e)}}else{var Jn=Vn("state");Kn[Jn]=!0,kn=function(e,t){if(qn(e,Jn))throw new Wn("Object already initialized");return t.facade=e,Gn(e,Jn,t),t},En=function(e){return qn(e,Jn)?e[Jn]:{}},xn=function(e){return qn(e,Jn)}}var Xn={set:kn,get:En,has:xn,enforce:function(e){return xn(e)?En(e):kn(e,{})},getterFor:function(e){return function(t){var n;if(!Nn(t)||(n=En(t)).type!==e)throw Wn("Incompatible receiver, "+e+" required");return n}}},Zn=F,er=pt,tr=Function.prototype,nr=Zn&&Object.getOwnPropertyDescriptor,rr=er(tr,"name"),ar={EXISTS:rr,PROPER:rr&&"something"===function(){}.name,CONFIGURABLE:rr&&(!Zn||Zn&&nr(tr,"name").configurable)},ir=N,sr=ye,or=pt,dr=yn,ur=it,lr=Sn,cr=ar.CONFIGURABLE,hr=Xn.get,fr=Xn.enforce,pr=String(String).split("String");(bn.exports=function(e,t,n,r){var a,i=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet,d=r&&void 0!==r.name?r.name:t;sr(n)&&("Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!or(n,"name")||cr&&n.name!==d)&&dr(n,"name",d),(a=fr(n)).source||(a.source=pr.join("string"==typeof d?d:""))),e!==ir?(i?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:dr(e,t,n)):s?e[t]=n:ur(t,n)})(Function.prototype,"toString",(function(){return sr(this)&&hr(this).source||lr(this)}));var mr={},vr=Math.ceil,gr=Math.floor,yr=function(e){var t=+e;return t!=t||0===t?0:(t>0?gr:vr)(t)},br=yr,_r=Math.max,wr=Math.min,Ar=function(e,t){var n=br(e);return n<0?_r(n+t,0):wr(n,t)},kr=yr,Er=Math.min,xr=function(e){return e>0?Er(kr(e),9007199254740991):0},Sr=xr,Dr=function(e){return Sr(e.length)},Tr=ge,Rr=Ar,Ir=Dr,Or=function(e){return function(t,n,r){var a,i=Tr(t),s=Ir(i),o=Rr(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}},Pr={includes:Or(!0),indexOf:Or(!1)},Cr=pt,Lr=ge,Mr=Pr.indexOf,Ur=Mn,jr=ne([].push),Br=function(e,t){var n,r=Lr(e),a=0,i=[];for(n in r)!Cr(Ur,n)&&Cr(r,n)&&jr(i,n);for(;t.length>a;)Cr(r,n=t[a++])&&(~Mr(i,n)||jr(i,n));return i},Nr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Gr=Br,qr=Nr.concat("length","prototype");mr.f=Object.getOwnPropertyNames||function(e){return Gr(e,qr)};var Fr={};Fr.f=Object.getOwnPropertySymbols;var Vr=Ee,Kr=mr,Wr=Fr,Hr=un,zr=ne([].concat),$r=Vr("Reflect","ownKeys")||function(e){var t=Kr.f(Hr(e)),n=Wr.f;return n?zr(t,n(e)):t},Qr=pt,Yr=$r,Jr=G,Xr=rn,Zr=function(e,t){for(var n=Yr(t),r=Xr.f,a=Jr.f,i=0;i<n.length;i++){var s=n[i];Qr(e,s)||r(e,s,a(t,s))}},ea=q,ta=ye,na=/#|\.prototype\./,ra=function(e,t){var n=ia[aa(e)];return n==oa||n!=sa&&(ta(t)?ea(t):!!t)},aa=ra.normalize=function(e){return String(e).replace(na,".").toLowerCase()},ia=ra.data={},sa=ra.NATIVE="N",oa=ra.POLYFILL="P",da=ra,ua=N,la=G.f,ca=yn,ha=bn.exports,fa=it,pa=Zr,ma=da,va=function(e,t){var n,r,a,i,s,o=e.target,d=e.global,u=e.stat;if(n=d?ua:u?ua[o]||fa(o,{}):(ua[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=la(n,r))&&s.value:n[r],!ma(d?r:o+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;pa(i,a)}(e.sham||a&&a.sham)&&ca(i,"sham",!0),ha(n,r,i,e)}},ga=Br,ya=Nr,ba=Object.keys||function(e){return ga(e,ya)},_a=ct,wa=ba;va({target:"Object",stat:!0,forced:q((function(){wa(1)}))},{keys:function(e){return wa(_a(e))}});var Aa=Function.prototype,ka=Aa.apply,Ea=Aa.bind,xa=Aa.call,Sa="object"==typeof Reflect&&Reflect.apply||(Ea?xa.bind(ka):function(){return xa.apply(ka,arguments)}),Da=se,Ta=Array.isArray||function(e){return"Array"==Da(e)},Ra={};Ra[It("toStringTag")]="z";var Ia,Oa="[object z]"===String(Ra),Pa=N,Ca=Oa,La=ye,Ma=se,Ua=It("toStringTag"),ja=Pa.Object,Ba="Arguments"==Ma(function(){return arguments}()),Na=Ca?Ma: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=ja(e),Ua))?n:Ba?Ma(t):"Object"==(r=Ma(t))&&La(t.callee)?"Arguments":r},Ga=Na,qa=N.String,Fa=function(e){if("Symbol"===Ga(e))throw TypeError("Cannot convert a Symbol value to a string");return qa(e)},Va=rn,Ka=un,Wa=ge,Ha=ba,za=F?Object.defineProperties:function(e,t){Ka(e);for(var n,r=Wa(t),a=Ha(t),i=a.length,s=0;i>s;)Va.f(e,n=a[s++],r[n]);return e},$a=Ee("document","documentElement"),Qa=un,Ya=za,Ja=Nr,Xa=Mn,Za=$a,ei=Wt,ti=Ln("IE_PROTO"),ni=function(){},ri=function(e){return"<script>"+e+"<\/script>"},ai=function(e){e.write(ri("")),e.close();var t=e.parentWindow.Object;return e=null,t},ii=function(){try{Ia=new ActiveXObject("htmlfile")}catch(e){}var e,t;ii="undefined"!=typeof document?document.domain&&Ia?ai(Ia):((t=ei("iframe")).style.display="none",Za.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ri("document.F=Object")),e.close(),e.F):ai(Ia);for(var n=Ja.length;n--;)delete ii.prototype[Ja[n]];return ii()};Xa[ti]=!0;var si=Object.create||function(e,t){var n;return null!==e?(ni.prototype=Qa(e),n=new ni,ni.prototype=null,n[ti]=e):n=ii(),void 0===t?n:Ya(n,t)},oi={},di=ne([].slice),ui=se,li=ge,ci=mr.f,hi=di,fi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];oi.f=function(e){return fi&&"Window"==ui(e)?function(e){try{return ci(e)}catch(e){return hi(fi)}}(e):ci(li(e))};var pi={},mi=It;pi.f=mi;var vi=N,gi=pt,yi=pi,bi=rn.f,_i=function(e){var t=vi.Symbol||(vi.Symbol={});gi(t,e)||bi(t,e,{value:yi.f(e)})},wi=rn.f,Ai=pt,ki=It("toStringTag"),Ei=function(e,t,n){e&&!Ai(e=n?e:e.prototype,ki)&&wi(e,ki,{configurable:!0,value:t})},xi=Qe,Si=ne(ne.bind),Di=function(e,t){return xi(e),void 0===t?e:Si?Si(e,t):function(){return e.apply(t,arguments)}},Ti=ne,Ri=q,Ii=ye,Oi=Na,Pi=Sn,Ci=function(){},Li=[],Mi=Ee("Reflect","construct"),Ui=/^\s*(?:class|function)\b/,ji=Ti(Ui.exec),Bi=!Ui.exec(Ci),Ni=function(e){if(!Ii(e))return!1;try{return Mi(Ci,Li,e),!0}catch(e){return!1}},Gi=!Mi||Ri((function(){var e;return Ni(Ni.call)||!Ni(Object)||!Ni((function(){e=!0}))||e}))?function(e){if(!Ii(e))return!1;switch(Oi(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Bi||!!ji(Ui,Pi(e))}:Ni,qi=N,Fi=Ta,Vi=Gi,Ki=_e,Wi=It("species"),Hi=qi.Array,zi=function(e){var t;return Fi(e)&&(t=e.constructor,(Vi(t)&&(t===Hi||Fi(t.prototype))||Ki(t)&&null===(t=t[Wi]))&&(t=void 0)),void 0===t?Hi:t},$i=function(e,t){return new(zi(e))(0===t?0:t)},Qi=Di,Yi=he,Ji=ct,Xi=Dr,Zi=$i,es=ne([].push),ts=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,l,c){for(var h,f,p=Ji(d),m=Yi(p),v=Qi(u,l),g=Xi(m),y=0,b=c||Zi,_=t?b(d,g):n||s?b(d,0):void 0;g>y;y++)if((o||y in m)&&(f=v(h=m[y],y,p),e))if(t)_[y]=f;else if(f)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:es(_,h)}else switch(e){case 4:return!1;case 7:es(_,h)}return i?-1:r||a?a:_}},ns={forEach:ts(0),map:ts(1),filter:ts(2),some:ts(3),every:ts(4),find:ts(5),findIndex:ts(6),filterReject:ts(7)},rs=va,as=N,is=Ee,ss=Sa,os=K,ds=ne,us=F,ls=Ue,cs=q,hs=pt,fs=Ta,ps=ye,ms=_e,vs=xe,gs=Ve,ys=un,bs=ct,_s=ge,ws=qt,As=Fa,ks=J,Es=si,xs=ba,Ss=mr,Ds=oi,Ts=Fr,Rs=G,Is=rn,Os=W,Ps=di,Cs=bn.exports,Ls=nt.exports,Ms=Mn,Us=bt,js=It,Bs=pi,Ns=_i,Gs=Ei,qs=Xn,Fs=ns.forEach,Vs=Ln("hidden"),Ks=js("toPrimitive"),Ws=qs.set,Hs=qs.getterFor("Symbol"),zs=Object.prototype,$s=as.Symbol,Qs=$s&&$s.prototype,Ys=as.TypeError,Js=as.QObject,Xs=is("JSON","stringify"),Zs=Rs.f,eo=Is.f,to=Ds.f,no=Os.f,ro=ds([].push),ao=Ls("symbols"),io=Ls("op-symbols"),so=Ls("string-to-symbol-registry"),oo=Ls("symbol-to-string-registry"),uo=Ls("wks"),lo=!Js||!Js.prototype||!Js.prototype.findChild,co=us&&cs((function(){return 7!=Es(eo({},"a",{get:function(){return eo(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Zs(zs,t);r&&delete zs[t],eo(e,t,n),r&&e!==zs&&eo(zs,t,r)}:eo,ho=function(e,t){var n=ao[e]=Es(Qs);return Ws(n,{type:"Symbol",tag:e,description:t}),us||(n.description=t),n},fo=function(e,t,n){e===zs&&fo(io,t,n),ys(e);var r=ws(t);return ys(n),hs(ao,r)?(n.enumerable?(hs(e,Vs)&&e[Vs][r]&&(e[Vs][r]=!1),n=Es(n,{enumerable:ks(0,!1)})):(hs(e,Vs)||eo(e,Vs,ks(1,{})),e[Vs][r]=!0),co(e,r,n)):eo(e,r,n)},po=function(e,t){ys(e);var n=_s(t),r=xs(n).concat(yo(n));return Fs(r,(function(t){us&&!os(mo,n,t)||fo(e,t,n[t])})),e},mo=function(e){var t=ws(e),n=os(no,this,t);return!(this===zs&&hs(ao,t)&&!hs(io,t))&&(!(n||!hs(this,t)||!hs(ao,t)||hs(this,Vs)&&this[Vs][t])||n)},vo=function(e,t){var n=_s(e),r=ws(t);if(n!==zs||!hs(ao,r)||hs(io,r)){var a=Zs(n,r);return!a||!hs(ao,r)||hs(n,Vs)&&n[Vs][r]||(a.enumerable=!0),a}},go=function(e){var t=to(_s(e)),n=[];return Fs(t,(function(e){hs(ao,e)||hs(Ms,e)||ro(n,e)})),n},yo=function(e){var t=e===zs,n=to(t?io:_s(e)),r=[];return Fs(n,(function(e){!hs(ao,e)||t&&!hs(zs,e)||ro(r,ao[e])})),r};(ls||(Cs(Qs=($s=function(){if(vs(Qs,this))throw Ys("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?As(arguments[0]):void 0,t=Us(e),n=function(e){this===zs&&os(n,io,e),hs(this,Vs)&&hs(this[Vs],t)&&(this[Vs][t]=!1),co(this,t,ks(1,e))};return us&&lo&&co(zs,t,{configurable:!0,set:n}),ho(t,e)}).prototype,"toString",(function(){return Hs(this).tag})),Cs($s,"withoutSetter",(function(e){return ho(Us(e),e)})),Os.f=mo,Is.f=fo,Rs.f=vo,Ss.f=Ds.f=go,Ts.f=yo,Bs.f=function(e){return ho(js(e),e)},us&&(eo(Qs,"description",{configurable:!0,get:function(){return Hs(this).description}}),Cs(zs,"propertyIsEnumerable",mo,{unsafe:!0}))),rs({global:!0,wrap:!0,forced:!ls,sham:!ls},{Symbol:$s}),Fs(xs(uo),(function(e){Ns(e)})),rs({target:"Symbol",stat:!0,forced:!ls},{for:function(e){var t=As(e);if(hs(so,t))return so[t];var n=$s(t);return so[t]=n,oo[n]=t,n},keyFor:function(e){if(!gs(e))throw Ys(e+" is not a symbol");if(hs(oo,e))return oo[e]},useSetter:function(){lo=!0},useSimple:function(){lo=!1}}),rs({target:"Object",stat:!0,forced:!ls,sham:!us},{create:function(e,t){return void 0===t?Es(e):po(Es(e),t)},defineProperty:fo,defineProperties:po,getOwnPropertyDescriptor:vo}),rs({target:"Object",stat:!0,forced:!ls},{getOwnPropertyNames:go,getOwnPropertySymbols:yo}),rs({target:"Object",stat:!0,forced:cs((function(){Ts.f(1)}))},{getOwnPropertySymbols:function(e){return Ts.f(bs(e))}}),Xs)&&rs({target:"JSON",stat:!0,forced:!ls||cs((function(){var e=$s();return"[null]"!=Xs([e])||"{}"!=Xs({a:e})||"{}"!=Xs(Object(e))}))},{stringify:function(e,t,n){var r=Ps(arguments),a=t;if((ms(t)||void 0!==e)&&!gs(e))return fs(t)||(t=function(e,t){if(ps(a)&&(t=os(a,this,e,t)),!gs(t))return t}),r[1]=t,ss(Xs,null,r)}});if(!Qs[Ks]){var bo=Qs.valueOf;Cs(Qs,Ks,(function(e){return os(bo,this)}))}Gs($s,"Symbol"),Ms[Vs]=!0;var _o=q,wo=Ce,Ao=It("species"),ko=function(e){return wo>=51||!_o((function(){var t=[];return(t.constructor={})[Ao]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Eo=ns.filter;va({target:"Array",proto:!0,forced:!ko("filter")},{filter:function(e){return Eo(this,e,arguments.length>1?arguments[1]:void 0)}});var xo=va,So=q,Do=ge,To=G.f,Ro=F,Io=So((function(){To(1)}));xo({target:"Object",stat:!0,forced:!Ro||Io,sham:!Ro},{getOwnPropertyDescriptor:function(e,t){return To(Do(e),t)}});var Oo={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},Po=Wt("span").classList,Co=Po&&Po.constructor&&Po.constructor.prototype,Lo=Co===Object.prototype?void 0:Co,Mo=q,Uo=ns.forEach,jo=function(e,t){var n=[][e];return!!n&&Mo((function(){n.call(null,t||function(){throw 1},1)}))},Bo=N,No=Oo,Go=Lo,qo=jo("forEach")?[].forEach:function(e){return Uo(this,e,arguments.length>1?arguments[1]:void 0)},Fo=yn,Vo=function(e){if(e&&e.forEach!==qo)try{Fo(e,"forEach",qo)}catch(t){e.forEach=qo}};for(var Ko in No)No[Ko]&&Vo(Bo[Ko]&&Bo[Ko].prototype);Vo(Go);var Wo=qt,Ho=rn,zo=J,$o=function(e,t,n){var r=Wo(t);r in e?Ho.f(e,r,zo(0,n)):e[r]=n},Qo=$r,Yo=ge,Jo=G,Xo=$o;va({target:"Object",stat:!0,sham:!F},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Yo(e),a=Jo.f,i=Qo(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&Xo(s,t,n);return s}});var Zo=va,ed=N,td=Ta,nd=Gi,rd=_e,ad=Ar,id=Dr,sd=ge,od=$o,dd=It,ud=di,ld=ko("slice"),cd=dd("species"),hd=ed.Array,fd=Math.max;Zo({target:"Array",proto:!0,forced:!ld},{slice:function(e,t){var n,r,a,i=sd(this),s=id(i),o=ad(e,s),d=ad(void 0===t?s:t,s);if(td(i)&&(n=i.constructor,(nd(n)&&(n===hd||td(n.prototype))||rd(n)&&null===(n=n[cd]))&&(n=void 0),n===hd||void 0===n))return ud(i,o,d);for(r=new(void 0===n?hd:n)(fd(d-o,0)),a=0;o<d;o++,a++)o in i&&od(r,a,i[o]);return r.length=a,r}});var pd=K,md=un,vd=Je,gd=function(e,t,n){var r,a;md(e);try{if(!(r=vd(e,"return"))){if("throw"===t)throw n;return n}r=pd(r,e)}catch(e){a=!0,r=e}if("throw"===t)throw n;if(a)throw r;return md(r),n},yd=un,bd=gd,_d={},wd=_d,Ad=It("iterator"),kd=Array.prototype,Ed=function(e){return void 0!==e&&(wd.Array===e||kd[Ad]===e)},xd=Na,Sd=Je,Dd=_d,Td=It("iterator"),Rd=function(e){if(null!=e)return Sd(e,Td)||Sd(e,"@@iterator")||Dd[xd(e)]},Id=K,Od=Qe,Pd=un,Cd=We,Ld=Rd,Md=N.TypeError,Ud=function(e,t){var n=arguments.length<2?Ld(e):t;if(Od(n))return Pd(Id(n,e));throw Md(Cd(e)+" is not iterable")},jd=Di,Bd=K,Nd=ct,Gd=function(e,t,n,r){try{return r?t(yd(n)[0],n[1]):t(n)}catch(t){bd(e,"throw",t)}},qd=Ed,Fd=Gi,Vd=Dr,Kd=$o,Wd=Ud,Hd=Rd,zd=N.Array,$d=It("iterator"),Qd=!1;try{var Yd=0,Jd={next:function(){return{done:!!Yd++}},return:function(){Qd=!0}};Jd[$d]=function(){return this},Array.from(Jd,(function(){throw 2}))}catch(e){}var Xd=function(e,t){if(!t&&!Qd)return!1;var n=!1;try{var r={};r[$d]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Zd=function(e){var t=Nd(e),n=Fd(this),r=arguments.length,a=r>1?arguments[1]:void 0,i=void 0!==a;i&&(a=jd(a,r>2?arguments[2]:void 0));var s,o,d,u,l,c,h=Hd(t),f=0;if(!h||this==zd&&qd(h))for(s=Vd(t),o=n?new this(s):zd(s);s>f;f++)c=i?a(t[f],f):t[f],Kd(o,f,c);else for(l=(u=Wd(t,h)).next,o=n?new this:[];!(d=Bd(l,u)).done;f++)c=i?Gd(u,a,[d.value,f],!0):d.value,Kd(o,f,c);return o.length=f,o};va({target:"Array",stat:!0,forced:!Xd((function(e){Array.from(e)}))},{from:Zd});var eu,tu,nu,ru=ne,au=yr,iu=Fa,su=pe,ou=ru("".charAt),du=ru("".charCodeAt),uu=ru("".slice),lu=function(e){return function(t,n){var r,a,i=iu(su(t)),s=au(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=du(i,s))<55296||r>56319||s+1===o||(a=du(i,s+1))<56320||a>57343?e?ou(i,s):r:e?uu(i,s,s+2):a-56320+(r-55296<<10)+65536}},cu={codeAt:lu(!1),charAt:lu(!0)},hu=!q((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),fu=N,pu=pt,mu=ye,vu=ct,gu=hu,yu=Ln("IE_PROTO"),bu=fu.Object,_u=bu.prototype,wu=gu?bu.getPrototypeOf:function(e){var t=vu(e);if(pu(t,yu))return t[yu];var n=t.constructor;return mu(n)&&t instanceof n?n.prototype:t instanceof bu?_u:null},Au=q,ku=ye,Eu=wu,xu=bn.exports,Su=It("iterator"),Du=!1;[].keys&&("next"in(nu=[].keys())?(tu=Eu(Eu(nu)))!==Object.prototype&&(eu=tu):Du=!0);var Tu=null==eu||Au((function(){var e={};return eu[Su].call(e)!==e}));Tu&&(eu={}),ku(eu[Su])||xu(eu,Su,(function(){return this}));var Ru={IteratorPrototype:eu,BUGGY_SAFARI_ITERATORS:Du},Iu=Ru.IteratorPrototype,Ou=si,Pu=J,Cu=Ei,Lu=_d,Mu=function(){return this},Uu=function(e,t,n){var r=t+" Iterator";return e.prototype=Ou(Iu,{next:Pu(1,n)}),Cu(e,r,!1),Lu[r]=Mu,e},ju=N,Bu=ye,Nu=ju.String,Gu=ju.TypeError,qu=ne,Fu=un,Vu=function(e){if("object"==typeof e||Bu(e))return e;throw Gu("Can't set "+Nu(e)+" as a prototype")},Ku=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=qu(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Fu(n),Vu(r),t?e(n,r):n.__proto__=r,n}}():void 0),Wu=va,Hu=K,zu=ar,$u=ye,Qu=Uu,Yu=wu,Ju=Ku,Xu=Ei,Zu=yn,el=bn.exports,tl=_d,nl=zu.PROPER,rl=zu.CONFIGURABLE,al=Ru.IteratorPrototype,il=Ru.BUGGY_SAFARI_ITERATORS,sl=It("iterator"),ol=function(){return this},dl=function(e,t,n,r,a,i,s){Qu(n,t,r);var o,d,u,l=function(e){if(e===a&&m)return m;if(!il&&e in f)return f[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+" Iterator",h=!1,f=e.prototype,p=f[sl]||f["@@iterator"]||a&&f[a],m=!il&&p||l(a),v="Array"==t&&f.entries||p;if(v&&(o=Yu(v.call(new e)))!==Object.prototype&&o.next&&(Yu(o)!==al&&(Ju?Ju(o,al):$u(o[sl])||el(o,sl,ol)),Xu(o,c,!0)),nl&&"values"==a&&p&&"values"!==p.name&&(rl?Zu(f,"name","values"):(h=!0,m=function(){return Hu(p,this)})),a)if(d={values:l("values"),keys:i?m:l("keys"),entries:l("entries")},s)for(u in d)(il||h||!(u in f))&&el(f,u,d[u]);else Wu({target:t,proto:!0,forced:il||h},d);return f[sl]!==m&&el(f,sl,m,{name:a}),tl[t]=m,d},ul=cu.charAt,ll=Fa,cl=Xn,hl=dl,fl=cl.set,pl=cl.getterFor("String Iterator");hl(String,"String",(function(e){fl(this,{type:"String Iterator",string:ll(e),index:0})}),(function(){var e,t=pl(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=ul(n,r),t.index+=e.length,{value:e,done:!1})}));var ml=un,vl=function(){var e=ml(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},gl={},yl=q,bl=N.RegExp;gl.UNSUPPORTED_Y=yl((function(){var e=bl("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),gl.BROKEN_CARET=yl((function(){var e=bl("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var _l=q,wl=N.RegExp,Al=_l((function(){var e=wl(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),kl=q,El=N.RegExp,xl=kl((function(){var e=El("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Sl=K,Dl=ne,Tl=Fa,Rl=vl,Il=gl,Ol=nt.exports,Pl=si,Cl=Xn.get,Ll=Al,Ml=xl,Ul=Ol("native-string-replace",String.prototype.replace),jl=RegExp.prototype.exec,Bl=jl,Nl=Dl("".charAt),Gl=Dl("".indexOf),ql=Dl("".replace),Fl=Dl("".slice),Vl=function(){var e=/a/,t=/b*/g;return Sl(jl,e,"a"),Sl(jl,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Kl=Il.UNSUPPORTED_Y||Il.BROKEN_CARET,Wl=void 0!==/()??/.exec("")[1];(Vl||Wl||Kl||Ll||Ml)&&(Bl=function(e){var t,n,r,a,i,s,o,d=this,u=Cl(d),l=Tl(e),c=u.raw;if(c)return c.lastIndex=d.lastIndex,t=Sl(Bl,c,l),d.lastIndex=c.lastIndex,t;var h=u.groups,f=Kl&&d.sticky,p=Sl(Rl,d),m=d.source,v=0,g=l;if(f&&(p=ql(p,"y",""),-1===Gl(p,"g")&&(p+="g"),g=Fl(l,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==Nl(l,d.lastIndex-1))&&(m="(?: "+m+")",g=" "+g,v++),n=new RegExp("^(?:"+m+")",p)),Wl&&(n=new RegExp("^"+m+"$(?!\\s)",p)),Vl&&(r=d.lastIndex),a=Sl(jl,f?n:d,g),f?a?(a.input=Fl(a.input,v),a[0]=Fl(a[0],v),a.index=d.lastIndex,d.lastIndex+=a[0].length):d.lastIndex=0:Vl&&a&&(d.lastIndex=d.global?a.index+a[0].length:r),Wl&&a&&a.length>1&&Sl(Ul,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=Pl(null),i=0;i<h.length;i++)s[(o=h[i])[0]]=a[o[1]];return a});var Hl=Bl;va({target:"RegExp",proto:!0,forced:/./.exec!==Hl},{exec:Hl});var zl=va,$l=F,Ql=N,Yl=ne,Jl=pt,Xl=ye,Zl=xe,ec=Fa,tc=rn.f,nc=Zr,rc=Ql.Symbol,ac=rc&&rc.prototype;if($l&&Xl(rc)&&(!("description"in ac)||void 0!==rc().description)){var ic={},sc=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:ec(arguments[0]),t=Zl(ac,this)?new rc(e):void 0===e?rc():rc(e);return""===e&&(ic[t]=!0),t};nc(sc,rc),sc.prototype=ac,ac.constructor=sc;var oc="Symbol(test)"==String(rc("test")),dc=Yl(ac.toString),uc=Yl(ac.valueOf),lc=/^Symbol\((.*)\)[^)]+$/,cc=Yl("".replace),hc=Yl("".slice);tc(ac,"description",{configurable:!0,get:function(){var e=uc(this),t=dc(e);if(Jl(ic,e))return"";var n=oc?hc(t,7,-1):cc(t,lc,"$1");return""===n?void 0:n}}),zl({global:!0,forced:!0},{Symbol:sc})}_i("iterator");var fc=si,pc=rn,mc=It("unscopables"),vc=Array.prototype;null==vc[mc]&&pc.f(vc,mc,{configurable:!0,value:fc(null)});var gc=function(e){vc[mc][e]=!0},yc=ge,bc=gc,_c=_d,wc=Xn,Ac=dl,kc=wc.set,Ec=wc.getterFor("Array Iterator"),xc=Ac(Array,"Array",(function(e,t){kc(this,{type:"Array Iterator",target:yc(e),index:0,kind:t})}),(function(){var e=Ec(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");_c.Arguments=_c.Array,bc("keys"),bc("values"),bc("entries");var Sc=N,Dc=Oo,Tc=Lo,Rc=xc,Ic=yn,Oc=It,Pc=Oc("iterator"),Cc=Oc("toStringTag"),Lc=Rc.values,Mc=function(e,t){if(e){if(e[Pc]!==Lc)try{Ic(e,Pc,Lc)}catch(t){e[Pc]=Lc}if(e[Cc]||Ic(e,Cc,t),Dc[t])for(var n in Rc)if(e[n]!==Rc[n])try{Ic(e,n,Rc[n])}catch(t){e[n]=Rc[n]}}};for(var Uc in Dc)Mc(Sc[Uc]&&Sc[Uc].prototype,Uc);Mc(Tc,"DOMTokenList");var jc=Na,Bc=Oa?{}.toString:function(){return"[object "+jc(this)+"]"},Nc=Oa,Gc=bn.exports,qc=Bc;Nc||Gc(Object.prototype,"toString",qc,{unsafe:!0});var Fc,Vc,Kc,Wc,Hc=N.Promise,zc=bn.exports,$c=function(e,t,n){for(var r in t)zc(e,r,t[r],n);return e},Qc=Ee,Yc=rn,Jc=F,Xc=It("species"),Zc=function(e){var t=Qc(e),n=Yc.f;Jc&&t&&!t[Xc]&&n(t,Xc,{configurable:!0,get:function(){return this}})},eh=xe,th=N.TypeError,nh=function(e,t){if(eh(t,e))return e;throw th("Incorrect invocation")},rh=Di,ah=K,ih=un,sh=We,oh=Ed,dh=Dr,uh=xe,lh=Ud,ch=Rd,hh=gd,fh=N.TypeError,ph=function(e,t){this.stopped=e,this.result=t},mh=ph.prototype,vh=Gi,gh=We,yh=N.TypeError,bh=un,_h=function(e){if(vh(e))return e;throw yh(gh(e)+" is not a constructor")},wh=It("species"),Ah=function(e,t){var n,r=bh(e).constructor;return void 0===r||null==(n=bh(r)[wh])?t:_h(n)},kh=/(?:ipad|iphone|ipod).*applewebkit/i.test(Se),Eh="process"==se(N.process),xh=N,Sh=Sa,Dh=Di,Th=ye,Rh=pt,Ih=q,Oh=$a,Ph=di,Ch=Wt,Lh=kh,Mh=Eh,Uh=xh.setImmediate,jh=xh.clearImmediate,Bh=xh.process,Nh=xh.Dispatch,Gh=xh.Function,qh=xh.MessageChannel,Fh=xh.String,Vh=0,Kh={};try{Fc=xh.location}catch(e){}var Wh=function(e){if(Rh(Kh,e)){var t=Kh[e];delete Kh[e],t()}},Hh=function(e){return function(){Wh(e)}},zh=function(e){Wh(e.data)},$h=function(e){xh.postMessage(Fh(e),Fc.protocol+"//"+Fc.host)};Uh&&jh||(Uh=function(e){var t=Ph(arguments,1);return Kh[++Vh]=function(){Sh(Th(e)?e:Gh(e),void 0,t)},Vc(Vh),Vh},jh=function(e){delete Kh[e]},Mh?Vc=function(e){Bh.nextTick(Hh(e))}:Nh&&Nh.now?Vc=function(e){Nh.now(Hh(e))}:qh&&!Lh?(Wc=(Kc=new qh).port2,Kc.port1.onmessage=zh,Vc=Dh(Wc.postMessage,Wc)):xh.addEventListener&&Th(xh.postMessage)&&!xh.importScripts&&Fc&&"file:"!==Fc.protocol&&!Ih($h)?(Vc=$h,xh.addEventListener("message",zh,!1)):Vc="onreadystatechange"in Ch("script")?function(e){Oh.appendChild(Ch("script")).onreadystatechange=function(){Oh.removeChild(this),Wh(e)}}:function(e){setTimeout(Hh(e),0)});var Qh,Yh,Jh,Xh,Zh,ef,tf,nf,rf={set:Uh,clear:jh},af=N,sf=/ipad|iphone|ipod/i.test(Se)&&void 0!==af.Pebble,of=/web0s(?!.*chrome)/i.test(Se),df=N,uf=Di,lf=G.f,cf=rf.set,hf=kh,ff=sf,pf=of,mf=Eh,vf=df.MutationObserver||df.WebKitMutationObserver,gf=df.document,yf=df.process,bf=df.Promise,_f=lf(df,"queueMicrotask"),wf=_f&&_f.value;wf||(Qh=function(){var e,t;for(mf&&(e=yf.domain)&&e.exit();Yh;){t=Yh.fn,Yh=Yh.next;try{t()}catch(e){throw Yh?Xh():Jh=void 0,e}}Jh=void 0,e&&e.enter()},hf||mf||pf||!vf||!gf?!ff&&bf&&bf.resolve?((tf=bf.resolve(void 0)).constructor=bf,nf=uf(tf.then,tf),Xh=function(){nf(Qh)}):mf?Xh=function(){yf.nextTick(Qh)}:(cf=uf(cf,df),Xh=function(){cf(Qh)}):(Zh=!0,ef=gf.createTextNode(""),new vf(Qh).observe(ef,{characterData:!0}),Xh=function(){ef.data=Zh=!Zh}));var Af=wf||function(e){var t={fn:e,next:void 0};Jh&&(Jh.next=t),Yh||(Yh=t,Xh()),Jh=t},kf={},Ef=Qe,xf=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=Ef(t),this.reject=Ef(n)};kf.f=function(e){return new xf(e)};var Sf,Df,Tf,Rf,If=un,Of=_e,Pf=kf,Cf=function(e,t){if(If(e),Of(t)&&t.constructor===e)return t;var n=Pf.f(e);return(0,n.resolve)(t),n.promise},Lf=N,Mf="object"==typeof window,Uf=va,jf=N,Bf=Ee,Nf=K,Gf=Hc,qf=bn.exports,Ff=$c,Vf=Ku,Kf=Ei,Wf=Zc,Hf=Qe,zf=ye,$f=_e,Qf=nh,Yf=Sn,Jf=function(e,t,n){var r,a,i,s,o,d,u,l=n&&n.that,c=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),f=!(!n||!n.INTERRUPTED),p=rh(t,l),m=function(e){return r&&hh(r,"normal",e),new ph(!0,e)},v=function(e){return c?(ih(e),f?p(e[0],e[1],m):p(e[0],e[1])):f?p(e,m):p(e)};if(h)r=e;else{if(!(a=ch(e)))throw fh(sh(e)+" is not iterable");if(oh(a)){for(i=0,s=dh(e);s>i;i++)if((o=v(e[i]))&&uh(mh,o))return o;return new ph(!1)}r=lh(e,a)}for(d=r.next;!(u=ah(d,r)).done;){try{o=v(u.value)}catch(e){hh(r,"throw",e)}if("object"==typeof o&&o&&uh(mh,o))return o}return new ph(!1)},Xf=Xd,Zf=Ah,ep=rf.set,tp=Af,np=Cf,rp=function(e,t){var n=Lf.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},ap=kf,ip=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},sp=Xn,op=da,dp=Mf,up=Eh,lp=Ce,cp=It("species"),hp=sp.get,fp=sp.set,pp=sp.getterFor("Promise"),mp=Gf&&Gf.prototype,vp=Gf,gp=mp,yp=jf.TypeError,bp=jf.document,_p=jf.process,wp=ap.f,Ap=wp,kp=!!(bp&&bp.createEvent&&jf.dispatchEvent),Ep=zf(jf.PromiseRejectionEvent),xp=!1,Sp=op("Promise",(function(){var e=Yf(vp),t=e!==String(vp);if(!t&&66===lp)return!0;if(lp>=51&&/native code/.test(e))return!1;var n=new vp((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[cp]=r,!(xp=n.then((function(){}))instanceof r)||!t&&dp&&!Ep})),Dp=Sp||!Xf((function(e){vp.all(e).catch((function(){}))})),Tp=function(e){var t;return!(!$f(e)||!zf(t=e.then))&&t},Rp=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;tp((function(){for(var r=e.value,a=1==e.state,i=0;n.length>i;){var s,o,d,u=n[i++],l=a?u.ok:u.fail,c=u.resolve,h=u.reject,f=u.domain;try{l?(a||(2===e.rejection&&Cp(e),e.rejection=1),!0===l?s=r:(f&&f.enter(),s=l(r),f&&(f.exit(),d=!0)),s===u.promise?h(yp("Promise-chain cycle")):(o=Tp(s))?Nf(o,s,c,h):c(s)):h(r)}catch(e){f&&!d&&f.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Op(e)}))}},Ip=function(e,t,n){var r,a;kp?((r=bp.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),jf.dispatchEvent(r)):r={promise:t,reason:n},!Ep&&(a=jf["on"+e])?a(r):"unhandledrejection"===e&&rp("Unhandled promise rejection",n)},Op=function(e){Nf(ep,jf,(function(){var t,n=e.facade,r=e.value;if(Pp(e)&&(t=ip((function(){up?_p.emit("unhandledRejection",r,n):Ip("unhandledrejection",n,r)})),e.rejection=up||Pp(e)?2:1,t.error))throw t.value}))},Pp=function(e){return 1!==e.rejection&&!e.parent},Cp=function(e){Nf(ep,jf,(function(){var t=e.facade;up?_p.emit("rejectionHandled",t):Ip("rejectionhandled",t,e.value)}))},Lp=function(e,t,n){return function(r){e(t,r,n)}},Mp=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Rp(e,!0))},Up=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw yp("Promise can't be resolved itself");var r=Tp(t);r?tp((function(){var n={done:!1};try{Nf(r,t,Lp(Up,n,e),Lp(Mp,n,e))}catch(t){Mp(n,t,e)}})):(e.value=t,e.state=1,Rp(e,!1))}catch(t){Mp({done:!1},t,e)}}};if(Sp&&(gp=(vp=function(e){Qf(this,gp),Hf(e),Nf(Sf,this);var t=hp(this);try{e(Lp(Up,t),Lp(Mp,t))}catch(e){Mp(t,e)}}).prototype,(Sf=function(e){fp(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Ff(gp,{then:function(e,t){var n=pp(this),r=n.reactions,a=wp(Zf(this,vp));return a.ok=!zf(e)||e,a.fail=zf(t)&&t,a.domain=up?_p.domain:void 0,n.parent=!0,r[r.length]=a,0!=n.state&&Rp(n,!1),a.promise},catch:function(e){return this.then(void 0,e)}}),Df=function(){var e=new Sf,t=hp(e);this.promise=e,this.resolve=Lp(Up,t),this.reject=Lp(Mp,t)},ap.f=wp=function(e){return e===vp||e===Tf?new Df(e):Ap(e)},zf(Gf)&&mp!==Object.prototype)){Rf=mp.then,xp||(qf(mp,"then",(function(e,t){var n=this;return new vp((function(e,t){Nf(Rf,n,e,t)})).then(e,t)}),{unsafe:!0}),qf(mp,"catch",gp.catch,{unsafe:!0}));try{delete mp.constructor}catch(e){}Vf&&Vf(mp,gp)}Uf({global:!0,wrap:!0,forced:Sp},{Promise:vp}),Kf(vp,"Promise",!1),Wf("Promise"),Tf=Bf("Promise"),Uf({target:"Promise",stat:!0,forced:Sp},{reject:function(e){var t=wp(this);return Nf(t.reject,void 0,e),t.promise}}),Uf({target:"Promise",stat:!0,forced:Sp},{resolve:function(e){return np(this,e)}}),Uf({target:"Promise",stat:!0,forced:Dp},{all:function(e){var t=this,n=wp(t),r=n.resolve,a=n.reject,i=ip((function(){var n=Hf(t.resolve),i=[],s=0,o=1;Jf(e,(function(e){var d=s++,u=!1;o++,Nf(n,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=wp(t),r=n.reject,a=ip((function(){var a=Hf(t.resolve);Jf(e,(function(e){Nf(a,t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var jp=va,Bp=N,Np=q,Gp=Ta,qp=_e,Fp=ct,Vp=Dr,Kp=$o,Wp=$i,Hp=ko,zp=Ce,$p=It("isConcatSpreadable"),Qp=Bp.TypeError,Yp=zp>=51||!Np((function(){var e=[];return e[$p]=!1,e.concat()[0]!==e})),Jp=Hp("concat"),Xp=function(e){if(!qp(e))return!1;var t=e[$p];return void 0!==t?!!t:Gp(e)};jp({target:"Array",proto:!0,forced:!Yp||!Jp},{concat:function(e){var t,n,r,a,i,s=Fp(this),o=Wp(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Xp(i=-1===t?s:arguments[t])){if(d+(a=Vp(i))>9007199254740991)throw Qp("Maximum allowed index exceeded");for(n=0;n<a;n++,d++)n in i&&Kp(o,d,i[n])}else{if(d>=9007199254740991)throw Qp("Maximum allowed index exceeded");Kp(o,d++,i)}return o.length=d,o}});var Zp=F,em=ar.EXISTS,tm=ne,nm=rn.f,rm=Function.prototype,am=tm(rm.toString),im=/^\s*function ([^ (]*)/,sm=tm(im.exec);function om(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 dm(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 dm(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 dm(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 um(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 lm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?um(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):um(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Zp&&!em&&nm(rm,"name",{configurable:!0,get:function(){try{return sm(im,am(this))[1]}catch(e){return""}}});var cm={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"}},hm={},fm=function(e,t){hm[e]=lm(lm({},t),{},{isLoading:!1})},pm=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(A.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))},mm=function(){var e=w.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=hm[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=om(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=cm[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,pm({id:s,src:cm[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,pm({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)}}(),vm=new function e(){var t=this;x.default(this,e),S.default(this,"load",w.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mm("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),S.default(this,"showLeaderboard",function(){var e=w.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)}}()),S.default(this,"addScore",function(){var e=w.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"]},fm(this.moduleName,this.moduleConfig)},gm=ne,ym=bn.exports,bm=Hl,_m=q,wm=It,Am=yn,km=wm("species"),Em=RegExp.prototype,xm=function(e,t,n,r){var a=wm(e),i=!_m((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!_m((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[km]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||n){var o=gm(/./[a]),d=t(a,""[e],(function(e,t,n,r,a){var s=gm(e),d=t.exec;return d===bm||d===Em.exec?i&&!a?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));ym(String.prototype,e,d[0]),ym(Em,a,d[1])}r&&Am(Em[a],"sham",!0)},Sm=cu.charAt,Dm=function(e,t,n){return t+(n?Sm(e,t).length:1)},Tm=ne,Rm=ct,Im=Math.floor,Om=Tm("".charAt),Pm=Tm("".replace),Cm=Tm("".slice),Lm=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Mm=/\$([$&'`]|\d{1,2})/g,Um=K,jm=un,Bm=ye,Nm=se,Gm=Hl,qm=N.TypeError,Fm=function(e,t){var n=e.exec;if(Bm(n)){var r=Um(n,e,t);return null!==r&&jm(r),r}if("RegExp"===Nm(e))return Um(Gm,e,t);throw qm("RegExp#exec called on incompatible receiver")},Vm=Sa,Km=K,Wm=ne,Hm=xm,zm=q,$m=un,Qm=ye,Ym=yr,Jm=xr,Xm=Fa,Zm=pe,ev=Dm,tv=Je,nv=function(e,t,n,r,a,i){var s=n+e.length,o=r.length,d=Mm;return void 0!==a&&(a=Rm(a),d=Lm),Pm(i,d,(function(i,d){var u;switch(Om(d,0)){case"$":return"$";case"&":return e;case"`":return Cm(t,0,n);case"'":return Cm(t,s);case"<":u=a[Cm(d,1,-1)];break;default:var l=+d;if(0===l)return i;if(l>o){var c=Im(l/10);return 0===c?i:c<=o?void 0===r[c-1]?Om(d,1):r[c-1]+Om(d,1):i}u=r[l-1]}return void 0===u?"":u}))},rv=Fm,av=It("replace"),iv=Math.max,sv=Math.min,ov=Wm([].concat),dv=Wm([].push),uv=Wm("".indexOf),lv=Wm("".slice),cv="$0"==="a".replace(/./,"$0"),hv=!!/./[av]&&""===/./[av]("a","$0");Hm("replace",(function(e,t,n){var r=hv?"$":"$0";return[function(e,n){var r=Zm(this),a=null==e?void 0:tv(e,av);return a?Km(a,e,r,n):Km(t,Xm(r),e,n)},function(e,a){var i=$m(this),s=Xm(e);if("string"==typeof a&&-1===uv(a,r)&&-1===uv(a,"$<")){var o=n(t,i,s,a);if(o.done)return o.value}var d=Qm(a);d||(a=Xm(a));var u=i.global;if(u){var l=i.unicode;i.lastIndex=0}for(var c=[];;){var h=rv(i,s);if(null===h)break;if(dv(c,h),!u)break;""===Xm(h[0])&&(i.lastIndex=ev(s,Jm(i.lastIndex),l))}for(var f,p="",m=0,v=0;v<c.length;v++){for(var g=Xm((h=c[v])[0]),y=iv(sv(Ym(h.index),s.length),0),b=[],_=1;_<h.length;_++)dv(b,void 0===(f=h[_])?f:String(f));var w=h.groups;if(d){var A=ov([g],b,y,s);void 0!==w&&dv(A,w);var k=Xm(Vm(a,void 0,A))}else k=nv(g,s,y,b,w,a);y>=m&&(p+=lv(s,m,y)+k,m=y+g.length)}return p+lv(s,m)}]}),!!zm((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!cv||hv);var fv=q,pv=It("iterator"),mv=!fv((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[pv]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),vv=di,gv=Math.floor,yv=function(e,t){var n=e.length,r=gv(n/2);return n<8?bv(e,t):_v(e,yv(vv(e,0,r),t),yv(vv(e,r),t),t)},bv=function(e,t){for(var n,r,a=e.length,i=1;i<a;){for(r=i,n=e[i];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},_v=function(e,t,n,r){for(var a=t.length,i=n.length,s=0,o=0;s<a||o<i;)e[s+o]=s<a&&o<i?r(t[s],n[o])<=0?t[s++]:n[o++]:s<a?t[s++]:n[o++];return e},wv=yv,Av=va,kv=N,Ev=Ee,xv=K,Sv=ne,Dv=mv,Tv=bn.exports,Rv=$c,Iv=Ei,Ov=Uu,Pv=Xn,Cv=nh,Lv=ye,Mv=pt,Uv=Di,jv=Na,Bv=un,Nv=_e,Gv=Fa,qv=si,Fv=J,Vv=Ud,Kv=Rd,Wv=wv,Hv=It("iterator"),zv=Pv.set,$v=Pv.getterFor("URLSearchParams"),Qv=Pv.getterFor("URLSearchParamsIterator"),Yv=Ev("fetch"),Jv=Ev("Request"),Xv=Ev("Headers"),Zv=Jv&&Jv.prototype,eg=Xv&&Xv.prototype,tg=kv.RegExp,ng=kv.TypeError,rg=kv.decodeURIComponent,ag=kv.encodeURIComponent,ig=Sv("".charAt),sg=Sv([].join),og=Sv([].push),dg=Sv("".replace),ug=Sv([].shift),lg=Sv([].splice),cg=Sv("".split),hg=Sv("".slice),fg=/\+/g,pg=Array(4),mg=function(e){return pg[e-1]||(pg[e-1]=tg("((?:%[\\da-f]{2}){"+e+"})","gi"))},vg=function(e){try{return rg(e)}catch(t){return e}},gg=function(e){var t=dg(e,fg," "),n=4;try{return rg(t)}catch(e){for(;n;)t=dg(t,mg(n--),vg);return t}},yg=/[!'()~]|%20/g,bg={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},_g=function(e){return bg[e]},wg=function(e){return dg(ag(e),yg,_g)},Ag=function(e,t){if(t)for(var n,r,a=cg(t,"&"),i=0;i<a.length;)(n=a[i++]).length&&(r=cg(n,"="),og(e,{key:gg(ug(r)),value:gg(sg(r,"="))}))},kg=function(e){this.entries.length=0,Ag(this.entries,e)},Eg=function(e,t){if(e<t)throw ng("Not enough arguments")},xg=Ov((function(e,t){zv(this,{type:"URLSearchParamsIterator",iterator:Vv($v(e).entries),kind:t})}),"Iterator",(function(){var e=Qv(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),Sg=function(){Cv(this,Dg);var e,t,n,r,a,i,s,o,d,u=arguments.length>0?arguments[0]:void 0,l=this,c=[];if(zv(l,{type:"URLSearchParams",entries:c,updateURL:function(){},updateSearchParams:kg}),void 0!==u)if(Nv(u))if(e=Kv(u))for(n=(t=Vv(u,e)).next;!(r=xv(n,t)).done;){if(i=(a=Vv(Bv(r.value))).next,(s=xv(i,a)).done||(o=xv(i,a)).done||!xv(i,a).done)throw ng("Expected sequence with length 2");og(c,{key:Gv(s.value),value:Gv(o.value)})}else for(d in u)Mv(u,d)&&og(c,{key:d,value:Gv(u[d])});else Ag(c,"string"==typeof u?"?"===ig(u,0)?hg(u,1):u:Gv(u))},Dg=Sg.prototype;if(Rv(Dg,{append:function(e,t){Eg(arguments.length,2);var n=$v(this);og(n.entries,{key:Gv(e),value:Gv(t)}),n.updateURL()},delete:function(e){Eg(arguments.length,1);for(var t=$v(this),n=t.entries,r=Gv(e),a=0;a<n.length;)n[a].key===r?lg(n,a,1):a++;t.updateURL()},get:function(e){Eg(arguments.length,1);for(var t=$v(this).entries,n=Gv(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){Eg(arguments.length,1);for(var t=$v(this).entries,n=Gv(e),r=[],a=0;a<t.length;a++)t[a].key===n&&og(r,t[a].value);return r},has:function(e){Eg(arguments.length,1);for(var t=$v(this).entries,n=Gv(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){Eg(arguments.length,1);for(var n,r=$v(this),a=r.entries,i=!1,s=Gv(e),o=Gv(t),d=0;d<a.length;d++)(n=a[d]).key===s&&(i?lg(a,d--,1):(i=!0,n.value=o));i||og(a,{key:s,value:o}),r.updateURL()},sort:function(){var e=$v(this);Wv(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=$v(this).entries,r=Uv(e,arguments.length>1?arguments[1]:void 0),a=0;a<n.length;)r((t=n[a++]).value,t.key,this)},keys:function(){return new xg(this,"keys")},values:function(){return new xg(this,"values")},entries:function(){return new xg(this,"entries")}},{enumerable:!0}),Tv(Dg,Hv,Dg.entries,{name:"entries"}),Tv(Dg,"toString",(function(){for(var e,t=$v(this).entries,n=[],r=0;r<t.length;)e=t[r++],og(n,wg(e.key)+"="+wg(e.value));return sg(n,"&")}),{enumerable:!0}),Iv(Sg,"URLSearchParams"),Av({global:!0,forced:!Dv},{URLSearchParams:Sg}),!Dv&&Lv(Xv)){var Tg=Sv(eg.has),Rg=Sv(eg.set),Ig=function(e){if(Nv(e)){var t,n=e.body;if("URLSearchParams"===jv(n))return t=e.headers?new Xv(e.headers):new Xv,Tg(t,"content-type")||Rg(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),qv(e,{body:Fv(0,Gv(n)),headers:Fv(0,t)})}return e};if(Lv(Yv)&&Av({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return Yv(e,arguments.length>1?Ig(arguments[1]):{})}}),Lv(Jv)){var Og=function(e){return Cv(this,Zv),new Jv(e,arguments.length>1?Ig(arguments[1]):{})};Zv.constructor=Og,Og.prototype=Zv,Av({global:!0,forced:!0},{Request:Og})}}var Pg=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Cg=K,Lg=un,Mg=pe,Ug=Pg,jg=Fa,Bg=Je,Ng=Fm;function Gg(e){var t=this,n={},r=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,i=(null==e?void 0:e.self_origin)||window.location.origin,s=(null==e?void 0:e.referrer_url)||document.referrer;function o(e){return I.default(n,e)}function d(e,t){return O.default(n,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new D.default(e,t)}catch(e){console.log(e)}}function l(){for(var t=(null==e?void 0:e.urls)||[a,s],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var o=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(o&&(o=decodeURIComponent(o),T.default.isURL(o)))return o}}}return function(){var e;A.default(this,t),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){d("depth.error",e.message)}d("depth.value",e)}(),function(){var e=r,t=n.depth.value,a=i;if(d("top.domain.from","fallback"),e&&e.length>0)a=e[e.length-1],d("top.domain.from","origins");else if(0===t)a=i,d("top.domain.from","self-top");else if(1===t){var o=u(s);o&&(a=o.origin,d("top.domain.from","referrer"))}d("top.domain.value",a.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=l();if(e)if(R.default(e))d("partner.domain.value",e),d("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)d("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),d("partner.domain.from","partner-url");else d("partner.domain.value",n.top.domain.value),d("partner.domain.from","partner-fallback")}else d("partner.domain.value",n.top.domain.value),d("partner.domain.from","fallback")}(),e=l(),0===n.depth.value?(d("partner.url.value",a),d("partner.url.from","self-top")):e?R.default(e)?(d("partner.url.value",a),d("partner.url.from","partner-domain")):(d("partner.url.value",e),d("partner.url.from","partner-url")):(d("partner.url.value",s),d("partner.url.from","fallback"))}.bind(this)(),{get:o,print:function(e){console.log(o(e))}}}xm("search",(function(e,t,n){return[function(t){var n=Mg(this),r=null==t?void 0:Bg(t,e);return r?Cg(r,t,n):new RegExp(t)[e](jg(n))},function(e){var r=Lg(this),a=jg(e),i=n(t,r,a);if(i.done)return i.value;var s=r.lastIndex;Ug(s,0)||(r.lastIndex=0);var o=Ng(r,a);return Ug(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var qg={name:"@bygd/gd-sdk-pes",version:"1.27.13",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":"^21.0.1","@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.3","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","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",validator:"^13.6.0"}},Fg="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Fg&&Fg,Vg="URLSearchParams"in Fg,Kg="Symbol"in Fg&&"iterator"in Symbol,Wg="FileReader"in Fg&&"Blob"in Fg&&function(){try{return new Blob,!0}catch(e){return!1}}(),Hg="FormData"in Fg,zg="ArrayBuffer"in Fg;if(zg)var $g=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Qg=ArrayBuffer.isView||function(e){return e&&$g.indexOf(Object.prototype.toString.call(e))>-1};function Yg(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 Jg(e){return"string"!=typeof e&&(e=String(e)),e}function Xg(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Kg&&(t[Symbol.iterator]=function(){return t}),t}function Zg(e){this.map={},e instanceof Zg?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 ey(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function ty(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function ny(e){var t=new FileReader,n=ty(t);return t.readAsArrayBuffer(e),n}function ry(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function ay(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Wg&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Hg&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Vg&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():zg&&Wg&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=ry(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):zg&&(ArrayBuffer.prototype.isPrototypeOf(e)||Qg(e))?this._bodyArrayBuffer=ry(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):Vg&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Wg&&(this.blob=function(){var e=ey(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=ey(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(ny)}),this.text=function(){var e=ey(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=ty(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)},Hg&&(this.formData=function(){return this.text().then(oy)}),this.json=function(){return this.text().then(JSON.parse)},this}Zg.prototype.append=function(e,t){e=Yg(e),t=Jg(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Zg.prototype.delete=function(e){delete this.map[Yg(e)]},Zg.prototype.get=function(e){return e=Yg(e),this.has(e)?this.map[e]:null},Zg.prototype.has=function(e){return this.map.hasOwnProperty(Yg(e))},Zg.prototype.set=function(e,t){this.map[Yg(e)]=Jg(t)},Zg.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Zg.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Xg(e)},Zg.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Xg(e)},Zg.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Xg(e)},Kg&&(Zg.prototype[Symbol.iterator]=Zg.prototype.entries);var iy=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function sy(e,t){if(!(this instanceof sy))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 sy){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Zg(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 Zg(t.headers)),this.method=function(e){var t=e.toUpperCase();return iy.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 oy(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 dy(e,t){if(!(this instanceof dy))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 Zg(t.headers),this.url=t.url||"",this._initBody(e)}sy.prototype.clone=function(){return new sy(this,{body:this._bodyInit})},ay.call(sy.prototype),ay.call(dy.prototype),dy.prototype.clone=function(){return new dy(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Zg(this.headers),url:this.url})},dy.error=function(){var e=new dy(null,{status:0,statusText:""});return e.type="error",e};var uy=[301,302,303,307,308];dy.redirect=function(e,t){if(-1===uy.indexOf(t))throw new RangeError("Invalid status code");return new dy(null,{status:t,headers:{location:e}})};var ly=Fg.DOMException;try{new ly}catch(e){ly=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},ly.prototype=Object.create(Error.prototype),ly.prototype.constructor=ly}function cy(e,t){return new Promise((function(n,r){var a=new sy(e,t);if(a.signal&&a.signal.aborted)return r(new ly("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 Zg,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 dy(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 ly("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&Fg.location.href?Fg.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&&(Wg?i.responseType="blob":zg&&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 Zg?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,Jg(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)}))}cy.polyfill=!0,Fg.fetch||(Fg.fetch=cy,Fg.Headers=Zg,Fg.Request=sy,Fg.Response=dy);var hy,fy=Array.isArray,py=Object.prototype.toString,my=fy||function(e){return!!e&&"[object Array]"==py.call(e)},vy=function(){return hy},gy=function(e){var t=this,n=new Gg;n.get();var r=n.get("partner.domain.value"),i=function(){return A.default(this,t),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this),s=function(){A.default(this,t);var n=o(),a=n?"&mode=".concat(n):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(r).concat(a,"&v=").concat(qg.version,"&localTime=").concat((new Date).getHours())}.bind(this),o=function(){var e=this;return A.default(this,t),new Proxy(new URLSearchParams(window.location.search),{get:function(t,n){return A.default(this,e),t.get(n)}.bind(this)}).gd_mode}.bind(this),d=function(e){A.default(this,t);var n=u("object"===k.default(e)?e:a.parseJSON(e));return n&&n.version?qg.version>=n.version?n:void 0:n}.bind(this),u=function(e){var n=this;if(A.default(this,t),!my(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){A.default(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var a=Math.floor(Math.random()*Math.floor(r));r=0;for(var i=0;i<e.length;i++){var s=e[i];if(a<(r+=s.weight))return s}}.bind(this);return new Promise(function(e){var n=this;if(A.default(this,t),hy)e(hy);else{var r=i(),o=s();fetch(o).then(function(e){return A.default(this,n),e.json()}.bind(this)).then(function(t){if(A.default(this,n),t.success){var i,s,o,u,l=t.result.game,c={gameId:l.gameMd5,slug:l.slug,pname:l.pname,dname:l.dname,status:l.status,description:l.description,enableAds:!0===l.enableAds||!0===(null===(i=l.enableAds)||void 0===i?void 0:i.enabled),preroll:l.preRoll,midroll:6e4*l.timeAds,rewardedAds:l.rewardedAds,title:l.title,tags:l.tags,category:l.category,assets:l.assets,disp_2nd_prer:l.disp_2nd_prer,ctry_vst:l.ctry_vst,ctry:l.ctry,crtv:l.crtv,dmain:l.dmain,block_exts:d(l.push_cuda),bloc_gard:d(l.bloc_gard),cookie:d(l.cookie),gdpr:d(l.gdpr),diagnostic:d(l.diagnostic),cmp:d(l.cmp),gft:d(l.gft),sdk:d(l.sdk)||{},sdkfw:d(l.sdkfw)||{},loader:d(l.loader)||{},splash:d(l.splash)||{},promo:d(l.promo)||{},dAds:d(l.dads)||{},pAds:d(l.pads)||{},mAds:d(l.mads)||{},rAds:d(l.rads)||{},lp:d(l.lp)||{},extsc:d(l.extsc)||{}},h=a.extendDefaults(P.default(r),c);h.afg_disabled=!1===(null===(s=h.sdk)||void 0===s||null===(o=s.afg)||void 0===o?void 0:o.enabled),null!==(u=h.pAds)&&void 0!==u&&u.enabled&&(h.preroll=!0),hy=h,e(h)}else r.failed=!0,e(r)}.bind(this)).catch(function(t){A.default(this,n),console.log("gd:adp failed game data",t),r.failed=!0,e(r)}.bind(this))}}.bind(this))},yy=function(){var e,t=vy();return!(null==t||null===(e=t.sdkfw)||void 0===e||!e.enabled)},by=function(){var e,t,n,r,a,i,s=vy(),o=!(null==s||null===(e=s.extsc)||void 0===e||!e.enabled);return{enabled:o,path:o?null==s||null===(t=s.extsc)||void 0===t?void 0:t.path:"",name:o?null==s||null===(n=s.extsc)||void 0===n?void 0:n.name:"",ref:o?null==s||null===(r=s.extsc)||void 0===r?void 0:r.ref:"",loadedFlag:o?null==s||null===(a=s.extsc)||void 0===a?void 0:a.loadedFlag:void 0,loadedFlagCheck:!!o&&!(null==s||null===(i=s.extsc)||void 0===i||!i.loadedFlagCheck)}},_y=function(){var e=w.default(E.default.mark((function e(){var t,n,r,i,s,o=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=by()).enabled){e.next=3;break}return e.abrupt("return");case 3:return n=t.path,r=t.name,i=t.ref,e.prev=4,s={},e.next=8,a.getScript(n,r,{error_prefix:"Blocked:",exists:function(){return A.default(this,o),!!i&&!!window[i]}.bind(this),attrs:s});case 8:console.log("extsc: after external partner script load",r,n),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(4),console.log("extsc: error on external partner script load",r,e.t0),a.dankLog("DEVELOPER_ERROR",e.t0,"warning");case 15:case"end":return e.stop()}}),e,this,[[4,11]])})));return function(){return e.apply(this,arguments)}}(),wy=!1,Ay=!1,ky=function(){var e=this;return new Promise(function(t,n){var r=this;if(A.default(this,e),wy)return t(Ay);wy=!0;var a=by();if(!a.enabled)return t(!1);var i=a.loadedFlag,s=a.loadedFlagCheck;if(s&&!i)return t(!1);if(!s)return Ay=!0,t(!0);var o=!0;setTimeout(function(){A.default(this,r),o&&(console.log("extsc: clearing on wait after timeout"),o=!1,wy=!0,t(!1))}.bind(this),5e3);var d=setInterval(function(){A.default(this,r),o&&s&&window[i]?(console.log("extsc: loaderflag for external script is set!"),o=!1,wy=!0,Ay=!0,clearInterval(d),t(!0)):o||(console.log("extsc: clearing interval after timeout"),clearInterval(d))}.bind(this),100)}.bind(this))},Ey=function(e){var t=function(e){var t=this,n=function(e){return A.default(this,t),l("showAd",{adType:e})}.bind(this),r=function(e){return A.default(this,t),l("preloadAd",{adType:e})}.bind(this),a=function(e){return A.default(this,t),l("showDisplayAd",{options:e})}.bind(this),i=function(){return A.default(this,t),l("cancelAd")}.bind(this),s=function(){return A.default(this,t),l("openConsole")}.bind(this),o=function(){return A.default(this,t),l("showBanner")}.bind(this),d=function(){return A.default(this,t),l("session")}.bind(this),u=function(){A.default(this,t),console.log("_sendSDKReady")}.bind(this),l=function(e,n){var r=this;return A.default(this,t),n||(n={}),new Promise(function(t,a){A.default(this,r);try{var i={type:"gd-sdk",method:e,options:n};window.parent.postMessage(i,"https://html5.gamedistribution.com"),t()}catch(e){console.log("gd:adp:m:s:error",e),t()}}.bind(this))}.bind(this),c=function(){A.default(this,t),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&(console.log("gd:adp received on-event",r),r&&f(r))}),!1)}.bind(this),h=function(){A.default(this,t),c(),l("init")}.bind(this),f=function(n){A.default(this,t),e.onEvent&&e.onEvent(n)}.bind(this);return{showBanner:o,showAd:n,preloadAd:r,showDisplayAd:a,cancelAd:i,openConsole:s,getSession:d,onEvent:f,init:h,_sendSDKReady:u}}(e);return t.init(),t},xy=function(){var e=this;return{isMasterGameURL:function(){A.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){A.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){A.default(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},Sy=function(e){var t=this;return new Promise(function(n,r){var a=this;A.default(this,t);var i={type:"gd-sdk-frame-handshake-request"},s=!1;window.addEventListener("message",(function(e){var t=e.data,r=e.origin,a=e.source,i=t.type;if("gd-sdk-frame-handshake-request"===i){var o={type:"gd-sdk-frame-handshake-response"};a.postMessage(o,r)}else"gd-sdk-frame-handshake-response"===i&&(s=!0,n({origin:r,source:a}))})),e?n():(setTimeout(function(){A.default(this,a),s||n()}.bind(this),200),window.parent!==window?window.parent.postMessage(i,"*"):n())}.bind(this))},Dy=function(){var e=w.default(E.default.mark((function e(t){var n,r,a,i,s,o,d,u,l,c;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gy(t);case 2:return e.next=5,yy();case 5:return n=e.sent,console.log("gd:adp ,isSDKForwardEnable",n),r=!n,e.next=10,Sy(r);case 10:if(a=e.sent,n){e.next=13;break}return e.abrupt("return",!1);case 13:return i=xy(),s=i.isMasterGameURL,o=i.isTokenGameURL,d=s(),u=o(),h=void 0,f=void 0,f=vy(),l=yy()&&!(null==f||null===(h=f.sdkfw)||void 0===h||!h.handshake),c=!1,c=l?!d&&!!a:!d,console.log("gd:adp: frameCheck result",{_isMasterGameURL:d,_isTokenGameURL:u,isHandshakeEnabled:l,hsResult:a,result:c}),e.abrupt("return",c);case 21:case"end":return e.stop()}var h,f}),e)})));return function(t){return e.apply(this,arguments)}}(),Ty=F,Ry=ne,Iy=ba,Oy=ge,Py=Ry(W.f),Cy=Ry([].push),Ly=function(e){return function(t){for(var n,r=Oy(t),a=Iy(r),i=a.length,s=0,o=[];i>s;)n=a[s++],Ty&&!Py(r,n)||Cy(o,e?[n,r[n]]:r[n]);return o}},My={entries:Ly(!0),values:Ly(!1)}.values;va({target:"Object",stat:!0},{values:function(e){return My(e)}});var Uy=va,jy=Hc,By=q,Ny=Ee,Gy=ye,qy=Ah,Fy=Cf,Vy=bn.exports;if(Uy({target:"Promise",proto:!0,real:!0,forced:!!jy&&By((function(){jy.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=qy(this,Ny("Promise")),n=Gy(e);return this.then(n?function(n){return Fy(t,e()).then((function(){return n}))}:e,n?function(n){return Fy(t,e()).then((function(){throw n}))}:e)}}),Gy(jy)){var Ky=Ny("Promise").prototype.finally;jy.prototype.finally!==Ky&&Vy(jy.prototype,"finally",Ky,{unsafe:!0})}var Wy=pe,Hy=Fa,zy=ne("".replace),$y="[\t\n\v\f\r                 \u2028\u2029\ufeff]",Qy=RegExp("^"+$y+$y+"*"),Yy=RegExp($y+$y+"*$"),Jy=function(e){return function(t){var n=Hy(Wy(t));return 1&e&&(n=zy(n,Qy,"")),2&e&&(n=zy(n,Yy,"")),n}},Xy={start:Jy(1),end:Jy(2),trim:Jy(3)},Zy=ar.PROPER,eb=q,tb="\t\n\v\f\r                 \u2028\u2029\ufeff",nb=Xy.trim;va({target:"String",proto:!0,forced:function(e){return eb((function(){return!!tb[e]()||"​…᠎"!=="​…᠎"[e]()||Zy&&tb[e].name!==e}))}("trim")},{trim:function(){return nb(this)}});var rb=ye,ab=_e,ib=Ku,sb=_e,ob=se,db=It("match"),ub=function(e){var t;return sb(e)&&(void 0!==(t=e[db])?!!t:"RegExp"==ob(e))},lb=F,cb=N,hb=ne,fb=da,pb=function(e,t,n){var r,a;return ib&&rb(r=t.constructor)&&r!==n&&ab(a=r.prototype)&&a!==n.prototype&&ib(e,a),e},mb=yn,vb=rn.f,gb=mr.f,yb=xe,bb=ub,_b=Fa,wb=vl,Ab=gl,kb=bn.exports,Eb=q,xb=pt,Sb=Xn.enforce,Db=Zc,Tb=Al,Rb=xl,Ib=It("match"),Ob=cb.RegExp,Pb=Ob.prototype,Cb=cb.SyntaxError,Lb=hb(wb),Mb=hb(Pb.exec),Ub=hb("".charAt),jb=hb("".replace),Bb=hb("".indexOf),Nb=hb("".slice),Gb=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,qb=/a/g,Fb=/a/g,Vb=new Ob(qb)!==qb,Kb=Ab.UNSUPPORTED_Y,Wb=lb&&(!Vb||Kb||Tb||Rb||Eb((function(){return Fb[Ib]=!1,Ob(qb)!=qb||Ob(Fb)==Fb||"/a/i"!=Ob(qb,"i")})));if(fb("RegExp",Wb)){for(var Hb=function(e,t){var n,r,a,i,s,o,d=yb(Pb,this),u=bb(e),l=void 0===t,c=[],h=e;if(!d&&u&&l&&e.constructor===Hb)return e;if((u||yb(Pb,e))&&(e=e.source,l&&(t="flags"in h?h.flags:Lb(h))),e=void 0===e?"":_b(e),t=void 0===t?"":_b(t),h=e,Tb&&"dotAll"in qb&&(r=!!t&&Bb(t,"s")>-1)&&(t=jb(t,/s/g,"")),n=t,Kb&&"sticky"in qb&&(a=!!t&&Bb(t,"y")>-1)&&(t=jb(t,/y/g,"")),Rb&&(i=function(e){for(var t,n=e.length,r=0,a="",i=[],s={},o=!1,d=!1,u=0,l="";r<=n;r++){if("\\"===(t=Ub(e,r)))t+=Ub(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:Mb(Gb,Nb(e,r+1))&&(r+=2,d=!0),a+=t,u++;continue;case">"===t&&d:if(""===l||xb(s,l))throw new Cb("Invalid capture group name");s[l]=!0,i[i.length]=[l,u],d=!1,l="";continue}d?l+=t:a+=t}return[a,i]}(e),e=i[0],c=i[1]),s=pb(Ob(e,t),d?this:Pb,Hb),(r||a||c.length)&&(o=Sb(s),r&&(o.dotAll=!0,o.raw=Hb(function(e){for(var t,n=e.length,r=0,a="",i=!1;r<=n;r++)"\\"!==(t=Ub(e,r))?i||"."!==t?("["===t?i=!0:"]"===t&&(i=!1),a+=t):a+="[\\s\\S]":a+=t+Ub(e,++r);return a}(e),n)),a&&(o.sticky=!0),c.length&&(o.groups=c)),e!==h)try{mb(s,"source",""===h?"(?:)":h)}catch(e){}return s},zb=function(e){e in Hb||vb(Hb,e,{configurable:!0,get:function(){return Ob[e]},set:function(t){Ob[e]=t}})},$b=gb(Ob),Qb=0;$b.length>Qb;)zb($b[Qb++]);Pb.constructor=Hb,Hb.prototype=Pb,kb(cb,"RegExp",Hb)}Db("RegExp");var Yb=ne,Jb=ar.PROPER,Xb=bn.exports,Zb=un,e_=xe,t_=Fa,n_=q,r_=vl,a_=RegExp.prototype,i_=a_.toString,s_=Yb(r_),o_=n_((function(){return"/a/b"!=i_.call({source:"a",flags:"b"})})),d_=Jb&&"toString"!=i_.name;(o_||d_)&&Xb(RegExp.prototype,"toString",(function(){var e=Zb(this),t=t_(e.source),n=e.flags;return"/"+t+"/"+t_(void 0===n&&e_(a_,e)&&!("flags"in a_)?s_(e):n)}),{unsafe:!0});var u_,l_=ub,c_=N.TypeError,h_=function(e){if(l_(e))throw c_("The method doesn't accept regular expressions");return e},f_=It("match"),p_=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[f_]=!1,"/./"[e](t)}catch(e){}}return!1},m_=va,v_=ne,g_=G.f,y_=xr,b_=Fa,__=h_,w_=pe,A_=p_,k_=v_("".startsWith),E_=v_("".slice),x_=Math.min,S_=A_("startsWith");m_({target:"String",proto:!0,forced:!!(S_||(u_=g_(String.prototype,"startsWith"),!u_||u_.writable))&&!S_},{startsWith:function(e){var t=b_(w_(this));__(e);var n=y_(x_(arguments.length>1?arguments[1]:void 0,t.length)),r=b_(e);return k_?k_(t,r,n):E_(t,n,n+r.length)===r}});var D_=Pr.includes,T_=gc;va({target:"Array",proto:!0},{includes:function(e){return D_(this,e,arguments.length>1?arguments[1]:void 0)}}),T_("includes");var R_=va,I_=h_,O_=pe,P_=Fa,C_=p_,L_=ne("".indexOf);R_({target:"String",proto:!0,forced:!C_("includes")},{includes:function(e){return!!~L_(P_(O_(this)),P_(I_(e)),arguments.length>1?arguments[1]:void 0)}});var M_=va,U_=ns.find,j_=gc,B_=!0;"find"in[]&&Array(1).find((function(){B_=!1})),M_({target:"Array",proto:!0,forced:B_},{find:function(e){return U_(this,e,arguments.length>1?arguments[1]:void 0)}}),j_("find");var N_=F,G_=ne,q_=K,F_=q,V_=ba,K_=Fr,W_=W,H_=ct,z_=he,$_=Object.assign,Q_=Object.defineProperty,Y_=G_([].concat),J_=!$_||F_((function(){if(N_&&1!==$_({b:1},$_(Q_({},"a",{enumerable:!0,get:function(){Q_(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=$_({},e)[n]||V_($_({},t)).join("")!=r}))?function(e,t){for(var n=H_(e),r=arguments.length,a=1,i=K_.f,s=W_.f;r>a;)for(var o,d=z_(arguments[a++]),u=i?Y_(V_(d),i(d)):V_(d),l=u.length,c=0;l>c;)o=u[c++],N_&&!q_(s,d,o)||(n[o]=d[o]);return n}:$_,X_=J_;va({target:"Object",stat:!0,forced:Object.assign!==X_},{assign:X_});var Z_=Sa,ew=K,tw=ne,nw=xm,rw=ub,aw=un,iw=pe,sw=Ah,ow=Dm,dw=xr,uw=Fa,lw=Je,cw=di,hw=Fm,fw=Hl,pw=q,mw=gl.UNSUPPORTED_Y,vw=Math.min,gw=[].push,yw=tw(/./.exec),bw=tw(gw),_w=tw("".slice);nw("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=uw(iw(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!rw(e))return ew(t,r,e,a);for(var i,s,o,d=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,c=new RegExp(e.source,u+"g");(i=ew(fw,c,r))&&!((s=c.lastIndex)>l&&(bw(d,_w(r,l,i.index)),i.length>1&&i.index<r.length&&Z_(gw,d,cw(i,1)),o=i[0].length,l=s,d.length>=a));)c.lastIndex===i.index&&c.lastIndex++;return l===r.length?!o&&yw(c,"")||bw(d,""):bw(d,_w(r,l)),d.length>a?cw(d,0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:ew(t,this,e,n)}:t,[function(t,n){var a=iw(this),i=null==t?void 0:lw(t,e);return i?ew(i,t,a,n):ew(r,uw(a),t,n)},function(e,a){var i=aw(this),s=uw(e),o=n(r,i,s,a,r!==t);if(o.done)return o.value;var d=sw(i,RegExp),u=i.unicode,l=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(mw?"g":"y"),c=new d(mw?"^(?:"+i.source+")":i,l),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===s.length)return null===hw(c,s)?[s]:[];for(var f=0,p=0,m=[];p<s.length;){c.lastIndex=mw?0:p;var v,g=hw(c,mw?_w(s,p):s);if(null===g||(v=vw(dw(c.lastIndex+(mw?p:0)),s.length))===f)p=ow(s,p,u);else{if(bw(m,_w(s,f,p)),m.length===h)return m;for(var y=1;y<=g.length-1;y++)if(bw(m,g[y]),m.length===h)return m;p=f=v}}return bw(m,_w(s,f)),m}]}),!!pw((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]})),mw);var ww=function(){function e(t){x.default(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return C.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(){var e=this;try{var t={},n=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,r=new D.default(location.href,!0);for(var a in r.query)t[a]=r.query[a];return Object.keys(t).filter(function(t){var n=this;return A.default(this,e),this.customParamKeys.some(function(e){return A.default(this,n),e===t}.bind(this))}.bind(this)).length>0||n?(console.log("custom-params",t,n),t):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),Aw=function(){function e(t,n){x.default(this,e),this.adContainer=t,this.onResume=n}return C.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(){A.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}(),kw=function(e){if(!e)return!1;var t=Ew.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)},Ew=Object.prototype.toString;function xw(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 Sw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xw(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dw(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()}function Tw(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 Rw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tw(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Iw=null,Ow=function(){function e(t,n,r){var i=this;if(x.default(this,e),Iw)return Iw;Iw=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=n?a.extendDefaults(s,n):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new a.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=a.getIMASampleTags(),this.atom_display,this.adType_="",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 o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:d,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){A.default(this,i),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){A.default(this,i),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,i,s,o,d,u,l,c,h,f,p,v,g,b,_,k,T;return C.default(e,[{key:"start",value:(T=w.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 T.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=w.default(E.default.mark((function r(i){var s,o,d,u,l,c,h,f,p=this;return E.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&a.Ls.getBoolean("gd_tag"))){r.next=6;break}return s=n.IMASampleTags[e],o=Math.floor(Math.random()*s.length),d=s[o],i({url:d}),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,u=n.nextAdPosition(e),n.eventBus.broadcast("AD_REQUEST",{message:u}),l=n.options,"preroll"===u&&m.isPlainObject(l.preroll)?l=l.preroll:"midroll"===u&&m.isPlainObject(l.midroll)?l=l.midroll:"rewarded"===u&&m.isPlainObject(l.rewarded)&&(l=l.rewarded),c="rewarded"===u?"rewardedVideo":"gdbanner"===u?"gd__banner":"midroll"===u?"midroll":"video1",r.next=16,window.idhb.isLoaded();case 16:if(h={tnl_keys:Rw(Rw({},window.idhb.getAdserverTargetingForAdSlot(c)),{},{tnl_ad_pos:u,tnl_asset_id:n.gameData.gameId})},!(t&&t.retry_on_success&&m.isPlainObject(l.retry_on_success)&&m.isPlainObject(l.retry_on_success.vast))){r.next=21;break}return r.abrupt("return",i(n._createCustomAdVastUrl(l.retry_on_success.vast,h)));case 21:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&m.isPlainObject(l.retry_on_failure.vast))){r.next=25;break}return r.abrupt("return",i(n._createCustomAdVastUrl(l.retry_on_failure.vast,h)));case 25:if(!m.isPlainObject(l.vast)){r.next=27;break}return r.abrupt("return",i(n._createCustomAdVastUrl(l.vast,h)));case 27:return r.next=29,n._create_dp_context(u,t);case 29:f=r.sent,window.idhb.requestAds({slots:S.default({},c,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,t){var r=this;A.default(this,p),!f||null!=t&&t.bidFloorApplied||fetch(f.skip_url).catch(function(e){A.default(this,r)}.bind(this)),i({tnl_keys:Rw(Rw({},window.idhb.getAdserverTargetingForAdSlot(c)),{},{tnl_ad_pos:u,tnl_asset_id:n.gameData.gameId}),url:e,dp:f,hl:t})}.bind(this)}),r.next=36;break;case 33:throw r.prev=33,r.t0=r.catch(8),new Error(r.t0);case 36:case"end":return r.stop()}}),r,this,[[8,33]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===a.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===a.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===a.AdType.Rewarded?"rewarded":e===a.AdType.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(r){if(A.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=Rw(Rw({},t),{},{adTag:o,tnl_ad_pos:i});this.adCounter[i]=this.adCounter[i]||0,this.adCounter[i]++;var u=e.dp,l=e.hl;if(u&&(u.adtag_url=o.url,this._extend_dp_with_adsense(u,l,null==e?void 0:e.tnl_keys)),this._isVMAP(i)){var c=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,a=Date.now(),i=new D.default(e.adtag_url_1,!0);i.query=Sw(Sw({},i.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:a,output:"xml_vast3"});var s=i.toString(),o=new D.default(e.adtag_url_2,!0);o.query=Sw(Sw({},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(Dw({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(Dw({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=c}else if(u&&l.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 f=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=f}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.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(k=w.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;A.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):L.default.video({inline:!0,muted:!1}).then(function(t){A.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 k.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(_=w.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 _.apply(this,arguments)})},{key:"startAd",value:(b=w.default(E.default.mark((function e(t){var n,r,i;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,r=t.adType,i=t.params,this.adType_=r,console.log("gd:adp startAd afgDisabled",n),r!==a.AdType.Interstitial){e.next=24;break}if(!n){e.next=9;break}return e.abrupt("return",this._startInterstitialAd(i));case 9:if("preroll"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=13;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 13:if("start"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=17;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 17:if("next"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=21;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 21:return e.abrupt("return",this._startInterstitialAd(i));case 22:case 30:e.next=33;break;case 24:if(r!==a.AdType.Rewarded){e.next=32;break}if(!n){e.next=29;break}return e.abrupt("return",this._startRewardedAd(i));case 29:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 32:throw new Error("Unsupported ad type");case 33:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"preloadAd",value:(g=w.default(E.default.mark((function e(t){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==a.AdType.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==a.AdType.Rewarded){e.next=8;break}return e.abrupt("return","gdsdk://preloaded");case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e)}))),function(e){return g.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){A.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new Aw(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(v=w.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=w.default(E.default.mark((function e(r,i){var s,o,d,u,l,c,h,f,p,m=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(o=t?t.containerId:null)||i("Container id is not specified"),d=document.getElementById(o),document.getElementById(o)||i("No container is found with this id - ".concat(o)),void 0===window.idhb.requestAds&&i("Prebid.js wrapper script hit an error or didn't exist!"),u=t.slotId?t.slotId:"gd__banner@".concat(o),document.getElementById(u)||(l="\n .gd__banner{\n z-index: ".concat(a.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=l:c.appendChild(document.createTextNode(l)),d.appendChild(c)),(h=document.createElement("div")).id=u,h.classList.add("gd__banner"),d.appendChild(h)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,null!==(s=n.atom_display)&&void 0!==s&&s.params&&window.idhb.setAdserverTargeting(null===(f=n.atom_display)||void 0===f?void 0:f.params),(p={})[u]={maxSize:[d.offsetWidth,d.offsetHeight]},window.idhb.requestAds({slots:p,callback:function(e){A.default(this,m)}.bind(this)}),r(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),i(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return v.apply(this,arguments)})},{key:"_startInterstitialAd",value:(p=w.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(Rw(Rw({},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:"_loadInterstitialAd",value:(f=w.default(E.default.mark((function e(t){var n,r,i=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(a.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,Rw({adType:a.AdType.Interstitial},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;A.default(this,i);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){A.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){A.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,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:(h=w.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(Rw(Rw({},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 h.apply(this,arguments)})},{key:"_loadRewardedAd",value:(c=w.default(E.default.mark((function e(t){var n,r,i=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(a.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,Rw({adType:a.AdType.Rewarded},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;A.default(this,i);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){A.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){A.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,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 c.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(l=w.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(a.AdType.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return l.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(u=w.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(a.AdType.Rewarded);case 5:e.t0=e.sent;case 6:return this.preloadedRewardedAdVast=e.t0,e.abrupt("return",this.preloadedRewardedAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),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.adsManager.setVolume(0),r&&this.eventBus.broadcast("AD_T4R"),r&&setTimeout(function(){A.default(this,t),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(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,this.adsManager.setVolume(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=a.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 i=function(){A.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",i),window.document.addEventListener("DOMContentLoaded",i)}},{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(){A.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,n=new Date,r=n.getHours(),i=n.getDate(),s=n.getMonth(),o=n.getFullYear(),d=a.getKeyByValue(google.ima.AdEvent.Type,e.type),u=!1,l=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",c=!l.startsWith("image")&&!l.startsWith("text");this._sendIMAEventsToHB(e);var h="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:h="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:h="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:u=!0,h="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:h="Fired when the ad is clicked.";var f=e.getAd().getContentType();this._show({mode:"click",contentType:f});break;case google.ima.AdEvent.Type.COMPLETE:u=this._is_completed(e.getAd()),h="Fired when the ad completes playing.",this.adType_===a.AdType.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:h="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:h="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",u=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:h="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:h="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:h="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:h="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:h="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var m=e.getAd().getContentType();h=m,this._show({mode:"loaded",contentType:m});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(h=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:h="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:c&&this.adResume.show(),h="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:h="Fired when the ad is resumed.",c&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:h="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:u=this._is_completed(e.getAd()),h="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),h="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:h="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:u=this._is_completed(e.getAd()),h="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:h="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:h="Fired when the ad volume has been muted."}""!==d&&""!==h&&this.eventBus.broadcast(d,{name:d,message:h,status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(s," y").concat(o)}}),u&&!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}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{console.log("gd:adp will hide adresume"),this.adResume&&this.adResume.hide(),console.log("gd:adp hiding adresume")}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event: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(){A.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/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(kw(e.getInnerError)){var t=e.getInnerError();if(t)return kw(t.getErrorCode)&&kw(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(A.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];m.isPlainObject(i)&&(r.query[a]=M.default.stringify(i))}var s=new D.default(r.url,!0);return U.default(s.query,r.query||{}),Rw({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new D.default(e.url,!0),a=this._transformQuery(e,t,r);a&&(n.url=r.toString());var i=a?r:new D.default(e.url,!0);if(i.query.cust_params){var s=M.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&&m.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&&m.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=P.default(a),m.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=M.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 A.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,U.default(i,u),i.cust_params=M.default.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,a,i,s,o,d,u,l,c,h=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(null!=e&&null!==(n=e.contentType)&&void 0!==n&&n.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return h&&("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===(l=u.rAds)||void 0===l||null===(c=l.t4r)||void 0===c?void 0:c.enabled));if(null!=e&&e.contentType.startsWith("video/")){var f,p,m,v,g,y,b,_,w,A="preroll"===h?null===(f=this.gameData)||void 0===f||null===(p=f.pAds)||void 0===p||null===(m=p.t4r)||void 0===m?void 0:m.viper:"midroll"===h?null===(v=this.gameData)||void 0===v||null===(g=v.mAds)||void 0===g||null===(y=g.t4r)||void 0===y?void 0:y.viper:"rewarded"===h?null===(b=this.gameData)||void 0===b||null===(_=b.rAds)||void 0===_||null===(w=_.t4r)||void 0===w?void 0:w.viper:0;if(A>0){var k,E,x,S,D,T,R,I,O,P=Math.random()<A;return h&&P&&("preroll"===h&&(null===(k=this.gameData)||void 0===k||null===(E=k.pAds)||void 0===E||null===(x=E.t4r)||void 0===x?void 0:x.enabled)||"midroll"===h&&(null===(S=this.gameData)||void 0===S||null===(D=S.mAds)||void 0===D||null===(T=D.t4r)||void 0===T?void 0:T.enabled)||"rewarded"===h&&(null===(R=this.gameData)||void 0===R||null===(I=R.rAds)||void 0===I||null===(O=I.t4r)||void 0===O?void 0:O.enabled))}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,d,u,l,c,h,f,p,m;if(!e)return!1;var v="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===(l=u.vmap)||void 0===l?void 0:l.enabled))||"rewarded"===e&&(!0===(null===(c=this.gameData)||void 0===c||null===(h=c.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(f=this.gameData)||void 0===f||null===(p=f.rAds)||void 0===p||null===(m=p.vmap)||void 0===m?void 0:m.enabled));if(!v)return!1;var g=this._get_vmap_config(e),y=this.adCounter[e];return void 0!==(null==g?void 0:g.start)?y>=(null==g?void 0:g.start):v}},{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,l,c,h,f,p,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===(l=u.dp)||void 0===l?void 0:l.enabled))||"rewarded"===e&&(!0===(null===(c=this.gameData)||void 0===c||null===(h=c.rAds)||void 0===h?void 0:h.dp)||!0===(null===(f=this.gameData)||void 0===f||null===(p=f.rAds)||void 0===p||null===(m=p.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;A.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new ww(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(y.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return A.default(this,n),e.json()}.bind(this)).then(function(e){if(A.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){A.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,t){var n=this;return new Promise(function(){var r=w.default(E.default.mark((function r(a){var i,s,o,d,u,l,c=this;return E.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,n._isDP(e)){r.next=5;break}return n.msgrt.send("dp.na",{message:"rule"}),r.abrupt("return",a());case 5:s={id:n.topDomain||n.parentDomain,au:e||"unknown",ty:"video",aid:n.gameData.gameId,pgu:n.parentURL},(o=new ww(n.gameData).checkCustomParams())&&(s.cp=o),d=encodeURIComponent(y.Base64.encode(JSON.stringify(s))),u=null===(i=n.gameData.promo)||void 0===i?void 0:i.rainbow,l=(null==u?void 0:u.enabled)&&!0!==(null==t?void 0:t.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(d)).then(function(e){return A.default(this,c),e.json()}.bind(this)).then(function(e){if(A.default(this,c),!e||!e.p)return n.msgrt.send("dp.na",{message:"atom"}),a();var t=e.p/100;a({id:Date.now(),floor_price:t,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(d,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(d),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(d),promo_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(d):void 0,promo_imp_blue_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:l?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){A.default(this,c),n.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),a()}.bind(this)),r.next=18;break;case 14:r.prev=14,r.t0=r.catch(0),n.msgrt.send("dp.err",{message:(null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0}),a();case 18:case"end":return r.stop()}}),r,this,[[0,14]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new D.default(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var a=M.default.parse(r.query.cust_params);if(!a.tnl_asset_id)return;a.adsense=1,r.query.cust_params=M.default.stringify(a,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(d=w.default(E.default.mark((function e(t){var n,r,i,s,o,d=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),r=n[0],window.idhb=window.idhb||{},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=8,a.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return A.default(this,d),window.idhb.requestAds}.bind(this)});case 8:i=a.getQueryString("ch",window.location.href),s=a.getQueryString("ch_date",window.location.href),o={tnl_content_category:this.category.toLowerCase()},i&&(o.channel=i),s&&(o.ch_date=s),window.idhb.setAdserverTargeting(o),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var t=this;A.default(this,d);try{var n,r=e.slotId.split("@");r=1===r.length?r[0]:r[1],e.isEmpty?(null!==(n=this.atom_display)&&void 0!==n&&n.error_url&&(fetch(this.atom_display.error_url).catch(function(e){A.default(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:r,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){A.default(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:r,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"_init_ima_script",value:(o=w.default(E.default.mark((function e(t){var n,r,i=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,a.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return A.default(this,i),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_afg_script",value:(s=w.default(E.default.mark((function e(t){var n,r,i,s,o=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(s={}).crossorigin="anonymous",s["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",s["data-ad-frequency-hint"]="30s",s.allow="autoplay",(null==t||null===(r=t.adsense_channel)||void 0===r?void 0:r.length)>0&&(s["data-ad-channel"]=t.adsense_channel),(null==t||null===(i=t.adsense_host)||void 0===i?void 0:i.length)>0&&(s["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(s["data-adbreak-test"]="on"),e.next=14,a.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return A.default(this,o),!!window.adsbygoogle}.bind(this),attrs:s});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(i=w.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(console.log("gd:adp _startAdsensePlacementRewardedAd"),e.prev=2,!this.requestRunning){e.next=6;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 6:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),n=function(){A.default(this,d),console.log("gd:adp rw beforeAd"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){A.default(this,d),console.log("gd:adp rw afterAd"),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){A.default(this,d),console.log("gd:adp rw adDismmissed"),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){A.default(this,d),console.log("gd:adp rw adViewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){A.default(this,d),console.log("gd:adp rw beforeReward"),e()}.bind(this),o=function(e){A.default(this,d),console.log("gd:adp rw adBreakDone"),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),console.log("gd:adp rw window.adsbygoogle.push(o). tm",window.adsbygoogle),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(2),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}var t}),e,this,[[2,18]])}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=w.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){A.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=w.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(){A.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){A.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){A.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=w.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(){A.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){A.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){A.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(y.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,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===a.AdType.Rewarded)t="reward";else if(n===a.AdType.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}}]),e}(),Pw=function e(t){var n=this;x.default(this,e),S.default(this,"load",w.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),S.default(this,"promo",w.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},fm(this.moduleName,this.moduleConfig)},Cw=function e(t){var n=this;x.default(this,e),S.default(this,"load",w.default(E.default.mark((function e(){return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),S.default(this,"splash",w.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},fm(this.moduleName,this.moduleConfig)},Lw=function(e,t){console.log(e,t)},Mw={},Uw={},jw=null;function Bw(){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 Mw.version=r,Mw.frame=e,Mw.function=n,Mw.version}function Nw(e){var t=this;return jw||(jw=new Promise(function(n){function r(t,r){if(Lw("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:Mw,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}A.default(this,t),Bw(),Mw.frame?2===Mw.version?(Lw("TCF v2 CMP found. Fetching the consent."),Mw.function?(Lw("CMP API is directly accessible, calling it now..."),Mw.function("addEventListener",Mw.version,r)):(Lw("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!==Uw[r.callId]&&Uw[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){A.default(this,r);var o=Math.random()+"",d="".concat(a,"Call"),u=S.default({},d,{command:e,parameter:s,callId:o,version:n});Uw[o]=i,t.postMessage(u,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,Mw.version,n)}("addEventListener",Mw.frame,r))):n({result:"cmpVersionNotV2",cmp:Mw}):n({result:"cmpNotFound"})}.bind(this)),jw)}var Gw=new(function(){function e(){x.default(this,e),this.productName="Game Distribution"}var t;return C.default(e,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(t=w.default(E.default.mark((function e(t,n){var r,a,i,s,o,d;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(r=t.visitor)||void 0===r?void 0:r.visitorId){e.next=6;break}return e.abrupt("return");case 6:return i=encodeURIComponent(this.productName),s=encodeURIComponent(a),e.prev=8,o="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=12,fetch(o,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,d="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=22,fetch(d,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,n){return t.apply(this,arguments)})}]),e}());function qw(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 Fw(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 Fw(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 Fw(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}var Vw=function(e){var t=this,n=e.src,r=e.attributes,a=e.target,i=e.isAsync;return new Promise(function(e,s){var o=this;A.default(this,t);try{var d=document.createElement("script");if(d.async=null==i||i,d.type="text/javascript",d.onload=function(){A.default(this,o),e()}.bind(this),d.onerror=function(){A.default(this,o);var e="Error on script load, Error: ".concat(n);console.log(e),s(e)}.bind(this),d.src=n,r){var u,l=qw(r);try{for(l.s();!(u=l.n()).done;){var c=u.value,h=c.key,f=c.value;d.setAttribute(h,f)}}catch(e){l.e(e)}finally{l.f()}}a||(a=document.head),a.appendChild(d)}catch(e){var p="Error on script load catch, Error: ".concat(n);console.log(p,e),s(p)}}.bind(this))},Kw=function(){var e=w.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,Vw({src:"https://cdn.cookielaw.org/consent/tcf.stub.js",attributes:[{key:"id",value:"gd-cookie-pro-tcf-stub"},{key:"charset",value:"UTF-8"}],isAsync:!1});case 3:return e.next=5,Vw({src:"https://cookie-cdn.cookiepro.com/consent/".concat("140feb72-7952-4420-8ae5-e8978d87bc17","/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,Vw({src:"https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js",attributes:[{key:"id",value:"gd-cookie-pro-stub"},{key:"charset",value:"UTF-8"},{key:"data-domain-script",value:"140feb72-7952-4420-8ae5-e8978d87bc17"}],isAsync:!1});case 7:n=void 0,r=void 0,a=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(a=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(a),console.log("GD: CMP cookie pro loaded successfully."),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 14:case"end":return e.stop()}var t,n,r,a}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Ww=new b.EventEmitter,Hw={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function zw(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 $w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zw(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}window.addEventListener("message",(function(e){var t=this,n=e.data,r=e.origin,a=n.type;if(Object.keys(Hw).some(function(e){return A.default(this,t),e===r}.bind(this))&&(null==n||!n.__tcfapiCall)&&(window.parent&&!n.type.startsWith("gd-sdk")&&(window.parent.postMessage(n,"*"),console.log("GD-SDK:pst fw sg event to parent complete",window.parent.location.href,n)),a)){var i=Hw[r][a];i&&Ww.emit(i,n)}}),!1);var Qw,Yw=null,Jw=null,Xw=function(){function e(t){var n=this;if(x.default(this,e),Yw)return Yw;Yw=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new Gg,this._location.print(),this._parentURL=this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){A.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){A.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e;A.default(this,n),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen()}.bind(this)),this._registerSGBridge()}var t,n,r,i,s,o,d,u,l,c,h;return C.default(e,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(A.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))}},{key:"_loadCMP",value:(h=w.default(E.default.mark((function e(){var t,n,r,a;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=8;break}if(r=new Gg,a=r.get("depth"),console.log("CMP location.depth",a),0!==(null==a?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=8;break}return e.next=7,Kw();case 7:console.log("CMP loaded");case 8:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var e=Bw();console.log("CMP found",e),w.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,Nw({});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:"_registerSGBridge",value:function(){var e=this;Ww.on("splash-hidden",function(t){A.default(this,e),console.log("GD-SDK:pst on splash-hidden",t),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){console.log(":pst hide cmp button");var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{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"})}catch(e){}}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(console.log("in gamedock gameplay",this._gameData.loader.enabled,e),!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),console.log("gamedock gameplay"),this._gameDockGamePlaySent=!0}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:(c=w.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,this._gameData=this._getGameData(),e.next=4,this._loadCMP();case 4: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 A.default(this,a),console.error(e.message||e)}.bind(this))),t(this._gameData),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),n(e.t0);case 19:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(e,t){return c.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=P.default(e);this.options=t?a.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=qg.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=this;void 0===this._topDomain&&(this._topDomain=void 0);var n={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(M.default.stringify(n))).catch(function(e){A.default(this,t)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=a.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,a.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!a.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0),a.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0)),a.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 a.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:a.getIframeDepth(),version:qg.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:a.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.4.0/script/gamedock-sdk.min.js"];a.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){var t,n;A.default(this,e),Jw=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&Jw.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),Gw.track(Jw,this._gameData)}.bind(this)).catch(function(t){A.default(this,e),this._sendSDKError(t)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,n;null===(t=Jw)||void 0===t||null===(n=t.tracking)||void 0===n||n.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{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"];a.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){A.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];a.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return A.default(this,e),window.ga}.bind(this)}).then(function(){A.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){A.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new a.EventBus,a.SDKEvents.forEach(function(t){var n=this;return A.default(this,e),this.eventBus.subscribe(t,function(e){return A.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),a.IMAEvents.forEach(function(t){var n=this;return A.default(this,e),this.eventBus.subscribe(t,function(e){return A.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(A.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 A.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){var n,r;A.default(this,e),this.msgrt.send("ad.impression"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&Gw.track(Jw,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){A.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){A.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){A.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){A.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){A.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 A.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(qg.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(l=w.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(){A.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(M.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 l.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(){A.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&(a.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,a=this._gameData,i=a.gdpr&&!0===a.gdpr.consent,s=a.loader,o=null===(e=a.promo)||void 0===e?void 0:e[null===(t=a.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(a.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(a,i):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||i?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):!1!==s.enabled&&this._createSplash(a,i):null!=o&&o.enabled&&this._createPromo(a,i))}},{key:"_initializeVideoAd",value:(u=w.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=a.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new a.Macros({game:t,bridge:this._bridge}),this.adInstance=new Ow(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=qg,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17: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){a.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){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){a.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var e=vy();return this._bridge.noPreroll=(!this._getisMobile()||!1!==e.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(e),a.setDankLog(e.diagnostic),e}},{key:"_getGameDataOld",value:function(){var e=this;return new Promise(function(t){var n=this;A.default(this,e);var r=this._getDefaultGameData(),i=this._getGameDataUrl();fetch(i).then(function(e){return A.default(this,n),e.json()}.bind(this)).then(function(e){if(A.default(this,n),e.success){var i,s,o,d,u=e.result.game,l={gameId:u.gameMd5,slug:u.slug,pname:u.pname,dname:u.dname,status:u.status,description:u.description,enableAds:!0===u.enableAds||!0===(null===(i=u.enableAds)||void 0===i?void 0:i.enabled),preroll:u.preRoll,midroll:6e4*u.timeAds,rewardedAds:u.rewardedAds,title:u.title,tags:u.tags,category:u.category,assets:u.assets,disp_2nd_prer:u.disp_2nd_prer,ctry_vst:u.ctry_vst,ctry:u.ctry,crtv:u.crtv,dmain:u.dmain,block_exts:this._parseAndSelectRandomOne(u.push_cuda),bloc_gard:this._parseAndSelectRandomOne(u.bloc_gard),cookie:this._parseAndSelectRandomOne(u.cookie),gdpr:this._parseAndSelectRandomOne(u.gdpr),diagnostic:this._parseAndSelectRandomOne(u.diagnostic),cmp:this._parseAndSelectRandomOne(u.cmp),gft:this._parseAndSelectRandomOne(u.gft),sdk:this._parseAndSelectRandomOne(u.sdk)||{},loader:this._parseAndSelectRandomOne(u.loader)||{},splash:this._parseAndSelectRandomOne(u.splash)||{},promo:this._parseAndSelectRandomOne(u.promo)||{},dAds:this._parseAndSelectRandomOne(u.dads)||{},pAds:this._parseAndSelectRandomOne(u.pads)||{},mAds:this._parseAndSelectRandomOne(u.mads)||{},rAds:this._parseAndSelectRandomOne(u.rads)||{},lp:this._parseAndSelectRandomOne(u.lp)||{}},c=a.extendDefaults(P.default(r),l);c.afg_disabled=!1===(null===(s=c.sdk)||void 0===s||null===(o=s.afg)||void 0===o?void 0:o.enabled),console.log("gd:adp gameData.afgDisabled",c.afg_disabled),null!==(d=c.pAds)&&void 0!==d&&d.enabled&&(c.preroll=!0),this._bridge.noPreroll=(!this._getisMobile()||!1!==c.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(c),a.setDankLog(c.diagnostic),t(c)}else r.failed=!0,t(r)}.bind(this)).catch(function(e){A.default(this,n),r.failed=!0,t(r)}.bind(this))}.bind(this))}},{key:"_createSplash",value:(d=w.default(E.default.mark((function e(t,n){var r,i,s,o,d=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,i=new r($w($w({},this.options),{},{isConsentDomain:n,version:qg.version}),t,this._parentDomain),s=by(),o=s.enabled,i.on("playClick",function(){var e=this;if(A.default(this,d),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this._hideCMPButton(),o?window.gdsdk.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){A.default(this,e),console.log("extsc: splash error",t),i.hide()}.bind(this)):this.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){A.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(){A.default(this,d),i.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){A.default(this,d),i.hide()}.bind(this));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(o=w.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($w($w({},this.options),{},{isConsentDomain:n,version:qg.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){A.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 o.apply(this,arguments)})},{key:"_createPromo",value:(s=w.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($w($w({},this.options),{},{isConsentDomain:n,version:qg.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){A.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 s.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(a.AdType.Interstitial).catch(function(){A.default(this,e)}.bind(this))}},{key:"showAd",value:(i=w.default(E.default.mark((function e(t){var n,r=this,a=arguments;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},console.log("gd:adp, showAd izMaster,izToken",this._isMasterGameURL(),this._isTokenGameURL()),e.abrupt("return",new Promise(function(){var e=w.default(E.default.mark((function e(a,i){var s,o,d,u,l,c,h,f,p,m,v,g=this;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,c={adType:t,params:n,adTimestamp:r.adRequestTimer},e.next=4,r.sdkReady;case 4:return h=e.sent,e.next=7,r.videoAdReady;case 7:return null!==(s=r._gameData.lp)&&void 0!==s&&s.load||r._sendLoadedEvent(),r._sendGamedockGamePlay(),r._rejectAdIfGameBlocked({gameData:h,adRequest:c}),r._rejectAdIfAdDisabled({gameData:h,adRequest:c}),r._rejectAdIfUnsupportedType({adRequest:c}),r._rejectAdIfRewardedDisabled({gameData:h,adRequest:c}),(null===(o=h.gft)||void 0===o||!o.enabled||null!==(d=h.gft)&&void 0!==d&&d.enabled&&(null==h||null===(u=h.gft)||void 0===u||null===(l=u.durations[r._giftCount])||void 0===l?void 0:l.after)!==r.adInstance.adMidrollCount)&&r._rejectAdIfAdRateHits({gameData:h,adRequest:c}),r.adInstance.attachAfgPosition(c),r._attachAfgFallback({gameData:h,adRequest:c}),f="main.showad",p=function(e){var t,n,a;A.default(this,g),r.eventBus.unsubscribeScope(f),r.onResumeGame(e.message,"warning"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(a=n.durations[r._giftCount])||void 0===a?void 0:a.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),i(e.message)}.bind(this),m=function(e){var t,n,i;A.default(this,g),r.eventBus.unsubscribeScope(f),r.adRequestTimer=Date.now(),r.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(i=n.durations[r._giftCount])||void 0===i?void 0:i.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),a(e.message)}.bind(this),v=function(e){var s=this;A.default(this,g),r.eventBus.unsubscribeScope(f),n.fallback_adsense=!1,r.showAd(t,$w($w({},n),{},{adapter:"adsense"})).then(function(e){A.default(this,s),a(e)}.bind(this)).catch(function(e){A.default(this,s),i(e)}.bind(this))}.bind(this),r.eventBus.subscribe("AD_ERROR",null!=n&&n.fallback_adsense?v:p,f),r.eventBus.subscribe("AD_SDK_CANCELED",null!=n&&n.fallback_adsense?v:p,f),r.eventBus.subscribe("AD_SUCCESS",m,f),e.next=25,r.adInstance.startAd(c);case 25:r._post_message({topic:"adrequest.instream"}),e.next=32;break;case 28:e.prev=28,e.t0=e.catch(0),r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 32:case"end":return e.stop()}}),e,this,[[0,28]])})));return function(t,n){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.params.fallback_adsense=!0}}},{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!==a.AdType.Interstitial&&t.adType!==a.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=a.AdType.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===a.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,s,o,d=e.gameData,u=e.adRequest,l=null;u.adType===a.AdType.Interstitial&&null!==(t=d.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=d.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(l=6e4*(null===(s=d.diagnostic)||void 0===s||null===(o=s.useMidrollIndex)||void 0===o?void 0:o.indexes[this.adInstance.adMidrollCount])):l=d.midroll;if(u.adType===a.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<l)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=w.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=w.default(E.default.mark((function e(r,i){var s,o;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 s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=a.AdType.Rewarded,e.next=16;break;case 14:if(t===a.AdType.Interstitial||t===a.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==a.AdType.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:o=e.sent,r(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),i(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=w.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=w.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=w.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){a.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+""}}),this.adInstance&&this.adInstance._hideAddResume()}},{key:"onPauseGame",value:function(e,t){this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){a.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 a.ImplementationTest(this).start(),a.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(A.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){A.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;A.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 A.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 i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),d=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,v=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:d,noLoadedEvent:u,noBlockerEvent:l,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:c,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:v,depth:a.getIframeDepth(),domainMatched:s===o,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 D.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 D.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new D.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(y.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Cw(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=w.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 Pw(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(y.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new D.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(M.default.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new D.default(e,!0);return n.query=$w($w({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return y.Base64.encode(JSON.stringify(e))}},{key:"_parseAndSelectRandomOne",value:function(e){var t=this._selectRandomOne("object"===k.default(e)?e:a.parseJSON(e));return t&&t.version?qg.version>=t.version?t:void 0:t}},{key:"_selectRandomOne",value:function(e){var t=this;if(!my(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){A.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=w.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 A.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)}}},{key:"decideToGiveAGift",value:function(){var e=this;try{var t,n=null===(t=this._gameData)||void 0===t?void 0:t.gft;this.giftInterval=setInterval(w.default(E.default.mark((function t(){var n=this;return E.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.adInstance.requestRunning?console.log("Advertisement already running..."):(e.showAd(a.AdType.Interstitial,{position:"midroll"}).catch(function(e){A.default(this,n)}.bind(this)),clearInterval(e.giftInterval),e.giftInterval=void 0,e._giftCount++);case 1:case"end":return t.stop()}}),t,this)}))),1e3*n.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),e}(),Zw={},eA=function(e){try{if(Zw.source){var t={type:"gd-sdk-on-event",event:e};Zw.source.postMessage(t,Zw.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},tA=function(){eA({name:"SDK_READY",status:"success",message:"Everything is ready."}),eA({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),eA({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},nA=function(e){console.log("gd:adp registerForForwarderPosts");window.addEventListener("message",(function(t){var n=t.data,r=t.origin,a=t.source,i=n.type,s=n.method,o=n.options;if("gd-sdk-self"===i){var d={type:"gd-sdk",method:s,options:o};return window.postMessage(d,"https://html5.gamedistribution.com"),void console.log("gd:adp after self post")}if("gd-sdk"===i){if(!Zw.source&&"init"===s)return function(e){var t=e.source,n=e.origin;Zw={source:t,origin:n}}({source:a,origin:r}),void tA();var u=e[s];u&&w.default(E.default.mark((function t(){var n;return E.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!(n=u.apply(e,Object.values(o)))||!n.then){t.next=5;break}return t.next=5,n;case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("gd:adp:m:r onFrameMessage error",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))()}}),!1)},rA=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){eA(e),t.apply(this,arguments)}}(e);var t=new Xw(e);return nA(t),t},aA={create:function(){var e=w.default(E.default.mark((function e(t){var n,r;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Dy(t);case 3:return n=e.sent,r=n?Ey(t):rA(t),_y(),e.abrupt("return",r);case 9:return e.prev=9,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",rA(t));case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()};function iA(){return(iA=w.default(E.default.mark((function e(t,n){var r,a;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ky();case 2:if(r=e.sent,console.log("extsc: should wrapper be called?",r),!r){e.next=8;break}e.t0=window.gdsdk,e.next=11;break;case 8:return e.next=10,oA(t);case 10:e.t0=e.sent;case 11:return a=e.t0,e.abrupt("return",n(a));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var sA=!1;function oA(e){var t=this;return new Promise(function(n,r){var a=this;if(A.default(this,t),Qw)return n(Qw);if(sA)var i=setInterval(function(){A.default(this,a),Qw&&(sA=!1,clearInterval(i),n(Qw))}.bind(this),100);else sA=!0,aA.create(e).then(function(e){A.default(this,a),console.log("sdk created!"),Qw=e,e._sendSDKReady(),sA=!1,n(Qw)}.bind(this))}.bind(this))}var dA,uA=(oA(dA=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":k.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===k.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}()),{invoke:function(e){return function(e,t){return iA.apply(this,arguments)}(dA,e)}});function lA(){var e=this;this.AdType=a.AdType,this.preloadAd=function(e){var t=this;return uA.invoke(function(n){return A.default(this,t),n.preloadAd(e)}.bind(this))},this.showAd=function(){var e=w.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",uA.invoke(function(e){return A.default(this,r),t===a.AdType.Display?e.showDisplayAd(n):e.showAd(t)}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return uA.invoke(function(t){return A.default(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return uA.invoke(function(t){return A.default(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return uA.invoke(function(t){return A.default(this,e),t.session()}.bind(this))},this.leaderboard={show:function(){A.default(this,e),vm.showLeaderboard()}.bind(this),addScore:function(t){A.default(this,e),vm.addScore(t)}.bind(this)}}lA.prototype=new function(){this.showBanner=function(){var e=this;return uA.invoke(function(t){return A.default(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new lA,window.gdApi=window.gdsdk;
1
+ "use strict";var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/newArrowCheck"),n=require("@babel/runtime/helpers/typeof"),r=require("@babel/runtime/regenerator"),a=require("@bygd/gd-sdk-era/dist/default"),i=require("@babel/runtime/helpers/classCallCheck"),s=require("@babel/runtime/helpers/defineProperty"),o=require("url-parse"),d=require("validator"),u=require("is-valid-domain"),c=require("get-value"),l=require("set-value"),h=require("lodash.clonedeep"),f=require("@babel/runtime/helpers/createClass"),p=require("can-autoplay"),m=require("is-plain-object"),g=require("querystringify"),v=require("lodash.merge"),y=require("js-base64"),b=require("events"),_=require("uuid");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var A=w(e),k=w(t),E=w(n),x=w(r),D=w(i),S=w(s),T=w(o),R=w(d),O=w(u),I=w(c),P=w(l),C=w(h),L=w(f),M=w(p),U=w(g),j=w(v),B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},G=function(e){return e&&e.Math==Math&&e},N=G("object"==typeof globalThis&&globalThis)||G("object"==typeof window&&window)||G("object"==typeof self&&self)||G("object"==typeof B&&B)||function(){return this}()||Function("return this")(),q={},F=function(e){try{return!!e()}catch(e){return!0}},V=!F((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),K=Function.prototype.call,W=K.bind?K.bind(K):function(){return K.apply(K,arguments)},H={},z={}.propertyIsEnumerable,$=Object.getOwnPropertyDescriptor,Q=$&&!z.call({1:2},1);H.f=Q?function(e){var t=$(this,e);return!!t&&t.enumerable}:z;var Y,J,X=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Z=Function.prototype,ee=Z.bind,te=Z.call,ne=ee&&ee.bind(te),re=ee?function(e){return e&&ne(te,e)}:function(e){return e&&function(){return te.apply(e,arguments)}},ae=re,ie=ae({}.toString),se=ae("".slice),oe=function(e){return se(ie(e),8,-1)},de=re,ue=F,ce=oe,le=N.Object,he=de("".split),fe=ue((function(){return!le("z").propertyIsEnumerable(0)}))?function(e){return"String"==ce(e)?he(e,""):le(e)}:le,pe=N.TypeError,me=function(e){if(null==e)throw pe("Can't call method on "+e);return e},ge=fe,ve=me,ye=function(e){return ge(ve(e))},be=function(e){return"function"==typeof e},_e=be,we=function(e){return"object"==typeof e?null!==e:_e(e)},Ae=N,ke=be,Ee=function(e){return ke(e)?e:void 0},xe=function(e,t){return arguments.length<2?Ee(Ae[e]):Ae[e]&&Ae[e][t]},De=re({}.isPrototypeOf),Se=xe("navigator","userAgent")||"",Te=N,Re=Se,Oe=Te.process,Ie=Te.Deno,Pe=Oe&&Oe.versions||Ie&&Ie.version,Ce=Pe&&Pe.v8;Ce&&(J=(Y=Ce.split("."))[0]>0&&Y[0]<4?1:+(Y[0]+Y[1])),!J&&Re&&(!(Y=Re.match(/Edge\/(\d+)/))||Y[1]>=74)&&(Y=Re.match(/Chrome\/(\d+)/))&&(J=+Y[1]);var Le=J,Me=Le,Ue=F,je=!!Object.getOwnPropertySymbols&&!Ue((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Me&&Me<41})),Be=je&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ge=xe,Ne=be,qe=De,Fe=Be,Ve=N.Object,Ke=Fe?function(e){return"symbol"==typeof e}:function(e){var t=Ge("Symbol");return Ne(t)&&qe(t.prototype,Ve(e))},We=N.String,He=function(e){try{return We(e)}catch(e){return"Object"}},ze=be,$e=He,Qe=N.TypeError,Ye=function(e){if(ze(e))return e;throw Qe($e(e)+" is not a function")},Je=Ye,Xe=function(e,t){var n=e[t];return null==n?void 0:Je(n)},Ze=W,et=be,tt=we,nt=N.TypeError,rt={exports:{}},at=N,it=Object.defineProperty,st=function(e,t){try{it(at,e,{value:t,configurable:!0,writable:!0})}catch(n){at[e]=t}return t},ot=st,dt=N["__core-js_shared__"]||ot("__core-js_shared__",{}),ut=dt;(rt.exports=function(e,t){return ut[e]||(ut[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var ct=me,lt=N.Object,ht=function(e){return lt(ct(e))},ft=ht,pt=re({}.hasOwnProperty),mt=Object.hasOwn||function(e,t){return pt(ft(e),t)},gt=re,vt=0,yt=Math.random(),bt=gt(1..toString),_t=function(e){return"Symbol("+(void 0===e?"":e)+")_"+bt(++vt+yt,36)},wt=N,At=rt.exports,kt=mt,Et=_t,xt=je,Dt=Be,St=At("wks"),Tt=wt.Symbol,Rt=Tt&&Tt.for,Ot=Dt?Tt:Tt&&Tt.withoutSetter||Et,It=function(e){if(!kt(St,e)||!xt&&"string"!=typeof St[e]){var t="Symbol."+e;xt&&kt(Tt,e)?St[e]=Tt[e]:St[e]=Dt&&Rt?Rt(t):Ot(t)}return St[e]},Pt=W,Ct=we,Lt=Ke,Mt=Xe,Ut=function(e,t){var n,r;if("string"===t&&et(n=e.toString)&&!tt(r=Ze(n,e)))return r;if(et(n=e.valueOf)&&!tt(r=Ze(n,e)))return r;if("string"!==t&&et(n=e.toString)&&!tt(r=Ze(n,e)))return r;throw nt("Can't convert object to primitive value")},jt=It,Bt=N.TypeError,Gt=jt("toPrimitive"),Nt=function(e,t){if(!Ct(e)||Lt(e))return e;var n,r=Mt(e,Gt);if(r){if(void 0===t&&(t="default"),n=Pt(r,e,t),!Ct(n)||Lt(n))return n;throw Bt("Can't convert object to primitive value")}return void 0===t&&(t="number"),Ut(e,t)},qt=Ke,Ft=function(e){var t=Nt(e,"string");return qt(t)?t:t+""},Vt=we,Kt=N.document,Wt=Vt(Kt)&&Vt(Kt.createElement),Ht=function(e){return Wt?Kt.createElement(e):{}},zt=Ht,$t=!V&&!F((function(){return 7!=Object.defineProperty(zt("div"),"a",{get:function(){return 7}}).a})),Qt=V,Yt=W,Jt=H,Xt=X,Zt=ye,en=Ft,tn=mt,nn=$t,rn=Object.getOwnPropertyDescriptor;q.f=Qt?rn:function(e,t){if(e=Zt(e),t=en(t),nn)try{return rn(e,t)}catch(e){}if(tn(e,t))return Xt(!Yt(Jt.f,e,t),e[t])};var an={},sn=N,on=we,dn=sn.String,un=sn.TypeError,cn=function(e){if(on(e))return e;throw un(dn(e)+" is not an object")},ln=V,hn=$t,fn=cn,pn=Ft,mn=N.TypeError,gn=Object.defineProperty;an.f=ln?gn:function(e,t,n){if(fn(e),t=pn(t),fn(n),hn)try{return gn(e,t,n)}catch(e){}if("get"in n||"set"in n)throw mn("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var vn=an,yn=X,bn=V?function(e,t,n){return vn.f(e,t,yn(1,n))}:function(e,t,n){return e[t]=n,e},_n={exports:{}},wn=be,An=dt,kn=re(Function.toString);wn(An.inspectSource)||(An.inspectSource=function(e){return kn(e)});var En,xn,Dn,Sn=An.inspectSource,Tn=be,Rn=Sn,On=N.WeakMap,In=Tn(On)&&/native code/.test(Rn(On)),Pn=rt.exports,Cn=_t,Ln=Pn("keys"),Mn=function(e){return Ln[e]||(Ln[e]=Cn(e))},Un={},jn=In,Bn=N,Gn=re,Nn=we,qn=bn,Fn=mt,Vn=dt,Kn=Mn,Wn=Un,Hn=Bn.TypeError,zn=Bn.WeakMap;if(jn||Vn.state){var $n=Vn.state||(Vn.state=new zn),Qn=Gn($n.get),Yn=Gn($n.has),Jn=Gn($n.set);En=function(e,t){if(Yn($n,e))throw new Hn("Object already initialized");return t.facade=e,Jn($n,e,t),t},xn=function(e){return Qn($n,e)||{}},Dn=function(e){return Yn($n,e)}}else{var Xn=Kn("state");Wn[Xn]=!0,En=function(e,t){if(Fn(e,Xn))throw new Hn("Object already initialized");return t.facade=e,qn(e,Xn,t),t},xn=function(e){return Fn(e,Xn)?e[Xn]:{}},Dn=function(e){return Fn(e,Xn)}}var Zn={set:En,get:xn,has:Dn,enforce:function(e){return Dn(e)?xn(e):En(e,{})},getterFor:function(e){return function(t){var n;if(!Nn(t)||(n=xn(t)).type!==e)throw Hn("Incompatible receiver, "+e+" required");return n}}},er=V,tr=mt,nr=Function.prototype,rr=er&&Object.getOwnPropertyDescriptor,ar=tr(nr,"name"),ir={EXISTS:ar,PROPER:ar&&"something"===function(){}.name,CONFIGURABLE:ar&&(!er||er&&rr(nr,"name").configurable)},sr=N,or=be,dr=mt,ur=bn,cr=st,lr=Sn,hr=ir.CONFIGURABLE,fr=Zn.get,pr=Zn.enforce,mr=String(String).split("String");(_n.exports=function(e,t,n,r){var a,i=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet,d=r&&void 0!==r.name?r.name:t;or(n)&&("Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!dr(n,"name")||hr&&n.name!==d)&&ur(n,"name",d),(a=pr(n)).source||(a.source=mr.join("string"==typeof d?d:""))),e!==sr?(i?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:ur(e,t,n)):s?e[t]=n:cr(t,n)})(Function.prototype,"toString",(function(){return or(this)&&fr(this).source||lr(this)}));var gr={},vr=Math.ceil,yr=Math.floor,br=function(e){var t=+e;return t!=t||0===t?0:(t>0?yr:vr)(t)},_r=br,wr=Math.max,Ar=Math.min,kr=function(e,t){var n=_r(e);return n<0?wr(n+t,0):Ar(n,t)},Er=br,xr=Math.min,Dr=function(e){return e>0?xr(Er(e),9007199254740991):0},Sr=Dr,Tr=function(e){return Sr(e.length)},Rr=ye,Or=kr,Ir=Tr,Pr=function(e){return function(t,n,r){var a,i=Rr(t),s=Ir(i),o=Or(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}},Cr={includes:Pr(!0),indexOf:Pr(!1)},Lr=mt,Mr=ye,Ur=Cr.indexOf,jr=Un,Br=re([].push),Gr=function(e,t){var n,r=Mr(e),a=0,i=[];for(n in r)!Lr(jr,n)&&Lr(r,n)&&Br(i,n);for(;t.length>a;)Lr(r,n=t[a++])&&(~Ur(i,n)||Br(i,n));return i},Nr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qr=Gr,Fr=Nr.concat("length","prototype");gr.f=Object.getOwnPropertyNames||function(e){return qr(e,Fr)};var Vr={};Vr.f=Object.getOwnPropertySymbols;var Kr=xe,Wr=gr,Hr=Vr,zr=cn,$r=re([].concat),Qr=Kr("Reflect","ownKeys")||function(e){var t=Wr.f(zr(e)),n=Hr.f;return n?$r(t,n(e)):t},Yr=mt,Jr=Qr,Xr=q,Zr=an,ea=function(e,t){for(var n=Jr(t),r=Zr.f,a=Xr.f,i=0;i<n.length;i++){var s=n[i];Yr(e,s)||r(e,s,a(t,s))}},ta=F,na=be,ra=/#|\.prototype\./,aa=function(e,t){var n=sa[ia(e)];return n==da||n!=oa&&(na(t)?ta(t):!!t)},ia=aa.normalize=function(e){return String(e).replace(ra,".").toLowerCase()},sa=aa.data={},oa=aa.NATIVE="N",da=aa.POLYFILL="P",ua=aa,ca=N,la=q.f,ha=bn,fa=_n.exports,pa=st,ma=ea,ga=ua,va=function(e,t){var n,r,a,i,s,o=e.target,d=e.global,u=e.stat;if(n=d?ca:u?ca[o]||pa(o,{}):(ca[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=la(n,r))&&s.value:n[r],!ga(d?r:o+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;ma(i,a)}(e.sham||a&&a.sham)&&ha(i,"sham",!0),fa(n,r,i,e)}},ya=Gr,ba=Nr,_a=Object.keys||function(e){return ya(e,ba)},wa=ht,Aa=_a;va({target:"Object",stat:!0,forced:F((function(){Aa(1)}))},{keys:function(e){return Aa(wa(e))}});var ka=Function.prototype,Ea=ka.apply,xa=ka.bind,Da=ka.call,Sa="object"==typeof Reflect&&Reflect.apply||(xa?Da.bind(Ea):function(){return Da.apply(Ea,arguments)}),Ta=oe,Ra=Array.isArray||function(e){return"Array"==Ta(e)},Oa={};Oa[It("toStringTag")]="z";var Ia,Pa="[object z]"===String(Oa),Ca=N,La=Pa,Ma=be,Ua=oe,ja=It("toStringTag"),Ba=Ca.Object,Ga="Arguments"==Ua(function(){return arguments}()),Na=La?Ua: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=Ba(e),ja))?n:Ga?Ua(t):"Object"==(r=Ua(t))&&Ma(t.callee)?"Arguments":r},qa=Na,Fa=N.String,Va=function(e){if("Symbol"===qa(e))throw TypeError("Cannot convert a Symbol value to a string");return Fa(e)},Ka=an,Wa=cn,Ha=ye,za=_a,$a=V?Object.defineProperties:function(e,t){Wa(e);for(var n,r=Ha(t),a=za(t),i=a.length,s=0;i>s;)Ka.f(e,n=a[s++],r[n]);return e},Qa=xe("document","documentElement"),Ya=cn,Ja=$a,Xa=Nr,Za=Un,ei=Qa,ti=Ht,ni=Mn("IE_PROTO"),ri=function(){},ai=function(e){return"<script>"+e+"<\/script>"},ii=function(e){e.write(ai("")),e.close();var t=e.parentWindow.Object;return e=null,t},si=function(){try{Ia=new ActiveXObject("htmlfile")}catch(e){}var e,t;si="undefined"!=typeof document?document.domain&&Ia?ii(Ia):((t=ti("iframe")).style.display="none",ei.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ai("document.F=Object")),e.close(),e.F):ii(Ia);for(var n=Xa.length;n--;)delete si.prototype[Xa[n]];return si()};Za[ni]=!0;var oi=Object.create||function(e,t){var n;return null!==e?(ri.prototype=Ya(e),n=new ri,ri.prototype=null,n[ni]=e):n=si(),void 0===t?n:Ja(n,t)},di={},ui=re([].slice),ci=oe,li=ye,hi=gr.f,fi=ui,pi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];di.f=function(e){return pi&&"Window"==ci(e)?function(e){try{return hi(e)}catch(e){return fi(pi)}}(e):hi(li(e))};var mi={},gi=It;mi.f=gi;var vi=N,yi=mt,bi=mi,_i=an.f,wi=function(e){var t=vi.Symbol||(vi.Symbol={});yi(t,e)||_i(t,e,{value:bi.f(e)})},Ai=an.f,ki=mt,Ei=It("toStringTag"),xi=function(e,t,n){e&&!ki(e=n?e:e.prototype,Ei)&&Ai(e,Ei,{configurable:!0,value:t})},Di=Ye,Si=re(re.bind),Ti=function(e,t){return Di(e),void 0===t?e:Si?Si(e,t):function(){return e.apply(t,arguments)}},Ri=re,Oi=F,Ii=be,Pi=Na,Ci=Sn,Li=function(){},Mi=[],Ui=xe("Reflect","construct"),ji=/^\s*(?:class|function)\b/,Bi=Ri(ji.exec),Gi=!ji.exec(Li),Ni=function(e){if(!Ii(e))return!1;try{return Ui(Li,Mi,e),!0}catch(e){return!1}},qi=!Ui||Oi((function(){var e;return Ni(Ni.call)||!Ni(Object)||!Ni((function(){e=!0}))||e}))?function(e){if(!Ii(e))return!1;switch(Pi(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Gi||!!Bi(ji,Ci(e))}:Ni,Fi=N,Vi=Ra,Ki=qi,Wi=we,Hi=It("species"),zi=Fi.Array,$i=function(e){var t;return Vi(e)&&(t=e.constructor,(Ki(t)&&(t===zi||Vi(t.prototype))||Wi(t)&&null===(t=t[Hi]))&&(t=void 0)),void 0===t?zi:t},Qi=function(e,t){return new($i(e))(0===t?0:t)},Yi=Ti,Ji=fe,Xi=ht,Zi=Tr,es=Qi,ts=re([].push),ns=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,f,p=Xi(d),m=Ji(p),g=Yi(u,c),v=Zi(m),y=0,b=l||es,_=t?b(d,v):n||s?b(d,0):void 0;v>y;y++)if((o||y in m)&&(f=g(h=m[y],y,p),e))if(t)_[y]=f;else if(f)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:ts(_,h)}else switch(e){case 4:return!1;case 7:ts(_,h)}return i?-1:r||a?a:_}},rs={forEach:ns(0),map:ns(1),filter:ns(2),some:ns(3),every:ns(4),find:ns(5),findIndex:ns(6),filterReject:ns(7)},as=va,is=N,ss=xe,os=Sa,ds=W,us=re,cs=V,ls=je,hs=F,fs=mt,ps=Ra,ms=be,gs=we,vs=De,ys=Ke,bs=cn,_s=ht,ws=ye,As=Ft,ks=Va,Es=X,xs=oi,Ds=_a,Ss=gr,Ts=di,Rs=Vr,Os=q,Is=an,Ps=H,Cs=ui,Ls=_n.exports,Ms=rt.exports,Us=Un,js=_t,Bs=It,Gs=mi,Ns=wi,qs=xi,Fs=Zn,Vs=rs.forEach,Ks=Mn("hidden"),Ws=Bs("toPrimitive"),Hs=Fs.set,zs=Fs.getterFor("Symbol"),$s=Object.prototype,Qs=is.Symbol,Ys=Qs&&Qs.prototype,Js=is.TypeError,Xs=is.QObject,Zs=ss("JSON","stringify"),eo=Os.f,to=Is.f,no=Ts.f,ro=Ps.f,ao=us([].push),io=Ms("symbols"),so=Ms("op-symbols"),oo=Ms("string-to-symbol-registry"),uo=Ms("symbol-to-string-registry"),co=Ms("wks"),lo=!Xs||!Xs.prototype||!Xs.prototype.findChild,ho=cs&&hs((function(){return 7!=xs(to({},"a",{get:function(){return to(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=eo($s,t);r&&delete $s[t],to(e,t,n),r&&e!==$s&&to($s,t,r)}:to,fo=function(e,t){var n=io[e]=xs(Ys);return Hs(n,{type:"Symbol",tag:e,description:t}),cs||(n.description=t),n},po=function(e,t,n){e===$s&&po(so,t,n),bs(e);var r=As(t);return bs(n),fs(io,r)?(n.enumerable?(fs(e,Ks)&&e[Ks][r]&&(e[Ks][r]=!1),n=xs(n,{enumerable:Es(0,!1)})):(fs(e,Ks)||to(e,Ks,Es(1,{})),e[Ks][r]=!0),ho(e,r,n)):to(e,r,n)},mo=function(e,t){bs(e);var n=ws(t),r=Ds(n).concat(bo(n));return Vs(r,(function(t){cs&&!ds(go,n,t)||po(e,t,n[t])})),e},go=function(e){var t=As(e),n=ds(ro,this,t);return!(this===$s&&fs(io,t)&&!fs(so,t))&&(!(n||!fs(this,t)||!fs(io,t)||fs(this,Ks)&&this[Ks][t])||n)},vo=function(e,t){var n=ws(e),r=As(t);if(n!==$s||!fs(io,r)||fs(so,r)){var a=eo(n,r);return!a||!fs(io,r)||fs(n,Ks)&&n[Ks][r]||(a.enumerable=!0),a}},yo=function(e){var t=no(ws(e)),n=[];return Vs(t,(function(e){fs(io,e)||fs(Us,e)||ao(n,e)})),n},bo=function(e){var t=e===$s,n=no(t?so:ws(e)),r=[];return Vs(n,(function(e){!fs(io,e)||t&&!fs($s,e)||ao(r,io[e])})),r};(ls||(Ls(Ys=(Qs=function(){if(vs(Ys,this))throw Js("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ks(arguments[0]):void 0,t=js(e),n=function(e){this===$s&&ds(n,so,e),fs(this,Ks)&&fs(this[Ks],t)&&(this[Ks][t]=!1),ho(this,t,Es(1,e))};return cs&&lo&&ho($s,t,{configurable:!0,set:n}),fo(t,e)}).prototype,"toString",(function(){return zs(this).tag})),Ls(Qs,"withoutSetter",(function(e){return fo(js(e),e)})),Ps.f=go,Is.f=po,Os.f=vo,Ss.f=Ts.f=yo,Rs.f=bo,Gs.f=function(e){return fo(Bs(e),e)},cs&&(to(Ys,"description",{configurable:!0,get:function(){return zs(this).description}}),Ls($s,"propertyIsEnumerable",go,{unsafe:!0}))),as({global:!0,wrap:!0,forced:!ls,sham:!ls},{Symbol:Qs}),Vs(Ds(co),(function(e){Ns(e)})),as({target:"Symbol",stat:!0,forced:!ls},{for:function(e){var t=ks(e);if(fs(oo,t))return oo[t];var n=Qs(t);return oo[t]=n,uo[n]=t,n},keyFor:function(e){if(!ys(e))throw Js(e+" is not a symbol");if(fs(uo,e))return uo[e]},useSetter:function(){lo=!0},useSimple:function(){lo=!1}}),as({target:"Object",stat:!0,forced:!ls,sham:!cs},{create:function(e,t){return void 0===t?xs(e):mo(xs(e),t)},defineProperty:po,defineProperties:mo,getOwnPropertyDescriptor:vo}),as({target:"Object",stat:!0,forced:!ls},{getOwnPropertyNames:yo,getOwnPropertySymbols:bo}),as({target:"Object",stat:!0,forced:hs((function(){Rs.f(1)}))},{getOwnPropertySymbols:function(e){return Rs.f(_s(e))}}),Zs)&&as({target:"JSON",stat:!0,forced:!ls||hs((function(){var e=Qs();return"[null]"!=Zs([e])||"{}"!=Zs({a:e})||"{}"!=Zs(Object(e))}))},{stringify:function(e,t,n){var r=Cs(arguments),a=t;if((gs(t)||void 0!==e)&&!ys(e))return ps(t)||(t=function(e,t){if(ms(a)&&(t=ds(a,this,e,t)),!ys(t))return t}),r[1]=t,os(Zs,null,r)}});if(!Ys[Ws]){var _o=Ys.valueOf;Ls(Ys,Ws,(function(e){return ds(_o,this)}))}qs(Qs,"Symbol"),Us[Ks]=!0;var wo=F,Ao=Le,ko=It("species"),Eo=function(e){return Ao>=51||!wo((function(){var t=[];return(t.constructor={})[ko]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},xo=rs.filter;va({target:"Array",proto:!0,forced:!Eo("filter")},{filter:function(e){return xo(this,e,arguments.length>1?arguments[1]:void 0)}});var Do=va,So=F,To=ye,Ro=q.f,Oo=V,Io=So((function(){Ro(1)}));Do({target:"Object",stat:!0,forced:!Oo||Io,sham:!Oo},{getOwnPropertyDescriptor:function(e,t){return Ro(To(e),t)}});var Po={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},Co=Ht("span").classList,Lo=Co&&Co.constructor&&Co.constructor.prototype,Mo=Lo===Object.prototype?void 0:Lo,Uo=F,jo=rs.forEach,Bo=function(e,t){var n=[][e];return!!n&&Uo((function(){n.call(null,t||function(){throw 1},1)}))},Go=N,No=Po,qo=Mo,Fo=Bo("forEach")?[].forEach:function(e){return jo(this,e,arguments.length>1?arguments[1]:void 0)},Vo=bn,Ko=function(e){if(e&&e.forEach!==Fo)try{Vo(e,"forEach",Fo)}catch(t){e.forEach=Fo}};for(var Wo in No)No[Wo]&&Ko(Go[Wo]&&Go[Wo].prototype);Ko(qo);var Ho=Ft,zo=an,$o=X,Qo=function(e,t,n){var r=Ho(t);r in e?zo.f(e,r,$o(0,n)):e[r]=n},Yo=Qr,Jo=ye,Xo=q,Zo=Qo;va({target:"Object",stat:!0,sham:!V},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Jo(e),a=Xo.f,i=Yo(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&Zo(s,t,n);return s}});var ed=va,td=N,nd=Ra,rd=qi,ad=we,id=kr,sd=Tr,od=ye,dd=Qo,ud=It,cd=ui,ld=Eo("slice"),hd=ud("species"),fd=td.Array,pd=Math.max;ed({target:"Array",proto:!0,forced:!ld},{slice:function(e,t){var n,r,a,i=od(this),s=sd(i),o=id(e,s),d=id(void 0===t?s:t,s);if(nd(i)&&(n=i.constructor,(rd(n)&&(n===fd||nd(n.prototype))||ad(n)&&null===(n=n[hd]))&&(n=void 0),n===fd||void 0===n))return cd(i,o,d);for(r=new(void 0===n?fd:n)(pd(d-o,0)),a=0;o<d;o++,a++)o in i&&dd(r,a,i[o]);return r.length=a,r}});var md=W,gd=cn,vd=Xe,yd=function(e,t,n){var r,a;gd(e);try{if(!(r=vd(e,"return"))){if("throw"===t)throw n;return n}r=md(r,e)}catch(e){a=!0,r=e}if("throw"===t)throw n;if(a)throw r;return gd(r),n},bd=cn,_d=yd,wd={},Ad=wd,kd=It("iterator"),Ed=Array.prototype,xd=function(e){return void 0!==e&&(Ad.Array===e||Ed[kd]===e)},Dd=Na,Sd=Xe,Td=wd,Rd=It("iterator"),Od=function(e){if(null!=e)return Sd(e,Rd)||Sd(e,"@@iterator")||Td[Dd(e)]},Id=W,Pd=Ye,Cd=cn,Ld=He,Md=Od,Ud=N.TypeError,jd=function(e,t){var n=arguments.length<2?Md(e):t;if(Pd(n))return Cd(Id(n,e));throw Ud(Ld(e)+" is not iterable")},Bd=Ti,Gd=W,Nd=ht,qd=function(e,t,n,r){try{return r?t(bd(n)[0],n[1]):t(n)}catch(t){_d(e,"throw",t)}},Fd=xd,Vd=qi,Kd=Tr,Wd=Qo,Hd=jd,zd=Od,$d=N.Array,Qd=It("iterator"),Yd=!1;try{var Jd=0,Xd={next:function(){return{done:!!Jd++}},return:function(){Yd=!0}};Xd[Qd]=function(){return this},Array.from(Xd,(function(){throw 2}))}catch(e){}var Zd=function(e,t){if(!t&&!Yd)return!1;var n=!1;try{var r={};r[Qd]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},eu=function(e){var t=Nd(e),n=Vd(this),r=arguments.length,a=r>1?arguments[1]:void 0,i=void 0!==a;i&&(a=Bd(a,r>2?arguments[2]:void 0));var s,o,d,u,c,l,h=zd(t),f=0;if(!h||this==$d&&Fd(h))for(s=Kd(t),o=n?new this(s):$d(s);s>f;f++)l=i?a(t[f],f):t[f],Wd(o,f,l);else for(c=(u=Hd(t,h)).next,o=n?new this:[];!(d=Gd(c,u)).done;f++)l=i?qd(u,a,[d.value,f],!0):d.value,Wd(o,f,l);return o.length=f,o};va({target:"Array",stat:!0,forced:!Zd((function(e){Array.from(e)}))},{from:eu});var tu,nu,ru,au=re,iu=br,su=Va,ou=me,du=au("".charAt),uu=au("".charCodeAt),cu=au("".slice),lu=function(e){return function(t,n){var r,a,i=su(ou(t)),s=iu(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=uu(i,s))<55296||r>56319||s+1===o||(a=uu(i,s+1))<56320||a>57343?e?du(i,s):r:e?cu(i,s,s+2):a-56320+(r-55296<<10)+65536}},hu={codeAt:lu(!1),charAt:lu(!0)},fu=!F((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),pu=N,mu=mt,gu=be,vu=ht,yu=fu,bu=Mn("IE_PROTO"),_u=pu.Object,wu=_u.prototype,Au=yu?_u.getPrototypeOf:function(e){var t=vu(e);if(mu(t,bu))return t[bu];var n=t.constructor;return gu(n)&&t instanceof n?n.prototype:t instanceof _u?wu:null},ku=F,Eu=be,xu=Au,Du=_n.exports,Su=It("iterator"),Tu=!1;[].keys&&("next"in(ru=[].keys())?(nu=xu(xu(ru)))!==Object.prototype&&(tu=nu):Tu=!0);var Ru=null==tu||ku((function(){var e={};return tu[Su].call(e)!==e}));Ru&&(tu={}),Eu(tu[Su])||Du(tu,Su,(function(){return this}));var Ou={IteratorPrototype:tu,BUGGY_SAFARI_ITERATORS:Tu},Iu=Ou.IteratorPrototype,Pu=oi,Cu=X,Lu=xi,Mu=wd,Uu=function(){return this},ju=function(e,t,n){var r=t+" Iterator";return e.prototype=Pu(Iu,{next:Cu(1,n)}),Lu(e,r,!1),Mu[r]=Uu,e},Bu=N,Gu=be,Nu=Bu.String,qu=Bu.TypeError,Fu=re,Vu=cn,Ku=function(e){if("object"==typeof e||Gu(e))return e;throw qu("Can't set "+Nu(e)+" as a prototype")},Wu=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Fu(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Vu(n),Ku(r),t?e(n,r):n.__proto__=r,n}}():void 0),Hu=va,zu=W,$u=ir,Qu=be,Yu=ju,Ju=Au,Xu=Wu,Zu=xi,ec=bn,tc=_n.exports,nc=wd,rc=$u.PROPER,ac=$u.CONFIGURABLE,ic=Ou.IteratorPrototype,sc=Ou.BUGGY_SAFARI_ITERATORS,oc=It("iterator"),dc=function(){return this},uc=function(e,t,n,r,a,i,s){Yu(n,t,r);var o,d,u,c=function(e){if(e===a&&m)return m;if(!sc&&e in f)return f[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,f=e.prototype,p=f[oc]||f["@@iterator"]||a&&f[a],m=!sc&&p||c(a),g="Array"==t&&f.entries||p;if(g&&(o=Ju(g.call(new e)))!==Object.prototype&&o.next&&(Ju(o)!==ic&&(Xu?Xu(o,ic):Qu(o[oc])||tc(o,oc,dc)),Zu(o,l,!0)),rc&&"values"==a&&p&&"values"!==p.name&&(ac?ec(f,"name","values"):(h=!0,m=function(){return zu(p,this)})),a)if(d={values:c("values"),keys:i?m:c("keys"),entries:c("entries")},s)for(u in d)(sc||h||!(u in f))&&tc(f,u,d[u]);else Hu({target:t,proto:!0,forced:sc||h},d);return f[oc]!==m&&tc(f,oc,m,{name:a}),nc[t]=m,d},cc=hu.charAt,lc=Va,hc=Zn,fc=uc,pc=hc.set,mc=hc.getterFor("String Iterator");fc(String,"String",(function(e){pc(this,{type:"String Iterator",string:lc(e),index:0})}),(function(){var e,t=mc(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=cc(n,r),t.index+=e.length,{value:e,done:!1})}));var gc=cn,vc=function(){var e=gc(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},yc={},bc=F,_c=N.RegExp;yc.UNSUPPORTED_Y=bc((function(){var e=_c("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),yc.BROKEN_CARET=bc((function(){var e=_c("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var wc=F,Ac=N.RegExp,kc=wc((function(){var e=Ac(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Ec=F,xc=N.RegExp,Dc=Ec((function(){var e=xc("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Sc=W,Tc=re,Rc=Va,Oc=vc,Ic=yc,Pc=rt.exports,Cc=oi,Lc=Zn.get,Mc=kc,Uc=Dc,jc=Pc("native-string-replace",String.prototype.replace),Bc=RegExp.prototype.exec,Gc=Bc,Nc=Tc("".charAt),qc=Tc("".indexOf),Fc=Tc("".replace),Vc=Tc("".slice),Kc=function(){var e=/a/,t=/b*/g;return Sc(Bc,e,"a"),Sc(Bc,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Wc=Ic.UNSUPPORTED_Y||Ic.BROKEN_CARET,Hc=void 0!==/()??/.exec("")[1];(Kc||Hc||Wc||Mc||Uc)&&(Gc=function(e){var t,n,r,a,i,s,o,d=this,u=Lc(d),c=Rc(e),l=u.raw;if(l)return l.lastIndex=d.lastIndex,t=Sc(Gc,l,c),d.lastIndex=l.lastIndex,t;var h=u.groups,f=Wc&&d.sticky,p=Sc(Oc,d),m=d.source,g=0,v=c;if(f&&(p=Fc(p,"y",""),-1===qc(p,"g")&&(p+="g"),v=Vc(c,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==Nc(c,d.lastIndex-1))&&(m="(?: "+m+")",v=" "+v,g++),n=new RegExp("^(?:"+m+")",p)),Hc&&(n=new RegExp("^"+m+"$(?!\\s)",p)),Kc&&(r=d.lastIndex),a=Sc(Bc,f?n:d,v),f?a?(a.input=Vc(a.input,g),a[0]=Vc(a[0],g),a.index=d.lastIndex,d.lastIndex+=a[0].length):d.lastIndex=0:Kc&&a&&(d.lastIndex=d.global?a.index+a[0].length:r),Hc&&a&&a.length>1&&Sc(jc,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=Cc(null),i=0;i<h.length;i++)s[(o=h[i])[0]]=a[o[1]];return a});var zc=Gc;va({target:"RegExp",proto:!0,forced:/./.exec!==zc},{exec:zc});var $c=va,Qc=V,Yc=N,Jc=re,Xc=mt,Zc=be,el=De,tl=Va,nl=an.f,rl=ea,al=Yc.Symbol,il=al&&al.prototype;if(Qc&&Zc(al)&&(!("description"in il)||void 0!==al().description)){var sl={},ol=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:tl(arguments[0]),t=el(il,this)?new al(e):void 0===e?al():al(e);return""===e&&(sl[t]=!0),t};rl(ol,al),ol.prototype=il,il.constructor=ol;var dl="Symbol(test)"==String(al("test")),ul=Jc(il.toString),cl=Jc(il.valueOf),ll=/^Symbol\((.*)\)[^)]+$/,hl=Jc("".replace),fl=Jc("".slice);nl(il,"description",{configurable:!0,get:function(){var e=cl(this),t=ul(e);if(Xc(sl,e))return"";var n=dl?fl(t,7,-1):hl(t,ll,"$1");return""===n?void 0:n}}),$c({global:!0,forced:!0},{Symbol:ol})}wi("iterator");var pl=oi,ml=an,gl=It("unscopables"),vl=Array.prototype;null==vl[gl]&&ml.f(vl,gl,{configurable:!0,value:pl(null)});var yl=function(e){vl[gl][e]=!0},bl=ye,_l=yl,wl=wd,Al=Zn,kl=uc,El=Al.set,xl=Al.getterFor("Array Iterator"),Dl=kl(Array,"Array",(function(e,t){El(this,{type:"Array Iterator",target:bl(e),index:0,kind:t})}),(function(){var e=xl(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");wl.Arguments=wl.Array,_l("keys"),_l("values"),_l("entries");var Sl=N,Tl=Po,Rl=Mo,Ol=Dl,Il=bn,Pl=It,Cl=Pl("iterator"),Ll=Pl("toStringTag"),Ml=Ol.values,Ul=function(e,t){if(e){if(e[Cl]!==Ml)try{Il(e,Cl,Ml)}catch(t){e[Cl]=Ml}if(e[Ll]||Il(e,Ll,t),Tl[t])for(var n in Ol)if(e[n]!==Ol[n])try{Il(e,n,Ol[n])}catch(t){e[n]=Ol[n]}}};for(var jl in Tl)Ul(Sl[jl]&&Sl[jl].prototype,jl);Ul(Rl,"DOMTokenList");var Bl=Na,Gl=Pa?{}.toString:function(){return"[object "+Bl(this)+"]"},Nl=Pa,ql=_n.exports,Fl=Gl;Nl||ql(Object.prototype,"toString",Fl,{unsafe:!0});var Vl,Kl,Wl,Hl,zl=N.Promise,$l=_n.exports,Ql=function(e,t,n){for(var r in t)$l(e,r,t[r],n);return e},Yl=xe,Jl=an,Xl=V,Zl=It("species"),eh=function(e){var t=Yl(e),n=Jl.f;Xl&&t&&!t[Zl]&&n(t,Zl,{configurable:!0,get:function(){return this}})},th=De,nh=N.TypeError,rh=function(e,t){if(th(t,e))return e;throw nh("Incorrect invocation")},ah=Ti,ih=W,sh=cn,oh=He,dh=xd,uh=Tr,ch=De,lh=jd,hh=Od,fh=yd,ph=N.TypeError,mh=function(e,t){this.stopped=e,this.result=t},gh=mh.prototype,vh=qi,yh=He,bh=N.TypeError,_h=cn,wh=function(e){if(vh(e))return e;throw bh(yh(e)+" is not a constructor")},Ah=It("species"),kh=function(e,t){var n,r=_h(e).constructor;return void 0===r||null==(n=_h(r)[Ah])?t:wh(n)},Eh=/(?:ipad|iphone|ipod).*applewebkit/i.test(Se),xh="process"==oe(N.process),Dh=N,Sh=Sa,Th=Ti,Rh=be,Oh=mt,Ih=F,Ph=Qa,Ch=ui,Lh=Ht,Mh=Eh,Uh=xh,jh=Dh.setImmediate,Bh=Dh.clearImmediate,Gh=Dh.process,Nh=Dh.Dispatch,qh=Dh.Function,Fh=Dh.MessageChannel,Vh=Dh.String,Kh=0,Wh={};try{Vl=Dh.location}catch(e){}var Hh=function(e){if(Oh(Wh,e)){var t=Wh[e];delete Wh[e],t()}},zh=function(e){return function(){Hh(e)}},$h=function(e){Hh(e.data)},Qh=function(e){Dh.postMessage(Vh(e),Vl.protocol+"//"+Vl.host)};jh&&Bh||(jh=function(e){var t=Ch(arguments,1);return Wh[++Kh]=function(){Sh(Rh(e)?e:qh(e),void 0,t)},Kl(Kh),Kh},Bh=function(e){delete Wh[e]},Uh?Kl=function(e){Gh.nextTick(zh(e))}:Nh&&Nh.now?Kl=function(e){Nh.now(zh(e))}:Fh&&!Mh?(Hl=(Wl=new Fh).port2,Wl.port1.onmessage=$h,Kl=Th(Hl.postMessage,Hl)):Dh.addEventListener&&Rh(Dh.postMessage)&&!Dh.importScripts&&Vl&&"file:"!==Vl.protocol&&!Ih(Qh)?(Kl=Qh,Dh.addEventListener("message",$h,!1)):Kl="onreadystatechange"in Lh("script")?function(e){Ph.appendChild(Lh("script")).onreadystatechange=function(){Ph.removeChild(this),Hh(e)}}:function(e){setTimeout(zh(e),0)});var Yh,Jh,Xh,Zh,ef,tf,nf,rf,af={set:jh,clear:Bh},sf=N,of=/ipad|iphone|ipod/i.test(Se)&&void 0!==sf.Pebble,df=/web0s(?!.*chrome)/i.test(Se),uf=N,cf=Ti,lf=q.f,hf=af.set,ff=Eh,pf=of,mf=df,gf=xh,vf=uf.MutationObserver||uf.WebKitMutationObserver,yf=uf.document,bf=uf.process,_f=uf.Promise,wf=lf(uf,"queueMicrotask"),Af=wf&&wf.value;Af||(Yh=function(){var e,t;for(gf&&(e=bf.domain)&&e.exit();Jh;){t=Jh.fn,Jh=Jh.next;try{t()}catch(e){throw Jh?Zh():Xh=void 0,e}}Xh=void 0,e&&e.enter()},ff||gf||mf||!vf||!yf?!pf&&_f&&_f.resolve?((nf=_f.resolve(void 0)).constructor=_f,rf=cf(nf.then,nf),Zh=function(){rf(Yh)}):gf?Zh=function(){bf.nextTick(Yh)}:(hf=cf(hf,uf),Zh=function(){hf(Yh)}):(ef=!0,tf=yf.createTextNode(""),new vf(Yh).observe(tf,{characterData:!0}),Zh=function(){tf.data=ef=!ef}));var kf=Af||function(e){var t={fn:e,next:void 0};Xh&&(Xh.next=t),Jh||(Jh=t,Zh()),Xh=t},Ef={},xf=Ye,Df=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=xf(t),this.reject=xf(n)};Ef.f=function(e){return new Df(e)};var Sf,Tf,Rf,Of,If=cn,Pf=we,Cf=Ef,Lf=function(e,t){if(If(e),Pf(t)&&t.constructor===e)return t;var n=Cf.f(e);return(0,n.resolve)(t),n.promise},Mf=N,Uf="object"==typeof window,jf=va,Bf=N,Gf=xe,Nf=W,qf=zl,Ff=_n.exports,Vf=Ql,Kf=Wu,Wf=xi,Hf=eh,zf=Ye,$f=be,Qf=we,Yf=rh,Jf=Sn,Xf=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),f=!(!n||!n.INTERRUPTED),p=ah(t,c),m=function(e){return r&&fh(r,"normal",e),new mh(!0,e)},g=function(e){return l?(sh(e),f?p(e[0],e[1],m):p(e[0],e[1])):f?p(e,m):p(e)};if(h)r=e;else{if(!(a=hh(e)))throw ph(oh(e)+" is not iterable");if(dh(a)){for(i=0,s=uh(e);s>i;i++)if((o=g(e[i]))&&ch(gh,o))return o;return new mh(!1)}r=lh(e,a)}for(d=r.next;!(u=ih(d,r)).done;){try{o=g(u.value)}catch(e){fh(r,"throw",e)}if("object"==typeof o&&o&&ch(gh,o))return o}return new mh(!1)},Zf=Zd,ep=kh,tp=af.set,np=kf,rp=Lf,ap=function(e,t){var n=Mf.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))},ip=Ef,sp=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},op=Zn,dp=ua,up=Uf,cp=xh,lp=Le,hp=It("species"),fp=op.get,pp=op.set,mp=op.getterFor("Promise"),gp=qf&&qf.prototype,vp=qf,yp=gp,bp=Bf.TypeError,_p=Bf.document,wp=Bf.process,Ap=ip.f,kp=Ap,Ep=!!(_p&&_p.createEvent&&Bf.dispatchEvent),xp=$f(Bf.PromiseRejectionEvent),Dp=!1,Sp=dp("Promise",(function(){var e=Jf(vp),t=e!==String(vp);if(!t&&66===lp)return!0;if(lp>=51&&/native code/.test(e))return!1;var n=new vp((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[hp]=r,!(Dp=n.then((function(){}))instanceof r)||!t&&up&&!xp})),Tp=Sp||!Zf((function(e){vp.all(e).catch((function(){}))})),Rp=function(e){var t;return!(!Qf(e)||!$f(t=e.then))&&t},Op=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;np((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,f=u.domain;try{c?(a||(2===e.rejection&&Lp(e),e.rejection=1),!0===c?s=r:(f&&f.enter(),s=c(r),f&&(f.exit(),d=!0)),s===u.promise?h(bp("Promise-chain cycle")):(o=Rp(s))?Nf(o,s,l,h):l(s)):h(r)}catch(e){f&&!d&&f.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Pp(e)}))}},Ip=function(e,t,n){var r,a;Ep?((r=_p.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Bf.dispatchEvent(r)):r={promise:t,reason:n},!xp&&(a=Bf["on"+e])?a(r):"unhandledrejection"===e&&ap("Unhandled promise rejection",n)},Pp=function(e){Nf(tp,Bf,(function(){var t,n=e.facade,r=e.value;if(Cp(e)&&(t=sp((function(){cp?wp.emit("unhandledRejection",r,n):Ip("unhandledrejection",n,r)})),e.rejection=cp||Cp(e)?2:1,t.error))throw t.value}))},Cp=function(e){return 1!==e.rejection&&!e.parent},Lp=function(e){Nf(tp,Bf,(function(){var t=e.facade;cp?wp.emit("rejectionHandled",t):Ip("rejectionhandled",t,e.value)}))},Mp=function(e,t,n){return function(r){e(t,r,n)}},Up=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Op(e,!0))},jp=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw bp("Promise can't be resolved itself");var r=Rp(t);r?np((function(){var n={done:!1};try{Nf(r,t,Mp(jp,n,e),Mp(Up,n,e))}catch(t){Up(n,t,e)}})):(e.value=t,e.state=1,Op(e,!1))}catch(t){Up({done:!1},t,e)}}};if(Sp&&(yp=(vp=function(e){Yf(this,yp),zf(e),Nf(Sf,this);var t=fp(this);try{e(Mp(jp,t),Mp(Up,t))}catch(e){Up(t,e)}}).prototype,(Sf=function(e){pp(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Vf(yp,{then:function(e,t){var n=mp(this),r=n.reactions,a=Ap(ep(this,vp));return a.ok=!$f(e)||e,a.fail=$f(t)&&t,a.domain=cp?wp.domain:void 0,n.parent=!0,r[r.length]=a,0!=n.state&&Op(n,!1),a.promise},catch:function(e){return this.then(void 0,e)}}),Tf=function(){var e=new Sf,t=fp(e);this.promise=e,this.resolve=Mp(jp,t),this.reject=Mp(Up,t)},ip.f=Ap=function(e){return e===vp||e===Rf?new Tf(e):kp(e)},$f(qf)&&gp!==Object.prototype)){Of=gp.then,Dp||(Ff(gp,"then",(function(e,t){var n=this;return new vp((function(e,t){Nf(Of,n,e,t)})).then(e,t)}),{unsafe:!0}),Ff(gp,"catch",yp.catch,{unsafe:!0}));try{delete gp.constructor}catch(e){}Kf&&Kf(gp,yp)}jf({global:!0,wrap:!0,forced:Sp},{Promise:vp}),Wf(vp,"Promise",!1),Hf("Promise"),Rf=Gf("Promise"),jf({target:"Promise",stat:!0,forced:Sp},{reject:function(e){var t=Ap(this);return Nf(t.reject,void 0,e),t.promise}}),jf({target:"Promise",stat:!0,forced:Sp},{resolve:function(e){return rp(this,e)}}),jf({target:"Promise",stat:!0,forced:Tp},{all:function(e){var t=this,n=Ap(t),r=n.resolve,a=n.reject,i=sp((function(){var n=zf(t.resolve),i=[],s=0,o=1;Xf(e,(function(e){var d=s++,u=!1;o++,Nf(n,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=Ap(t),r=n.reject,a=sp((function(){var a=zf(t.resolve);Xf(e,(function(e){Nf(a,t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var Bp=va,Gp=N,Np=F,qp=Ra,Fp=we,Vp=ht,Kp=Tr,Wp=Qo,Hp=Qi,zp=Eo,$p=Le,Qp=It("isConcatSpreadable"),Yp=Gp.TypeError,Jp=$p>=51||!Np((function(){var e=[];return e[Qp]=!1,e.concat()[0]!==e})),Xp=zp("concat"),Zp=function(e){if(!Fp(e))return!1;var t=e[Qp];return void 0!==t?!!t:qp(e)};Bp({target:"Array",proto:!0,forced:!Jp||!Xp},{concat:function(e){var t,n,r,a,i,s=Vp(this),o=Hp(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Zp(i=-1===t?s:arguments[t])){if(d+(a=Kp(i))>9007199254740991)throw Yp("Maximum allowed index exceeded");for(n=0;n<a;n++,d++)n in i&&Wp(o,d,i[n])}else{if(d>=9007199254740991)throw Yp("Maximum allowed index exceeded");Wp(o,d++,i)}return o.length=d,o}});var em=V,tm=ir.EXISTS,nm=re,rm=an.f,am=Function.prototype,im=nm(am.toString),sm=/^\s*function ([^ (]*)/,om=nm(sm.exec);function dm(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 um(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 um(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 um(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 cm(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 lm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cm(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}em&&!tm&&rm(am,"name",{configurable:!0,get:function(){try{return om(sm,im(this))[1]}catch(e){return""}}});var hm={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"}},fm={},pm=function(e,t){fm[e]=lm(lm({},t),{},{isLoading:!1})},mm=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(k.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))},gm=function(){var e=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,d,u;return x.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=fm[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=dm(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=hm[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,mm({id:s,src:hm[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,mm({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)}}(),vm=new function e(){var t=this;D.default(this,e),S.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gm("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),S.default(this,"showLeaderboard",function(){var e=A.default(x.default.mark((function e(n){var r;return x.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)}}()),S.default(this,"addScore",function(){var e=A.default(x.default.mark((function e(n){return x.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"]},pm(this.moduleName,this.moduleConfig)},ym=re,bm=_n.exports,_m=zc,wm=F,Am=It,km=bn,Em=Am("species"),xm=RegExp.prototype,Dm=function(e,t,n,r){var a=Am(e),i=!wm((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!wm((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Em]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||n){var o=ym(/./[a]),d=t(a,""[e],(function(e,t,n,r,a){var s=ym(e),d=t.exec;return d===_m||d===xm.exec?i&&!a?{done:!0,value:o(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));bm(String.prototype,e,d[0]),bm(xm,a,d[1])}r&&km(xm[a],"sham",!0)},Sm=hu.charAt,Tm=function(e,t,n){return t+(n?Sm(e,t).length:1)},Rm=re,Om=ht,Im=Math.floor,Pm=Rm("".charAt),Cm=Rm("".replace),Lm=Rm("".slice),Mm=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Um=/\$([$&'`]|\d{1,2})/g,jm=W,Bm=cn,Gm=be,Nm=oe,qm=zc,Fm=N.TypeError,Vm=function(e,t){var n=e.exec;if(Gm(n)){var r=jm(n,e,t);return null!==r&&Bm(r),r}if("RegExp"===Nm(e))return jm(qm,e,t);throw Fm("RegExp#exec called on incompatible receiver")},Km=Sa,Wm=W,Hm=re,zm=Dm,$m=F,Qm=cn,Ym=be,Jm=br,Xm=Dr,Zm=Va,eg=me,tg=Tm,ng=Xe,rg=function(e,t,n,r,a,i){var s=n+e.length,o=r.length,d=Um;return void 0!==a&&(a=Om(a),d=Mm),Cm(i,d,(function(i,d){var u;switch(Pm(d,0)){case"$":return"$";case"&":return e;case"`":return Lm(t,0,n);case"'":return Lm(t,s);case"<":u=a[Lm(d,1,-1)];break;default:var c=+d;if(0===c)return i;if(c>o){var l=Im(c/10);return 0===l?i:l<=o?void 0===r[l-1]?Pm(d,1):r[l-1]+Pm(d,1):i}u=r[c-1]}return void 0===u?"":u}))},ag=Vm,ig=It("replace"),sg=Math.max,og=Math.min,dg=Hm([].concat),ug=Hm([].push),cg=Hm("".indexOf),lg=Hm("".slice),hg="$0"==="a".replace(/./,"$0"),fg=!!/./[ig]&&""===/./[ig]("a","$0");zm("replace",(function(e,t,n){var r=fg?"$":"$0";return[function(e,n){var r=eg(this),a=null==e?void 0:ng(e,ig);return a?Wm(a,e,r,n):Wm(t,Zm(r),e,n)},function(e,a){var i=Qm(this),s=Zm(e);if("string"==typeof a&&-1===cg(a,r)&&-1===cg(a,"$<")){var o=n(t,i,s,a);if(o.done)return o.value}var d=Ym(a);d||(a=Zm(a));var u=i.global;if(u){var c=i.unicode;i.lastIndex=0}for(var l=[];;){var h=ag(i,s);if(null===h)break;if(ug(l,h),!u)break;""===Zm(h[0])&&(i.lastIndex=tg(s,Xm(i.lastIndex),c))}for(var f,p="",m=0,g=0;g<l.length;g++){for(var v=Zm((h=l[g])[0]),y=sg(og(Jm(h.index),s.length),0),b=[],_=1;_<h.length;_++)ug(b,void 0===(f=h[_])?f:String(f));var w=h.groups;if(d){var A=dg([v],b,y,s);void 0!==w&&ug(A,w);var k=Zm(Km(a,void 0,A))}else k=rg(v,s,y,b,w,a);y>=m&&(p+=lg(s,m,y)+k,m=y+v.length)}return p+lg(s,m)}]}),!!$m((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!hg||fg);var pg=F,mg=It("iterator"),gg=!pg((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[mg]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),vg=ui,yg=Math.floor,bg=function(e,t){var n=e.length,r=yg(n/2);return n<8?_g(e,t):wg(e,bg(vg(e,0,r),t),bg(vg(e,r),t),t)},_g=function(e,t){for(var n,r,a=e.length,i=1;i<a;){for(r=i,n=e[i];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},wg=function(e,t,n,r){for(var a=t.length,i=n.length,s=0,o=0;s<a||o<i;)e[s+o]=s<a&&o<i?r(t[s],n[o])<=0?t[s++]:n[o++]:s<a?t[s++]:n[o++];return e},Ag=bg,kg=va,Eg=N,xg=xe,Dg=W,Sg=re,Tg=gg,Rg=_n.exports,Og=Ql,Ig=xi,Pg=ju,Cg=Zn,Lg=rh,Mg=be,Ug=mt,jg=Ti,Bg=Na,Gg=cn,Ng=we,qg=Va,Fg=oi,Vg=X,Kg=jd,Wg=Od,Hg=Ag,zg=It("iterator"),$g=Cg.set,Qg=Cg.getterFor("URLSearchParams"),Yg=Cg.getterFor("URLSearchParamsIterator"),Jg=xg("fetch"),Xg=xg("Request"),Zg=xg("Headers"),ev=Xg&&Xg.prototype,tv=Zg&&Zg.prototype,nv=Eg.RegExp,rv=Eg.TypeError,av=Eg.decodeURIComponent,iv=Eg.encodeURIComponent,sv=Sg("".charAt),ov=Sg([].join),dv=Sg([].push),uv=Sg("".replace),cv=Sg([].shift),lv=Sg([].splice),hv=Sg("".split),fv=Sg("".slice),pv=/\+/g,mv=Array(4),gv=function(e){return mv[e-1]||(mv[e-1]=nv("((?:%[\\da-f]{2}){"+e+"})","gi"))},vv=function(e){try{return av(e)}catch(t){return e}},yv=function(e){var t=uv(e,pv," "),n=4;try{return av(t)}catch(e){for(;n;)t=uv(t,gv(n--),vv);return t}},bv=/[!'()~]|%20/g,_v={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},wv=function(e){return _v[e]},Av=function(e){return uv(iv(e),bv,wv)},kv=function(e,t){if(t)for(var n,r,a=hv(t,"&"),i=0;i<a.length;)(n=a[i++]).length&&(r=hv(n,"="),dv(e,{key:yv(cv(r)),value:yv(ov(r,"="))}))},Ev=function(e){this.entries.length=0,kv(this.entries,e)},xv=function(e,t){if(e<t)throw rv("Not enough arguments")},Dv=Pg((function(e,t){$g(this,{type:"URLSearchParamsIterator",iterator:Kg(Qg(e).entries),kind:t})}),"Iterator",(function(){var e=Yg(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),Sv=function(){Lg(this,Tv);var e,t,n,r,a,i,s,o,d,u=arguments.length>0?arguments[0]:void 0,c=this,l=[];if($g(c,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:Ev}),void 0!==u)if(Ng(u))if(e=Wg(u))for(n=(t=Kg(u,e)).next;!(r=Dg(n,t)).done;){if(i=(a=Kg(Gg(r.value))).next,(s=Dg(i,a)).done||(o=Dg(i,a)).done||!Dg(i,a).done)throw rv("Expected sequence with length 2");dv(l,{key:qg(s.value),value:qg(o.value)})}else for(d in u)Ug(u,d)&&dv(l,{key:d,value:qg(u[d])});else kv(l,"string"==typeof u?"?"===sv(u,0)?fv(u,1):u:qg(u))},Tv=Sv.prototype;if(Og(Tv,{append:function(e,t){xv(arguments.length,2);var n=Qg(this);dv(n.entries,{key:qg(e),value:qg(t)}),n.updateURL()},delete:function(e){xv(arguments.length,1);for(var t=Qg(this),n=t.entries,r=qg(e),a=0;a<n.length;)n[a].key===r?lv(n,a,1):a++;t.updateURL()},get:function(e){xv(arguments.length,1);for(var t=Qg(this).entries,n=qg(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){xv(arguments.length,1);for(var t=Qg(this).entries,n=qg(e),r=[],a=0;a<t.length;a++)t[a].key===n&&dv(r,t[a].value);return r},has:function(e){xv(arguments.length,1);for(var t=Qg(this).entries,n=qg(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){xv(arguments.length,1);for(var n,r=Qg(this),a=r.entries,i=!1,s=qg(e),o=qg(t),d=0;d<a.length;d++)(n=a[d]).key===s&&(i?lv(a,d--,1):(i=!0,n.value=o));i||dv(a,{key:s,value:o}),r.updateURL()},sort:function(){var e=Qg(this);Hg(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=Qg(this).entries,r=jg(e,arguments.length>1?arguments[1]:void 0),a=0;a<n.length;)r((t=n[a++]).value,t.key,this)},keys:function(){return new Dv(this,"keys")},values:function(){return new Dv(this,"values")},entries:function(){return new Dv(this,"entries")}},{enumerable:!0}),Rg(Tv,zg,Tv.entries,{name:"entries"}),Rg(Tv,"toString",(function(){for(var e,t=Qg(this).entries,n=[],r=0;r<t.length;)e=t[r++],dv(n,Av(e.key)+"="+Av(e.value));return ov(n,"&")}),{enumerable:!0}),Ig(Sv,"URLSearchParams"),kg({global:!0,forced:!Tg},{URLSearchParams:Sv}),!Tg&&Mg(Zg)){var Rv=Sg(tv.has),Ov=Sg(tv.set),Iv=function(e){if(Ng(e)){var t,n=e.body;if("URLSearchParams"===Bg(n))return t=e.headers?new Zg(e.headers):new Zg,Rv(t,"content-type")||Ov(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Fg(e,{body:Vg(0,qg(n)),headers:Vg(0,t)})}return e};if(Mg(Jg)&&kg({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return Jg(e,arguments.length>1?Iv(arguments[1]):{})}}),Mg(Xg)){var Pv=function(e){return Lg(this,ev),new Xg(e,arguments.length>1?Iv(arguments[1]):{})};ev.constructor=Pv,Pv.prototype=ev,kg({global:!0,forced:!0},{Request:Pv})}}var Cv=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Lv=W,Mv=cn,Uv=me,jv=Cv,Bv=Va,Gv=Xe,Nv=Vm;Dm("search",(function(e,t,n){return[function(t){var n=Uv(this),r=null==t?void 0:Gv(t,e);return r?Lv(r,t,n):new RegExp(t)[e](Bv(n))},function(e){var r=Mv(this),a=Bv(e),i=n(t,r,a);if(i.done)return i.value;var s=r.lastIndex;jv(s,0)||(r.lastIndex=0);var o=Nv(r,a);return jv(r.lastIndex,s)||(r.lastIndex=s),null===o?-1:o.index}]}));var qv=Cr.includes,Fv=yl;va({target:"Array",proto:!0},{includes:function(e){return qv(this,e,arguments.length>1?arguments[1]:void 0)}}),Fv("includes");var Vv=we,Kv=oe,Wv=It("match"),Hv=function(e){var t;return Vv(e)&&(void 0!==(t=e[Wv])?!!t:"RegExp"==Kv(e))},zv=Hv,$v=N.TypeError,Qv=function(e){if(zv(e))throw $v("The method doesn't accept regular expressions");return e},Yv=It("match"),Jv=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Yv]=!1,"/./"[e](t)}catch(e){}}return!1},Xv=va,Zv=Qv,ey=me,ty=Va,ny=Jv,ry=re("".indexOf);Xv({target:"String",proto:!0,forced:!ny("includes")},{includes:function(e){return!!~ry(ty(ey(this)),ty(Zv(e)),arguments.length>1?arguments[1]:void 0)}});var ay=Sa,iy=W,sy=re,oy=Dm,dy=Hv,uy=cn,cy=me,ly=kh,hy=Tm,fy=Dr,py=Va,my=Xe,gy=ui,vy=Vm,yy=zc,by=F,_y=yc.UNSUPPORTED_Y,wy=Math.min,Ay=[].push,ky=sy(/./.exec),Ey=sy(Ay),xy=sy("".slice);function Dy(e){var t=this,n={},r=(null==e?void 0:e._ancestor_origins)||window.location.ancestorOrigins,a=(null==e?void 0:e.self_url)||window.location.href,i=(null==e?void 0:e.self_origin)||window.location.origin,s=(null==e?void 0:e.referrer_url)||document.referrer;function o(e){return I.default(n,e)}function d(e,t){return P.default(n,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new T.default(e,t)}catch(e){console.log(e)}}function c(){for(var t=(null==e?void 0:e.urls)||[a,s],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var o=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(o&&(o=decodeURIComponent(o),R.default.isURL(o)))return o}}}return function(){var e;k.default(this,t),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){d("depth.error",e.message)}d("depth.value",e)}(),function(){var e=r,t=n.depth.value,a=i;if(d("top.domain.from","fallback"),e&&e.length>0)a=e[e.length-1],d("top.domain.from","origins");else if(0===t)a=i,d("top.domain.from","self-top");else if(1===t){var o=u(s);o&&(a=o.origin,d("top.domain.from","referrer"))}d("top.domain.value",a.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=c();if(e)if(O.default(e))d("partner.domain.value",e),d("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)d("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),d("partner.domain.from","partner-url");else d("partner.domain.value",n.top.domain.value),d("partner.domain.from","partner-fallback")}else d("partner.domain.value",n.top.domain.value),d("partner.domain.from","fallback")}(),e=c(),0===n.depth.value?(d("partner.url.value",a),d("partner.url.from","self-top")):e?O.default(e)?(d("partner.url.value",a),d("partner.url.from","partner-domain")):(d("partner.url.value",e),d("partner.url.from","partner-url")):(d("partner.url.value",s),d("partner.url.from","fallback"))}.bind(this)(),{get:o,print:function(e){console.log(o(e))}}}oy("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=py(cy(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!dy(e))return iy(t,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=iy(yy,l,r))&&!((s=l.lastIndex)>c&&(Ey(d,xy(r,c,i.index)),i.length>1&&i.index<r.length&&ay(Ay,d,gy(i,1)),o=i[0].length,c=s,d.length>=a));)l.lastIndex===i.index&&l.lastIndex++;return c===r.length?!o&&ky(l,"")||Ey(d,""):Ey(d,xy(r,c)),d.length>a?gy(d,0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:iy(t,this,e,n)}:t,[function(t,n){var a=cy(this),i=null==t?void 0:my(t,e);return i?iy(i,t,a,n):iy(r,py(a),t,n)},function(e,a){var i=uy(this),s=py(e),o=n(r,i,s,a,r!==t);if(o.done)return o.value;var d=ly(i,RegExp),u=i.unicode,c=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(_y?"g":"y"),l=new d(_y?"^(?:"+i.source+")":i,c),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===s.length)return null===vy(l,s)?[s]:[];for(var f=0,p=0,m=[];p<s.length;){l.lastIndex=_y?0:p;var g,v=vy(l,_y?xy(s,p):s);if(null===v||(g=wy(fy(l.lastIndex+(_y?p:0)),s.length))===f)p=hy(s,p,u);else{if(Ey(m,xy(s,f,p)),m.length===h)return m;for(var y=1;y<=v.length-1;y++)if(Ey(m,v[y]),m.length===h)return m;p=f=g}}return Ey(m,xy(s,f)),m}]}),!!by((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]})),_y);var Sy={name:"@bygd/gd-sdk-pes",version:"1.27.16",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":"^21.0.1","@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.3","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","is-valid-domain":"^0.1.2","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",uuid:"^8.3.2",validator:"^13.6.0"}},Ty="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Ty&&Ty,Ry="URLSearchParams"in Ty,Oy="Symbol"in Ty&&"iterator"in Symbol,Iy="FileReader"in Ty&&"Blob"in Ty&&function(){try{return new Blob,!0}catch(e){return!1}}(),Py="FormData"in Ty,Cy="ArrayBuffer"in Ty;if(Cy)var Ly=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],My=ArrayBuffer.isView||function(e){return e&&Ly.indexOf(Object.prototype.toString.call(e))>-1};function Uy(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 jy(e){return"string"!=typeof e&&(e=String(e)),e}function By(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Oy&&(t[Symbol.iterator]=function(){return t}),t}function Gy(e){this.map={},e instanceof Gy?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 Ny(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function qy(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function Fy(e){var t=new FileReader,n=qy(t);return t.readAsArrayBuffer(e),n}function Vy(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Ky(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Iy&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Py&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Ry&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Cy&&Iy&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Vy(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Cy&&(ArrayBuffer.prototype.isPrototypeOf(e)||My(e))?this._bodyArrayBuffer=Vy(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):Ry&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Iy&&(this.blob=function(){var e=Ny(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=Ny(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(Fy)}),this.text=function(){var e=Ny(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=qy(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)},Py&&(this.formData=function(){return this.text().then(zy)}),this.json=function(){return this.text().then(JSON.parse)},this}Gy.prototype.append=function(e,t){e=Uy(e),t=jy(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Gy.prototype.delete=function(e){delete this.map[Uy(e)]},Gy.prototype.get=function(e){return e=Uy(e),this.has(e)?this.map[e]:null},Gy.prototype.has=function(e){return this.map.hasOwnProperty(Uy(e))},Gy.prototype.set=function(e,t){this.map[Uy(e)]=jy(t)},Gy.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Gy.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),By(e)},Gy.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),By(e)},Gy.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),By(e)},Oy&&(Gy.prototype[Symbol.iterator]=Gy.prototype.entries);var Wy=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Hy(e,t){if(!(this instanceof Hy))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 Hy){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Gy(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 Gy(t.headers)),this.method=function(e){var t=e.toUpperCase();return Wy.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 zy(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 $y(e,t){if(!(this instanceof $y))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 Gy(t.headers),this.url=t.url||"",this._initBody(e)}Hy.prototype.clone=function(){return new Hy(this,{body:this._bodyInit})},Ky.call(Hy.prototype),Ky.call($y.prototype),$y.prototype.clone=function(){return new $y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Gy(this.headers),url:this.url})},$y.error=function(){var e=new $y(null,{status:0,statusText:""});return e.type="error",e};var Qy=[301,302,303,307,308];$y.redirect=function(e,t){if(-1===Qy.indexOf(t))throw new RangeError("Invalid status code");return new $y(null,{status:t,headers:{location:e}})};var Yy=Ty.DOMException;try{new Yy}catch(e){Yy=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Yy.prototype=Object.create(Error.prototype),Yy.prototype.constructor=Yy}function Jy(e,t){return new Promise((function(n,r){var a=new Hy(e,t);if(a.signal&&a.signal.aborted)return r(new Yy("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 Gy,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 $y(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 Yy("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&Ty.location.href?Ty.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&&(Iy?i.responseType="blob":Cy&&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 Gy?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,jy(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)}))}Jy.polyfill=!0,Ty.fetch||(Ty.fetch=Jy,Ty.Headers=Gy,Ty.Request=Hy,Ty.Response=$y);var Xy,Zy=Array.isArray,eb=Object.prototype.toString,tb=Zy||function(e){return!!e&&"[object Array]"==eb.call(e)},nb=function(){return Xy},rb=function(e){var t=this,n=new Dy;n.get();var r=n.get("partner.domain.value"),i=function(){return k.default(this,t),{gameId:e.gameId,enableAds:!0,preroll:!0,midroll:12e4,rewardedAds:!1,title:"",tags:[],category:"",assets:[],dmain:!0,sdk:{},loader:{},splash:{},promo:{},dAds:{},pAds:{},mAds:{},rAds:{}}}.bind(this),s=function(){k.default(this,t);var n=o(),a=n?"&mode=".concat(n):"";return"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(r).concat(a,"&v=").concat(Sy.version,"&localTime=").concat((new Date).getHours())}.bind(this),o=function(){var e=this;k.default(this,t);var n=new Proxy(new URLSearchParams(window.location.search),{get:function(t,n){return k.default(this,e),t.get(n)}.bind(this)});return!n.gd_mode&&window.location.search.includes("gd_mode")?window.location.search.split("gd_mode=")[1]:n.gd_mode}.bind(this),d=function(e){k.default(this,t);var n=u("object"===E.default(e)?e:a.parseJSON(e));return n&&n.version?Sy.version>=n.version?n:void 0:n}.bind(this),u=function(e){var n=this;if(k.default(this,t),!tb(e)||0===e.length)return e;if(1===e.length)return e[0];var r=0;e.forEach(function(e){k.default(this,n),e.weight=e.weight||1,r+=e.weight}.bind(this));var a=Math.floor(Math.random()*Math.floor(r));r=0;for(var i=0;i<e.length;i++){var s=e[i];if(a<(r+=s.weight))return s}}.bind(this);return new Promise(function(e){var n=this;if(k.default(this,t),Xy)e(Xy);else{var r=i(),o=s();fetch(o).then(function(e){return k.default(this,n),e.json()}.bind(this)).then(function(t){if(k.default(this,n),t.success){var i,s,o,u,c=t.result.game,l={gameId:c.gameMd5,slug:c.slug,pname:c.pname,dname:c.dname,status:c.status,description:c.description,enableAds:!0===c.enableAds||!0===(null===(i=c.enableAds)||void 0===i?void 0:i.enabled),preroll:c.preRoll,midroll:6e4*c.timeAds,rewardedAds:c.rewardedAds,title:c.title,tags:c.tags,category:c.category,assets:c.assets,disp_2nd_prer:c.disp_2nd_prer,ctry_vst:c.ctry_vst,ctry:c.ctry,crtv:c.crtv,dmain:c.dmain,block_exts:d(c.push_cuda),bloc_gard:d(c.bloc_gard),cookie:d(c.cookie),gdpr:d(c.gdpr),diagnostic:d(c.diagnostic),cmp:d(c.cmp),gft:d(c.gft),sdk:d(c.sdk)||{},sdkfw:d(c.sdkfw)||{},loader:d(c.loader)||{},splash:d(c.splash)||{},promo:d(c.promo)||{},dAds:d(c.dads)||{},pAds:d(c.pads)||{},mAds:d(c.mads)||{},rAds:d(c.rads)||{},lp:d(c.lp)||{},extsc:d(c.extsc)||{},evnts:d(c.evnts)||{},__t4r:d(c.__t4r)||{}},h=a.extendDefaults(C.default(r),l);h.afg_disabled=!1===(null===(s=h.sdk)||void 0===s||null===(o=s.afg)||void 0===o?void 0:o.enabled),null!==(u=h.pAds)&&void 0!==u&&u.enabled&&(h.preroll=!0),Xy=h,e(h)}else r.failed=!0,e(r)}.bind(this)).catch(function(t){k.default(this,n),console.log("gd:adp failed game data",t),r.failed=!0,e(r)}.bind(this))}}.bind(this))},ab=function(){var e,t=nb();return!(null==t||null===(e=t.sdkfw)||void 0===e||!e.enabled)},ib=function(){var e,t,n,r,a,i,s=nb(),o=!(null==s||null===(e=s.extsc)||void 0===e||!e.enabled);return{enabled:o,path:o?null==s||null===(t=s.extsc)||void 0===t?void 0:t.path:"",name:o?null==s||null===(n=s.extsc)||void 0===n?void 0:n.name:"",ref:o?null==s||null===(r=s.extsc)||void 0===r?void 0:r.ref:"",loadedFlag:o?null==s||null===(a=s.extsc)||void 0===a?void 0:a.loadedFlag:void 0,loadedFlagCheck:!!o&&!(null==s||null===(i=s.extsc)||void 0===i||!i.loadedFlagCheck)}},sb=function(){var e=A.default(x.default.mark((function e(){var t,n,r,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=ib()).enabled){e.next=3;break}return e.abrupt("return");case 3:return n=t.path,r=t.name,i=t.ref,e.prev=4,s={},e.next=8,a.getScript(n,r,{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!i&&!!window[i]}.bind(this),attrs:s});case 8:console.log("extsc: after external partner script load",r,n),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(4),console.log("extsc: error on external partner script load",r,e.t0),a.dankLog("DEVELOPER_ERROR",e.t0,"warning");case 15:case"end":return e.stop()}}),e,this,[[4,11]])})));return function(){return e.apply(this,arguments)}}(),ob=!1,db=!1,ub=function(){var e=this;return new Promise(function(t,n){var r=this;if(k.default(this,e),ob)return t(db);ob=!0;var a=ib();if(!a.enabled)return t(!1);var i=a.loadedFlag,s=a.loadedFlagCheck;if(s&&!i)return t(!1);if(!s)return db=!0,t(!0);var o=!0;setTimeout(function(){k.default(this,r),o&&(console.log("extsc: clearing on wait after timeout"),o=!1,ob=!0,t(!1))}.bind(this),5e3);var d=setInterval(function(){k.default(this,r),o&&s&&window[i]?(console.log("extsc: loaderflag for external script is set!"),o=!1,ob=!0,db=!0,clearInterval(d),t(!0)):o||(console.log("extsc: clearing interval after timeout"),clearInterval(d))}.bind(this),100)}.bind(this))},cb=function(e){var t=function(e){var t=this,n=function(e){return k.default(this,t),c("showAd",{adType:e})}.bind(this),r=function(e){return k.default(this,t),c("preloadAd",{adType:e})}.bind(this),a=function(e){return k.default(this,t),c("showDisplayAd",{options:e})}.bind(this),i=function(){return k.default(this,t),c("cancelAd")}.bind(this),s=function(){return k.default(this,t),c("openConsole")}.bind(this),o=function(){return k.default(this,t),c("showBanner")}.bind(this),d=function(){return k.default(this,t),c("session")}.bind(this),u=function(){k.default(this,t),console.log("_sendSDKReady")}.bind(this),c=function(e,n){var r=this;return k.default(this,t),n||(n={}),new Promise(function(t,a){k.default(this,r);try{var i={type:"gd-sdk",method:e,options:n};window.parent.postMessage(i,"https://html5.gamedistribution.com"),t()}catch(e){console.log("gd:adp:m:s:error",e),t()}}.bind(this))}.bind(this),l=function(){k.default(this,t),window.addEventListener("message",(function(e){var t=e.data;e.origin,e.source;var n=t.type,r=t.event;"gd-sdk-on-event"===n&&(console.log("gd:adp received on-event",r),r&&f(r))}),!1)}.bind(this),h=function(){k.default(this,t),l(),c("init")}.bind(this),f=function(n){k.default(this,t),e.onEvent&&e.onEvent(n)}.bind(this);return{showBanner:o,showAd:n,preloadAd:r,showDisplayAd:a,cancelAd:i,openConsole:s,getSession:d,onEvent:f,init:h,_sendSDKReady:u}}(e);return t.init(),t},lb=function(){var e=this;return{isMasterGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)}.bind(this),isTokenGameURL:function(){k.default(this,e);return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i.test(location.href)}.bind(this),isExtHostedGameURL:function(){k.default(this,e);return/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i.test(location.href)}.bind(this)}},hb=function(e){var t=this;return new Promise(function(n,r){var a=this;k.default(this,t);var i={type:"gd-sdk-frame-handshake-request"},s=!1;window.addEventListener("message",(function(e){var t=e.data,r=e.origin,a=e.source,i=t.type;if("gd-sdk-frame-handshake-request"===i){var o={type:"gd-sdk-frame-handshake-response"};a.postMessage(o,r)}else"gd-sdk-frame-handshake-response"===i&&(s=!0,n({origin:r,source:a}))})),e?n():(setTimeout(function(){k.default(this,a),s||n()}.bind(this),200),window.parent!==window?window.parent.postMessage(i,"*"):n())}.bind(this))},fb=function(){var e=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,d,u,c,l;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rb(t);case 2:return e.next=5,ab();case 5:return n=e.sent,console.log("gd:adp ,isSDKForwardEnable",n),r=!n,e.next=10,hb(r);case 10:if(a=e.sent,n){e.next=13;break}return e.abrupt("return",!1);case 13:return i=lb(),s=i.isMasterGameURL,o=i.isTokenGameURL,d=s(),u=o(),h=void 0,f=void 0,f=nb(),c=ab()&&!(null==f||null===(h=f.sdkfw)||void 0===h||!h.handshake),l=!1,l=c?!d&&!!a:!d,console.log("gd:adp: frameCheck result",{_isMasterGameURL:d,_isTokenGameURL:u,isHandshakeEnabled:c,hsResult:a,result:l}),e.abrupt("return",l);case 21:case"end":return e.stop()}var h,f}),e)})));return function(t){return e.apply(this,arguments)}}(),pb=V,mb=re,gb=_a,vb=ye,yb=mb(H.f),bb=mb([].push),_b=function(e){return function(t){for(var n,r=vb(t),a=gb(r),i=a.length,s=0,o=[];i>s;)n=a[s++],pb&&!yb(r,n)||bb(o,e?[n,r[n]]:r[n]);return o}},wb={entries:_b(!0),values:_b(!1)}.values;va({target:"Object",stat:!0},{values:function(e){return wb(e)}});var Ab=va,kb=zl,Eb=F,xb=xe,Db=be,Sb=kh,Tb=Lf,Rb=_n.exports;if(Ab({target:"Promise",proto:!0,real:!0,forced:!!kb&&Eb((function(){kb.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=Sb(this,xb("Promise")),n=Db(e);return this.then(n?function(n){return Tb(t,e()).then((function(){return n}))}:e,n?function(n){return Tb(t,e()).then((function(){throw n}))}:e)}}),Db(kb)){var Ob=xb("Promise").prototype.finally;kb.prototype.finally!==Ob&&Rb(kb.prototype,"finally",Ob,{unsafe:!0})}var Ib=me,Pb=Va,Cb=re("".replace),Lb="[\t\n\v\f\r                 \u2028\u2029\ufeff]",Mb=RegExp("^"+Lb+Lb+"*"),Ub=RegExp(Lb+Lb+"*$"),jb=function(e){return function(t){var n=Pb(Ib(t));return 1&e&&(n=Cb(n,Mb,"")),2&e&&(n=Cb(n,Ub,"")),n}},Bb={start:jb(1),end:jb(2),trim:jb(3)},Gb=ir.PROPER,Nb=F,qb="\t\n\v\f\r                 \u2028\u2029\ufeff",Fb=Bb.trim;va({target:"String",proto:!0,forced:function(e){return Nb((function(){return!!qb[e]()||"​…᠎"!=="​…᠎"[e]()||Gb&&qb[e].name!==e}))}("trim")},{trim:function(){return Fb(this)}});var Vb=be,Kb=we,Wb=Wu,Hb=V,zb=N,$b=re,Qb=ua,Yb=function(e,t,n){var r,a;return Wb&&Vb(r=t.constructor)&&r!==n&&Kb(a=r.prototype)&&a!==n.prototype&&Wb(e,a),e},Jb=bn,Xb=an.f,Zb=gr.f,e_=De,t_=Hv,n_=Va,r_=vc,a_=yc,i_=_n.exports,s_=F,o_=mt,d_=Zn.enforce,u_=eh,c_=kc,l_=Dc,h_=It("match"),f_=zb.RegExp,p_=f_.prototype,m_=zb.SyntaxError,g_=$b(r_),v_=$b(p_.exec),y_=$b("".charAt),b_=$b("".replace),__=$b("".indexOf),w_=$b("".slice),A_=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,k_=/a/g,E_=/a/g,x_=new f_(k_)!==k_,D_=a_.UNSUPPORTED_Y,S_=Hb&&(!x_||D_||c_||l_||s_((function(){return E_[h_]=!1,f_(k_)!=k_||f_(E_)==E_||"/a/i"!=f_(k_,"i")})));if(Qb("RegExp",S_)){for(var T_=function(e,t){var n,r,a,i,s,o,d=e_(p_,this),u=t_(e),c=void 0===t,l=[],h=e;if(!d&&u&&c&&e.constructor===T_)return e;if((u||e_(p_,e))&&(e=e.source,c&&(t="flags"in h?h.flags:g_(h))),e=void 0===e?"":n_(e),t=void 0===t?"":n_(t),h=e,c_&&"dotAll"in k_&&(r=!!t&&__(t,"s")>-1)&&(t=b_(t,/s/g,"")),n=t,D_&&"sticky"in k_&&(a=!!t&&__(t,"y")>-1)&&(t=b_(t,/y/g,"")),l_&&(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=y_(e,r)))t+=y_(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:v_(A_,w_(e,r+1))&&(r+=2,d=!0),a+=t,u++;continue;case">"===t&&d:if(""===c||o_(s,c))throw new m_("Invalid capture group name");s[c]=!0,i[i.length]=[c,u],d=!1,c="";continue}d?c+=t:a+=t}return[a,i]}(e),e=i[0],l=i[1]),s=Yb(f_(e,t),d?this:p_,T_),(r||a||l.length)&&(o=d_(s),r&&(o.dotAll=!0,o.raw=T_(function(e){for(var t,n=e.length,r=0,a="",i=!1;r<=n;r++)"\\"!==(t=y_(e,r))?i||"."!==t?("["===t?i=!0:"]"===t&&(i=!1),a+=t):a+="[\\s\\S]":a+=t+y_(e,++r);return a}(e),n)),a&&(o.sticky=!0),l.length&&(o.groups=l)),e!==h)try{Jb(s,"source",""===h?"(?:)":h)}catch(e){}return s},R_=function(e){e in T_||Xb(T_,e,{configurable:!0,get:function(){return f_[e]},set:function(t){f_[e]=t}})},O_=Zb(f_),I_=0;O_.length>I_;)R_(O_[I_++]);p_.constructor=T_,T_.prototype=p_,i_(zb,"RegExp",T_)}u_("RegExp");var P_=re,C_=ir.PROPER,L_=_n.exports,M_=cn,U_=De,j_=Va,B_=F,G_=vc,N_=RegExp.prototype,q_=N_.toString,F_=P_(G_),V_=B_((function(){return"/a/b"!=q_.call({source:"a",flags:"b"})})),K_=C_&&"toString"!=q_.name;(V_||K_)&&L_(RegExp.prototype,"toString",(function(){var e=M_(this),t=j_(e.source),n=e.flags;return"/"+t+"/"+j_(void 0===n&&U_(N_,e)&&!("flags"in N_)?F_(e):n)}),{unsafe:!0});var W_,H_=va,z_=re,$_=q.f,Q_=Dr,Y_=Va,J_=Qv,X_=me,Z_=Jv,ew=z_("".startsWith),tw=z_("".slice),nw=Math.min,rw=Z_("startsWith");H_({target:"String",proto:!0,forced:!!(rw||(W_=$_(String.prototype,"startsWith"),!W_||W_.writable))&&!rw},{startsWith:function(e){var t=Y_(X_(this));J_(e);var n=Q_(nw(arguments.length>1?arguments[1]:void 0,t.length)),r=Y_(e);return ew?ew(t,r,n):tw(t,n,n+r.length)===r}});var aw=va,iw=rs.find,sw=yl,ow=!0;"find"in[]&&Array(1).find((function(){ow=!1})),aw({target:"Array",proto:!0,forced:ow},{find:function(e){return iw(this,e,arguments.length>1?arguments[1]:void 0)}}),sw("find");var dw=V,uw=re,cw=W,lw=F,hw=_a,fw=Vr,pw=H,mw=ht,gw=fe,vw=Object.assign,yw=Object.defineProperty,bw=uw([].concat),_w=!vw||lw((function(){if(dw&&1!==vw({b:1},vw(yw({},"a",{enumerable:!0,get:function(){yw(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=vw({},e)[n]||hw(vw({},t)).join("")!=r}))?function(e,t){for(var n=mw(e),r=arguments.length,a=1,i=fw.f,s=pw.f;r>a;)for(var o,d=gw(arguments[a++]),u=i?bw(hw(d),i(d)):hw(d),c=u.length,l=0;c>l;)o=u[l++],dw&&!cw(s,d,o)||(n[o]=d[o]);return n}:vw,ww=_w;va({target:"Object",stat:!0,forced:Object.assign!==ww},{assign:ww});var Aw=function(){function e(t){D.default(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return L.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(){var e=this;try{var t={},n=this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled,r=new T.default(location.href,!0);for(var a in r.query)t[a]=r.query[a];return Object.keys(t).filter(function(t){var n=this;return k.default(this,e),this.customParamKeys.some(function(e){return k.default(this,n),e===t}.bind(this))}.bind(this)).length>0||n?(console.log("custom-params",t,n),t):void console.log("custom-params, none")}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),kw=function(){function e(t,n){D.default(this,e),this.adContainer=t,this.onResume=n}return L.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(){k.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}(),Ew=function(e){if(!e)return!1;var t=xw.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)},xw=Object.prototype.toString;function Dw(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 Sw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dw(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Tw(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()}function Rw(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 Ow(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rw(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rw(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Iw=null,Pw=function(){function e(t,n,r){var i=this;if(D.default(this,e),Iw)return Iw;Iw=this;var s={debug:!1,width:640,height:360,locale:"en"};this.options=n?a.extendDefaults(s,n):s,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new a.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=a.getIMASampleTags(),this.atom_display,this.adType_="",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 o=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:o,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:d,this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){k.default(this,i),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){k.default(this,i),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,i,s,o,d,u,c,l,h,f,p,g,v,b,_,w,E;return L.default(e,[{key:"start",value:(E=A.default(x.default.mark((function e(){return x.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 E.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(i){var s,o,d,u,c,l,h,f,p=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&a.Ls.getBoolean("gd_tag"))){r.next=6;break}return s=n.IMASampleTags[e],o=Math.floor(Math.random()*s.length),d=s[o],i({url:d}),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,u=n.nextAdPosition(e),n.eventBus.broadcast("AD_REQUEST",{message:u}),c=n.options,"preroll"===u&&m.isPlainObject(c.preroll)?c=c.preroll:"midroll"===u&&m.isPlainObject(c.midroll)?c=c.midroll:"rewarded"===u&&m.isPlainObject(c.rewarded)&&(c=c.rewarded),l="rewarded"===u?"rewardedVideo":"gdbanner"===u?"gd__banner":"midroll"===u?"midroll":"video1",r.next=16,window.idhb.isLoaded();case 16:if(h={tnl_keys:Ow(Ow({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:u,tnl_asset_id:n.gameData.gameId})},!(t&&t.retry_on_success&&m.isPlainObject(c.retry_on_success)&&m.isPlainObject(c.retry_on_success.vast))){r.next=21;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_success.vast,h)));case 21:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&m.isPlainObject(c.retry_on_failure.vast))){r.next=25;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.retry_on_failure.vast,h)));case 25:if(!m.isPlainObject(c.vast)){r.next=27;break}return r.abrupt("return",i(n._createCustomAdVastUrl(c.vast,h)));case 27:return r.next=29,n._create_dp_context(u,t);case 29:f=r.sent,window.idhb.requestAds({slots:S.default({},l,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,t){var r=this;k.default(this,p),!f||null!=t&&t.bidFloorApplied||fetch(f.skip_url).catch(function(e){k.default(this,r)}.bind(this)),i({tnl_keys:Ow(Ow({},window.idhb.getAdserverTargetingForAdSlot(l)),{},{tnl_ad_pos:u,tnl_asset_id:n.gameData.gameId}),url:e,dp:f,hl:t})}.bind(this)}),r.next=36;break;case 33:throw r.prev=33,r.t0=r.catch(8),new Error(r.t0);case 36:case"end":return r.stop()}}),r,this,[[8,33]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===a.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===a.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===a.AdType.Rewarded?"rewarded":e===a.AdType.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(r){if(k.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=Ow(Ow({},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=Sw(Sw({},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=Sw(Sw({},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(Tw({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(Tw({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 f=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=f}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.gameData.gameId}})}}},{key:"_checkAutoPlay",value:(w=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=this;k.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):M.default.video({inline:!0,muted:!1}).then(function(t){k.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 w.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(_=A.default(x.default.mark((function e(){var t;return x.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 _.apply(this,arguments)})},{key:"startAd",value:(b=A.default(x.default.mark((function e(t){var n,r,i;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,r=t.adType,i=t.params,this.adType_=r,console.log("gd:adp startAd afgDisabled",n),r!==a.AdType.Interstitial){e.next=24;break}if(!n){e.next=9;break}return e.abrupt("return",this._startInterstitialAd(i));case 9:if("preroll"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=13;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 13:if("start"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=17;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 17:if("next"!==(null==i?void 0:i.position)||"adsense"!==(null==i?void 0:i.adapter)){e.next=21;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 21:return e.abrupt("return",this._startInterstitialAd(i));case 22:case 30:e.next=33;break;case 24:if(r!==a.AdType.Rewarded){e.next=32;break}if(!n){e.next=29;break}return e.abrupt("return",this._startRewardedAd(i));case 29:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 32:throw new Error("Unsupported ad type");case 33:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"preloadAd",value:(v=A.default(x.default.mark((function e(t){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==a.AdType.Interstitial){e.next=4;break}return e.abrupt("return","gdsdk://preloaded");case 4:if(t!==a.AdType.Rewarded){e.next=8;break}return e.abrupt("return","gdsdk://preloaded");case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e)}))),function(e){return v.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){k.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new kw(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(g=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o,d,u,c,l,h,f,p,m=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(o=t?t.containerId:null)||i("Container id is not specified"),d=document.getElementById(o),document.getElementById(o)||i("No container is found with this id - ".concat(o)),void 0===window.idhb.requestAds&&i("Prebid.js wrapper script hit an error or didn't exist!"),u=t.slotId?t.slotId:"gd__banner@".concat(o),document.getElementById(u)||(c="\n .gd__banner{\n z-index: ".concat(a.Layers.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((l=document.createElement("style")).type="text/css",l.id="gd__banner__style",l.styleSheet?l.styleSheet.cssText=c:l.appendChild(document.createTextNode(c)),d.appendChild(l)),(h=document.createElement("div")).id=u,h.classList.add("gd__banner"),d.appendChild(h)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,null!==(s=n.atom_display)&&void 0!==s&&s.params&&window.idhb.setAdserverTargeting(null===(f=n.atom_display)||void 0===f?void 0:f.params),(p={})[u]={maxSize:[d.offsetWidth,d.offsetHeight]},window.idhb.requestAds({slots:p,callback:function(e){k.default(this,m)}.bind(this)}),r(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),i(e.t0.message||e.t0);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return g.apply(this,arguments)})},{key:"_startInterstitialAd",value:(p=A.default(x.default.mark((function e(t){var n;return x.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(Ow(Ow({},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:"_loadInterstitialAd",value:(f=A.default(x.default.mark((function e(t){var n,r,i=this;return x.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(a.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,Ow({adType:a.AdType.Interstitial},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;k.default(this,i);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){k.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){k.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,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:(h=A.default(x.default.mark((function e(t){var n;return x.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(Ow(Ow({},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 h.apply(this,arguments)})},{key:"_loadRewardedAd",value:(l=A.default(x.default.mark((function e(t){var n,r,i=this;return x.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(a.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,Ow({adType:a.AdType.Rewarded},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;k.default(this,i);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var a=function(t){k.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){k.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",a,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 l.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(c=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(a.AdType.Interstitial);case 5:e.t0=e.sent;case 6:return this.preloadedInterstitialAdVast=e.t0,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return c.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(u=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=6;break}return e.next=5,this._getAdVast(a.AdType.Rewarded);case 5:e.t0=e.sent;case 6:return this.preloadedRewardedAdVast=e.t0,e.abrupt("return",this.preloadedRewardedAdVast.url);case 10:throw e.prev=10,e.t1=e.catch(0),new Error(e.t1);case 13:case"end":return e.stop()}}),e,this,[[0,10]])}))),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.adsManager.setVolume(0),r&&this.eventBus.broadcast("AD_T4R"),r&&setTimeout(function(){k.default(this,t),this.activeAdContainer.style.opacity=1,this.adsManager.setVolume(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,this.adsManager.setVolume(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=a.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 i=function(){k.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",i),window.document.addEventListener("DOMContentLoaded",i)}},{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(){k.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,n=new Date,r=n.getHours(),i=n.getDate(),s=n.getMonth(),o=n.getFullYear(),d=a.getKeyByValue(google.ima.AdEvent.Type,e.type),u=!1,c=(null==e||null===(t=e.getAd())||void 0===t?void 0:t.getContentType())||"",l=!c.startsWith("image")&&!c.startsWith("text");this._sendIMAEventsToHB(e);var h="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:h="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:h="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:u=!0,h="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:h="Fired when the ad is clicked.";var f=e.getAd().getContentType();this._show({mode:"click",contentType:f});break;case google.ima.AdEvent.Type.COMPLETE:u=this._is_completed(e.getAd()),h="Fired when the ad completes playing.",this.adType_===a.AdType.Rewarded&&this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"});break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:h="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:h="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",u=!0,this._hideAddResume();break;case google.ima.AdEvent.Type.DURATION_CHANGE:h="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:h="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:h="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:h="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:h="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var m=e.getAd().getContentType();h=m,this._show({mode:"loaded",contentType:m});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(h=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:h="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:l&&this.adResume.show(),h="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:h="Fired when the ad is resumed.",l&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:h="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:u=this._is_completed(e.getAd()),h="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:this._hideAddResume(),h="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:h="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:u=this._is_completed(e.getAd()),h="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:h="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:h="Fired when the ad volume has been muted."}""!==d&&""!==h&&this.eventBus.broadcast(d,{name:d,message:h,status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(r," d").concat(i," m").concat(s," y").concat(o)}}),u&&!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}}),this._hideAddResume()}catch(e){}}},{key:"_hideAddResume",value:function(){try{console.log("gd:adp will hide adresume"),this.adResume&&this.adResume.hide(),console.log("gd:adp hiding adresume")}catch(e){console.log("Error on hide adResume",e)}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({event: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(){k.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/headerlift.min.js","http://hb.improvedigital.com/pbw/headerlift.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(Ew(e.getInnerError)){var t=e.getInnerError();if(t)return Ew(t.getErrorCode)&&Ew(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(k.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];m.isPlainObject(i)&&(r.query[a]=U.default.stringify(i))}var s=new T.default(r.url,!0);return j.default(s.query,r.query||{}),Ow({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=U.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&&m.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&&m.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=C.default(a),m.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=U.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 k.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,j.default(i,u),i.cust_params=U.default.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,a,i=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;if(null!=e&&null!==(n=e.contentType)&&void 0!==n&&n.startsWith("image/")||"text"===(null==e?void 0:e.contentType))return i&&(null===(r=this.gameData)||void 0===r||null===(a=r.__t4r[i])||void 0===a?void 0:a.enabled);if(null!=e&&e.contentType.startsWith("video/")){var s,o,d=(null===(s=this.gameData)||void 0===s||null===(o=s.__t4r[i])||void 0===o?void 0:o.viper)||0;if(d>0){var u,c,l=Math.random()<d;return i&&l&&(null===(u=this.gameData)||void 0===u||null===(c=u.__t4r[i])||void 0===c?void 0:c.enabled)}return!1}return!1}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h,f,p,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===(f=this.gameData)||void 0===f||null===(p=f.rAds)||void 0===p||null===(m=p.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=null===(e=this._adrequest_user_context)||void 0===e?void 0:e.tnl_ad_pos;switch(a){case"preroll":return null===(t=this.gameData)||void 0===t?void 0:t.__t4r[a];case"midroll":return null===(n=this.gameData)||void 0===n?void 0:n.__t4r[a];case"rewarded":return null===(r=this.gameData)||void 0===r?void 0:r.__t4r[a]}}},{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,f,p,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===(f=this.gameData)||void 0===f||null===(p=f.rAds)||void 0===p||null===(m=p.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;k.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Aw(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(y.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return k.default(this,n),e.json()}.bind(this)).then(function(e){if(k.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){k.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,t){var n=this;return new Promise(function(){var r=A.default(x.default.mark((function r(a){var i,s,o,d,u,c,l=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,n._isDP(e)){r.next=5;break}return n.msgrt.send("dp.na",{message:"rule"}),r.abrupt("return",a());case 5:s={id:n.topDomain||n.parentDomain,au:e||"unknown",ty:"video",aid:n.gameData.gameId,pgu:n.parentURL},(o=new Aw(n.gameData).checkCustomParams())&&(s.cp=o),d=encodeURIComponent(y.Base64.encode(JSON.stringify(s))),u=null===(i=n.gameData.promo)||void 0===i?void 0:i.rainbow,c=(null==u?void 0:u.enabled)&&!0!==(null==t?void 0:t.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(d)).then(function(e){return k.default(this,l),e.json()}.bind(this)).then(function(e){if(k.default(this,l),!e||!e.p)return n.msgrt.send("dp.na",{message:"atom"}),a();var t=e.p/100;a({id:Date.now(),floor_price:t,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(d,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(d),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(d),promo_url:c?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(d):void 0,promo_imp_blue_url:c?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:c?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){k.default(this,l),n.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),a()}.bind(this)),r.next=18;break;case 14:r.prev=14,r.t0=r.catch(0),n.msgrt.send("dp.err",{message:(null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0}),a();case 18:case"end":return r.stop()}}),r,this,[[0,14]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t){if(e&&t)try{var n,r=new T.default(t.vastUrl,!0);if(null===(n=r.query)||void 0===n||!n.cust_params)return;var a=U.default.parse(r.query.cust_params);if(!a.tnl_asset_id)return;a.adsense=1,r.query.cust_params=U.default.stringify(a,!1),e.fallback_url=r.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(d=A.default(x.default.mark((function e(t){var n,r,i,s,o,d=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),r=n[0],window.idhb=window.idhb||{},window.idhb.options=window.idhb.options||{},Object.assign(window.idhb.options,{assetId:this.gameData.gameId,configUrl:this.topDomain||this.parentDomain,parentUrl:this.parentURL,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=8,a.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,d),window.idhb.requestAds}.bind(this)});case 8:i=a.getQueryString("ch",window.location.href),s=a.getQueryString("ch_date",window.location.href),o={tnl_content_category:this.category.toLowerCase()},i&&(o.channel=i),s&&(o.ch_date=s),window.idhb.setAdserverTargeting(o),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var t=this;k.default(this,d);try{var n,r=e.slotId.split("@");r=1===r.length?r[0]:r[1],e.isEmpty?(null!==(n=this.atom_display)&&void 0!==n&&n.error_url&&(fetch(this.atom_display.error_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:r,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){k.default(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:r,status:"success"}))}catch(e){}}.bind(this));case 16:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"_init_ima_script",value:(o=A.default(x.default.mark((function e(t){var n,r,i=this;return x.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,a.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return k.default(this,i),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_afg_script",value:(s=A.default(x.default.mark((function e(t){var n,r,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(s={}).crossorigin="anonymous",s["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",s["data-ad-frequency-hint"]="30s",s.allow="autoplay",(null==t||null===(r=t.adsense_channel)||void 0===r?void 0:r.length)>0&&(s["data-ad-channel"]=t.adsense_channel),(null==t||null===(i=t.adsense_host)||void 0===i?void 0:i.length)>0&&(s["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(s["data-adbreak-test"]="on"),e.next=14,a.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return k.default(this,o),!!window.adsbygoogle}.bind(this),attrs:s});case 14:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 16:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"clearSession",value:function(){this.requestRunning=!1}},{key:"_startAdsensePlacementRewardedAd",value:(i=A.default(x.default.mark((function e(t){var n,r,a,i,s,o,d=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("gd:adp _startAdsensePlacementRewardedAd"),e.prev=2,!this.requestRunning){e.next=6;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 6:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),n=function(){k.default(this,d),console.log("gd:adp rw beforeAd"),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,d),console.log("gd:adp rw afterAd"),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){k.default(this,d),console.log("gd:adp rw adDismmissed"),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){k.default(this,d),console.log("gd:adp rw adViewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("SDK_REWARDED_WATCH_COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){k.default(this,d),console.log("gd:adp rw beforeReward"),e()}.bind(this),o=function(e){k.default(this,d),console.log("gd:adp rw adBreakDone"),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),console.log("gd:adp rw window.adsbygoogle.push(o). tm",window.adsbygoogle),e.next=22;break;case 18:throw e.prev=18,e.t0=e.catch(2),this._onError(e.t0),e.t0;case 22:case"end":return e.stop()}var t}),e,this,[[2,18]])}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=A.default(x.default.mark((function e(t){var n,r=this;return x.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){k.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=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.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(){k.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.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=A.default(x.default.mark((function e(t){var n,r,a,i=this;return x.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(){k.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){k.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){k.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(y.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,href:window.location.href})}},{key:"_isAfgPositionNext",value:function(e){return void 0!==e.adTimestamp}},{key:"_isAfgPositionStart",value:function(e){if(void 0!==e.adTimestamp)return!1;return this.adCounter.preroll=this.adCounter.preroll||0,0===this.adCounter.preroll}},{key:"attachAfgPosition",value:function(e){var t=e.params.position;switch(t){case"preroll":case"start":case"pause":case"next":case"browse":case"reward":return}var n=e.adType;if(n===a.AdType.Rewarded)t="reward";else if(n===a.AdType.Interstitial){var r,i;if(this._isAfgPositionStart(e))t=null===(r=this.gameData.pAds)||void 0===r||!r.enabled||null!==(i=this.gameData.loader)&&void 0!==i&&i.enabled?"start":"next";else this._isAfgPositionNext(e)&&(t="next")}e.params.position=t}}]),e}(),Cw=function e(t){var n=this;D.default(this,e),S.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),S.default(this,"promo",A.default(x.default.mark((function e(){return x.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},pm(this.moduleName,this.moduleConfig)},Lw=function e(t){var n=this;D.default(this,e),S.default(this,"load",A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gm(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),S.default(this,"splash",A.default(x.default.mark((function e(){return x.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},pm(this.moduleName,this.moduleConfig)},Mw=function(e,t){console.log(e,t)},Uw={},jw={},Bw=null;function Gw(){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 Uw.version=r,Uw.frame=e,Uw.function=n,Uw.version}function Nw(e){var t=this;return Bw||(Bw=new Promise(function(n){function r(t,r){if(Mw("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:Uw,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}k.default(this,t),Gw(),Uw.frame?2===Uw.version?(Mw("TCF v2 CMP found. Fetching the consent."),Uw.function?(Mw("CMP API is directly accessible, calling it now..."),Uw.function("addEventListener",Uw.version,r)):(Mw("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!==jw[r.callId]&&jw[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){k.default(this,r);var o=Math.random()+"",d="".concat(a,"Call"),u=S.default({},d,{command:e,parameter:s,callId:o,version:n});jw[o]=i,t.postMessage(u,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,Uw.version,n)}("addEventListener",Uw.frame,r))):n({result:"cmpVersionNotV2",cmp:Uw}):n({result:"cmpNotFound"})}.bind(this)),Bw)}var qw=new(function(){function e(){D.default(this,e),this.productName="Game Distribution"}var t;return L.default(e,[{key:"checkIfExcluded",value:function(e){try{var t,n;return!(null===(t=e.diagnostic)||void 0===t||null===(n=t.gameDock)||void 0===n||!n.excluded)}catch(e){return console.log("Error on checkIfExclude check",e),!1}}},{key:"track",value:(t=A.default(x.default.mark((function e(t,n){var r,a,i,s,o,d;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(r=t.visitor)||void 0===r?void 0:r.visitorId){e.next=6;break}return e.abrupt("return");case 6:return i=encodeURIComponent(this.productName),s=encodeURIComponent(a),e.prev=8,o="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=12,fetch(o,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,d="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=22,fetch(d,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,n){return t.apply(this,arguments)})}]),e}());function Fw(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 Vw(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 Vw(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 Vw(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}var Kw=function(e){var t=this,n=e.src,r=e.attributes,a=e.target,i=e.isAsync;return new Promise(function(e,s){var o=this;k.default(this,t);try{var d=document.createElement("script");if(d.async=null==i||i,d.type="text/javascript",d.onload=function(){k.default(this,o),e()}.bind(this),d.onerror=function(){k.default(this,o);var e="Error on script load, Error: ".concat(n);console.log(e),s(e)}.bind(this),d.src=n,r){var u,c=Fw(r);try{for(c.s();!(u=c.n()).done;){var l=u.value,h=l.key,f=l.value;d.setAttribute(h,f)}}catch(e){c.e(e)}finally{c.f()}}a||(a=document.head),a.appendChild(d)}catch(e){var p="Error on script load catch, Error: ".concat(n);console.log(p,e),s(p)}}.bind(this))},Ww=function(){var e=A.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Kw({src:"https://cdn.cookielaw.org/consent/tcf.stub.js",attributes:[{key:"id",value:"gd-cookie-pro-tcf-stub"},{key:"charset",value:"UTF-8"}],isAsync:!1});case 3:return e.next=5,Kw({src:"https://cookie-cdn.cookiepro.com/consent/".concat("140feb72-7952-4420-8ae5-e8978d87bc17","/OtAutoBlock.js"),attributes:[{key:"id",value:"gd-cookie-pro-autoblock"}],isAsync:!1});case 5:return e.next=7,Kw({src:"https://cookie-cdn.cookiepro.com/scripttemplates/otSDKStub.js",attributes:[{key:"id",value:"gd-cookie-pro-stub"},{key:"charset",value:"UTF-8"},{key:"data-domain-script",value:"140feb72-7952-4420-8ae5-e8978d87bc17"}],isAsync:!1});case 7:n=void 0,r=void 0,a=void 0,n=(t={inlineScript:"function OptanonWrapper() { }"}).inlineScript,r=t.target,(a=document.createElement("script")).text=n,r||(r=document.head),r.appendChild(a),console.log("GD: CMP cookie pro loaded successfully."),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("GD: CMP error on load",e.t0);case 14:case"end":return e.stop()}var t,n,r,a}),e,null,[[0,11]])})));return function(){return e.apply(this,arguments)}}(),Hw=new b.EventEmitter,zw={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function $w(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}window.addEventListener("message",(function(e){var t=this,n=e.data,r=e.origin,a=n.type;if(Object.keys(zw).some(function(e){return k.default(this,t),e===r}.bind(this))&&(null==n||!n.__tcfapiCall)&&(window.parent&&!n.type.startsWith("gd-sdk")&&(window.parent.postMessage(n,"*"),console.log("GD-SDK:pst fw sg event to parent complete",window.parent.location.href,n)),a)){var i=zw[r][a];i&&Hw.emit(i,n)}}),!1);var Qw=_.v4(),Yw=function(e){var t=this;if(!window.__msgr){var n=document.createElement("iframe");if(n.src="https://static.gamedistribution.com/message/index.html",n.style.display="none",n.name="__msgr",document.body.appendChild(n),window!==window.top){var r={gameId:e.gameId,target:e.evnts.domain,token:Qw,event_name:"TokenGenerated",timestamp:Date.now()};n.onload=function(){Zw(r)},setInterval(function(){k.default(this,t),r.timestamp=Date.now(),r.event_name="Heartbeat",Zw(r)}.bind(this),1e3*e.evnts.heartbeatDuration)}}window.addEventListener("message",function(e){k.default(this,t);try{var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$w(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e.data);if(!n.event_name)return;n.token=Qw,Zw(n)}catch(e){console.error("GD Messager Error",e.message)}}.bind(this),!1)},Jw=function(e){try{var t={gameId:e.game.gameId,target:e.game.evnts.domain,event_name:e.event,timestamp:Date.now()},n=Xw(window);n!==window.top&&(null==n||n.postMessage(t,"https://html5.gamedistribution.com"))}catch(e){}},Xw=function e(t){try{var n,r,a=null==t?void 0:t.parent;if("game"===(null===(n=a.document)||void 0===n||null===(r=n.activeElement)||void 0===r?void 0:r.id))return a;e(a)}catch(e){return t}},Zw=function(e){window.__msgr.postMessage(e,"https://static.gamedistribution.com")};function eA(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 tA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eA(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nA,rA=null,aA=null,iA=function(){function e(t){var n=this;if(D.default(this,e),rA)return rA;rA=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new Dy,this._location.print(),this._parentURL=this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._giftCount=0,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){k.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){k.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e,t;k.default(this,n),!0===(null===(e=this._gameData.lp)||void 0===e?void 0:e.load)&&this._sendLoadedEvent(1),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),this._initUnityHandler(),this._checkFullscreen(),null!==(t=this._gameData.evnts)&&void 0!==t&&t.enabled&&this._isLoaderGameURL()&&Yw(this._gameData)}.bind(this)),this._registerSGBridge()}var t,n,r,i,s,o,d,u,c,l,h;return L.default(e,[{key:"_initUnityHandler",value:function(){var e=this;window.addEventListener("DOMNodeInserted",function(){if(k.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))}},{key:"_loadCMP",value:(h=A.default(x.default.mark((function e(){var t,n,r,a;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=8;break}if(r=new Dy,a=r.get("depth"),console.log("CMP location.depth",a),0!==(null==a?void 0:a.value)||null===(t=this._gameData)||void 0===t||null===(n=t.cmp)||void 0===n||!n.enabled||"html5.gamedistribution.com"!==this._topDomain){e.next=8;break}return e.next=7,Ww();case 7:console.log("CMP loaded");case 8:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var e=Gw();console.log("CMP found",e),A.default(x.default.mark((function e(){var t;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nw({});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:"_registerSGBridge",value:function(){var e=this;Hw.on("splash-hidden",function(t){k.default(this,e),console.log("GD-SDK:pst on splash-hidden",t),this._hideCMPButton()}.bind(this))}},{key:"_hideCMPButton",value:function(){console.log(":pst hide cmp button");var e=document.getElementById("ot-sdk-btn-floating");e&&(e.style.display="none")}},{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"})}catch(e){}}}},{key:"_sendGamedockGamePlay",value:function(){var e=this._isTokenGameURL();if(console.log("in gamedock gameplay",this._gameData.loader.enabled,e),!(this._gameData.loader.enabled&&e||this._gameDockGamePlaySent))try{this._sendGamedockEvent("gameplay"),console.log("gamedock gameplay"),this._gameDockGamePlaySent=!0}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=A.default(x.default.mark((function e(t,n){var r,a=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this._gameData=this._getGameData(),e.next=4,this._loadCMP();case 4: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 k.default(this,a),console.error(e.message||e)}.bind(this))),t(this._gameData),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),n(e.t0);case 19:case"end":return e.stop()}}),e,this,[[0,14]])}))),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=C.default(e);this.options=t?a.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=Sy.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=this;void 0===this._topDomain&&(this._topDomain=void 0);var n={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(U.default.stringify(n))).catch(function(e){k.default(this,t)}.bind(this))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=a.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,a.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!a.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0),a.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(a.Ls.set("gd_debug_ex",!0),a.Ls.set("gd_disable_midroll_timer",!0)),a.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 a.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:a.getIframeDepth(),version:Sy.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:a.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.4.0/script/gamedock-sdk.min.js"];a.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){var t,n;k.default(this,e),aA=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&aA.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),qw.track(aA,this._gameData)}.bind(this)).catch(function(t){k.default(this,e),this._sendSDKError(t)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e){if(!this._bridge.isCoreSDKMode)return e.initialize("gd",this._parentDomain)}},{key:"_sendGamedockEvent",value:function(e){var t,n;null===(t=aA)||void 0===t||null===(n=t.tracking)||void 0===n||n.trackEvent(e,{pageId:this.options.gameId,pageType:"game"})}},{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"];a.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];a.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return k.default(this,e),window.ga}.bind(this)}).then(function(){k.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){k.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new a.EventBus,a.SDKEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),a.IMAEvents.forEach(function(t){var n=this;return k.default(this,e),this.eventBus.subscribe(t,function(e){return k.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(k.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 k.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){var n,r;k.default(this,e),this.msgrt.send("ad.impression"),null!==(n=this._gameData.diagnostic)&&void 0!==n&&null!==(r=n.gameDock)&&void 0!==r&&r.adViewEvent&&qw.track(aA,this._gameData)}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){k.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){k.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){k.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){k.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){k.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 k.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(Sy.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(c=A.default(x.default.mark((function e(){var t,n,r=this;return x.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(){k.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(U.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(){k.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;a.Ls.available&&a.Ls.getBoolean("gd_debug_ex")&&(a.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,a=this._gameData,i=a.gdpr&&!0===a.gdpr.consent,s=a.loader,o=null===(e=a.promo)||void 0===e?void 0:e[null===(t=a.promo)||void 0===t||null===(n=t.template)||void 0===n?void 0:n.preroll];(a.preroll||(this.adRequestTimer=Date.now()),this.options.loader.enabled)?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):s.enabled&&!0!==(null===(r=s.splash)||void 0===r?void 0:r.skip)?this._createSplash(a,i):this.onResumeGame("Skipped splash.","success"):s.enabled||this._bridge.isTokenGameURL&&this._bridge.isExtHostedGameURL||(this.options.advertisementSettings.autoplay||i?null!=o&&o.enabled?this._createPromoBeforeSplash(a,i):!1!==s.enabled&&this._createSplash(a,i):null!=o&&o.enabled&&this._createPromo(a,i))}},{key:"_initializeVideoAd",value:(u=A.default(x.default.mark((function e(){var t;return x.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=a.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new a.Macros({game:t,bridge:this._bridge}),this.adInstance=new Pw(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=Sy,this.adInstance._send("gd.location",this._location.get()),e.next=17,this.adInstance.start();case 17: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){a.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){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){a.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var e=nb();return this._bridge.noPreroll=(!this._getisMobile()||!1!==e.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(e),a.setDankLog(e.diagnostic),e}},{key:"_getGameDataOld",value:function(){var e=this;return new Promise(function(t){var n=this;k.default(this,e);var r=this._getDefaultGameData(),i=this._getGameDataUrl();fetch(i).then(function(e){return k.default(this,n),e.json()}.bind(this)).then(function(e){if(k.default(this,n),e.success){var i,s,o,d,u=e.result.game,c={gameId:u.gameMd5,slug:u.slug,pname:u.pname,dname:u.dname,status:u.status,description:u.description,enableAds:!0===u.enableAds||!0===(null===(i=u.enableAds)||void 0===i?void 0:i.enabled),preroll:u.preRoll,midroll:6e4*u.timeAds,rewardedAds:u.rewardedAds,title:u.title,tags:u.tags,category:u.category,assets:u.assets,disp_2nd_prer:u.disp_2nd_prer,ctry_vst:u.ctry_vst,ctry:u.ctry,crtv:u.crtv,dmain:u.dmain,block_exts:this._parseAndSelectRandomOne(u.push_cuda),bloc_gard:this._parseAndSelectRandomOne(u.bloc_gard),cookie:this._parseAndSelectRandomOne(u.cookie),gdpr:this._parseAndSelectRandomOne(u.gdpr),diagnostic:this._parseAndSelectRandomOne(u.diagnostic),cmp:this._parseAndSelectRandomOne(u.cmp),gft:this._parseAndSelectRandomOne(u.gft),sdk:this._parseAndSelectRandomOne(u.sdk)||{},loader:this._parseAndSelectRandomOne(u.loader)||{},splash:this._parseAndSelectRandomOne(u.splash)||{},promo:this._parseAndSelectRandomOne(u.promo)||{},dAds:this._parseAndSelectRandomOne(u.dads)||{},pAds:this._parseAndSelectRandomOne(u.pads)||{},mAds:this._parseAndSelectRandomOne(u.mads)||{},rAds:this._parseAndSelectRandomOne(u.rads)||{},lp:this._parseAndSelectRandomOne(u.lp)||{}},l=a.extendDefaults(C.default(r),c);l.afg_disabled=!1===(null===(s=l.sdk)||void 0===s||null===(o=s.afg)||void 0===o?void 0:o.enabled),console.log("gd:adp gameData.afgDisabled",l.afg_disabled),null!==(d=l.pAds)&&void 0!==d&&d.enabled&&(l.preroll=!0),this._bridge.noPreroll=(!this._getisMobile()||!1!==l.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(l),a.setDankLog(l.diagnostic),t(l)}else r.failed=!0,t(r)}.bind(this)).catch(function(e){k.default(this,n),r.failed=!0,t(r)}.bind(this))}.bind(this))}},{key:"_createSplash",value:(d=A.default(x.default.mark((function e(t,n){var r,i,s,o,d=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:r=e.sent,i=new r(tA(tA({},this.options),{},{isConsentDomain:n,version:Sy.version}),t,this._parentDomain),s=ib(),o=s.enabled,i.on("playClick",function(){var e=this;if(k.default(this,d),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this._hideCMPButton(),o?window.gdsdk.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.default(this,e),console.log("extsc: splash error",t),i.hide()}.bind(this)):this.showAd(a.AdType.Interstitial,{position:"preroll"}).catch(function(t){k.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(){k.default(this,d),i.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){k.default(this,d),i.hide()}.bind(this));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(o=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.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(tA(tA({},this.options),{},{isConsentDomain:n,version:Sy.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.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 o.apply(this,arguments)})},{key:"_createPromo",value:(s=A.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.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(tA(tA({},this.options),{},{isConsentDomain:n,version:Sy.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){k.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 s.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(a.AdType.Interstitial).catch(function(){k.default(this,e)}.bind(this))}},{key:"showAd",value:(i=A.default(x.default.mark((function e(t){var n,r=this,a=arguments;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},console.log("gd:adp, showAd izMaster,izToken",this._isMasterGameURL(),this._isTokenGameURL()),e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(a,i){var s,o,d,u,c,l,h,f,p,m,g,v=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,l={adType:t,params:n,adTimestamp:r.adRequestTimer},e.next=4,r.sdkReady;case 4:return h=e.sent,e.next=7,r.videoAdReady;case 7:return null!==(s=r._gameData.lp)&&void 0!==s&&s.load||r._sendLoadedEvent(),r._sendGamedockGamePlay(),r._rejectAdIfGameBlocked({gameData:h,adRequest:l}),r._rejectAdIfAdDisabled({gameData:h,adRequest:l}),r._rejectAdIfUnsupportedType({adRequest:l}),r._rejectAdIfRewardedDisabled({gameData:h,adRequest:l}),(null===(o=h.gft)||void 0===o||!o.enabled||null!==(d=h.gft)&&void 0!==d&&d.enabled&&(null==h||null===(u=h.gft)||void 0===u||null===(c=u.durations[r._giftCount])||void 0===c?void 0:c.after)!==r.adInstance.adMidrollCount)&&r._rejectAdIfAdRateHits({gameData:h,adRequest:l}),r.adInstance.attachAfgPosition(l),r._attachAfgFallback({gameData:h,adRequest:l}),f="main.showad",p=function(e){var t,n,a;k.default(this,v),r.eventBus.unsubscribeScope(f),r.onResumeGame(e.message,"warning"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(a=n.durations[r._giftCount])||void 0===a?void 0:a.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),i(e.message)}.bind(this),m=function(e){var t,n,i;k.default(this,v),r.eventBus.unsubscribeScope(f),r.adRequestTimer=Date.now(),r.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=h&&null!==(t=h.gft)&&void 0!==t&&t.enabled&&(null==h||null===(n=h.gft)||void 0===n||null===(i=n.durations[r._giftCount])||void 0===i?void 0:i.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),a(e.message)}.bind(this),g=function(e){var s=this;k.default(this,v),r.eventBus.unsubscribeScope(f),n.fallback_adsense=!1,r.showAd(t,tA(tA({},n),{},{adapter:"adsense"})).then(function(e){k.default(this,s),a(e)}.bind(this)).catch(function(e){k.default(this,s),i(e)}.bind(this))}.bind(this),r.eventBus.subscribe("AD_ERROR",null!=n&&n.fallback_adsense?g:p,f),r.eventBus.subscribe("AD_SDK_CANCELED",null!=n&&n.fallback_adsense?g:p,f),r.eventBus.subscribe("AD_SUCCESS",m,f),e.next=25,r.adInstance.startAd(l);case 25:r._post_message({topic:"adrequest.instream"}),e.next=32;break;case 28:e.prev=28,e.t0=e.catch(0),r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 32:case"end":return e.stop()}}),e,this,[[0,28]])})));return function(t,n){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"clearSession",value:function(){this.adInstance.clearSession()}},{key:"_attachAfgFallback",value:function(e){var t=e.gameData,n=e.adRequest;if(!t.afg_disabled&&!n.params.hasOwnProperty("fallback_adsense"))switch(n.params.position){case"preroll":case"start":case"next":n.params.fallback_adsense=!0}}},{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!==a.AdType.Interstitial&&t.adType!==a.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=a.AdType.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===a.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t,n,r,i,s,o,d=e.gameData,u=e.adRequest,c=null;u.adType===a.AdType.Interstitial&&null!==(t=d.diagnostic)&&void 0!==t&&null!==(n=t.useMidrollIndex)&&void 0!==n&&n.enabled&&this.adInstance.noPreroll?this.adInstance.adMidrollCount>(null===(r=d.diagnostic)||void 0===r||null===(i=r.useMidrollIndex)||void 0===i?void 0:i.indexes.length)-1||(c=6e4*(null===(s=d.diagnostic)||void 0===s||null===(o=s.useMidrollIndex)||void 0===o?void 0:o.indexes[this.adInstance.adMidrollCount])):c=d.midroll;if(u.adType===a.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<c)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=A.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(r,i){var s,o;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return s=e.sent,e.next=6,n.videoAdReady;case 6:if(!s.bloc_gard||!0!==s.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(s.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=a.AdType.Rewarded,e.next=16;break;case 14:if(t===a.AdType.Interstitial||t===a.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==a.AdType.Rewarded||s.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:o=e.sent,r(o),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),i(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=A.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=A.default(x.default.mark((function e(n,r){return x.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=A.default(x.default.mark((function n(r,a){var i;return x.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){var n;this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_START";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),this.adInstance&&this.adInstance._hideAddResume(),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Jw({event:"GameStarted",game:this._gameData})}},{key:"onPauseGame",value:function(e,t){var n;this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){a.dankLog("DEVELOPER_ERROR",e.message,"warning")}var r="SDK_GAME_PAUSE";this.eventBus.broadcast(r,{name:r,message:e,status:t,analytics:{category:"SDK",action:r,label:this.options.gameId+""}}),null===(n=this._gameData.evnts)||void 0===n||!n.enabled||this._isMasterGameURL()&&!this._isExtHostedGameURL()||Jw({event:"GamePaused",game:this._gameData})}},{key:"openConsole",value:function(){try{new a.ImplementationTest(this).start(),a.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(k.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){k.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;k.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 k.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 i=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:a.getParentUrl()),s=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:a.getParentDomain()),o=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===a.getIframeDepth()?s:a.getTopDomain()),d=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,p=(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:d,noLoadedEvent:u,noBlockerEvent:c,noPreroll:m,parentURL:i,parentDomain:s,topDomain:o&&o.length?o:s,noGAPageView:l,noLotamePageView:h,noGamedockSDK:f,noMinijuegosSDK:p,version:r.version,pauseGameOnStartup:g,depth:a.getIframeDepth(),domainMatched:s===o,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:"_isLoaderGameURL",value:function(){return/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i.test(location.href)&&location.href.startsWith("https://html5.gamedistribution.com")}},{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(y.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Lw(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=A.default(x.default.mark((function e(t){var n,r,a,i,s;return x.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 Cw(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(y.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(U.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=tA(tA({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return y.Base64.encode(JSON.stringify(e))}},{key:"_parseAndSelectRandomOne",value:function(e){var t=this._selectRandomOne("object"===E.default(e)?e:a.parseJSON(e));return t&&t.version?Sy.version>=t.version?t:void 0:t}},{key:"_selectRandomOne",value:function(e){var t=this;if(!tb(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){k.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=A.default(x.default.mark((function t(n,r){var a;return x.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 k.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)}}},{key:"decideToGiveAGift",value:function(){var e=this;try{var t,n=null===(t=this._gameData)||void 0===t?void 0:t.gft,r=setInterval(A.default(x.default.mark((function t(){var n=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.adInstance.requestRunning?console.log("Advertisement already running..."):(e.showAd(a.AdType.Interstitial,{position:"midroll"}).catch(function(e){k.default(this,n)}.bind(this)),clearInterval(r),e._giftCount++);case 1:case"end":return t.stop()}}),t,this)}))),1e3*n.durations[this._giftCount].wait)}catch(e){console.log("Advertisement Error...")}}}]),e}(),sA={},oA=function(e){try{if(sA.source){var t={type:"gd-sdk-on-event",event:e};sA.source.postMessage(t,sA.origin)}}catch(e){console.log("gd-sdk forwardEvent err",e)}},dA=function(){oA({name:"SDK_READY",status:"success",message:"Everything is ready."}),oA({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),oA({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},uA=function(e){console.log("gd:adp registerForForwarderPosts");window.addEventListener("message",(function(t){var n=t.data,r=t.origin,a=t.source,i=n.type,s=n.method,o=n.options;if("gd-sdk-self"===i){var d={type:"gd-sdk",method:s,options:o};return window.postMessage(d,"https://html5.gamedistribution.com"),void console.log("gd:adp after self post")}if("gd-sdk"===i){if(!sA.source&&"init"===s)return function(e){var t=e.source,n=e.origin;sA={source:t,origin:n}}({source:a,origin:r}),void dA();var u=e[s];u&&A.default(x.default.mark((function t(){var n;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!(n=u.apply(e,Object.values(o)))||!n.then){t.next=5;break}return t.next=5,n;case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("gd:adp:m:r onFrameMessage error",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))()}}),!1)},cA=function(e){!function(e){var t=e.onEvent;e.onEvent=function(e){oA(e),t.apply(this,arguments)}}(e);var t=new iA(e);return uA(t),t},lA={create:function(){var e=A.default(x.default.mark((function e(t){var n,r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fb(t);case 3:return n=e.sent,r=n?cb(t):cA(t),sb(),e.abrupt("return",r);case 9:return e.prev=9,e.t0=e.catch(0),console.log("gd:adp: sdk adaptor create failed, fallback to default adapter",e.t0),e.abrupt("return",cA(t));case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()};function hA(){return(hA=A.default(x.default.mark((function e(t,n){var r,a;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ub();case 2:if(r=e.sent,console.log("extsc: should wrapper be called?",r),!r){e.next=8;break}e.t0=window.gdsdk,e.next=11;break;case 8:return e.next=10,pA(t);case 10:e.t0=e.sent;case 11:return a=e.t0,e.abrupt("return",n(a));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fA=!1;function pA(e){var t=this;return new Promise(function(n,r){var a=this;if(k.default(this,t),nA)return n(nA);if(fA)var i=setInterval(function(){k.default(this,a),nA&&(fA=!1,clearInterval(i),n(nA))}.bind(this),100);else fA=!0,lA.create(e).then(function(e){k.default(this,a),console.log("sdk created!"),nA=e,e._sendSDKReady(),fA=!1,n(nA)}.bind(this))}.bind(this))}var mA,gA=(pA(mA=function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":E.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===E.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}()),{invoke:function(e){return function(e,t){return hA.apply(this,arguments)}(mA,e)}});function vA(){var e=this;this.AdType=a.AdType,this.preloadAd=function(e){var t=this;return gA.invoke(function(n){return k.default(this,t),n.preloadAd(e)}.bind(this))},this.showAd=function(){var e=A.default(x.default.mark((function e(t,n){var r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",gA.invoke(function(e){return k.default(this,r),t===a.AdType.Display?e.showDisplayAd(n):e.showAd(t)}.bind(this)));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),this.cancelAd=function(){var e=this;return gA.invoke(function(t){return k.default(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return gA.invoke(function(t){return k.default(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return gA.invoke(function(t){return k.default(this,e),t.session()}.bind(this))},this.leaderboard={show:function(){k.default(this,e),vm.showLeaderboard()}.bind(this),addScore:function(t){k.default(this,e),vm.addScore(t)}.bind(this)}}vA.prototype=new function(){this.showBanner=function(){var e=this;return gA.invoke(function(t){return k.default(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new vA,window.gdApi=window.gdsdk;