@bygd/gd-sdk-pes 1.27.8 → 1.27.9
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),E=_(n),k=_(r),x=_(i),S=_(s),D=_(o),T=_(d),R=_(u),O=_(l),C=_(c),I=_(h),P=_(f),L=_(p),M=_(v),j=_(g),U="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 U&&U)||Function("return this")(),G={},q=function(e){try{return!!e()}catch(e){return!0}},V=!q((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),F={},K={}.propertyIsEnumerable,W=Object.getOwnPropertyDescriptor,H=W&&!K.call({1:2},1);F.f=H?function(e){var t=W(this,e);return!!t&&t.enumerable}:K;var z=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},$={}.toString,Q=function(e){return $.call(e).slice(8,-1)},Y=Q,J="".split,X=q((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==Y(e)?J.call(e,""):Object(e)}:Object,Z=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},ee=X,te=Z,ne=function(e){return ee(te(e))},re=function(e){return"object"==typeof e?null!==e:"function"==typeof e},ae=re,ie=function(e,t){if(!ae(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!ae(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!ae(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!ae(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},se={}.hasOwnProperty,oe=function(e,t){return se.call(e,t)},de=re,ue=N.document,le=de(ue)&&de(ue.createElement),ce=function(e){return le?ue.createElement(e):{}},he=ce,fe=!V&&!q((function(){return 7!=Object.defineProperty(he("div"),"a",{get:function(){return 7}}).a})),pe=V,me=F,ve=z,ge=ne,ye=ie,be=oe,_e=fe,we=Object.getOwnPropertyDescriptor;G.f=pe?we:function(e,t){if(e=ge(e),t=ye(t,!0),_e)try{return we(e,t)}catch(e){}if(be(e,t))return ve(!me.f.call(e,t),e[t])};var Ae={},Ee=re,ke=function(e){if(!Ee(e))throw TypeError(String(e)+" is not an object");return e},xe=V,Se=fe,De=ke,Te=ie,Re=Object.defineProperty;Ae.f=xe?Re:function(e,t,n){if(De(e),t=Te(t,!0),De(n),Se)try{return Re(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Oe=Ae,Ce=z,Ie=V?function(e,t,n){return Oe.f(e,t,Ce(1,n))}:function(e,t,n){return e[t]=n,e},Pe={exports:{}},Le=N,Me=Ie,je=function(e,t){try{Me(Le,e,t)}catch(n){Le[e]=t}return t},Ue=je,Be=N["__core-js_shared__"]||Ue("__core-js_shared__",{}),Ne=Be,Ge=Function.toString;"function"!=typeof Ne.inspectSource&&(Ne.inspectSource=function(e){return Ge.call(e)});var qe=Ne.inspectSource,Ve=qe,Fe=N.WeakMap,Ke="function"==typeof Fe&&/native code/.test(Ve(Fe)),We={exports:{}},He=Be;(We.exports=function(e,t){return He[e]||(He[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var ze,$e,Qe,Ye=0,Je=Math.random(),Xe=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Ye+Je).toString(36)},Ze=We.exports,et=Xe,tt=Ze("keys"),nt=function(e){return tt[e]||(tt[e]=et(e))},rt={},at=Ke,it=re,st=Ie,ot=oe,dt=nt,ut=rt,lt=N.WeakMap;if(at){var ct=new lt,ht=ct.get,ft=ct.has,pt=ct.set;ze=function(e,t){return pt.call(ct,e,t),t},$e=function(e){return ht.call(ct,e)||{}},Qe=function(e){return ft.call(ct,e)}}else{var mt=dt("state");ut[mt]=!0,ze=function(e,t){return st(e,mt,t),t},$e=function(e){return ot(e,mt)?e[mt]:{}},Qe=function(e){return ot(e,mt)}}var vt={set:ze,get:$e,has:Qe,enforce:function(e){return Qe(e)?$e(e):ze(e,{})},getterFor:function(e){return function(t){var n;if(!it(t)||(n=$e(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},gt=N,yt=Ie,bt=oe,_t=je,wt=qe,At=vt.get,Et=vt.enforce,kt=String(String).split("String");(Pe.exports=function(e,t,n,r){var a=!!r&&!!r.unsafe,i=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||bt(n,"name")||yt(n,"name",t),Et(n).source=kt.join("string"==typeof t?t:"")),e!==gt?(a?!s&&e[t]&&(i=!0):delete e[t],i?e[t]=n:yt(e,t,n)):i?e[t]=n:_t(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&At(this).source||wt(this)}));var xt=N,St=xt,Dt=N,Tt=function(e){return"function"==typeof e?e:void 0},Rt=function(e,t){return arguments.length<2?Tt(St[e])||Tt(Dt[e]):St[e]&&St[e][t]||Dt[e]&&Dt[e][t]},Ot={},Ct=Math.ceil,It=Math.floor,Pt=function(e){return isNaN(e=+e)?0:(e>0?It:Ct)(e)},Lt=Pt,Mt=Math.min,jt=function(e){return e>0?Mt(Lt(e),9007199254740991):0},Ut=Pt,Bt=Math.max,Nt=Math.min,Gt=function(e,t){var n=Ut(e);return n<0?Bt(n+t,0):Nt(n,t)},qt=ne,Vt=jt,Ft=Gt,Kt=function(e){return function(t,n,r){var a,i=qt(t),s=Vt(i.length),o=Ft(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}},Wt={includes:Kt(!0),indexOf:Kt(!1)},Ht=oe,zt=ne,$t=Wt.indexOf,Qt=rt,Yt=function(e,t){var n,r=zt(e),a=0,i=[];for(n in r)!Ht(Qt,n)&&Ht(r,n)&&i.push(n);for(;t.length>a;)Ht(r,n=t[a++])&&(~$t(i,n)||i.push(n));return i},Jt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Xt=Yt,Zt=Jt.concat("length","prototype");Ot.f=Object.getOwnPropertyNames||function(e){return Xt(e,Zt)};var en={};en.f=Object.getOwnPropertySymbols;var tn=Ot,nn=en,rn=ke,an=Rt("Reflect","ownKeys")||function(e){var t=tn.f(rn(e)),n=nn.f;return n?t.concat(n(e)):t},sn=oe,on=an,dn=G,un=Ae,ln=function(e,t){for(var n=on(t),r=un.f,a=dn.f,i=0;i<n.length;i++){var s=n[i];sn(e,s)||r(e,s,a(t,s))}},cn=q,hn=/#|\.prototype\./,fn=function(e,t){var n=mn[pn(e)];return n==gn||n!=vn&&("function"==typeof t?cn(t):!!t)},pn=fn.normalize=function(e){return String(e).replace(hn,".").toLowerCase()},mn=fn.data={},vn=fn.NATIVE="N",gn=fn.POLYFILL="P",yn=fn,bn=N,_n=G.f,wn=Ie,An=Pe.exports,En=je,kn=ln,xn=yn,Sn=function(e,t){var n,r,a,i,s,o=e.target,d=e.global,u=e.stat;if(n=d?bn:u?bn[o]||En(o,{}):(bn[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=_n(n,r))&&s.value:n[r],!xn(d?r:o+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;kn(i,a)}(e.sham||a&&a.sham)&&wn(i,"sham",!0),An(n,r,i,e)}},Dn=Z,Tn=function(e){return Object(Dn(e))},Rn=Yt,On=Jt,Cn=Object.keys||function(e){return Rn(e,On)},In=Tn,Pn=Cn;Sn({target:"Object",stat:!0,forced:q((function(){Pn(1)}))},{keys:function(e){return Pn(In(e))}});var Ln,Mn=q,jn=!!Object.getOwnPropertySymbols&&!Mn((function(){return!String(Symbol())})),Un=jn&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Bn=Q,Nn=Array.isArray||function(e){return"Array"==Bn(e)},Gn=Ae,qn=ke,Vn=Cn,Fn=V?Object.defineProperties:function(e,t){qn(e);for(var n,r=Vn(t),a=r.length,i=0;a>i;)Gn.f(e,n=r[i++],t[n]);return e},Kn=Rt("document","documentElement"),Wn=ke,Hn=Fn,zn=Jt,$n=rt,Qn=Kn,Yn=ce,Jn=nt("IE_PROTO"),Xn=function(){},Zn=function(e){return"<script>"+e+"<\/script>"},er=function(){try{Ln=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;er=Ln?function(e){e.write(Zn("")),e.close();var t=e.parentWindow.Object;return e=null,t}(Ln):((t=Yn("iframe")).style.display="none",Qn.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Zn("document.F=Object")),e.close(),e.F);for(var n=zn.length;n--;)delete er.prototype[zn[n]];return er()};$n[Jn]=!0;var tr=Object.create||function(e,t){var n;return null!==e?(Xn.prototype=Wn(e),n=new Xn,Xn.prototype=null,n[Jn]=e):n=er(),void 0===t?n:Hn(n,t)},nr={},rr=ne,ar=Ot.f,ir={}.toString,sr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];nr.f=function(e){return sr&&"[object Window]"==ir.call(e)?function(e){try{return ar(e)}catch(e){return sr.slice()}}(e):ar(rr(e))};var or=N,dr=We.exports,ur=oe,lr=Xe,cr=jn,hr=Un,fr=dr("wks"),pr=or.Symbol,mr=hr?pr:pr&&pr.withoutSetter||lr,vr=function(e){return ur(fr,e)||(cr&&ur(pr,e)?fr[e]=pr[e]:fr[e]=mr("Symbol."+e)),fr[e]},gr={},yr=vr;gr.f=yr;var br=xt,_r=oe,wr=gr,Ar=Ae.f,Er=function(e){var t=br.Symbol||(br.Symbol={});_r(t,e)||Ar(t,e,{value:wr.f(e)})},kr=Ae.f,xr=oe,Sr=vr("toStringTag"),Dr=function(e,t,n){e&&!xr(e=n?e:e.prototype,Sr)&&kr(e,Sr,{configurable:!0,value:t})},Tr=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Rr=Tr,Or=function(e,t,n){if(Rr(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}},Cr=re,Ir=Nn,Pr=vr("species"),Lr=function(e,t){var n;return Ir(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!Ir(n.prototype)?Cr(n)&&null===(n=n[Pr])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},Mr=Or,jr=X,Ur=Tn,Br=jt,Nr=Lr,Gr=[].push,qr=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=5==e||i;return function(o,d,u,l){for(var c,h,f=Ur(o),p=jr(f),m=Mr(d,u,3),v=Br(p.length),g=0,y=l||Nr,b=t?y(o,v):n?y(o,0):void 0;v>g;g++)if((s||g in p)&&(h=m(c=p[g],g,f),e))if(t)b[g]=h;else if(h)switch(e){case 3:return!0;case 5:return c;case 6:return g;case 2:Gr.call(b,c)}else if(a)return!1;return i?-1:r||a?a:b}},Vr={forEach:qr(0),map:qr(1),filter:qr(2),some:qr(3),every:qr(4),find:qr(5),findIndex:qr(6)},Fr=Sn,Kr=N,Wr=Rt,Hr=V,zr=jn,$r=Un,Qr=q,Yr=oe,Jr=Nn,Xr=re,Zr=ke,ea=Tn,ta=ne,na=ie,ra=z,aa=tr,ia=Cn,sa=Ot,oa=nr,da=en,ua=G,la=Ae,ca=F,ha=Ie,fa=Pe.exports,pa=We.exports,ma=rt,va=Xe,ga=vr,ya=gr,ba=Er,_a=Dr,wa=vt,Aa=Vr.forEach,Ea=nt("hidden"),ka=ga("toPrimitive"),xa=wa.set,Sa=wa.getterFor("Symbol"),Da=Object.prototype,Ta=Kr.Symbol,Ra=Wr("JSON","stringify"),Oa=ua.f,Ca=la.f,Ia=oa.f,Pa=ca.f,La=pa("symbols"),Ma=pa("op-symbols"),ja=pa("string-to-symbol-registry"),Ua=pa("symbol-to-string-registry"),Ba=pa("wks"),Na=Kr.QObject,Ga=!Na||!Na.prototype||!Na.prototype.findChild,qa=Hr&&Qr((function(){return 7!=aa(Ca({},"a",{get:function(){return Ca(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Oa(Da,t);r&&delete Da[t],Ca(e,t,n),r&&e!==Da&&Ca(Da,t,r)}:Ca,Va=function(e,t){var n=La[e]=aa(Ta.prototype);return xa(n,{type:"Symbol",tag:e,description:t}),Hr||(n.description=t),n},Fa=$r?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Ta},Ka=function(e,t,n){e===Da&&Ka(Ma,t,n),Zr(e);var r=na(t,!0);return Zr(n),Yr(La,r)?(n.enumerable?(Yr(e,Ea)&&e[Ea][r]&&(e[Ea][r]=!1),n=aa(n,{enumerable:ra(0,!1)})):(Yr(e,Ea)||Ca(e,Ea,ra(1,{})),e[Ea][r]=!0),qa(e,r,n)):Ca(e,r,n)},Wa=function(e,t){Zr(e);var n=ta(t),r=ia(n).concat(Qa(n));return Aa(r,(function(t){Hr&&!Ha.call(n,t)||Ka(e,t,n[t])})),e},Ha=function(e){var t=na(e,!0),n=Pa.call(this,t);return!(this===Da&&Yr(La,t)&&!Yr(Ma,t))&&(!(n||!Yr(this,t)||!Yr(La,t)||Yr(this,Ea)&&this[Ea][t])||n)},za=function(e,t){var n=ta(e),r=na(t,!0);if(n!==Da||!Yr(La,r)||Yr(Ma,r)){var a=Oa(n,r);return!a||!Yr(La,r)||Yr(n,Ea)&&n[Ea][r]||(a.enumerable=!0),a}},$a=function(e){var t=Ia(ta(e)),n=[];return Aa(t,(function(e){Yr(La,e)||Yr(ma,e)||n.push(e)})),n},Qa=function(e){var t=e===Da,n=Ia(t?Ma:ta(e)),r=[];return Aa(n,(function(e){!Yr(La,e)||t&&!Yr(Da,e)||r.push(La[e])})),r};(zr||(fa((Ta=function(){if(this instanceof Ta)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=va(e),n=function(e){this===Da&&n.call(Ma,e),Yr(this,Ea)&&Yr(this[Ea],t)&&(this[Ea][t]=!1),qa(this,t,ra(1,e))};return Hr&&Ga&&qa(Da,t,{configurable:!0,set:n}),Va(t,e)}).prototype,"toString",(function(){return Sa(this).tag})),fa(Ta,"withoutSetter",(function(e){return Va(va(e),e)})),ca.f=Ha,la.f=Ka,ua.f=za,sa.f=oa.f=$a,da.f=Qa,ya.f=function(e){return Va(ga(e),e)},Hr&&(Ca(Ta.prototype,"description",{configurable:!0,get:function(){return Sa(this).description}}),fa(Da,"propertyIsEnumerable",Ha,{unsafe:!0}))),Fr({global:!0,wrap:!0,forced:!zr,sham:!zr},{Symbol:Ta}),Aa(ia(Ba),(function(e){ba(e)})),Fr({target:"Symbol",stat:!0,forced:!zr},{for:function(e){var t=String(e);if(Yr(ja,t))return ja[t];var n=Ta(t);return ja[t]=n,Ua[n]=t,n},keyFor:function(e){if(!Fa(e))throw TypeError(e+" is not a symbol");if(Yr(Ua,e))return Ua[e]},useSetter:function(){Ga=!0},useSimple:function(){Ga=!1}}),Fr({target:"Object",stat:!0,forced:!zr,sham:!Hr},{create:function(e,t){return void 0===t?aa(e):Wa(aa(e),t)},defineProperty:Ka,defineProperties:Wa,getOwnPropertyDescriptor:za}),Fr({target:"Object",stat:!0,forced:!zr},{getOwnPropertyNames:$a,getOwnPropertySymbols:Qa}),Fr({target:"Object",stat:!0,forced:Qr((function(){da.f(1)}))},{getOwnPropertySymbols:function(e){return da.f(ea(e))}}),Ra)&&Fr({target:"JSON",stat:!0,forced:!zr||Qr((function(){var e=Ta();return"[null]"!=Ra([e])||"{}"!=Ra({a:e})||"{}"!=Ra(Object(e))}))},{stringify:function(e,t,n){for(var r,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(r=t,(Xr(t)||void 0!==e)&&!Fa(e))return Jr(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!Fa(t))return t}),a[1]=t,Ra.apply(null,a)}});Ta.prototype[ka]||ha(Ta.prototype,ka,Ta.prototype.valueOf),_a(Ta,"Symbol"),ma[Ea]=!0;var Ya,Ja,Xa=Rt("navigator","userAgent")||"",Za=Xa,ei=N.process,ti=ei&&ei.versions,ni=ti&&ti.v8;ni?Ja=(Ya=ni.split("."))[0]+Ya[1]:Za&&(!(Ya=Za.match(/Edge\/(\d+)/))||Ya[1]>=74)&&(Ya=Za.match(/Chrome\/(\d+)/))&&(Ja=Ya[1]);var ri=Ja&&+Ja,ai=q,ii=ri,si=vr("species"),oi=function(e){return ii>=51||!ai((function(){var t=[];return(t.constructor={})[si]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},di=V,ui=q,li=oe,ci=Object.defineProperty,hi={},fi=function(e){throw e},pi=function(e,t){if(li(hi,e))return hi[e];t||(t={});var n=[][e],r=!!li(t,"ACCESSORS")&&t.ACCESSORS,a=li(t,0)?t[0]:fi,i=li(t,1)?t[1]:void 0;return hi[e]=!!n&&!ui((function(){if(r&&!di)return!0;var e={length:-1};r?ci(e,1,{enumerable:!0,get:fi}):e[1]=1,n.call(e,a,i)}))},mi=Sn,vi=Vr.filter,gi=pi,yi=oi("filter"),bi=gi("filter");mi({target:"Array",proto:!0,forced:!yi||!bi},{filter:function(e){return vi(this,e,arguments.length>1?arguments[1]:void 0)}});var _i=Sn,wi=q,Ai=ne,Ei=G.f,ki=V,xi=wi((function(){Ei(1)}));_i({target:"Object",stat:!0,forced:!ki||xi,sham:!ki},{getOwnPropertyDescriptor:function(e,t){return Ei(Ai(e),t)}});var Si={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},Di=q,Ti=Vr.forEach,Ri=pi,Oi=function(e,t){var n=[][e];return!!n&&Di((function(){n.call(null,t||function(){throw 1},1)}))}("forEach"),Ci=Ri("forEach"),Ii=N,Pi=Si,Li=Oi&&Ci?[].forEach:function(e){return Ti(this,e,arguments.length>1?arguments[1]:void 0)},Mi=Ie;for(var ji in Pi){var Ui=Ii[ji],Bi=Ui&&Ui.prototype;if(Bi&&Bi.forEach!==Li)try{Mi(Bi,"forEach",Li)}catch(e){Bi.forEach=Li}}var Ni=ie,Gi=Ae,qi=z,Vi=function(e,t,n){var r=Ni(t);r in e?Gi.f(e,r,qi(0,n)):e[r]=n},Fi=an,Ki=ne,Wi=G,Hi=Vi;Sn({target:"Object",stat:!0,sham:!V},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Ki(e),a=Wi.f,i=Fi(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&Hi(s,t,n);return s}});var zi=Sn,$i=re,Qi=Nn,Yi=Gt,Ji=jt,Xi=ne,Zi=Vi,es=vr,ts=pi,ns=oi("slice"),rs=ts("slice",{ACCESSORS:!0,0:0,1:2}),as=es("species"),is=[].slice,ss=Math.max;zi({target:"Array",proto:!0,forced:!ns||!rs},{slice:function(e,t){var n,r,a,i=Xi(this),s=Ji(i.length),o=Yi(e,s),d=Yi(void 0===t?s:t,s);if(Qi(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Qi(n.prototype)?$i(n)&&null===(n=n[as])&&(n=void 0):n=void 0,n===Array||void 0===n))return is.call(i,o,d);for(r=new(void 0===n?Array:n)(ss(d-o,0)),a=0;o<d;o++,a++)o in i&&Zi(r,a,i[o]);return r.length=a,r}});var os=ke,ds=function(e,t,n,r){try{return r?t(os(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&os(a.call(e)),t}},us={},ls=us,cs=vr("iterator"),hs=Array.prototype,fs=function(e){return void 0!==e&&(ls.Array===e||hs[cs]===e)},ps={};ps[vr("toStringTag")]="z";var ms="[object z]"===String(ps),vs=ms,gs=Q,ys=vr("toStringTag"),bs="Arguments"==gs(function(){return arguments}()),_s=vs?gs:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),ys))?n:bs?gs(t):"Object"==(r=gs(t))&&"function"==typeof t.callee?"Arguments":r},ws=_s,As=us,Es=vr("iterator"),ks=function(e){if(null!=e)return e[Es]||e["@@iterator"]||As[ws(e)]},xs=Or,Ss=Tn,Ds=ds,Ts=fs,Rs=jt,Os=Vi,Cs=ks,Is=vr("iterator"),Ps=!1;try{var Ls=0,Ms={next:function(){return{done:!!Ls++}},return:function(){Ps=!0}};Ms[Is]=function(){return this},Array.from(Ms,(function(){throw 2}))}catch(e){}var js=function(e,t){if(!t&&!Ps)return!1;var n=!1;try{var r={};r[Is]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Us=function(e){var t,n,r,a,i,s,o=Ss(e),d="function"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,c=void 0!==l,h=Cs(o),f=0;if(c&&(l=xs(l,u>2?arguments[2]:void 0,2)),null==h||d==Array&&Ts(h))for(n=new d(t=Rs(o.length));t>f;f++)s=c?l(o[f],f):o[f],Os(n,f,s);else for(i=(a=h.call(o)).next,n=new d;!(r=i.call(a)).done;f++)s=c?Ds(a,l,[r.value,f],!0):r.value,Os(n,f,s);return n.length=f,n};Sn({target:"Array",stat:!0,forced:!js((function(e){Array.from(e)}))},{from:Us});var Bs,Ns,Gs,qs=Pt,Vs=Z,Fs=function(e){return function(t,n){var r,a,i=String(Vs(t)),s=qs(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=i.charCodeAt(s))<55296||r>56319||s+1===o||(a=i.charCodeAt(s+1))<56320||a>57343?e?i.charAt(s):r:e?i.slice(s,s+2):a-56320+(r-55296<<10)+65536}},Ks={codeAt:Fs(!1),charAt:Fs(!0)},Ws=!q((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Hs=oe,zs=Tn,$s=Ws,Qs=nt("IE_PROTO"),Ys=Object.prototype,Js=$s?Object.getPrototypeOf:function(e){return e=zs(e),Hs(e,Qs)?e[Qs]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Ys:null},Xs=Js,Zs=Ie,eo=oe,to=vr("iterator"),no=!1;[].keys&&("next"in(Gs=[].keys())?(Ns=Xs(Xs(Gs)))!==Object.prototype&&(Bs=Ns):no=!0),null==Bs&&(Bs={}),eo(Bs,to)||Zs(Bs,to,(function(){return this}));var ro={IteratorPrototype:Bs,BUGGY_SAFARI_ITERATORS:no},ao=ro.IteratorPrototype,io=tr,so=z,oo=Dr,uo=us,lo=function(){return this},co=re,ho=ke,fo=function(e){if(!co(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},po=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return ho(n),fo(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),mo=Sn,vo=function(e,t,n){var r=t+" Iterator";return e.prototype=io(ao,{next:so(1,n)}),oo(e,r,!1),uo[r]=lo,e},go=Js,yo=po,bo=Dr,_o=Ie,wo=Pe.exports,Ao=us,Eo=ro.IteratorPrototype,ko=ro.BUGGY_SAFARI_ITERATORS,xo=vr("iterator"),So=function(){return this},Do=function(e,t,n,r,a,i,s){vo(n,t,r);var o,d,u,l=function(e){if(e===a&&m)return m;if(!ko&&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[xo]||f["@@iterator"]||a&&f[a],m=!ko&&p||l(a),v="Array"==t&&f.entries||p;if(v&&(o=go(v.call(new e)),Eo!==Object.prototype&&o.next&&(go(o)!==Eo&&(yo?yo(o,Eo):"function"!=typeof o[xo]&&_o(o,xo,So)),bo(o,c,!0))),"values"==a&&p&&"values"!==p.name&&(h=!0,m=function(){return p.call(this)}),f[xo]!==m&&_o(f,xo,m),Ao[t]=m,a)if(d={values:l("values"),keys:i?m:l("keys"),entries:l("entries")},s)for(u in d)(ko||h||!(u in f))&&wo(f,u,d[u]);else mo({target:t,proto:!0,forced:ko||h},d);return d},To=Ks.charAt,Ro=vt,Oo=Do,Co=Ro.set,Io=Ro.getterFor("String Iterator");Oo(String,"String",(function(e){Co(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Io(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=To(n,r),t.index+=e.length,{value:e,done:!1})}));var Po=Sn,Lo=V,Mo=N,jo=oe,Uo=re,Bo=Ae.f,No=ln,Go=Mo.Symbol;if(Lo&&"function"==typeof Go&&(!("description"in Go.prototype)||void 0!==Go().description)){var qo={},Vo=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Vo?new Go(e):void 0===e?Go():Go(e);return""===e&&(qo[t]=!0),t};No(Vo,Go);var Fo=Vo.prototype=Go.prototype;Fo.constructor=Vo;var Ko=Fo.toString,Wo="Symbol(test)"==String(Go("test")),Ho=/^Symbol\((.*)\)[^)]+$/;Bo(Fo,"description",{configurable:!0,get:function(){var e=Uo(this)?this.valueOf():this,t=Ko.call(e);if(jo(qo,e))return"";var n=Wo?t.slice(7,-1):t.replace(Ho,"$1");return""===n?void 0:n}}),Po({global:!0,forced:!0},{Symbol:Vo})}Er("iterator");var zo=tr,$o=Ae,Qo=vr("unscopables"),Yo=Array.prototype;null==Yo[Qo]&&$o.f(Yo,Qo,{configurable:!0,value:zo(null)});var Jo=function(e){Yo[Qo][e]=!0},Xo=ne,Zo=Jo,ed=us,td=vt,nd=Do,rd=td.set,ad=td.getterFor("Array Iterator"),id=nd(Array,"Array",(function(e,t){rd(this,{type:"Array Iterator",target:Xo(e),index:0,kind:t})}),(function(){var e=ad(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");ed.Arguments=ed.Array,Zo("keys"),Zo("values"),Zo("entries");var sd=N,od=Si,dd=id,ud=Ie,ld=vr,cd=ld("iterator"),hd=ld("toStringTag"),fd=dd.values;for(var pd in od){var md=sd[pd],vd=md&&md.prototype;if(vd){if(vd[cd]!==fd)try{ud(vd,cd,fd)}catch(e){vd[cd]=fd}if(vd[hd]||ud(vd,hd,pd),od[pd])for(var gd in dd)if(vd[gd]!==dd[gd])try{ud(vd,gd,dd[gd])}catch(e){vd[gd]=dd[gd]}}}var yd=_s,bd=ms?{}.toString:function(){return"[object "+yd(this)+"]"},_d=ms,wd=Pe.exports,Ad=bd;_d||wd(Object.prototype,"toString",Ad,{unsafe:!0});var Ed=N.Promise,kd=Pe.exports,xd=Rt,Sd=Ae,Dd=V,Td=vr("species"),Rd=function(e){var t=xd(e),n=Sd.f;Dd&&t&&!t[Td]&&n(t,Td,{configurable:!0,get:function(){return this}})},Od={exports:{}},Cd=ke,Id=fs,Pd=jt,Ld=Or,Md=ks,jd=ds,Ud=function(e,t){this.stopped=e,this.result=t};(Od.exports=function(e,t,n,r,a){var i,s,o,d,u,l,c,h=Ld(t,n,r?2:1);if(a)i=e;else{if("function"!=typeof(s=Md(e)))throw TypeError("Target is not iterable");if(Id(s)){for(o=0,d=Pd(e.length);d>o;o++)if((u=r?h(Cd(c=e[o])[0],c[1]):h(e[o]))&&u instanceof Ud)return u;return new Ud(!1)}i=s.call(e)}for(l=i.next;!(c=l.call(i)).done;)if("object"==typeof(u=jd(i,h,c.value,r))&&u&&u instanceof Ud)return u;return new Ud(!1)}).stop=function(e){return new Ud(!0,e)};var Bd,Nd,Gd,qd=ke,Vd=Tr,Fd=vr("species"),Kd=function(e,t){var n,r=qd(e).constructor;return void 0===r||null==(n=qd(r)[Fd])?t:Vd(n)},Wd=/(iphone|ipod|ipad).*applewebkit/i.test(Xa),Hd=N,zd=q,$d=Q,Qd=Or,Yd=Kn,Jd=ce,Xd=Wd,Zd=Hd.location,eu=Hd.setImmediate,tu=Hd.clearImmediate,nu=Hd.process,ru=Hd.MessageChannel,au=Hd.Dispatch,iu=0,su={},ou=function(e){if(su.hasOwnProperty(e)){var t=su[e];delete su[e],t()}},du=function(e){return function(){ou(e)}},uu=function(e){ou(e.data)},lu=function(e){Hd.postMessage(e+"",Zd.protocol+"//"+Zd.host)};eu&&tu||(eu=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return su[++iu]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Bd(iu),iu},tu=function(e){delete su[e]},"process"==$d(nu)?Bd=function(e){nu.nextTick(du(e))}:au&&au.now?Bd=function(e){au.now(du(e))}:ru&&!Xd?(Gd=(Nd=new ru).port2,Nd.port1.onmessage=uu,Bd=Qd(Gd.postMessage,Gd,1)):!Hd.addEventListener||"function"!=typeof postMessage||Hd.importScripts||zd(lu)||"file:"===Zd.protocol?Bd="onreadystatechange"in Jd("script")?function(e){Yd.appendChild(Jd("script")).onreadystatechange=function(){Yd.removeChild(this),ou(e)}}:function(e){setTimeout(du(e),0)}:(Bd=lu,Hd.addEventListener("message",uu,!1)));var cu,hu,fu,pu,mu,vu,gu,yu,bu={set:eu,clear:tu},_u=N,wu=G.f,Au=Q,Eu=bu.set,ku=Wd,xu=_u.MutationObserver||_u.WebKitMutationObserver,Su=_u.process,Du=_u.Promise,Tu="process"==Au(Su),Ru=wu(_u,"queueMicrotask"),Ou=Ru&&Ru.value;Ou||(cu=function(){var e,t;for(Tu&&(e=Su.domain)&&e.exit();hu;){t=hu.fn,hu=hu.next;try{t()}catch(e){throw hu?pu():fu=void 0,e}}fu=void 0,e&&e.enter()},Tu?pu=function(){Su.nextTick(cu)}:xu&&!ku?(mu=!0,vu=document.createTextNode(""),new xu(cu).observe(vu,{characterData:!0}),pu=function(){vu.data=mu=!mu}):Du&&Du.resolve?(gu=Du.resolve(void 0),yu=gu.then,pu=function(){yu.call(gu,cu)}):pu=function(){Eu.call(_u,cu)});var Cu=Ou||function(e){var t={fn:e,next:void 0};fu&&(fu.next=t),hu||(hu=t,pu()),fu=t},Iu={},Pu=Tr,Lu=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=Pu(t),this.reject=Pu(n)};Iu.f=function(e){return new Lu(e)};var Mu,ju,Uu,Bu,Nu=ke,Gu=re,qu=Iu,Vu=function(e,t){if(Nu(e),Gu(t)&&t.constructor===e)return t;var n=qu.f(e);return(0,n.resolve)(t),n.promise},Fu=N,Ku=Sn,Wu=N,Hu=Rt,zu=Ed,$u=Pe.exports,Qu=function(e,t,n){for(var r in t)kd(e,r,t[r],n);return e},Yu=Dr,Ju=Rd,Xu=re,Zu=Tr,el=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},tl=Q,nl=qe,rl=Od.exports,al=js,il=Kd,sl=bu.set,ol=Cu,dl=Vu,ul=function(e,t){var n=Fu.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},ll=Iu,cl=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},hl=vt,fl=yn,pl=ri,ml=vr("species"),vl="Promise",gl=hl.get,yl=hl.set,bl=hl.getterFor(vl),_l=zu,wl=Wu.TypeError,Al=Wu.document,El=Wu.process,kl=Hu("fetch"),xl=ll.f,Sl=xl,Dl="process"==tl(El),Tl=!!(Al&&Al.createEvent&&Wu.dispatchEvent),Rl=fl(vl,(function(){if(!(nl(_l)!==String(_l))){if(66===pl)return!0;if(!Dl&&"function"!=typeof PromiseRejectionEvent)return!0}if(pl>=51&&/native code/.test(_l))return!1;var e=_l.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[ml]=t,!(e.then((function(){}))instanceof t)})),Ol=Rl||!al((function(e){_l.all(e).catch((function(){}))})),Cl=function(e){var t;return!(!Xu(e)||"function"!=typeof(t=e.then))&&t},Il=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;ol((function(){for(var a=t.value,i=1==t.state,s=0;r.length>s;){var o,d,u,l=r[s++],c=i?l.ok:l.fail,h=l.resolve,f=l.reject,p=l.domain;try{c?(i||(2===t.rejection&&jl(e,t),t.rejection=1),!0===c?o=a:(p&&p.enter(),o=c(a),p&&(p.exit(),u=!0)),o===l.promise?f(wl("Promise-chain cycle")):(d=Cl(o))?d.call(o,h,f):h(o)):f(a)}catch(e){p&&!u&&p.exit(),f(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Ll(e,t)}))}},Pl=function(e,t,n){var r,a;Tl?((r=Al.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Wu.dispatchEvent(r)):r={promise:t,reason:n},(a=Wu["on"+e])?a(r):"unhandledrejection"===e&&ul("Unhandled promise rejection",n)},Ll=function(e,t){sl.call(Wu,(function(){var n,r=t.value;if(Ml(t)&&(n=cl((function(){Dl?El.emit("unhandledRejection",r,e):Pl("unhandledrejection",e,r)})),t.rejection=Dl||Ml(t)?2:1,n.error))throw n.value}))},Ml=function(e){return 1!==e.rejection&&!e.parent},jl=function(e,t){sl.call(Wu,(function(){Dl?El.emit("rejectionHandled",e):Pl("rejectionhandled",e,t.value)}))},Ul=function(e,t,n,r){return function(a){e(t,n,a,r)}},Bl=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,Il(e,t,!0))},Nl=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw wl("Promise can't be resolved itself");var a=Cl(n);a?ol((function(){var r={done:!1};try{a.call(n,Ul(Nl,e,r,t),Ul(Bl,e,r,t))}catch(n){Bl(e,r,n,t)}})):(t.value=n,t.state=1,Il(e,t,!1))}catch(n){Bl(e,{done:!1},n,t)}}};Rl&&(_l=function(e){el(this,_l,vl),Zu(e),Mu.call(this);var t=gl(this);try{e(Ul(Nl,this,t),Ul(Bl,this,t))}catch(e){Bl(this,t,e)}},(Mu=function(e){yl(this,{type:vl,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Qu(_l.prototype,{then:function(e,t){var n=bl(this),r=xl(il(this,_l));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Dl?El.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Il(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),ju=function(){var e=new Mu,t=gl(e);this.promise=e,this.resolve=Ul(Nl,e,t),this.reject=Ul(Bl,e,t)},ll.f=xl=function(e){return e===_l||e===Uu?new ju(e):Sl(e)},"function"==typeof zu&&(Bu=zu.prototype.then,$u(zu.prototype,"then",(function(e,t){var n=this;return new _l((function(e,t){Bu.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof kl&&Ku({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return dl(_l,kl.apply(Wu,arguments))}}))),Ku({global:!0,wrap:!0,forced:Rl},{Promise:_l}),Yu(_l,vl,!1),Ju(vl),Uu=Hu(vl),Ku({target:vl,stat:!0,forced:Rl},{reject:function(e){var t=xl(this);return t.reject.call(void 0,e),t.promise}}),Ku({target:vl,stat:!0,forced:Rl},{resolve:function(e){return dl(this,e)}}),Ku({target:vl,stat:!0,forced:Ol},{all:function(e){var t=this,n=xl(t),r=n.resolve,a=n.reject,i=cl((function(){var n=Zu(t.resolve),i=[],s=0,o=1;rl(e,(function(e){var d=s++,u=!1;i.push(void 0),o++,n.call(t,e).then((function(e){u||(u=!0,i[d]=e,--o||r(i))}),a)})),--o||r(i)}));return i.error&&a(i.value),n.promise},race:function(e){var t=this,n=xl(t),r=n.reject,a=cl((function(){var a=Zu(t.resolve);rl(e,(function(e){a.call(t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var Gl=Sn,ql=q,Vl=Nn,Fl=re,Kl=Tn,Wl=jt,Hl=Vi,zl=Lr,$l=oi,Ql=ri,Yl=vr("isConcatSpreadable"),Jl=Ql>=51||!ql((function(){var e=[];return e[Yl]=!1,e.concat()[0]!==e})),Xl=$l("concat"),Zl=function(e){if(!Fl(e))return!1;var t=e[Yl];return void 0!==t?!!t:Vl(e)};Gl({target:"Array",proto:!0,forced:!Jl||!Xl},{concat:function(e){var t,n,r,a,i,s=Kl(this),o=zl(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Zl(i=-1===t?s:arguments[t])){if(d+(a=Wl(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,d++)n in i&&Hl(o,d,i[n])}else{if(d>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Hl(o,d++,i)}return o.length=d,o}});var ec=V,tc=Ae.f,nc=Function.prototype,rc=nc.toString,ac=/^\s*function ([^ (]*)/;function ic(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 sc(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 sc(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 sc(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 oc(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 dc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oc(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}ec&&!("name"in nc)&&tc(nc,"name",{configurable:!0,get:function(){try{return rc.call(this).match(ac)[1]}catch(e){return""}}});var uc={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"}},lc={},cc=function(e,t){lc[e]=dc(dc({},t),{},{isLoading:!1})},hc=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))},fc=function(){var e=w.default(k.default.mark((function e(t){var n,r,a,i,s,o,d,u;return k.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=lc[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=ic(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=uc[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,hc({id:s,src:uc[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,hc({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)}}(),pc=new function e(){var t=this;x.default(this,e),S.default(this,"load",w.default(k.default.mark((function e(){return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fc("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),S.default(this,"showLeaderboard",function(){var e=w.default(k.default.mark((function e(n){var r;return k.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(k.default.mark((function e(n){return k.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"]},cc(this.moduleName,this.moduleConfig)},mc=ke,vc=function(){var e=mc(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},gc={},yc=q;function bc(e,t){return RegExp(e,t)}gc.UNSUPPORTED_Y=yc((function(){var e=bc("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),gc.BROKEN_CARET=yc((function(){var e=bc("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var _c=vc,wc=gc,Ac=RegExp.prototype.exec,Ec=String.prototype.replace,kc=Ac,xc=function(){var e=/a/,t=/b*/g;return Ac.call(e,"a"),Ac.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Sc=wc.UNSUPPORTED_Y||wc.BROKEN_CARET,Dc=void 0!==/()??/.exec("")[1];(xc||Dc||Sc)&&(kc=function(e){var t,n,r,a,i=this,s=Sc&&i.sticky,o=_c.call(i),d=i.source,u=0,l=e;return s&&(-1===(o=o.replace("y","")).indexOf("g")&&(o+="g"),l=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(d="(?: "+d+")",l=" "+l,u++),n=new RegExp("^(?:"+d+")",o)),Dc&&(n=new RegExp("^"+d+"$(?!\\s)",o)),xc&&(t=i.lastIndex),r=Ac.call(s?n:i,l),s?r?(r.input=r.input.slice(u),r[0]=r[0].slice(u),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:xc&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),Dc&&r&&r.length>1&&Ec.call(r[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r});var Tc=kc;Sn({target:"RegExp",proto:!0,forced:/./.exec!==Tc},{exec:Tc});var Rc=Pe.exports,Oc=q,Cc=vr,Ic=Tc,Pc=Ie,Lc=Cc("species"),Mc=!Oc((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),jc="$0"==="a".replace(/./,"$0"),Uc=Cc("replace"),Bc=!!/./[Uc]&&""===/./[Uc]("a","$0"),Nc=!Oc((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]})),Gc=function(e,t,n,r){var a=Cc(e),i=!Oc((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!Oc((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Lc]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||"replace"===e&&(!Mc||!jc||Bc)||"split"===e&&!Nc){var o=/./[a],d=n(a,""[e],(function(e,t,n,r,a){return t.exec===Ic?i&&!a?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:jc,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Bc}),u=d[0],l=d[1];Rc(String.prototype,e,u),Rc(RegExp.prototype,a,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}r&&Pc(RegExp.prototype[a],"sham",!0)},qc=Ks.charAt,Vc=function(e,t,n){return t+(n?qc(e,t).length:1)},Fc=Q,Kc=Tc,Wc=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Fc(e))throw TypeError("RegExp#exec called on incompatible receiver");return Kc.call(e,t)},Hc=Gc,zc=ke,$c=Tn,Qc=jt,Yc=Pt,Jc=Z,Xc=Vc,Zc=Wc,eh=Math.max,th=Math.min,nh=Math.floor,rh=/\$([$&'`]|\d\d?|<[^>]*>)/g,ah=/\$([$&'`]|\d\d?)/g;function ih(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 O.default(n,e)}function d(e,t){return C.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))}}}Hc("replace",2,(function(e,t,n,r){var a=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,s=a?"$":"$0";return[function(n,r){var a=Jc(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,a,r):t.call(String(a),n,r)},function(e,r){if(!a&&i||"string"==typeof r&&-1===r.indexOf(s)){var d=n(t,e,this,r);if(d.done)return d.value}var u=zc(e),l=String(this),c="function"==typeof r;c||(r=String(r));var h=u.global;if(h){var f=u.unicode;u.lastIndex=0}for(var p=[];;){var m=Zc(u,l);if(null===m)break;if(p.push(m),!h)break;""===String(m[0])&&(u.lastIndex=Xc(l,Qc(u.lastIndex),f))}for(var v,g="",y=0,b=0;b<p.length;b++){m=p[b];for(var _=String(m[0]),w=eh(th(Yc(m.index),l.length),0),A=[],E=1;E<m.length;E++)A.push(void 0===(v=m[E])?v:String(v));var k=m.groups;if(c){var x=[_].concat(A,w,l);void 0!==k&&x.push(k);var S=String(r.apply(void 0,x))}else S=o(_,l,w,A,k,r);w>=y&&(g+=l.slice(y,w)+S,y=w+_.length)}return g+l.slice(y)}];function o(e,n,r,a,i,s){var o=r+e.length,d=a.length,u=ah;return void 0!==i&&(i=$c(i),u=rh),t.call(s,u,(function(t,s){var u;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(o);case"<":u=i[s.slice(1,-1)];break;default:var l=+s;if(0===l)return t;if(l>d){var c=nh(l/10);return 0===c?t:c<=d?void 0===a[c-1]?s.charAt(1):a[c-1]+s.charAt(1):t}u=a[l-1]}return void 0===u?"":u}))}}));var sh={name:"@bygd/gd-sdk-pes",version:"1.27.8",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"}},oh="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==oh&&oh,dh="URLSearchParams"in oh,uh="Symbol"in oh&&"iterator"in Symbol,lh="FileReader"in oh&&"Blob"in oh&&function(){try{return new Blob,!0}catch(e){return!1}}(),ch="FormData"in oh,hh="ArrayBuffer"in oh;if(hh)var fh=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ph=ArrayBuffer.isView||function(e){return e&&fh.indexOf(Object.prototype.toString.call(e))>-1};function mh(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function vh(e){return"string"!=typeof e&&(e=String(e)),e}function gh(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return uh&&(t[Symbol.iterator]=function(){return t}),t}function yh(e){this.map={},e instanceof yh?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 bh(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function _h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function wh(e){var t=new FileReader,n=_h(t);return t.readAsArrayBuffer(e),n}function Ah(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Eh(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:lh&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:ch&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:dh&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():hh&&lh&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Ah(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):hh&&(ArrayBuffer.prototype.isPrototypeOf(e)||ph(e))?this._bodyArrayBuffer=Ah(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):dh&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},lh&&(this.blob=function(){var e=bh(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=bh(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(wh)}),this.text=function(){var e=bh(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=_h(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)},ch&&(this.formData=function(){return this.text().then(Sh)}),this.json=function(){return this.text().then(JSON.parse)},this}yh.prototype.append=function(e,t){e=mh(e),t=vh(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},yh.prototype.delete=function(e){delete this.map[mh(e)]},yh.prototype.get=function(e){return e=mh(e),this.has(e)?this.map[e]:null},yh.prototype.has=function(e){return this.map.hasOwnProperty(mh(e))},yh.prototype.set=function(e,t){this.map[mh(e)]=vh(t)},yh.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},yh.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),gh(e)},yh.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),gh(e)},yh.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),gh(e)},uh&&(yh.prototype[Symbol.iterator]=yh.prototype.entries);var kh=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function xh(e,t){if(!(this instanceof xh))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,a=(t=t||{}).body;if(e instanceof xh){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new yh(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=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 yh(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),kh.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Sh(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 Dh(e,t){if(!(this instanceof Dh))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="statusText"in t?t.statusText:"",this.headers=new yh(t.headers),this.url=t.url||"",this._initBody(e)}xh.prototype.clone=function(){return new xh(this,{body:this._bodyInit})},Eh.call(xh.prototype),Eh.call(Dh.prototype),Dh.prototype.clone=function(){return new Dh(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new yh(this.headers),url:this.url})},Dh.error=function(){var e=new Dh(null,{status:0,statusText:""});return e.type="error",e};var Th=[301,302,303,307,308];Dh.redirect=function(e,t){if(-1===Th.indexOf(t))throw new RangeError("Invalid status code");return new Dh(null,{status:t,headers:{location:e}})};var Rh=oh.DOMException;try{new Rh}catch(e){(Rh=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),Rh.prototype.constructor=Rh}function Oh(e,t){return new Promise((function(n,r){var a=new xh(e,t);if(a.signal&&a.signal.aborted)return r(new Rh("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 yh,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).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 Dh(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 Rh("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&oh.location.href?oh.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&&(lh?i.responseType="blob":hh&&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 yh?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,vh(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)}))}Oh.polyfill=!0,oh.fetch||(oh.fetch=Oh,oh.Headers=yh,oh.Request=xh,oh.Response=Dh);var Ch,Ih=Array.isArray,Ph=Object.prototype.toString,Lh=Ih||function(e){return!!e&&"[object Array]"==Ph.call(e)},Mh=function(){return Ch},jh=function(e){var t=this,n=new ih;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(){return A.default(this,t),"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(r,"&v=").concat(sh.version,"&localTime=").concat((new Date).getHours())}.bind(this),o=function(e){A.default(this,t);var n=d("object"===E.default(e)?e:a.parseJSON(e));return n&&n.version?sh.version>=n.version?n:void 0:n}.bind(this),d=function(e){var n=this;if(A.default(this,t),!Lh(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),Ch)e(Ch);else{var r=i(),d=s();fetch(d).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,d,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:o(l.push_cuda),bloc_gard:o(l.bloc_gard),cookie:o(l.cookie),gdpr:o(l.gdpr),diagnostic:o(l.diagnostic),cmp:o(l.cmp),gft:o(l.gft),sdk:o(l.sdk)||{},sdkfw:o(l.sdkfw)||{},loader:o(l.loader)||{},splash:o(l.splash)||{},promo:o(l.promo)||{},dAds:o(l.dads)||{},pAds:o(l.pads)||{},mAds:o(l.mads)||{},rAds:o(l.rads)||{},lp:o(l.lp)||{},extsc:o(l.extsc)||{}},h=a.extendDefaults(I.default(r),c);h.afg_disabled=!1===(null===(s=h.sdk)||void 0===s||null===(d=s.afg)||void 0===d?void 0:d.enabled),null!==(u=h.pAds)&&void 0!==u&&u.enabled&&(h.preroll=!0),Ch=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))},Uh=function(){var e,t=Mh();return!(null==t||null===(e=t.sdkfw)||void 0===e||!e.enabled)},Bh=function(){var e=w.default(k.default.mark((function e(){var t,n,r,i,s,o=this;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d=void 0,u=void 0,l=void 0,c=void 0,h=void 0,f=void 0,h=Mh(),f=!(null==h||null===(d=h.extsc)||void 0===d||!d.enabled),(t={enabled:f,path:f?null==h||null===(u=h.extsc)||void 0===u?void 0:u.path:"",name:f?null==h||null===(l=h.extsc)||void 0===l?void 0:l.name:"",ref:f?null==h||null===(c=h.extsc)||void 0===c?void 0:c.ref:""}).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()}var d,u,l,c,h,f}),e,this,[[4,11]])})));return function(){return e.apply(this,arguments)}}(),Nh=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},Gh=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)}},qh=function(){var e=this;return new Promise(function(t,n){var r=this;A.default(this,e);var a={type:"gd-sdk-frame-handshake-request"},i=!1;window.addEventListener("message",(function(e){var n=e.data,r=e.origin,a=e.source,s=n.type;if("gd-sdk-frame-handshake-request"===s){var o={type:"gd-sdk-frame-handshake-response"};a.postMessage(o,r)}else"gd-sdk-frame-handshake-response"===s&&(i=!0,t({origin:r,source:a}))})),setTimeout(function(){A.default(this,r),i||t()}.bind(this),200),window.parent!==window?window.parent.postMessage(a,"*"):t()}.bind(this))},Vh=function(){var e=w.default(k.default.mark((function e(t){var n,r,a,i,s,o,d,u,l;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jh(t);case 2:return e.next=5,Uh();case 5:if(n=e.sent,console.log("gd:adp ,isSDKForwardEnable",n),n){e.next=9;break}return e.abrupt("return",!1);case 9:if(r=Gh(),a=r.isMasterGameURL,i=r.isTokenGameURL,s=a(),o=i(),c=void 0,h=void 0,h=Mh(),d=Uh()&&!(null==h||null===(c=h.sdkfw)||void 0===c||!c.handshake),u=!1,l=!1,!d){e.next=22;break}return e.next=18,qh();case 18:l=e.sent,u=!s&&!!l,e.next=23;break;case 22:u=!s;case 23:return console.log("gd:adp: frameCheck result",{_isMasterGameURL:s,_isTokenGameURL:o,isHandshakeEnabled:d,hsResult:l,result:u}),e.abrupt("return",u);case 25:case"end":return e.stop()}var c,h}),e)})));return function(t){return e.apply(this,arguments)}}(),Fh=V,Kh=Cn,Wh=ne,Hh=F.f,zh=function(e){return function(t){for(var n,r=Wh(t),a=Kh(r),i=a.length,s=0,o=[];i>s;)n=a[s++],Fh&&!Hh.call(r,n)||o.push(e?[n,r[n]]:r[n]);return o}},$h={entries:zh(!0),values:zh(!1)}.values;Sn({target:"Object",stat:!0},{values:function(e){return $h(e)}});var Qh=Sn,Yh=Ed,Jh=q,Xh=Rt,Zh=Kd,ef=Vu,tf=Pe.exports;Qh({target:"Promise",proto:!0,real:!0,forced:!!Yh&&Jh((function(){Yh.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=Zh(this,Xh("Promise")),n="function"==typeof e;return this.then(n?function(n){return ef(t,e()).then((function(){return n}))}:e,n?function(n){return ef(t,e()).then((function(){throw n}))}:e)}}),"function"!=typeof Yh||Yh.prototype.finally||tf(Yh.prototype,"finally",Xh("Promise").prototype.finally);var nf=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},rf=ke,af=Z,sf=nf,of=Wc;Gc("search",1,(function(e,t,n){return[function(t){var n=af(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var a=rf(e),i=String(this),s=a.lastIndex;sf(s,0)||(a.lastIndex=0);var o=of(a,i);return sf(a.lastIndex,s)||(a.lastIndex=s),null===o?-1:o.index}]}));var df=Z,uf="[\t\n\v\f\r \u2028\u2029\ufeff]",lf=RegExp("^"+uf+uf+"*"),cf=RegExp(uf+uf+"*$"),hf=function(e){return function(t){var n=String(df(t));return 1&e&&(n=n.replace(lf,"")),2&e&&(n=n.replace(cf,"")),n}},ff={start:hf(1),end:hf(2),trim:hf(3)},pf=q,mf="\t\n\v\f\r \u2028\u2029\ufeff",vf=ff.trim;Sn({target:"String",proto:!0,forced:function(e){return pf((function(){return!!mf[e]()||"
"!="
"[e]()||mf[e].name!==e}))}("trim")},{trim:function(){return vf(this)}});var gf=re,yf=po,bf=re,_f=Q,wf=vr("match"),Af=function(e){var t;return bf(e)&&(void 0!==(t=e[wf])?!!t:"RegExp"==_f(e))},Ef=V,kf=N,xf=yn,Sf=function(e,t,n){var r,a;return yf&&"function"==typeof(r=t.constructor)&&r!==n&&gf(a=r.prototype)&&a!==n.prototype&&yf(e,a),e},Df=Ae.f,Tf=Ot.f,Rf=Af,Of=vc,Cf=gc,If=Pe.exports,Pf=q,Lf=vt.set,Mf=Rd,jf=vr("match"),Uf=kf.RegExp,Bf=Uf.prototype,Nf=/a/g,Gf=/a/g,qf=new Uf(Nf)!==Nf,Vf=Cf.UNSUPPORTED_Y;if(Ef&&xf("RegExp",!qf||Vf||Pf((function(){return Gf[jf]=!1,Uf(Nf)!=Nf||Uf(Gf)==Gf||"/a/i"!=Uf(Nf,"i")})))){for(var Ff=function(e,t){var n,r=this instanceof Ff,a=Rf(e),i=void 0===t;if(!r&&a&&e.constructor===Ff&&i)return e;qf?a&&!i&&(e=e.source):e instanceof Ff&&(i&&(t=Of.call(e)),e=e.source),Vf&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=Sf(qf?new Uf(e,t):Uf(e,t),r?this:Bf,Ff);return Vf&&n&&Lf(s,{sticky:n}),s},Kf=function(e){e in Ff||Df(Ff,e,{configurable:!0,get:function(){return Uf[e]},set:function(t){Uf[e]=t}})},Wf=Tf(Uf),Hf=0;Wf.length>Hf;)Kf(Wf[Hf++]);Bf.constructor=Ff,Ff.prototype=Bf,If(kf,"RegExp",Ff)}Mf("RegExp");var zf=Pe.exports,$f=ke,Qf=q,Yf=vc,Jf=RegExp.prototype,Xf=Jf.toString,Zf=Qf((function(){return"/a/b"!=Xf.call({source:"a",flags:"b"})})),ep="toString"!=Xf.name;(Zf||ep)&&zf(RegExp.prototype,"toString",(function(){var e=$f(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Jf)?Yf.call(e):n)}),{unsafe:!0});var tp,np=Af,rp=function(e){if(np(e))throw TypeError("The method doesn't accept regular expressions");return e},ap=vr("match"),ip=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[ap]=!1,"/./"[e](t)}catch(e){}}return!1},sp=Sn,op=G.f,dp=jt,up=rp,lp=Z,cp=ip,hp="".startsWith,fp=Math.min,pp=cp("startsWith");sp({target:"String",proto:!0,forced:!!(pp||(tp=op(String.prototype,"startsWith"),!tp||tp.writable))&&!pp},{startsWith:function(e){var t=String(lp(this));up(e);var n=dp(fp(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return hp?hp.call(t,r,n):t.slice(n,n+r.length)===r}});var mp=Wt.includes,vp=Jo;Sn({target:"Array",proto:!0,forced:!pi("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return mp(this,e,arguments.length>1?arguments[1]:void 0)}}),vp("includes");var gp=rp,yp=Z;Sn({target:"String",proto:!0,forced:!ip("includes")},{includes:function(e){return!!~String(yp(this)).indexOf(gp(e),arguments.length>1?arguments[1]:void 0)}});var bp=Sn,_p=Vr.find,wp=Jo,Ap=!0,Ep=pi("find");"find"in[]&&Array(1).find((function(){Ap=!1})),bp({target:"Array",proto:!0,forced:Ap||!Ep},{find:function(e){return _p(this,e,arguments.length>1?arguments[1]:void 0)}}),wp("find");var kp=V,xp=q,Sp=Cn,Dp=en,Tp=F,Rp=Tn,Op=X,Cp=Object.assign,Ip=Object.defineProperty,Pp=!Cp||xp((function(){if(kp&&1!==Cp({b:1},Cp(Ip({},"a",{enumerable:!0,get:function(){Ip(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!=Cp({},e)[n]||Sp(Cp({},t)).join("")!=r}))?function(e,t){for(var n=Rp(e),r=arguments.length,a=1,i=Dp.f,s=Tp.f;r>a;)for(var o,d=Op(arguments[a++]),u=i?Sp(d).concat(i(d)):Sp(d),l=u.length,c=0;l>c;)o=u[c++],kp&&!s.call(d,o)||(n[o]=d[o]);return n}:Cp;Sn({target:"Object",stat:!0,forced:Object.assign!==Pp},{assign:Pp});var Lp=Gc,Mp=Af,jp=ke,Up=Z,Bp=Kd,Np=Vc,Gp=jt,qp=Wc,Vp=Tc,Fp=q,Kp=[].push,Wp=Math.min,Hp=!Fp((function(){return!RegExp(4294967295,"y")}));Lp("split",2,(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=String(Up(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!Mp(e))return t.call(r,e,a);for(var i,s,o,d=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,c=new RegExp(e.source,u+"g");(i=Vp.call(c,r))&&!((s=c.lastIndex)>l&&(d.push(r.slice(l,i.index)),i.length>1&&i.index<r.length&&Kp.apply(d,i.slice(1)),o=i[0].length,l=s,d.length>=a));)c.lastIndex===i.index&&c.lastIndex++;return l===r.length?!o&&c.test("")||d.push(""):d.push(r.slice(l)),d.length>a?d.slice(0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var a=Up(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,a,n):r.call(String(a),t,n)},function(e,a){var i=n(r,e,this,a,r!==t);if(i.done)return i.value;var s=jp(e),o=String(this),d=Bp(s,RegExp),u=s.unicode,l=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(Hp?"y":"g"),c=new d(Hp?s:"^(?:"+s.source+")",l),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===o.length)return null===qp(c,o)?[o]:[];for(var f=0,p=0,m=[];p<o.length;){c.lastIndex=Hp?p:0;var v,g=qp(c,Hp?o:o.slice(p));if(null===g||(v=Wp(Gp(c.lastIndex+(Hp?0:p)),o.length))===f)p=Np(o,p,u);else{if(m.push(o.slice(f,p)),m.length===h)return m;for(var y=1;y<=g.length-1;y++)if(m.push(g[y]),m.length===h)return m;p=f=v}}return m.push(o.slice(f)),m}]}),!Hp);var zp=function(){function e(t){x.default(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return P.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}(),$p=function(){function e(t,n){x.default(this,e),this.adContainer=t,this.onResume=n}return P.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}(),Qp=function(e){if(!e)return!1;var t=Yp.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)},Yp=Object.prototype.toString;function Jp(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 Xp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jp(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zp(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 em(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 tm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?em(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):em(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nm=null,rm=function(){function e(t,n,r){var i=this;if(x.default(this,e),nm)return nm;nm=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,_,E,T;return P.default(e,[{key:"start",value:(T=w.default(k.default.mark((function e(){return k.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(k.default.mark((function r(i){var s,o,d,u,l,c,h,f,p=this;return k.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:tm(tm({},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:tm(tm({},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=tm(tm({},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=Xp(Xp({},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=Xp(Xp({},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(Zp({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(Zp({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:(E=w.default(k.default.mark((function e(){var t=this;return k.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 E.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(_=w.default(k.default.mark((function e(){var t;return k.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(k.default.mark((function e(t){var n,r,i;return k.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: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 30:e.next=33;break;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(k.default.mark((function e(t){return k.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 $p(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(v=w.default(k.default.mark((function e(t){var n=this;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=w.default(k.default.mark((function e(r,i){var s,o,d,u,l,c,h,f,p,m=this;return k.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(k.default.mark((function e(t){var n;return k.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(tm(tm({},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(k.default.mark((function e(t){var n,r,i=this;return k.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,tm({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(k.default.mark((function e(t){var n;return k.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(tm(tm({},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(k.default.mark((function e(t){var n,r,i=this;return k.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,tm({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(k.default.mark((function e(){return k.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(k.default.mark((function e(){return k.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;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: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}})}catch(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(Qp(e.getInnerError)){var t=e.getInnerError();if(t)return Qp(t.getErrorCode)&&Qp(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 j.default(s.query,r.query||{}),tm({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=I.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,j.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 E,k,x,S,D,T,R,O,C,I=Math.random()<A;return h&&I&&("preroll"===h&&(null===(E=this.gameData)||void 0===E||null===(k=E.pAds)||void 0===k||null===(x=k.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===(O=R.rAds)||void 0===O||null===(C=O.t4r)||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,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 zp(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(k.default.mark((function r(a){var i,s,o,d,u,l,c=this;return k.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 zp(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(k.default.mark((function e(t){var n,r,i,s,o,d=this;return k.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(k.default.mark((function e(t){var n,r,i=this;return k.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(k.default.mark((function e(t){var n,r,i,s,o=this;return k.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(k.default.mark((function e(t){var n,r,a,i,s,o,d=this;return k.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(k.default.mark((function e(t){var n,r=this;return k.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(k.default.mark((function e(t){var n,r,a,i=this;return k.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(k.default.mark((function e(t){var n,r,a,i=this;return k.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}(),am=function e(t){var n=this;x.default(this,e),S.default(this,"load",w.default(k.default.mark((function e(){return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fc(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),S.default(this,"promo",w.default(k.default.mark((function e(){return k.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},cc(this.moduleName,this.moduleConfig)},im=function e(t){var n=this;x.default(this,e),S.default(this,"load",w.default(k.default.mark((function e(){return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fc(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),S.default(this,"splash",w.default(k.default.mark((function e(){return k.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},cc(this.moduleName,this.moduleConfig)},sm=function(e,t){console.log(e,t)},om={},dm={},um=null;function lm(){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 om.version=r,om.frame=e,om.function=n,om.version}function cm(e){var t=this;return um||(um=new Promise(function(n){function r(t,r){if(sm("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:om,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}A.default(this,t),lm(),om.frame?2===om.version?(sm("TCF v2 CMP found. Fetching the consent."),om.function?(sm("CMP API is directly accessible, calling it now..."),om.function("addEventListener",om.version,r)):(sm("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!==dm[r.callId]&&dm[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});dm[o]=i,t.postMessage(u,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,om.version,n)}("addEventListener",om.frame,r))):n({result:"cmpVersionNotV2",cmp:om}):n({result:"cmpNotFound"})}.bind(this)))}var hm=new(function(){function e(){x.default(this,e),this.productName="Game Distribution"}var t;return P.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(k.default.mark((function e(t,n){var r,a,i,s,o,d;return k.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 fm(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 pm(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 pm(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 pm(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 mm=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=fm(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))},vm=function(){var e=w.default(k.default.mark((function e(){return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,mm({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,mm({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,mm({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)}}(),gm=new b.EventEmitter,ym={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function bm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bm(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}window.addEventListener("message",(function(e){var t=this,n=e.data,r=e.origin,a=n.type;if(Object.keys(ym).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=ym[r][a];i&&gm.emit(i,n)}}),!1);var wm,Am=null,Em=null,km=function(){function e(t){var n=this;if(x.default(this,e),Am)return Am;Am=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new ih,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 P.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(k.default.mark((function e(){var t,n,r,a;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isMasterGameURL()){e.next=8;break}if(r=new ih,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,vm();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=lm();console.log("CMP found",e),w.default(k.default.mark((function e(){var t;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,cm({});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;gm.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"}),this._sendGamedockEvent("gameplay")}catch(e){}}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(c=w.default(k.default.mark((function e(t,n){var r,a=this;return k.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=I.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=sh.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:sh.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),Em=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&Em.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),hm.track(Em,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=Em)||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&&hm.track(Em,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(sh.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(l=w.default(k.default.mark((function e(){var t,n,r=this;return k.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(k.default.mark((function e(){var t;return k.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 rm(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=sh,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=Mh();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(I.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(k.default.mark((function e(t,n){var r,i,s=this;return k.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(_m(_m({},this.options),{},{isConsentDomain:n,version:sh.version}),t,this._parentDomain)).on("playClick",function(){var e=this;if(A.default(this,s),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this._hideCMPButton(),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,s),i.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){A.default(this,s),i.hide()}.bind(this));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(o=w.default(k.default.mark((function e(t,n){var r,a,i,s,o=this;return k.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(_m(_m({},this.options),{},{isConsentDomain:n,version:sh.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(k.default.mark((function e(t,n){var r,a,i,s,o=this;return k.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(_m(_m({},this.options),{},{isConsentDomain:n,version:sh.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(k.default.mark((function e(t){var n,r=this,a=arguments;return k.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(k.default.mark((function e(a,i){var s,o,d,u,l,c,h,f,p,m,v,g=this;return k.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._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,_m(_m({},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=24,r.adInstance.startAd(c);case 24:r._post_message({topic:"adrequest.instream"}),e.next=31;break;case 27:e.prev=27,e.t0=e.catch(0),r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 31:case"end":return e.stop()}}),e,this,[[0,27]])})));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(k.default.mark((function e(t){var n=this;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=w.default(k.default.mark((function e(r,i){var s,o;return k.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(k.default.mark((function e(){var t=this;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=w.default(k.default.mark((function e(n,r){return k.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(k.default.mark((function n(r,a){var i;return k.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+""}})}},{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 im(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=w.default(k.default.mark((function e(t){var n,r,a,i,s;return k.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 am(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=_m(_m({},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?sh.version>=t.version?t:void 0:t}},{key:"_selectRandomOne",value:function(e){var t=this;if(!Lh(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(k.default.mark((function t(n,r){var a;return k.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(k.default.mark((function t(){var n=this;return k.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}(),xm={},Sm=function(e){if(xm.source){var t={type:"gd-sdk-on-event",event:e};xm.source.postMessage(t,xm.origin)}},Dm=function(){Sm({name:"SDK_READY",status:"success",message:"Everything is ready."}),Sm({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),Sm({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},Tm=function(e){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(!xm.source&&"init"===s)return function(e){var t=e.source,n=e.origin;xm={source:t,origin:n}}({source:a,origin:r}),void Dm();var u=e[s];u&&w.default(k.default.mark((function t(){var n;return k.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)},Rm=function(e){Uh()&&function(e){var t=e.onEvent;e.onEvent=function(e){Sm(e),t.apply(this,arguments)}}(e);var t=new km(e);return Uh()?(Tm(t),t):t},Om={create:function(){var e=w.default(k.default.mark((function e(t){var n,r;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Vh(t);case 3:return n=e.sent,r=n?Nh(t):Rm(t),Bh(),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",Rm(t));case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()};function Cm(){return(Cm=w.default(k.default.mark((function e(t,n){var r;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pm(t);case 2:return r=e.sent,e.abrupt("return",n(r));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Im=!1;function Pm(e){var t=this;return new Promise(function(n,r){var a=this;if(A.default(this,t),wm)return n(wm);if(Im)var i=setInterval(function(){A.default(this,a),wm&&(Im=!1,clearInterval(i),n(wm))}.bind(this),100);else Im=!0,Om.create(e).then(function(e){A.default(this,a),console.log("sdk created!"),wm=e,e._sendSDKReady(),Im=!1,n(wm)}.bind(this))}.bind(this))}var Lm,Mm=(Pm(Lm=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 Cm.apply(this,arguments)}(Lm,e)}});function jm(){var e=this;this.AdType=a.AdType,this.preloadAd=function(e){var t=this;return Mm.invoke(function(n){return A.default(this,t),n.preloadAd(e)}.bind(this))},this.showAd=function(){var e=w.default(k.default.mark((function e(t,n){var r=this;return k.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Mm.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 Mm.invoke(function(t){return A.default(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return Mm.invoke(function(t){return A.default(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return Mm.invoke(function(t){return A.default(this,e),t.session()}.bind(this))},this.leaderboard={show:function(){A.default(this,e),pc.showLeaderboard()}.bind(this),addScore:function(t){A.default(this,e),pc.addScore(t)}.bind(this)}}jm.prototype=new function(){this.showBanner=function(){var e=this;return Mm.invoke(function(t){return A.default(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new jm,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"),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),O=_(l),C=_(c),I=_(h),P=_(f),L=_(p),M=_(v),j=_(g),U="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 U&&U)||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={},K={}.propertyIsEnumerable,W=Object.getOwnPropertyDescriptor,H=W&&!K.call({1:2},1);V.f=H?function(e){var t=W(this,e);return!!t&&t.enumerable}:K;var z=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},$={}.toString,Q=function(e){return $.call(e).slice(8,-1)},Y=Q,J="".split,X=q((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==Y(e)?J.call(e,""):Object(e)}:Object,Z=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},ee=X,te=Z,ne=function(e){return ee(te(e))},re=function(e){return"object"==typeof e?null!==e:"function"==typeof e},ae=re,ie=function(e,t){if(!ae(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!ae(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!ae(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!ae(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},se={}.hasOwnProperty,oe=function(e,t){return se.call(e,t)},de=re,ue=N.document,le=de(ue)&&de(ue.createElement),ce=function(e){return le?ue.createElement(e):{}},he=ce,fe=!F&&!q((function(){return 7!=Object.defineProperty(he("div"),"a",{get:function(){return 7}}).a})),pe=F,me=V,ve=z,ge=ne,ye=ie,be=oe,_e=fe,we=Object.getOwnPropertyDescriptor;G.f=pe?we:function(e,t){if(e=ge(e),t=ye(t,!0),_e)try{return we(e,t)}catch(e){}if(be(e,t))return ve(!me.f.call(e,t),e[t])};var Ae={},ke=re,Ee=function(e){if(!ke(e))throw TypeError(String(e)+" is not an object");return e},xe=F,Se=fe,De=Ee,Te=ie,Re=Object.defineProperty;Ae.f=xe?Re:function(e,t,n){if(De(e),t=Te(t,!0),De(n),Se)try{return Re(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Oe=Ae,Ce=z,Ie=F?function(e,t,n){return Oe.f(e,t,Ce(1,n))}:function(e,t,n){return e[t]=n,e},Pe={exports:{}},Le=N,Me=Ie,je=function(e,t){try{Me(Le,e,t)}catch(n){Le[e]=t}return t},Ue=je,Be=N["__core-js_shared__"]||Ue("__core-js_shared__",{}),Ne=Be,Ge=Function.toString;"function"!=typeof Ne.inspectSource&&(Ne.inspectSource=function(e){return Ge.call(e)});var qe=Ne.inspectSource,Fe=qe,Ve=N.WeakMap,Ke="function"==typeof Ve&&/native code/.test(Fe(Ve)),We={exports:{}},He=Be;(We.exports=function(e,t){return He[e]||(He[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var ze,$e,Qe,Ye=0,Je=Math.random(),Xe=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Ye+Je).toString(36)},Ze=We.exports,et=Xe,tt=Ze("keys"),nt=function(e){return tt[e]||(tt[e]=et(e))},rt={},at=Ke,it=re,st=Ie,ot=oe,dt=nt,ut=rt,lt=N.WeakMap;if(at){var ct=new lt,ht=ct.get,ft=ct.has,pt=ct.set;ze=function(e,t){return pt.call(ct,e,t),t},$e=function(e){return ht.call(ct,e)||{}},Qe=function(e){return ft.call(ct,e)}}else{var mt=dt("state");ut[mt]=!0,ze=function(e,t){return st(e,mt,t),t},$e=function(e){return ot(e,mt)?e[mt]:{}},Qe=function(e){return ot(e,mt)}}var vt={set:ze,get:$e,has:Qe,enforce:function(e){return Qe(e)?$e(e):ze(e,{})},getterFor:function(e){return function(t){var n;if(!it(t)||(n=$e(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},gt=N,yt=Ie,bt=oe,_t=je,wt=qe,At=vt.get,kt=vt.enforce,Et=String(String).split("String");(Pe.exports=function(e,t,n,r){var a=!!r&&!!r.unsafe,i=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||bt(n,"name")||yt(n,"name",t),kt(n).source=Et.join("string"==typeof t?t:"")),e!==gt?(a?!s&&e[t]&&(i=!0):delete e[t],i?e[t]=n:yt(e,t,n)):i?e[t]=n:_t(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&At(this).source||wt(this)}));var xt=N,St=xt,Dt=N,Tt=function(e){return"function"==typeof e?e:void 0},Rt=function(e,t){return arguments.length<2?Tt(St[e])||Tt(Dt[e]):St[e]&&St[e][t]||Dt[e]&&Dt[e][t]},Ot={},Ct=Math.ceil,It=Math.floor,Pt=function(e){return isNaN(e=+e)?0:(e>0?It:Ct)(e)},Lt=Pt,Mt=Math.min,jt=function(e){return e>0?Mt(Lt(e),9007199254740991):0},Ut=Pt,Bt=Math.max,Nt=Math.min,Gt=function(e,t){var n=Ut(e);return n<0?Bt(n+t,0):Nt(n,t)},qt=ne,Ft=jt,Vt=Gt,Kt=function(e){return function(t,n,r){var a,i=qt(t),s=Ft(i.length),o=Vt(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}},Wt={includes:Kt(!0),indexOf:Kt(!1)},Ht=oe,zt=ne,$t=Wt.indexOf,Qt=rt,Yt=function(e,t){var n,r=zt(e),a=0,i=[];for(n in r)!Ht(Qt,n)&&Ht(r,n)&&i.push(n);for(;t.length>a;)Ht(r,n=t[a++])&&(~$t(i,n)||i.push(n));return i},Jt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Xt=Yt,Zt=Jt.concat("length","prototype");Ot.f=Object.getOwnPropertyNames||function(e){return Xt(e,Zt)};var en={};en.f=Object.getOwnPropertySymbols;var tn=Ot,nn=en,rn=Ee,an=Rt("Reflect","ownKeys")||function(e){var t=tn.f(rn(e)),n=nn.f;return n?t.concat(n(e)):t},sn=oe,on=an,dn=G,un=Ae,ln=function(e,t){for(var n=on(t),r=un.f,a=dn.f,i=0;i<n.length;i++){var s=n[i];sn(e,s)||r(e,s,a(t,s))}},cn=q,hn=/#|\.prototype\./,fn=function(e,t){var n=mn[pn(e)];return n==gn||n!=vn&&("function"==typeof t?cn(t):!!t)},pn=fn.normalize=function(e){return String(e).replace(hn,".").toLowerCase()},mn=fn.data={},vn=fn.NATIVE="N",gn=fn.POLYFILL="P",yn=fn,bn=N,_n=G.f,wn=Ie,An=Pe.exports,kn=je,En=ln,xn=yn,Sn=function(e,t){var n,r,a,i,s,o=e.target,d=e.global,u=e.stat;if(n=d?bn:u?bn[o]||kn(o,{}):(bn[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=_n(n,r))&&s.value:n[r],!xn(d?r:o+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;En(i,a)}(e.sham||a&&a.sham)&&wn(i,"sham",!0),An(n,r,i,e)}},Dn=Z,Tn=function(e){return Object(Dn(e))},Rn=Yt,On=Jt,Cn=Object.keys||function(e){return Rn(e,On)},In=Tn,Pn=Cn;Sn({target:"Object",stat:!0,forced:q((function(){Pn(1)}))},{keys:function(e){return Pn(In(e))}});var Ln,Mn=q,jn=!!Object.getOwnPropertySymbols&&!Mn((function(){return!String(Symbol())})),Un=jn&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Bn=Q,Nn=Array.isArray||function(e){return"Array"==Bn(e)},Gn=Ae,qn=Ee,Fn=Cn,Vn=F?Object.defineProperties:function(e,t){qn(e);for(var n,r=Fn(t),a=r.length,i=0;a>i;)Gn.f(e,n=r[i++],t[n]);return e},Kn=Rt("document","documentElement"),Wn=Ee,Hn=Vn,zn=Jt,$n=rt,Qn=Kn,Yn=ce,Jn=nt("IE_PROTO"),Xn=function(){},Zn=function(e){return"<script>"+e+"<\/script>"},er=function(){try{Ln=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;er=Ln?function(e){e.write(Zn("")),e.close();var t=e.parentWindow.Object;return e=null,t}(Ln):((t=Yn("iframe")).style.display="none",Qn.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Zn("document.F=Object")),e.close(),e.F);for(var n=zn.length;n--;)delete er.prototype[zn[n]];return er()};$n[Jn]=!0;var tr=Object.create||function(e,t){var n;return null!==e?(Xn.prototype=Wn(e),n=new Xn,Xn.prototype=null,n[Jn]=e):n=er(),void 0===t?n:Hn(n,t)},nr={},rr=ne,ar=Ot.f,ir={}.toString,sr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];nr.f=function(e){return sr&&"[object Window]"==ir.call(e)?function(e){try{return ar(e)}catch(e){return sr.slice()}}(e):ar(rr(e))};var or=N,dr=We.exports,ur=oe,lr=Xe,cr=jn,hr=Un,fr=dr("wks"),pr=or.Symbol,mr=hr?pr:pr&&pr.withoutSetter||lr,vr=function(e){return ur(fr,e)||(cr&&ur(pr,e)?fr[e]=pr[e]:fr[e]=mr("Symbol."+e)),fr[e]},gr={},yr=vr;gr.f=yr;var br=xt,_r=oe,wr=gr,Ar=Ae.f,kr=function(e){var t=br.Symbol||(br.Symbol={});_r(t,e)||Ar(t,e,{value:wr.f(e)})},Er=Ae.f,xr=oe,Sr=vr("toStringTag"),Dr=function(e,t,n){e&&!xr(e=n?e:e.prototype,Sr)&&Er(e,Sr,{configurable:!0,value:t})},Tr=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Rr=Tr,Or=function(e,t,n){if(Rr(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}},Cr=re,Ir=Nn,Pr=vr("species"),Lr=function(e,t){var n;return Ir(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!Ir(n.prototype)?Cr(n)&&null===(n=n[Pr])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},Mr=Or,jr=X,Ur=Tn,Br=jt,Nr=Lr,Gr=[].push,qr=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=5==e||i;return function(o,d,u,l){for(var c,h,f=Ur(o),p=jr(f),m=Mr(d,u,3),v=Br(p.length),g=0,y=l||Nr,b=t?y(o,v):n?y(o,0):void 0;v>g;g++)if((s||g in p)&&(h=m(c=p[g],g,f),e))if(t)b[g]=h;else if(h)switch(e){case 3:return!0;case 5:return c;case 6:return g;case 2:Gr.call(b,c)}else if(a)return!1;return i?-1:r||a?a:b}},Fr={forEach:qr(0),map:qr(1),filter:qr(2),some:qr(3),every:qr(4),find:qr(5),findIndex:qr(6)},Vr=Sn,Kr=N,Wr=Rt,Hr=F,zr=jn,$r=Un,Qr=q,Yr=oe,Jr=Nn,Xr=re,Zr=Ee,ea=Tn,ta=ne,na=ie,ra=z,aa=tr,ia=Cn,sa=Ot,oa=nr,da=en,ua=G,la=Ae,ca=V,ha=Ie,fa=Pe.exports,pa=We.exports,ma=rt,va=Xe,ga=vr,ya=gr,ba=kr,_a=Dr,wa=vt,Aa=Fr.forEach,ka=nt("hidden"),Ea=ga("toPrimitive"),xa=wa.set,Sa=wa.getterFor("Symbol"),Da=Object.prototype,Ta=Kr.Symbol,Ra=Wr("JSON","stringify"),Oa=ua.f,Ca=la.f,Ia=oa.f,Pa=ca.f,La=pa("symbols"),Ma=pa("op-symbols"),ja=pa("string-to-symbol-registry"),Ua=pa("symbol-to-string-registry"),Ba=pa("wks"),Na=Kr.QObject,Ga=!Na||!Na.prototype||!Na.prototype.findChild,qa=Hr&&Qr((function(){return 7!=aa(Ca({},"a",{get:function(){return Ca(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Oa(Da,t);r&&delete Da[t],Ca(e,t,n),r&&e!==Da&&Ca(Da,t,r)}:Ca,Fa=function(e,t){var n=La[e]=aa(Ta.prototype);return xa(n,{type:"Symbol",tag:e,description:t}),Hr||(n.description=t),n},Va=$r?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Ta},Ka=function(e,t,n){e===Da&&Ka(Ma,t,n),Zr(e);var r=na(t,!0);return Zr(n),Yr(La,r)?(n.enumerable?(Yr(e,ka)&&e[ka][r]&&(e[ka][r]=!1),n=aa(n,{enumerable:ra(0,!1)})):(Yr(e,ka)||Ca(e,ka,ra(1,{})),e[ka][r]=!0),qa(e,r,n)):Ca(e,r,n)},Wa=function(e,t){Zr(e);var n=ta(t),r=ia(n).concat(Qa(n));return Aa(r,(function(t){Hr&&!Ha.call(n,t)||Ka(e,t,n[t])})),e},Ha=function(e){var t=na(e,!0),n=Pa.call(this,t);return!(this===Da&&Yr(La,t)&&!Yr(Ma,t))&&(!(n||!Yr(this,t)||!Yr(La,t)||Yr(this,ka)&&this[ka][t])||n)},za=function(e,t){var n=ta(e),r=na(t,!0);if(n!==Da||!Yr(La,r)||Yr(Ma,r)){var a=Oa(n,r);return!a||!Yr(La,r)||Yr(n,ka)&&n[ka][r]||(a.enumerable=!0),a}},$a=function(e){var t=Ia(ta(e)),n=[];return Aa(t,(function(e){Yr(La,e)||Yr(ma,e)||n.push(e)})),n},Qa=function(e){var t=e===Da,n=Ia(t?Ma:ta(e)),r=[];return Aa(n,(function(e){!Yr(La,e)||t&&!Yr(Da,e)||r.push(La[e])})),r};(zr||(fa((Ta=function(){if(this instanceof Ta)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=va(e),n=function(e){this===Da&&n.call(Ma,e),Yr(this,ka)&&Yr(this[ka],t)&&(this[ka][t]=!1),qa(this,t,ra(1,e))};return Hr&&Ga&&qa(Da,t,{configurable:!0,set:n}),Fa(t,e)}).prototype,"toString",(function(){return Sa(this).tag})),fa(Ta,"withoutSetter",(function(e){return Fa(va(e),e)})),ca.f=Ha,la.f=Ka,ua.f=za,sa.f=oa.f=$a,da.f=Qa,ya.f=function(e){return Fa(ga(e),e)},Hr&&(Ca(Ta.prototype,"description",{configurable:!0,get:function(){return Sa(this).description}}),fa(Da,"propertyIsEnumerable",Ha,{unsafe:!0}))),Vr({global:!0,wrap:!0,forced:!zr,sham:!zr},{Symbol:Ta}),Aa(ia(Ba),(function(e){ba(e)})),Vr({target:"Symbol",stat:!0,forced:!zr},{for:function(e){var t=String(e);if(Yr(ja,t))return ja[t];var n=Ta(t);return ja[t]=n,Ua[n]=t,n},keyFor:function(e){if(!Va(e))throw TypeError(e+" is not a symbol");if(Yr(Ua,e))return Ua[e]},useSetter:function(){Ga=!0},useSimple:function(){Ga=!1}}),Vr({target:"Object",stat:!0,forced:!zr,sham:!Hr},{create:function(e,t){return void 0===t?aa(e):Wa(aa(e),t)},defineProperty:Ka,defineProperties:Wa,getOwnPropertyDescriptor:za}),Vr({target:"Object",stat:!0,forced:!zr},{getOwnPropertyNames:$a,getOwnPropertySymbols:Qa}),Vr({target:"Object",stat:!0,forced:Qr((function(){da.f(1)}))},{getOwnPropertySymbols:function(e){return da.f(ea(e))}}),Ra)&&Vr({target:"JSON",stat:!0,forced:!zr||Qr((function(){var e=Ta();return"[null]"!=Ra([e])||"{}"!=Ra({a:e})||"{}"!=Ra(Object(e))}))},{stringify:function(e,t,n){for(var r,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(r=t,(Xr(t)||void 0!==e)&&!Va(e))return Jr(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!Va(t))return t}),a[1]=t,Ra.apply(null,a)}});Ta.prototype[Ea]||ha(Ta.prototype,Ea,Ta.prototype.valueOf),_a(Ta,"Symbol"),ma[ka]=!0;var Ya,Ja,Xa=Rt("navigator","userAgent")||"",Za=Xa,ei=N.process,ti=ei&&ei.versions,ni=ti&&ti.v8;ni?Ja=(Ya=ni.split("."))[0]+Ya[1]:Za&&(!(Ya=Za.match(/Edge\/(\d+)/))||Ya[1]>=74)&&(Ya=Za.match(/Chrome\/(\d+)/))&&(Ja=Ya[1]);var ri=Ja&&+Ja,ai=q,ii=ri,si=vr("species"),oi=function(e){return ii>=51||!ai((function(){var t=[];return(t.constructor={})[si]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},di=F,ui=q,li=oe,ci=Object.defineProperty,hi={},fi=function(e){throw e},pi=function(e,t){if(li(hi,e))return hi[e];t||(t={});var n=[][e],r=!!li(t,"ACCESSORS")&&t.ACCESSORS,a=li(t,0)?t[0]:fi,i=li(t,1)?t[1]:void 0;return hi[e]=!!n&&!ui((function(){if(r&&!di)return!0;var e={length:-1};r?ci(e,1,{enumerable:!0,get:fi}):e[1]=1,n.call(e,a,i)}))},mi=Sn,vi=Fr.filter,gi=pi,yi=oi("filter"),bi=gi("filter");mi({target:"Array",proto:!0,forced:!yi||!bi},{filter:function(e){return vi(this,e,arguments.length>1?arguments[1]:void 0)}});var _i=Sn,wi=q,Ai=ne,ki=G.f,Ei=F,xi=wi((function(){ki(1)}));_i({target:"Object",stat:!0,forced:!Ei||xi,sham:!Ei},{getOwnPropertyDescriptor:function(e,t){return ki(Ai(e),t)}});var Si={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},Di=q,Ti=Fr.forEach,Ri=pi,Oi=function(e,t){var n=[][e];return!!n&&Di((function(){n.call(null,t||function(){throw 1},1)}))}("forEach"),Ci=Ri("forEach"),Ii=N,Pi=Si,Li=Oi&&Ci?[].forEach:function(e){return Ti(this,e,arguments.length>1?arguments[1]:void 0)},Mi=Ie;for(var ji in Pi){var Ui=Ii[ji],Bi=Ui&&Ui.prototype;if(Bi&&Bi.forEach!==Li)try{Mi(Bi,"forEach",Li)}catch(e){Bi.forEach=Li}}var Ni=ie,Gi=Ae,qi=z,Fi=function(e,t,n){var r=Ni(t);r in e?Gi.f(e,r,qi(0,n)):e[r]=n},Vi=an,Ki=ne,Wi=G,Hi=Fi;Sn({target:"Object",stat:!0,sham:!F},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Ki(e),a=Wi.f,i=Vi(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&Hi(s,t,n);return s}});var zi=Sn,$i=re,Qi=Nn,Yi=Gt,Ji=jt,Xi=ne,Zi=Fi,es=vr,ts=pi,ns=oi("slice"),rs=ts("slice",{ACCESSORS:!0,0:0,1:2}),as=es("species"),is=[].slice,ss=Math.max;zi({target:"Array",proto:!0,forced:!ns||!rs},{slice:function(e,t){var n,r,a,i=Xi(this),s=Ji(i.length),o=Yi(e,s),d=Yi(void 0===t?s:t,s);if(Qi(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Qi(n.prototype)?$i(n)&&null===(n=n[as])&&(n=void 0):n=void 0,n===Array||void 0===n))return is.call(i,o,d);for(r=new(void 0===n?Array:n)(ss(d-o,0)),a=0;o<d;o++,a++)o in i&&Zi(r,a,i[o]);return r.length=a,r}});var os=Ee,ds=function(e,t,n,r){try{return r?t(os(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&os(a.call(e)),t}},us={},ls=us,cs=vr("iterator"),hs=Array.prototype,fs=function(e){return void 0!==e&&(ls.Array===e||hs[cs]===e)},ps={};ps[vr("toStringTag")]="z";var ms="[object z]"===String(ps),vs=ms,gs=Q,ys=vr("toStringTag"),bs="Arguments"==gs(function(){return arguments}()),_s=vs?gs:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),ys))?n:bs?gs(t):"Object"==(r=gs(t))&&"function"==typeof t.callee?"Arguments":r},ws=_s,As=us,ks=vr("iterator"),Es=function(e){if(null!=e)return e[ks]||e["@@iterator"]||As[ws(e)]},xs=Or,Ss=Tn,Ds=ds,Ts=fs,Rs=jt,Os=Fi,Cs=Es,Is=vr("iterator"),Ps=!1;try{var Ls=0,Ms={next:function(){return{done:!!Ls++}},return:function(){Ps=!0}};Ms[Is]=function(){return this},Array.from(Ms,(function(){throw 2}))}catch(e){}var js=function(e,t){if(!t&&!Ps)return!1;var n=!1;try{var r={};r[Is]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Us=function(e){var t,n,r,a,i,s,o=Ss(e),d="function"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,c=void 0!==l,h=Cs(o),f=0;if(c&&(l=xs(l,u>2?arguments[2]:void 0,2)),null==h||d==Array&&Ts(h))for(n=new d(t=Rs(o.length));t>f;f++)s=c?l(o[f],f):o[f],Os(n,f,s);else for(i=(a=h.call(o)).next,n=new d;!(r=i.call(a)).done;f++)s=c?Ds(a,l,[r.value,f],!0):r.value,Os(n,f,s);return n.length=f,n};Sn({target:"Array",stat:!0,forced:!js((function(e){Array.from(e)}))},{from:Us});var Bs,Ns,Gs,qs=Pt,Fs=Z,Vs=function(e){return function(t,n){var r,a,i=String(Fs(t)),s=qs(n),o=i.length;return s<0||s>=o?e?"":void 0:(r=i.charCodeAt(s))<55296||r>56319||s+1===o||(a=i.charCodeAt(s+1))<56320||a>57343?e?i.charAt(s):r:e?i.slice(s,s+2):a-56320+(r-55296<<10)+65536}},Ks={codeAt:Vs(!1),charAt:Vs(!0)},Ws=!q((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Hs=oe,zs=Tn,$s=Ws,Qs=nt("IE_PROTO"),Ys=Object.prototype,Js=$s?Object.getPrototypeOf:function(e){return e=zs(e),Hs(e,Qs)?e[Qs]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Ys:null},Xs=Js,Zs=Ie,eo=oe,to=vr("iterator"),no=!1;[].keys&&("next"in(Gs=[].keys())?(Ns=Xs(Xs(Gs)))!==Object.prototype&&(Bs=Ns):no=!0),null==Bs&&(Bs={}),eo(Bs,to)||Zs(Bs,to,(function(){return this}));var ro={IteratorPrototype:Bs,BUGGY_SAFARI_ITERATORS:no},ao=ro.IteratorPrototype,io=tr,so=z,oo=Dr,uo=us,lo=function(){return this},co=re,ho=Ee,fo=function(e){if(!co(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},po=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return ho(n),fo(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),mo=Sn,vo=function(e,t,n){var r=t+" Iterator";return e.prototype=io(ao,{next:so(1,n)}),oo(e,r,!1),uo[r]=lo,e},go=Js,yo=po,bo=Dr,_o=Ie,wo=Pe.exports,Ao=us,ko=ro.IteratorPrototype,Eo=ro.BUGGY_SAFARI_ITERATORS,xo=vr("iterator"),So=function(){return this},Do=function(e,t,n,r,a,i,s){vo(n,t,r);var o,d,u,l=function(e){if(e===a&&m)return m;if(!Eo&&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[xo]||f["@@iterator"]||a&&f[a],m=!Eo&&p||l(a),v="Array"==t&&f.entries||p;if(v&&(o=go(v.call(new e)),ko!==Object.prototype&&o.next&&(go(o)!==ko&&(yo?yo(o,ko):"function"!=typeof o[xo]&&_o(o,xo,So)),bo(o,c,!0))),"values"==a&&p&&"values"!==p.name&&(h=!0,m=function(){return p.call(this)}),f[xo]!==m&&_o(f,xo,m),Ao[t]=m,a)if(d={values:l("values"),keys:i?m:l("keys"),entries:l("entries")},s)for(u in d)(Eo||h||!(u in f))&&wo(f,u,d[u]);else mo({target:t,proto:!0,forced:Eo||h},d);return d},To=Ks.charAt,Ro=vt,Oo=Do,Co=Ro.set,Io=Ro.getterFor("String Iterator");Oo(String,"String",(function(e){Co(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Io(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=To(n,r),t.index+=e.length,{value:e,done:!1})}));var Po=Sn,Lo=F,Mo=N,jo=oe,Uo=re,Bo=Ae.f,No=ln,Go=Mo.Symbol;if(Lo&&"function"==typeof Go&&(!("description"in Go.prototype)||void 0!==Go().description)){var qo={},Fo=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Fo?new Go(e):void 0===e?Go():Go(e);return""===e&&(qo[t]=!0),t};No(Fo,Go);var Vo=Fo.prototype=Go.prototype;Vo.constructor=Fo;var Ko=Vo.toString,Wo="Symbol(test)"==String(Go("test")),Ho=/^Symbol\((.*)\)[^)]+$/;Bo(Vo,"description",{configurable:!0,get:function(){var e=Uo(this)?this.valueOf():this,t=Ko.call(e);if(jo(qo,e))return"";var n=Wo?t.slice(7,-1):t.replace(Ho,"$1");return""===n?void 0:n}}),Po({global:!0,forced:!0},{Symbol:Fo})}kr("iterator");var zo=tr,$o=Ae,Qo=vr("unscopables"),Yo=Array.prototype;null==Yo[Qo]&&$o.f(Yo,Qo,{configurable:!0,value:zo(null)});var Jo=function(e){Yo[Qo][e]=!0},Xo=ne,Zo=Jo,ed=us,td=vt,nd=Do,rd=td.set,ad=td.getterFor("Array Iterator"),id=nd(Array,"Array",(function(e,t){rd(this,{type:"Array Iterator",target:Xo(e),index:0,kind:t})}),(function(){var e=ad(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");ed.Arguments=ed.Array,Zo("keys"),Zo("values"),Zo("entries");var sd=N,od=Si,dd=id,ud=Ie,ld=vr,cd=ld("iterator"),hd=ld("toStringTag"),fd=dd.values;for(var pd in od){var md=sd[pd],vd=md&&md.prototype;if(vd){if(vd[cd]!==fd)try{ud(vd,cd,fd)}catch(e){vd[cd]=fd}if(vd[hd]||ud(vd,hd,pd),od[pd])for(var gd in dd)if(vd[gd]!==dd[gd])try{ud(vd,gd,dd[gd])}catch(e){vd[gd]=dd[gd]}}}var yd=_s,bd=ms?{}.toString:function(){return"[object "+yd(this)+"]"},_d=ms,wd=Pe.exports,Ad=bd;_d||wd(Object.prototype,"toString",Ad,{unsafe:!0});var kd=N.Promise,Ed=Pe.exports,xd=Rt,Sd=Ae,Dd=F,Td=vr("species"),Rd=function(e){var t=xd(e),n=Sd.f;Dd&&t&&!t[Td]&&n(t,Td,{configurable:!0,get:function(){return this}})},Od={exports:{}},Cd=Ee,Id=fs,Pd=jt,Ld=Or,Md=Es,jd=ds,Ud=function(e,t){this.stopped=e,this.result=t};(Od.exports=function(e,t,n,r,a){var i,s,o,d,u,l,c,h=Ld(t,n,r?2:1);if(a)i=e;else{if("function"!=typeof(s=Md(e)))throw TypeError("Target is not iterable");if(Id(s)){for(o=0,d=Pd(e.length);d>o;o++)if((u=r?h(Cd(c=e[o])[0],c[1]):h(e[o]))&&u instanceof Ud)return u;return new Ud(!1)}i=s.call(e)}for(l=i.next;!(c=l.call(i)).done;)if("object"==typeof(u=jd(i,h,c.value,r))&&u&&u instanceof Ud)return u;return new Ud(!1)}).stop=function(e){return new Ud(!0,e)};var Bd,Nd,Gd,qd=Ee,Fd=Tr,Vd=vr("species"),Kd=function(e,t){var n,r=qd(e).constructor;return void 0===r||null==(n=qd(r)[Vd])?t:Fd(n)},Wd=/(iphone|ipod|ipad).*applewebkit/i.test(Xa),Hd=N,zd=q,$d=Q,Qd=Or,Yd=Kn,Jd=ce,Xd=Wd,Zd=Hd.location,eu=Hd.setImmediate,tu=Hd.clearImmediate,nu=Hd.process,ru=Hd.MessageChannel,au=Hd.Dispatch,iu=0,su={},ou=function(e){if(su.hasOwnProperty(e)){var t=su[e];delete su[e],t()}},du=function(e){return function(){ou(e)}},uu=function(e){ou(e.data)},lu=function(e){Hd.postMessage(e+"",Zd.protocol+"//"+Zd.host)};eu&&tu||(eu=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return su[++iu]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Bd(iu),iu},tu=function(e){delete su[e]},"process"==$d(nu)?Bd=function(e){nu.nextTick(du(e))}:au&&au.now?Bd=function(e){au.now(du(e))}:ru&&!Xd?(Gd=(Nd=new ru).port2,Nd.port1.onmessage=uu,Bd=Qd(Gd.postMessage,Gd,1)):!Hd.addEventListener||"function"!=typeof postMessage||Hd.importScripts||zd(lu)||"file:"===Zd.protocol?Bd="onreadystatechange"in Jd("script")?function(e){Yd.appendChild(Jd("script")).onreadystatechange=function(){Yd.removeChild(this),ou(e)}}:function(e){setTimeout(du(e),0)}:(Bd=lu,Hd.addEventListener("message",uu,!1)));var cu,hu,fu,pu,mu,vu,gu,yu,bu={set:eu,clear:tu},_u=N,wu=G.f,Au=Q,ku=bu.set,Eu=Wd,xu=_u.MutationObserver||_u.WebKitMutationObserver,Su=_u.process,Du=_u.Promise,Tu="process"==Au(Su),Ru=wu(_u,"queueMicrotask"),Ou=Ru&&Ru.value;Ou||(cu=function(){var e,t;for(Tu&&(e=Su.domain)&&e.exit();hu;){t=hu.fn,hu=hu.next;try{t()}catch(e){throw hu?pu():fu=void 0,e}}fu=void 0,e&&e.enter()},Tu?pu=function(){Su.nextTick(cu)}:xu&&!Eu?(mu=!0,vu=document.createTextNode(""),new xu(cu).observe(vu,{characterData:!0}),pu=function(){vu.data=mu=!mu}):Du&&Du.resolve?(gu=Du.resolve(void 0),yu=gu.then,pu=function(){yu.call(gu,cu)}):pu=function(){ku.call(_u,cu)});var Cu=Ou||function(e){var t={fn:e,next:void 0};fu&&(fu.next=t),hu||(hu=t,pu()),fu=t},Iu={},Pu=Tr,Lu=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=Pu(t),this.reject=Pu(n)};Iu.f=function(e){return new Lu(e)};var Mu,ju,Uu,Bu,Nu=Ee,Gu=re,qu=Iu,Fu=function(e,t){if(Nu(e),Gu(t)&&t.constructor===e)return t;var n=qu.f(e);return(0,n.resolve)(t),n.promise},Vu=N,Ku=Sn,Wu=N,Hu=Rt,zu=kd,$u=Pe.exports,Qu=function(e,t,n){for(var r in t)Ed(e,r,t[r],n);return e},Yu=Dr,Ju=Rd,Xu=re,Zu=Tr,el=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},tl=Q,nl=qe,rl=Od.exports,al=js,il=Kd,sl=bu.set,ol=Cu,dl=Fu,ul=function(e,t){var n=Vu.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},ll=Iu,cl=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},hl=vt,fl=yn,pl=ri,ml=vr("species"),vl="Promise",gl=hl.get,yl=hl.set,bl=hl.getterFor(vl),_l=zu,wl=Wu.TypeError,Al=Wu.document,kl=Wu.process,El=Hu("fetch"),xl=ll.f,Sl=xl,Dl="process"==tl(kl),Tl=!!(Al&&Al.createEvent&&Wu.dispatchEvent),Rl=fl(vl,(function(){if(!(nl(_l)!==String(_l))){if(66===pl)return!0;if(!Dl&&"function"!=typeof PromiseRejectionEvent)return!0}if(pl>=51&&/native code/.test(_l))return!1;var e=_l.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[ml]=t,!(e.then((function(){}))instanceof t)})),Ol=Rl||!al((function(e){_l.all(e).catch((function(){}))})),Cl=function(e){var t;return!(!Xu(e)||"function"!=typeof(t=e.then))&&t},Il=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;ol((function(){for(var a=t.value,i=1==t.state,s=0;r.length>s;){var o,d,u,l=r[s++],c=i?l.ok:l.fail,h=l.resolve,f=l.reject,p=l.domain;try{c?(i||(2===t.rejection&&jl(e,t),t.rejection=1),!0===c?o=a:(p&&p.enter(),o=c(a),p&&(p.exit(),u=!0)),o===l.promise?f(wl("Promise-chain cycle")):(d=Cl(o))?d.call(o,h,f):h(o)):f(a)}catch(e){p&&!u&&p.exit(),f(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Ll(e,t)}))}},Pl=function(e,t,n){var r,a;Tl?((r=Al.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Wu.dispatchEvent(r)):r={promise:t,reason:n},(a=Wu["on"+e])?a(r):"unhandledrejection"===e&&ul("Unhandled promise rejection",n)},Ll=function(e,t){sl.call(Wu,(function(){var n,r=t.value;if(Ml(t)&&(n=cl((function(){Dl?kl.emit("unhandledRejection",r,e):Pl("unhandledrejection",e,r)})),t.rejection=Dl||Ml(t)?2:1,n.error))throw n.value}))},Ml=function(e){return 1!==e.rejection&&!e.parent},jl=function(e,t){sl.call(Wu,(function(){Dl?kl.emit("rejectionHandled",e):Pl("rejectionhandled",e,t.value)}))},Ul=function(e,t,n,r){return function(a){e(t,n,a,r)}},Bl=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,Il(e,t,!0))},Nl=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw wl("Promise can't be resolved itself");var a=Cl(n);a?ol((function(){var r={done:!1};try{a.call(n,Ul(Nl,e,r,t),Ul(Bl,e,r,t))}catch(n){Bl(e,r,n,t)}})):(t.value=n,t.state=1,Il(e,t,!1))}catch(n){Bl(e,{done:!1},n,t)}}};Rl&&(_l=function(e){el(this,_l,vl),Zu(e),Mu.call(this);var t=gl(this);try{e(Ul(Nl,this,t),Ul(Bl,this,t))}catch(e){Bl(this,t,e)}},(Mu=function(e){yl(this,{type:vl,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Qu(_l.prototype,{then:function(e,t){var n=bl(this),r=xl(il(this,_l));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Dl?kl.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Il(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),ju=function(){var e=new Mu,t=gl(e);this.promise=e,this.resolve=Ul(Nl,e,t),this.reject=Ul(Bl,e,t)},ll.f=xl=function(e){return e===_l||e===Uu?new ju(e):Sl(e)},"function"==typeof zu&&(Bu=zu.prototype.then,$u(zu.prototype,"then",(function(e,t){var n=this;return new _l((function(e,t){Bu.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof El&&Ku({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return dl(_l,El.apply(Wu,arguments))}}))),Ku({global:!0,wrap:!0,forced:Rl},{Promise:_l}),Yu(_l,vl,!1),Ju(vl),Uu=Hu(vl),Ku({target:vl,stat:!0,forced:Rl},{reject:function(e){var t=xl(this);return t.reject.call(void 0,e),t.promise}}),Ku({target:vl,stat:!0,forced:Rl},{resolve:function(e){return dl(this,e)}}),Ku({target:vl,stat:!0,forced:Ol},{all:function(e){var t=this,n=xl(t),r=n.resolve,a=n.reject,i=cl((function(){var n=Zu(t.resolve),i=[],s=0,o=1;rl(e,(function(e){var d=s++,u=!1;i.push(void 0),o++,n.call(t,e).then((function(e){u||(u=!0,i[d]=e,--o||r(i))}),a)})),--o||r(i)}));return i.error&&a(i.value),n.promise},race:function(e){var t=this,n=xl(t),r=n.reject,a=cl((function(){var a=Zu(t.resolve);rl(e,(function(e){a.call(t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var Gl=Sn,ql=q,Fl=Nn,Vl=re,Kl=Tn,Wl=jt,Hl=Fi,zl=Lr,$l=oi,Ql=ri,Yl=vr("isConcatSpreadable"),Jl=Ql>=51||!ql((function(){var e=[];return e[Yl]=!1,e.concat()[0]!==e})),Xl=$l("concat"),Zl=function(e){if(!Vl(e))return!1;var t=e[Yl];return void 0!==t?!!t:Fl(e)};Gl({target:"Array",proto:!0,forced:!Jl||!Xl},{concat:function(e){var t,n,r,a,i,s=Kl(this),o=zl(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Zl(i=-1===t?s:arguments[t])){if(d+(a=Wl(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,d++)n in i&&Hl(o,d,i[n])}else{if(d>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Hl(o,d++,i)}return o.length=d,o}});var ec=F,tc=Ae.f,nc=Function.prototype,rc=nc.toString,ac=/^\s*function ([^ (]*)/;function ic(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 sc(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 sc(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 sc(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 oc(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 dc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oc(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}ec&&!("name"in nc)&&tc(nc,"name",{configurable:!0,get:function(){try{return rc.call(this).match(ac)[1]}catch(e){return""}}});var uc={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"}},lc={},cc=function(e,t){lc[e]=dc(dc({},t),{},{isLoading:!1})},hc=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))},fc=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=lc[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=ic(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=uc[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,hc({id:s,src:uc[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,hc({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)}}(),pc=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,fc("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"]},cc(this.moduleName,this.moduleConfig)},mc=Ee,vc=function(){var e=mc(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},gc={},yc=q;function bc(e,t){return RegExp(e,t)}gc.UNSUPPORTED_Y=yc((function(){var e=bc("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),gc.BROKEN_CARET=yc((function(){var e=bc("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var _c=vc,wc=gc,Ac=RegExp.prototype.exec,kc=String.prototype.replace,Ec=Ac,xc=function(){var e=/a/,t=/b*/g;return Ac.call(e,"a"),Ac.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Sc=wc.UNSUPPORTED_Y||wc.BROKEN_CARET,Dc=void 0!==/()??/.exec("")[1];(xc||Dc||Sc)&&(Ec=function(e){var t,n,r,a,i=this,s=Sc&&i.sticky,o=_c.call(i),d=i.source,u=0,l=e;return s&&(-1===(o=o.replace("y","")).indexOf("g")&&(o+="g"),l=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(d="(?: "+d+")",l=" "+l,u++),n=new RegExp("^(?:"+d+")",o)),Dc&&(n=new RegExp("^"+d+"$(?!\\s)",o)),xc&&(t=i.lastIndex),r=Ac.call(s?n:i,l),s?r?(r.input=r.input.slice(u),r[0]=r[0].slice(u),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:xc&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),Dc&&r&&r.length>1&&kc.call(r[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r});var Tc=Ec;Sn({target:"RegExp",proto:!0,forced:/./.exec!==Tc},{exec:Tc});var Rc=Pe.exports,Oc=q,Cc=vr,Ic=Tc,Pc=Ie,Lc=Cc("species"),Mc=!Oc((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),jc="$0"==="a".replace(/./,"$0"),Uc=Cc("replace"),Bc=!!/./[Uc]&&""===/./[Uc]("a","$0"),Nc=!Oc((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]})),Gc=function(e,t,n,r){var a=Cc(e),i=!Oc((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!Oc((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Lc]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||"replace"===e&&(!Mc||!jc||Bc)||"split"===e&&!Nc){var o=/./[a],d=n(a,""[e],(function(e,t,n,r,a){return t.exec===Ic?i&&!a?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:jc,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Bc}),u=d[0],l=d[1];Rc(String.prototype,e,u),Rc(RegExp.prototype,a,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}r&&Pc(RegExp.prototype[a],"sham",!0)},qc=Ks.charAt,Fc=function(e,t,n){return t+(n?qc(e,t).length:1)},Vc=Q,Kc=Tc,Wc=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==Vc(e))throw TypeError("RegExp#exec called on incompatible receiver");return Kc.call(e,t)},Hc=Gc,zc=Ee,$c=Tn,Qc=jt,Yc=Pt,Jc=Z,Xc=Fc,Zc=Wc,eh=Math.max,th=Math.min,nh=Math.floor,rh=/\$([$&'`]|\d\d?|<[^>]*>)/g,ah=/\$([$&'`]|\d\d?)/g;function ih(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 O.default(n,e)}function d(e,t){return C.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))}}}Hc("replace",2,(function(e,t,n,r){var a=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,s=a?"$":"$0";return[function(n,r){var a=Jc(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,a,r):t.call(String(a),n,r)},function(e,r){if(!a&&i||"string"==typeof r&&-1===r.indexOf(s)){var d=n(t,e,this,r);if(d.done)return d.value}var u=zc(e),l=String(this),c="function"==typeof r;c||(r=String(r));var h=u.global;if(h){var f=u.unicode;u.lastIndex=0}for(var p=[];;){var m=Zc(u,l);if(null===m)break;if(p.push(m),!h)break;""===String(m[0])&&(u.lastIndex=Xc(l,Qc(u.lastIndex),f))}for(var v,g="",y=0,b=0;b<p.length;b++){m=p[b];for(var _=String(m[0]),w=eh(th(Yc(m.index),l.length),0),A=[],k=1;k<m.length;k++)A.push(void 0===(v=m[k])?v:String(v));var E=m.groups;if(c){var x=[_].concat(A,w,l);void 0!==E&&x.push(E);var S=String(r.apply(void 0,x))}else S=o(_,l,w,A,E,r);w>=y&&(g+=l.slice(y,w)+S,y=w+_.length)}return g+l.slice(y)}];function o(e,n,r,a,i,s){var o=r+e.length,d=a.length,u=ah;return void 0!==i&&(i=$c(i),u=rh),t.call(s,u,(function(t,s){var u;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(o);case"<":u=i[s.slice(1,-1)];break;default:var l=+s;if(0===l)return t;if(l>d){var c=nh(l/10);return 0===c?t:c<=d?void 0===a[c-1]?s.charAt(1):a[c-1]+s.charAt(1):t}u=a[l-1]}return void 0===u?"":u}))}}));var sh={name:"@bygd/gd-sdk-pes",version:"1.27.9",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"}},oh="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==oh&&oh,dh="URLSearchParams"in oh,uh="Symbol"in oh&&"iterator"in Symbol,lh="FileReader"in oh&&"Blob"in oh&&function(){try{return new Blob,!0}catch(e){return!1}}(),ch="FormData"in oh,hh="ArrayBuffer"in oh;if(hh)var fh=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ph=ArrayBuffer.isView||function(e){return e&&fh.indexOf(Object.prototype.toString.call(e))>-1};function mh(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function vh(e){return"string"!=typeof e&&(e=String(e)),e}function gh(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return uh&&(t[Symbol.iterator]=function(){return t}),t}function yh(e){this.map={},e instanceof yh?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 bh(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function _h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function wh(e){var t=new FileReader,n=_h(t);return t.readAsArrayBuffer(e),n}function Ah(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function kh(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:lh&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:ch&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:dh&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():hh&&lh&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=Ah(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):hh&&(ArrayBuffer.prototype.isPrototypeOf(e)||ph(e))?this._bodyArrayBuffer=Ah(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):dh&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},lh&&(this.blob=function(){var e=bh(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=bh(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(wh)}),this.text=function(){var e=bh(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=_h(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)},ch&&(this.formData=function(){return this.text().then(Sh)}),this.json=function(){return this.text().then(JSON.parse)},this}yh.prototype.append=function(e,t){e=mh(e),t=vh(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},yh.prototype.delete=function(e){delete this.map[mh(e)]},yh.prototype.get=function(e){return e=mh(e),this.has(e)?this.map[e]:null},yh.prototype.has=function(e){return this.map.hasOwnProperty(mh(e))},yh.prototype.set=function(e,t){this.map[mh(e)]=vh(t)},yh.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},yh.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),gh(e)},yh.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),gh(e)},yh.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),gh(e)},uh&&(yh.prototype[Symbol.iterator]=yh.prototype.entries);var Eh=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function xh(e,t){if(!(this instanceof xh))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,a=(t=t||{}).body;if(e instanceof xh){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new yh(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=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 yh(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),Eh.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Sh(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 Dh(e,t){if(!(this instanceof Dh))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="statusText"in t?t.statusText:"",this.headers=new yh(t.headers),this.url=t.url||"",this._initBody(e)}xh.prototype.clone=function(){return new xh(this,{body:this._bodyInit})},kh.call(xh.prototype),kh.call(Dh.prototype),Dh.prototype.clone=function(){return new Dh(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new yh(this.headers),url:this.url})},Dh.error=function(){var e=new Dh(null,{status:0,statusText:""});return e.type="error",e};var Th=[301,302,303,307,308];Dh.redirect=function(e,t){if(-1===Th.indexOf(t))throw new RangeError("Invalid status code");return new Dh(null,{status:t,headers:{location:e}})};var Rh=oh.DOMException;try{new Rh}catch(e){(Rh=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),Rh.prototype.constructor=Rh}function Oh(e,t){return new Promise((function(n,r){var a=new xh(e,t);if(a.signal&&a.signal.aborted)return r(new Rh("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 yh,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).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 Dh(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 Rh("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&oh.location.href?oh.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&&(lh?i.responseType="blob":hh&&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 yh?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,vh(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)}))}Oh.polyfill=!0,oh.fetch||(oh.fetch=Oh,oh.Headers=yh,oh.Request=xh,oh.Response=Dh);var Ch,Ih=Array.isArray,Ph=Object.prototype.toString,Lh=Ih||function(e){return!!e&&"[object Array]"==Ph.call(e)},Mh=function(){return Ch},jh=function(e){var t=this,n=new ih;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(){return A.default(this,t),"https://game.api.gamedistribution.com/game/v4/get/".concat(e.gameId.replace(/-/g,""),"/?domain=").concat(r,"&v=").concat(sh.version,"&localTime=").concat((new Date).getHours())}.bind(this),o=function(e){A.default(this,t);var n=d("object"===k.default(e)?e:a.parseJSON(e));return n&&n.version?sh.version>=n.version?n:void 0:n}.bind(this),d=function(e){var n=this;if(A.default(this,t),!Lh(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),Ch)e(Ch);else{var r=i(),d=s();fetch(d).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,d,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:o(l.push_cuda),bloc_gard:o(l.bloc_gard),cookie:o(l.cookie),gdpr:o(l.gdpr),diagnostic:o(l.diagnostic),cmp:o(l.cmp),gft:o(l.gft),sdk:o(l.sdk)||{},sdkfw:o(l.sdkfw)||{},loader:o(l.loader)||{},splash:o(l.splash)||{},promo:o(l.promo)||{},dAds:o(l.dads)||{},pAds:o(l.pads)||{},mAds:o(l.mads)||{},rAds:o(l.rads)||{},lp:o(l.lp)||{},extsc:o(l.extsc)||{}},h=a.extendDefaults(I.default(r),c);h.afg_disabled=!1===(null===(s=h.sdk)||void 0===s||null===(d=s.afg)||void 0===d?void 0:d.enabled),null!==(u=h.pAds)&&void 0!==u&&u.enabled&&(h.preroll=!0),Ch=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))},Uh=function(){var e,t=Mh();return!(null==t||null===(e=t.sdkfw)||void 0===e||!e.enabled)},Bh=function(){var e,t,n,r,a,i,s=Mh(),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)}},Nh=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=Bh()).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)}}(),Gh=!1,qh=!1,Fh=function(){var e=this;return new Promise(function(t,n){var r=this;if(A.default(this,e),Gh)return t(qh);Gh=!0;var a=Bh();if(!a.enabled)return t(!1);var i=a.loadedFlag,s=a.loadedFlagCheck;if(s&&!i)return t(!1);if(!s)return qh=!0,t(!0);var o=!0;setTimeout(function(){A.default(this,r),o&&(console.log("extsc: clearing on wait after timeout"),o=!1,Gh=!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,Gh=!0,qh=!0,clearInterval(d),t(!0)):o||(console.log("extsc: clearing interval after timeout"),clearInterval(d))}.bind(this),100)}.bind(this))},Vh=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},Kh=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)}},Wh=function(){var e=this;return new Promise(function(t,n){var r=this;A.default(this,e);var a={type:"gd-sdk-frame-handshake-request"},i=!1;window.addEventListener("message",(function(e){var n=e.data,r=e.origin,a=e.source,s=n.type;if("gd-sdk-frame-handshake-request"===s){var o={type:"gd-sdk-frame-handshake-response"};a.postMessage(o,r)}else"gd-sdk-frame-handshake-response"===s&&(i=!0,t({origin:r,source:a}))})),setTimeout(function(){A.default(this,r),i||t()}.bind(this),200),window.parent!==window?window.parent.postMessage(a,"*"):t()}.bind(this))},Hh=function(){var e=w.default(E.default.mark((function e(t){var n,r,a,i,s,o,d,u,l;return E.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jh(t);case 2:return e.next=5,Uh();case 5:if(n=e.sent,console.log("gd:adp ,isSDKForwardEnable",n),n){e.next=9;break}return e.abrupt("return",!1);case 9:if(r=Kh(),a=r.isMasterGameURL,i=r.isTokenGameURL,s=a(),o=i(),c=void 0,h=void 0,h=Mh(),d=Uh()&&!(null==h||null===(c=h.sdkfw)||void 0===c||!c.handshake),u=!1,l=!1,!d){e.next=22;break}return e.next=18,Wh();case 18:l=e.sent,u=!s&&!!l,e.next=23;break;case 22:u=!s;case 23:return console.log("gd:adp: frameCheck result",{_isMasterGameURL:s,_isTokenGameURL:o,isHandshakeEnabled:d,hsResult:l,result:u}),e.abrupt("return",u);case 25:case"end":return e.stop()}var c,h}),e)})));return function(t){return e.apply(this,arguments)}}(),zh=F,$h=Cn,Qh=ne,Yh=V.f,Jh=function(e){return function(t){for(var n,r=Qh(t),a=$h(r),i=a.length,s=0,o=[];i>s;)n=a[s++],zh&&!Yh.call(r,n)||o.push(e?[n,r[n]]:r[n]);return o}},Xh={entries:Jh(!0),values:Jh(!1)}.values;Sn({target:"Object",stat:!0},{values:function(e){return Xh(e)}});var Zh=Sn,ef=kd,tf=q,nf=Rt,rf=Kd,af=Fu,sf=Pe.exports;Zh({target:"Promise",proto:!0,real:!0,forced:!!ef&&tf((function(){ef.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=rf(this,nf("Promise")),n="function"==typeof e;return this.then(n?function(n){return af(t,e()).then((function(){return n}))}:e,n?function(n){return af(t,e()).then((function(){throw n}))}:e)}}),"function"!=typeof ef||ef.prototype.finally||sf(ef.prototype,"finally",nf("Promise").prototype.finally);var of=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},df=Ee,uf=Z,lf=of,cf=Wc;Gc("search",1,(function(e,t,n){return[function(t){var n=uf(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var a=df(e),i=String(this),s=a.lastIndex;lf(s,0)||(a.lastIndex=0);var o=cf(a,i);return lf(a.lastIndex,s)||(a.lastIndex=s),null===o?-1:o.index}]}));var hf=Z,ff="[\t\n\v\f\r \u2028\u2029\ufeff]",pf=RegExp("^"+ff+ff+"*"),mf=RegExp(ff+ff+"*$"),vf=function(e){return function(t){var n=String(hf(t));return 1&e&&(n=n.replace(pf,"")),2&e&&(n=n.replace(mf,"")),n}},gf={start:vf(1),end:vf(2),trim:vf(3)},yf=q,bf="\t\n\v\f\r \u2028\u2029\ufeff",_f=gf.trim;Sn({target:"String",proto:!0,forced:function(e){return yf((function(){return!!bf[e]()||"
"!="
"[e]()||bf[e].name!==e}))}("trim")},{trim:function(){return _f(this)}});var wf=re,Af=po,kf=re,Ef=Q,xf=vr("match"),Sf=function(e){var t;return kf(e)&&(void 0!==(t=e[xf])?!!t:"RegExp"==Ef(e))},Df=F,Tf=N,Rf=yn,Of=function(e,t,n){var r,a;return Af&&"function"==typeof(r=t.constructor)&&r!==n&&wf(a=r.prototype)&&a!==n.prototype&&Af(e,a),e},Cf=Ae.f,If=Ot.f,Pf=Sf,Lf=vc,Mf=gc,jf=Pe.exports,Uf=q,Bf=vt.set,Nf=Rd,Gf=vr("match"),qf=Tf.RegExp,Ff=qf.prototype,Vf=/a/g,Kf=/a/g,Wf=new qf(Vf)!==Vf,Hf=Mf.UNSUPPORTED_Y;if(Df&&Rf("RegExp",!Wf||Hf||Uf((function(){return Kf[Gf]=!1,qf(Vf)!=Vf||qf(Kf)==Kf||"/a/i"!=qf(Vf,"i")})))){for(var zf=function(e,t){var n,r=this instanceof zf,a=Pf(e),i=void 0===t;if(!r&&a&&e.constructor===zf&&i)return e;Wf?a&&!i&&(e=e.source):e instanceof zf&&(i&&(t=Lf.call(e)),e=e.source),Hf&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=Of(Wf?new qf(e,t):qf(e,t),r?this:Ff,zf);return Hf&&n&&Bf(s,{sticky:n}),s},$f=function(e){e in zf||Cf(zf,e,{configurable:!0,get:function(){return qf[e]},set:function(t){qf[e]=t}})},Qf=If(qf),Yf=0;Qf.length>Yf;)$f(Qf[Yf++]);Ff.constructor=zf,zf.prototype=Ff,jf(Tf,"RegExp",zf)}Nf("RegExp");var Jf=Pe.exports,Xf=Ee,Zf=q,ep=vc,tp=RegExp.prototype,np=tp.toString,rp=Zf((function(){return"/a/b"!=np.call({source:"a",flags:"b"})})),ap="toString"!=np.name;(rp||ap)&&Jf(RegExp.prototype,"toString",(function(){var e=Xf(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in tp)?ep.call(e):n)}),{unsafe:!0});var ip,sp=Sf,op=function(e){if(sp(e))throw TypeError("The method doesn't accept regular expressions");return e},dp=vr("match"),up=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[dp]=!1,"/./"[e](t)}catch(e){}}return!1},lp=Sn,cp=G.f,hp=jt,fp=op,pp=Z,mp=up,vp="".startsWith,gp=Math.min,yp=mp("startsWith");lp({target:"String",proto:!0,forced:!!(yp||(ip=cp(String.prototype,"startsWith"),!ip||ip.writable))&&!yp},{startsWith:function(e){var t=String(pp(this));fp(e);var n=hp(gp(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return vp?vp.call(t,r,n):t.slice(n,n+r.length)===r}});var bp=Wt.includes,_p=Jo;Sn({target:"Array",proto:!0,forced:!pi("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return bp(this,e,arguments.length>1?arguments[1]:void 0)}}),_p("includes");var wp=op,Ap=Z;Sn({target:"String",proto:!0,forced:!up("includes")},{includes:function(e){return!!~String(Ap(this)).indexOf(wp(e),arguments.length>1?arguments[1]:void 0)}});var kp=Sn,Ep=Fr.find,xp=Jo,Sp=!0,Dp=pi("find");"find"in[]&&Array(1).find((function(){Sp=!1})),kp({target:"Array",proto:!0,forced:Sp||!Dp},{find:function(e){return Ep(this,e,arguments.length>1?arguments[1]:void 0)}}),xp("find");var Tp=F,Rp=q,Op=Cn,Cp=en,Ip=V,Pp=Tn,Lp=X,Mp=Object.assign,jp=Object.defineProperty,Up=!Mp||Rp((function(){if(Tp&&1!==Mp({b:1},Mp(jp({},"a",{enumerable:!0,get:function(){jp(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!=Mp({},e)[n]||Op(Mp({},t)).join("")!=r}))?function(e,t){for(var n=Pp(e),r=arguments.length,a=1,i=Cp.f,s=Ip.f;r>a;)for(var o,d=Lp(arguments[a++]),u=i?Op(d).concat(i(d)):Op(d),l=u.length,c=0;l>c;)o=u[c++],Tp&&!s.call(d,o)||(n[o]=d[o]);return n}:Mp;Sn({target:"Object",stat:!0,forced:Object.assign!==Up},{assign:Up});var Bp=Gc,Np=Sf,Gp=Ee,qp=Z,Fp=Kd,Vp=Fc,Kp=jt,Wp=Wc,Hp=Tc,zp=q,$p=[].push,Qp=Math.min,Yp=!zp((function(){return!RegExp(4294967295,"y")}));Bp("split",2,(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=String(qp(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!Np(e))return t.call(r,e,a);for(var i,s,o,d=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,c=new RegExp(e.source,u+"g");(i=Hp.call(c,r))&&!((s=c.lastIndex)>l&&(d.push(r.slice(l,i.index)),i.length>1&&i.index<r.length&&$p.apply(d,i.slice(1)),o=i[0].length,l=s,d.length>=a));)c.lastIndex===i.index&&c.lastIndex++;return l===r.length?!o&&c.test("")||d.push(""):d.push(r.slice(l)),d.length>a?d.slice(0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var a=qp(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,a,n):r.call(String(a),t,n)},function(e,a){var i=n(r,e,this,a,r!==t);if(i.done)return i.value;var s=Gp(e),o=String(this),d=Fp(s,RegExp),u=s.unicode,l=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(Yp?"y":"g"),c=new d(Yp?s:"^(?:"+s.source+")",l),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===o.length)return null===Wp(c,o)?[o]:[];for(var f=0,p=0,m=[];p<o.length;){c.lastIndex=Yp?p:0;var v,g=Wp(c,Yp?o:o.slice(p));if(null===g||(v=Qp(Kp(c.lastIndex+(Yp?0:p)),o.length))===f)p=Vp(o,p,u);else{if(m.push(o.slice(f,p)),m.length===h)return m;for(var y=1;y<=g.length-1;y++)if(m.push(g[y]),m.length===h)return m;p=f=v}}return m.push(o.slice(f)),m}]}),!Yp);var Jp=function(){function e(t){x.default(this,e),this.gameData=t,this.customParamKeys=["vid","_1ld","_1lp"]}return P.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}(),Xp=function(){function e(t,n){x.default(this,e),this.adContainer=t,this.onResume=n}return P.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}(),Zp=function(e){if(!e)return!1;var t=em.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)},em=Object.prototype.toString;function tm(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 nm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tm(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rm(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 am(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 im(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?am(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):am(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sm=null,om=function(){function e(t,n,r){var i=this;if(x.default(this,e),sm)return sm;sm=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 P.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:im(im({},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:im(im({},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=im(im({},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=nm(nm({},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=nm(nm({},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(rm({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(rm({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: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 30:e.next=33;break;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 Xp(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(im(im({},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,im({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(im(im({},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,im({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;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: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}})}catch(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(Zp(e.getInnerError)){var t=e.getInnerError();if(t)return Zp(t.getErrorCode)&&Zp(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 j.default(s.query,r.query||{}),im({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=I.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,j.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,O,C,I=Math.random()<A;return h&&I&&("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===(O=R.rAds)||void 0===O||null===(C=O.t4r)||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,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 Jp(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 Jp(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}(),dm=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,fc(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},cc(this.moduleName,this.moduleConfig)},um=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,fc(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},cc(this.moduleName,this.moduleConfig)},lm=function(e,t){console.log(e,t)},cm={},hm={},fm=null;function pm(){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 cm.version=r,cm.frame=e,cm.function=n,cm.version}function mm(e){var t=this;return fm||(fm=new Promise(function(n){function r(t,r){if(lm("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:cm,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}A.default(this,t),pm(),cm.frame?2===cm.version?(lm("TCF v2 CMP found. Fetching the consent."),cm.function?(lm("CMP API is directly accessible, calling it now..."),cm.function("addEventListener",cm.version,r)):(lm("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!==hm[r.callId]&&hm[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});hm[o]=i,t.postMessage(u,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,cm.version,n)}("addEventListener",cm.frame,r))):n({result:"cmpVersionNotV2",cmp:cm}):n({result:"cmpNotFound"})}.bind(this)))}var vm=new(function(){function e(){x.default(this,e),this.productName="Game Distribution"}var t;return P.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 gm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ym(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ym(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function ym(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var bm=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=gm(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))},_m=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,bm({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,bm({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,bm({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)}}(),wm=new b.EventEmitter,Am={"https://games.softgames.com":{"splash-hidden":"splash-hidden"}};function km(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 Em(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?km(Object(n),!0).forEach((function(t){S.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):km(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(Am).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=Am[r][a];i&&wm.emit(i,n)}}),!1);var xm,Sm=null,Dm=null,Tm=function(){function e(t){var n=this;if(x.default(this,e),Sm)return Sm;Sm=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new ih,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 P.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 ih,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,_m();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=pm();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,mm({});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;wm.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"}),this._sendGamedockEvent("gameplay")}catch(e){}}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(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=I.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=sh.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:sh.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),Dm=this._initGamedockTracker(window.GamedockSDK),this._sendGamedockEvent("pageview"),null!==(t=this._gameData.diagnostic)&&void 0!==t&&null!==(n=t.gameDock)&&void 0!==n&&n.adViewEvent&&Dm.tracking.enableHeartBeatForPage({pageId:this.options.gameId,pageType:"game"}),vm.track(Dm,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=Dm)||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&&vm.track(Dm,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(sh.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 om(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=sh,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=Mh();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(I.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(Em(Em({},this.options),{},{isConsentDomain:n,version:sh.version}),t,this._parentDomain),s=Bh(),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(Em(Em({},this.options),{},{isConsentDomain:n,version:sh.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(Em(Em({},this.options),{},{isConsentDomain:n,version:sh.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._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,Em(Em({},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=24,r.adInstance.startAd(c);case 24:r._post_message({topic:"adrequest.instream"}),e.next=31;break;case 27:e.prev=27,e.t0=e.catch(0),r.onResumeGame(e.t0.message,"warning"),i(e.t0.message);case 31:case"end":return e.stop()}}),e,this,[[0,27]])})));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+""}})}},{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 um(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 dm(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=Em(Em({},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?sh.version>=t.version?t:void 0:t}},{key:"_selectRandomOne",value:function(e){var t=this;if(!Lh(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}(),Rm={},Om=function(e){if(Rm.source){var t={type:"gd-sdk-on-event",event:e};Rm.source.postMessage(t,Rm.origin)}},Cm=function(){Om({name:"SDK_READY",status:"success",message:"Everything is ready."}),Om({name:"SDK_GAME_START",status:"success",message:"Advertisement(s) are done. Start / resume the game."}),Om({name:"CONTENT_RESUME_REQUESTED",status:"success",message:"Fired when content should be resumed. This usually happens when an ad finishes or collapses."})},Im=function(e){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(!Rm.source&&"init"===s)return function(e){var t=e.source,n=e.origin;Rm={source:t,origin:n}}({source:a,origin:r}),void Cm();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)},Pm=function(e){Uh()&&function(e){var t=e.onEvent;e.onEvent=function(e){Om(e),t.apply(this,arguments)}}(e);var t=new Tm(e);return Uh()?(Im(t),t):t},Lm={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,Hh(t);case 3:return n=e.sent,r=n?Vh(t):Pm(t),Nh(),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",Pm(t));case 13:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()};function Mm(){return(Mm=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,Fh();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,Um(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 jm=!1;function Um(e){var t=this;return new Promise(function(n,r){var a=this;if(A.default(this,t),xm)return n(xm);if(jm)var i=setInterval(function(){A.default(this,a),xm&&(jm=!1,clearInterval(i),n(xm))}.bind(this),100);else jm=!0,Lm.create(e).then(function(e){A.default(this,a),console.log("sdk created!"),xm=e,e._sendSDKReady(),jm=!1,n(xm)}.bind(this))}.bind(this))}var Bm,Nm=(Um(Bm=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 Mm.apply(this,arguments)}(Bm,e)}});function Gm(){var e=this;this.AdType=a.AdType,this.preloadAd=function(e){var t=this;return Nm.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",Nm.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 Nm.invoke(function(t){return A.default(this,e),t.cancelAd()}.bind(this))},this.openConsole=function(){var e=this;return Nm.invoke(function(t){return A.default(this,e),t.openConsole()}.bind(this))},this.getSession=function(){var e=this;return Nm.invoke(function(t){return A.default(this,e),t.session()}.bind(this))},this.leaderboard={show:function(){A.default(this,e),pc.showLeaderboard()}.bind(this),addScore:function(t){A.default(this,e),pc.addScore(t)}.bind(this)}}Gm.prototype=new function(){this.showBanner=function(){var e=this;return Nm.invoke(function(t){return A.default(this,e),t.showBanner()}.bind(this))},this.play=function(){},this.customLog=function(){}},window.gdsdk=new Gm,window.gdApi=window.gdsdk;
|