@bygd/gd-sdk-pes 1.22.3 → 1.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/newArrowCheck"),t=require("@babel/runtime/helpers/typeof"),n=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/asyncToGenerator"),a=require("@babel/runtime/helpers/classCallCheck"),i=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/regenerator"),o=require("@babel/runtime/helpers/objectWithoutProperties"),d=require("@bygd/gd-sdk-era/dist/default"),u=require("url-parse"),c=require("can-autoplay"),l=require("is-plain-object"),h=require("lodash.clonedeep"),p=require("querystringify"),f=require("lodash.merge"),m=require("js-base64"),g=require("validator"),v=require("is-valid-domain"),y=require("get-value"),b=require("set-value");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var w=_(e),A=_(t),E=_(n),k=_(r),S=_(a),x=_(i),T=_(s),D=_(o),R=_(u),O=_(c),I=_(h),C=_(p),P=_(f),L=_(g),U=_(v),j=_(y),M=_(b),B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},N=function(e){return e&&e.Math==Math&&e},q=N("object"==typeof globalThis&&globalThis)||N("object"==typeof window&&window)||N("object"==typeof self&&self)||N("object"==typeof B&&B)||function(){return this}()||Function("return this")(),G={},V=function(e){try{return!!e()}catch(e){return!0}},F=!V((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),K={},W={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,H=z&&!W.call({1:2},1);K.f=H?function(e){var t=z(this,e);return!!t&&t.enumerable}:W;var $=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Q={}.toString,Y=function(e){return Q.call(e).slice(8,-1)},J=Y,X="".split,Z=V((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==J(e)?X.call(e,""):Object(e)}:Object,ee=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},te=Z,ne=ee,re=function(e){return te(ne(e))},ae=function(e){return"object"==typeof e?null!==e:"function"==typeof e},ie=ae,se=function(e,t){if(!ie(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!ie(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!ie(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!ie(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},oe={}.hasOwnProperty,de=function(e,t){return oe.call(e,t)},ue=ae,ce=q.document,le=ue(ce)&&ue(ce.createElement),he=function(e){return le?ce.createElement(e):{}},pe=he,fe=!F&&!V((function(){return 7!=Object.defineProperty(pe("div"),"a",{get:function(){return 7}}).a})),me=F,ge=K,ve=$,ye=re,be=se,_e=de,we=fe,Ae=Object.getOwnPropertyDescriptor;G.f=me?Ae:function(e,t){if(e=ye(e),t=be(t,!0),we)try{return Ae(e,t)}catch(e){}if(_e(e,t))return ve(!ge.f.call(e,t),e[t])};var Ee={},ke=ae,Se=function(e){if(!ke(e))throw TypeError(String(e)+" is not an object");return e},xe=F,Te=fe,De=Se,Re=se,Oe=Object.defineProperty;Ee.f=xe?Oe:function(e,t,n){if(De(e),t=Re(t,!0),De(n),Te)try{return Oe(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 Ie=Ee,Ce=$,Pe=F?function(e,t,n){return Ie.f(e,t,Ce(1,n))}:function(e,t,n){return e[t]=n,e},Le={exports:{}},Ue=q,je=Pe,Me=function(e,t){try{je(Ue,e,t)}catch(n){Ue[e]=t}return t},Be=Me,Ne=q["__core-js_shared__"]||Be("__core-js_shared__",{}),qe=Ne,Ge=Function.toString;"function"!=typeof qe.inspectSource&&(qe.inspectSource=function(e){return Ge.call(e)});var Ve=qe.inspectSource,Fe=Ve,Ke=q.WeakMap,We="function"==typeof Ke&&/native code/.test(Fe(Ke)),ze={exports:{}},He=Ne;(ze.exports=function(e,t){return He[e]||(He[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.10.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var $e,Qe,Ye,Je=0,Xe=Math.random(),Ze=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Je+Xe).toString(36)},et=ze.exports,tt=Ze,nt=et("keys"),rt=function(e){return nt[e]||(nt[e]=tt(e))},at={},it=We,st=ae,ot=Pe,dt=de,ut=Ne,ct=rt,lt=at,ht=q.WeakMap;if(it){var pt=ut.state||(ut.state=new ht),ft=pt.get,mt=pt.has,gt=pt.set;$e=function(e,t){return t.facade=e,gt.call(pt,e,t),t},Qe=function(e){return ft.call(pt,e)||{}},Ye=function(e){return mt.call(pt,e)}}else{var vt=ct("state");lt[vt]=!0,$e=function(e,t){return t.facade=e,ot(e,vt,t),t},Qe=function(e){return dt(e,vt)?e[vt]:{}},Ye=function(e){return dt(e,vt)}}var yt={set:$e,get:Qe,has:Ye,enforce:function(e){return Ye(e)?Qe(e):$e(e,{})},getterFor:function(e){return function(t){var n;if(!st(t)||(n=Qe(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},bt=q,_t=Pe,wt=de,At=Me,Et=Ve,kt=yt.get,St=yt.enforce,xt=String(String).split("String");(Le.exports=function(e,t,n,r){var a,i=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||wt(n,"name")||_t(n,"name",t),(a=St(n)).source||(a.source=xt.join("string"==typeof t?t:""))),e!==bt?(i?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:_t(e,t,n)):s?e[t]=n:At(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&kt(this).source||Et(this)}));var Tt=q,Dt=Tt,Rt=q,Ot=function(e){return"function"==typeof e?e:void 0},It=function(e,t){return arguments.length<2?Ot(Dt[e])||Ot(Rt[e]):Dt[e]&&Dt[e][t]||Rt[e]&&Rt[e][t]},Ct={},Pt=Math.ceil,Lt=Math.floor,Ut=function(e){return isNaN(e=+e)?0:(e>0?Lt:Pt)(e)},jt=Ut,Mt=Math.min,Bt=function(e){return e>0?Mt(jt(e),9007199254740991):0},Nt=Ut,qt=Math.max,Gt=Math.min,Vt=function(e,t){var n=Nt(e);return n<0?qt(n+t,0):Gt(n,t)},Ft=re,Kt=Bt,Wt=Vt,zt=function(e){return function(t,n,r){var a,i=Ft(t),s=Kt(i.length),o=Wt(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}},Ht={includes:zt(!0),indexOf:zt(!1)},$t=de,Qt=re,Yt=Ht.indexOf,Jt=at,Xt=function(e,t){var n,r=Qt(e),a=0,i=[];for(n in r)!$t(Jt,n)&&$t(r,n)&&i.push(n);for(;t.length>a;)$t(r,n=t[a++])&&(~Yt(i,n)||i.push(n));return i},Zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],en=Xt,tn=Zt.concat("length","prototype");Ct.f=Object.getOwnPropertyNames||function(e){return en(e,tn)};var nn={};nn.f=Object.getOwnPropertySymbols;var rn=Ct,an=nn,sn=Se,on=It("Reflect","ownKeys")||function(e){var t=rn.f(sn(e)),n=an.f;return n?t.concat(n(e)):t},dn=de,un=on,cn=G,ln=Ee,hn=function(e,t){for(var n=un(t),r=ln.f,a=cn.f,i=0;i<n.length;i++){var s=n[i];dn(e,s)||r(e,s,a(t,s))}},pn=V,fn=/#|\.prototype\./,mn=function(e,t){var n=vn[gn(e)];return n==bn||n!=yn&&("function"==typeof t?pn(t):!!t)},gn=mn.normalize=function(e){return String(e).replace(fn,".").toLowerCase()},vn=mn.data={},yn=mn.NATIVE="N",bn=mn.POLYFILL="P",_n=mn,wn=q,An=G.f,En=Pe,kn=Le.exports,Sn=Me,xn=hn,Tn=_n,Dn=function(e,t){var n,r,a,i,s,o=e.target,d=e.global,u=e.stat;if(n=d?wn:u?wn[o]||Sn(o,{}):(wn[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=An(n,r))&&s.value:n[r],!Tn(d?r:o+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;xn(i,a)}(e.sham||a&&a.sham)&&En(i,"sham",!0),kn(n,r,i,e)}},Rn=ee,On=function(e){return Object(Rn(e))},In=Xt,Cn=Zt,Pn=Object.keys||function(e){return In(e,Cn)},Ln=On,Un=Pn;Dn({target:"Object",stat:!0,forced:V((function(){Un(1)}))},{keys:function(e){return Un(Ln(e))}});var jn,Mn,Bn=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Nn=Bn,qn=function(e,t,n){if(Nn(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)}},Gn=Y,Vn=Array.isArray||function(e){return"Array"==Gn(e)},Fn="process"==Y(q.process),Kn=It("navigator","userAgent")||"",Wn=Kn,zn=q.process,Hn=zn&&zn.versions,$n=Hn&&Hn.v8;$n?Mn=(jn=$n.split("."))[0]+jn[1]:Wn&&(!(jn=Wn.match(/Edge\/(\d+)/))||jn[1]>=74)&&(jn=Wn.match(/Chrome\/(\d+)/))&&(Mn=jn[1]);var Qn=Mn&&+Mn,Yn=Fn,Jn=Qn,Xn=V,Zn=!!Object.getOwnPropertySymbols&&!Xn((function(){return!Symbol.sham&&(Yn?38===Jn:Jn>37&&Jn<41)})),er=Zn&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tr=q,nr=ze.exports,rr=de,ar=Ze,ir=Zn,sr=er,or=nr("wks"),dr=tr.Symbol,ur=sr?dr:dr&&dr.withoutSetter||ar,cr=function(e){return rr(or,e)&&(ir||"string"==typeof or[e])||(ir&&rr(dr,e)?or[e]=dr[e]:or[e]=ur("Symbol."+e)),or[e]},lr=ae,hr=Vn,pr=cr("species"),fr=function(e,t){var n;return hr(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!hr(n.prototype)?lr(n)&&null===(n=n[pr])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},mr=qn,gr=Z,vr=On,yr=Bt,br=fr,_r=[].push,wr=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=7==e,o=5==e||i;return function(d,u,c,l){for(var h,p,f=vr(d),m=gr(f),g=mr(u,c,3),v=yr(m.length),y=0,b=l||br,_=t?b(d,v):n||s?b(d,0):void 0;v>y;y++)if((o||y in m)&&(p=g(h=m[y],y,f),e))if(t)_[y]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:_r.call(_,h)}else switch(e){case 4:return!1;case 7:_r.call(_,h)}return i?-1:r||a?a:_}},Ar={forEach:wr(0),map:wr(1),filter:wr(2),some:wr(3),every:wr(4),find:wr(5),findIndex:wr(6),filterOut:wr(7)},Er=V,kr=Qn,Sr=cr("species"),xr=function(e){return kr>=51||!Er((function(){var t=[];return(t.constructor={})[Sr]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Tr=Ar.filter;Dn({target:"Array",proto:!0,forced:!xr("filter")},{filter:function(e){return Tr(this,e,arguments.length>1?arguments[1]:void 0)}});var Dr=Dn,Rr=V,Or=re,Ir=G.f,Cr=F,Pr=Rr((function(){Ir(1)}));Dr({target:"Object",stat:!0,forced:!Cr||Pr,sham:!Cr},{getOwnPropertyDescriptor:function(e,t){return Ir(Or(e),t)}});var Lr=se,Ur=Ee,jr=$,Mr=function(e,t,n){var r=Lr(t);r in e?Ur.f(e,r,jr(0,n)):e[r]=n},Br=on,Nr=re,qr=G,Gr=Mr;Dn({target:"Object",stat:!0,sham:!F},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Nr(e),a=qr.f,i=Br(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&Gr(s,t,n);return s}});var Vr={};Vr[cr("toStringTag")]="z";var Fr="[object z]"===String(Vr),Kr=Fr,Wr=Y,zr=cr("toStringTag"),Hr="Arguments"==Wr(function(){return arguments}()),$r=Kr?Wr: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),zr))?n:Hr?Wr(t):"Object"==(r=Wr(t))&&"function"==typeof t.callee?"Arguments":r},Qr=$r,Yr=Fr?{}.toString:function(){return"[object "+Qr(this)+"]"},Jr=Fr,Xr=Le.exports,Zr=Yr;Jr||Xr(Object.prototype,"toString",Zr,{unsafe:!0});var ea=q.Promise,ta=Le.exports,na=Ee.f,ra=de,aa=cr("toStringTag"),ia=function(e,t,n){e&&!ra(e=n?e:e.prototype,aa)&&na(e,aa,{configurable:!0,value:t})},sa=It,oa=Ee,da=F,ua=cr("species"),ca=function(e){var t=sa(e),n=oa.f;da&&t&&!t[ua]&&n(t,ua,{configurable:!0,get:function(){return this}})},la={},ha=la,pa=cr("iterator"),fa=Array.prototype,ma=function(e){return void 0!==e&&(ha.Array===e||fa[pa]===e)},ga=$r,va=la,ya=cr("iterator"),ba=function(e){if(null!=e)return e[ya]||e["@@iterator"]||va[ga(e)]},_a=Se,wa=function(e){var t=e.return;if(void 0!==t)return _a(t.call(e)).value},Aa=Se,Ea=ma,ka=Bt,Sa=qn,xa=ba,Ta=wa,Da=function(e,t){this.stopped=e,this.result=t},Ra=cr("iterator"),Oa=!1;try{var Ia=0,Ca={next:function(){return{done:!!Ia++}},return:function(){Oa=!0}};Ca[Ra]=function(){return this},Array.from(Ca,(function(){throw 2}))}catch(e){}var Pa,La,Ua,ja=function(e,t){if(!t&&!Oa)return!1;var n=!1;try{var r={};r[Ra]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Ma=Se,Ba=Bn,Na=cr("species"),qa=function(e,t){var n,r=Ma(e).constructor;return void 0===r||null==(n=Ma(r)[Na])?t:Ba(n)},Ga=It("document","documentElement"),Va=/(?:iphone|ipod|ipad).*applewebkit/i.test(Kn),Fa=q,Ka=V,Wa=qn,za=Ga,Ha=he,$a=Va,Qa=Fn,Ya=Fa.location,Ja=Fa.setImmediate,Xa=Fa.clearImmediate,Za=Fa.process,ei=Fa.MessageChannel,ti=Fa.Dispatch,ni=0,ri={},ai=function(e){if(ri.hasOwnProperty(e)){var t=ri[e];delete ri[e],t()}},ii=function(e){return function(){ai(e)}},si=function(e){ai(e.data)},oi=function(e){Fa.postMessage(e+"",Ya.protocol+"//"+Ya.host)};Ja&&Xa||(Ja=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return ri[++ni]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Pa(ni),ni},Xa=function(e){delete ri[e]},Qa?Pa=function(e){Za.nextTick(ii(e))}:ti&&ti.now?Pa=function(e){ti.now(ii(e))}:ei&&!$a?(Ua=(La=new ei).port2,La.port1.onmessage=si,Pa=Wa(Ua.postMessage,Ua,1)):Fa.addEventListener&&"function"==typeof postMessage&&!Fa.importScripts&&Ya&&"file:"!==Ya.protocol&&!Ka(oi)?(Pa=oi,Fa.addEventListener("message",si,!1)):Pa="onreadystatechange"in Ha("script")?function(e){za.appendChild(Ha("script")).onreadystatechange=function(){za.removeChild(this),ai(e)}}:function(e){setTimeout(ii(e),0)});var di,ui,ci,li,hi,pi,fi,mi,gi={set:Ja,clear:Xa},vi=/web0s(?!.*chrome)/i.test(Kn),yi=q,bi=G.f,_i=gi.set,wi=Va,Ai=vi,Ei=Fn,ki=yi.MutationObserver||yi.WebKitMutationObserver,Si=yi.document,xi=yi.process,Ti=yi.Promise,Di=bi(yi,"queueMicrotask"),Ri=Di&&Di.value;Ri||(di=function(){var e,t;for(Ei&&(e=xi.domain)&&e.exit();ui;){t=ui.fn,ui=ui.next;try{t()}catch(e){throw ui?li():ci=void 0,e}}ci=void 0,e&&e.enter()},wi||Ei||Ai||!ki||!Si?Ti&&Ti.resolve?(fi=Ti.resolve(void 0),mi=fi.then,li=function(){mi.call(fi,di)}):li=Ei?function(){xi.nextTick(di)}:function(){_i.call(yi,di)}:(hi=!0,pi=Si.createTextNode(""),new ki(di).observe(pi,{characterData:!0}),li=function(){pi.data=hi=!hi}));var Oi=Ri||function(e){var t={fn:e,next:void 0};ci&&(ci.next=t),ui||(ui=t,li()),ci=t},Ii={},Ci=Bn,Pi=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=Ci(t),this.reject=Ci(n)};Ii.f=function(e){return new Pi(e)};var Li,Ui,ji,Mi,Bi=Se,Ni=ae,qi=Ii,Gi=function(e,t){if(Bi(e),Ni(t)&&t.constructor===e)return t;var n=qi.f(e);return(0,n.resolve)(t),n.promise},Vi=q,Fi=Dn,Ki=q,Wi=It,zi=ea,Hi=Le.exports,$i=function(e,t,n){for(var r in t)ta(e,r,t[r],n);return e},Qi=ia,Yi=ca,Ji=ae,Xi=Bn,Zi=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},es=Ve,ts=function(e,t,n){var r,a,i,s,o,d,u,c=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=Sa(t,c,1+l+p),m=function(e){return r&&Ta(r),new Da(!0,e)},g=function(e){return l?(Aa(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if("function"!=typeof(a=xa(e)))throw TypeError("Target is not iterable");if(Ea(a)){for(i=0,s=ka(e.length);s>i;i++)if((o=g(e[i]))&&o instanceof Da)return o;return new Da(!1)}r=a.call(e)}for(d=r.next;!(u=d.call(r)).done;){try{o=g(u.value)}catch(e){throw Ta(r),e}if("object"==typeof o&&o&&o instanceof Da)return o}return new Da(!1)},ns=ja,rs=qa,as=gi.set,is=Oi,ss=Gi,os=function(e,t){var n=Vi.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},ds=Ii,us=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},cs=yt,ls=_n,hs=Fn,ps=Qn,fs=cr("species"),ms="Promise",gs=cs.get,vs=cs.set,ys=cs.getterFor(ms),bs=zi,_s=Ki.TypeError,ws=Ki.document,As=Ki.process,Es=Wi("fetch"),ks=ds.f,Ss=ks,xs=!!(ws&&ws.createEvent&&Ki.dispatchEvent),Ts="function"==typeof PromiseRejectionEvent,Ds=ls(ms,(function(){if(!(es(bs)!==String(bs))){if(66===ps)return!0;if(!hs&&!Ts)return!0}if(ps>=51&&/native code/.test(bs))return!1;var e=bs.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[fs]=t,!(e.then((function(){}))instanceof t)})),Rs=Ds||!ns((function(e){bs.all(e).catch((function(){}))})),Os=function(e){var t;return!(!Ji(e)||"function"!=typeof(t=e.then))&&t},Is=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;is((function(){for(var r=e.value,a=1==e.state,i=0;n.length>i;){var s,o,d,u=n[i++],c=a?u.ok:u.fail,l=u.resolve,h=u.reject,p=u.domain;try{c?(a||(2===e.rejection&&Us(e),e.rejection=1),!0===c?s=r:(p&&p.enter(),s=c(r),p&&(p.exit(),d=!0)),s===u.promise?h(_s("Promise-chain cycle")):(o=Os(s))?o.call(s,l,h):l(s)):h(r)}catch(e){p&&!d&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Ps(e)}))}},Cs=function(e,t,n){var r,a;xs?((r=ws.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Ki.dispatchEvent(r)):r={promise:t,reason:n},!Ts&&(a=Ki["on"+e])?a(r):"unhandledrejection"===e&&os("Unhandled promise rejection",n)},Ps=function(e){as.call(Ki,(function(){var t,n=e.facade,r=e.value;if(Ls(e)&&(t=us((function(){hs?As.emit("unhandledRejection",r,n):Cs("unhandledrejection",n,r)})),e.rejection=hs||Ls(e)?2:1,t.error))throw t.value}))},Ls=function(e){return 1!==e.rejection&&!e.parent},Us=function(e){as.call(Ki,(function(){var t=e.facade;hs?As.emit("rejectionHandled",t):Cs("rejectionhandled",t,e.value)}))},js=function(e,t,n){return function(r){e(t,r,n)}},Ms=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Is(e,!0))},Bs=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw _s("Promise can't be resolved itself");var r=Os(t);r?is((function(){var n={done:!1};try{r.call(t,js(Bs,n,e),js(Ms,n,e))}catch(t){Ms(n,t,e)}})):(e.value=t,e.state=1,Is(e,!1))}catch(t){Ms({done:!1},t,e)}}};Ds&&(bs=function(e){Zi(this,bs,ms),Xi(e),Li.call(this);var t=gs(this);try{e(js(Bs,t),js(Ms,t))}catch(e){Ms(t,e)}},(Li=function(e){vs(this,{type:ms,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=$i(bs.prototype,{then:function(e,t){var n=ys(this),r=ks(rs(this,bs));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=hs?As.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Is(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),Ui=function(){var e=new Li,t=gs(e);this.promise=e,this.resolve=js(Bs,t),this.reject=js(Ms,t)},ds.f=ks=function(e){return e===bs||e===ji?new Ui(e):Ss(e)},"function"==typeof zi&&(Mi=zi.prototype.then,Hi(zi.prototype,"then",(function(e,t){var n=this;return new bs((function(e,t){Mi.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Es&&Fi({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return ss(bs,Es.apply(Ki,arguments))}}))),Fi({global:!0,wrap:!0,forced:Ds},{Promise:bs}),Qi(bs,ms,!1),Yi(ms),ji=Wi(ms),Fi({target:ms,stat:!0,forced:Ds},{reject:function(e){var t=ks(this);return t.reject.call(void 0,e),t.promise}}),Fi({target:ms,stat:!0,forced:Ds},{resolve:function(e){return ss(this,e)}}),Fi({target:ms,stat:!0,forced:Rs},{all:function(e){var t=this,n=ks(t),r=n.resolve,a=n.reject,i=us((function(){var n=Xi(t.resolve),i=[],s=0,o=1;ts(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=ks(t),r=n.reject,a=us((function(){var a=Xi(t.resolve);ts(e,(function(e){a.call(t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var Ns=Dn,qs=ea,Gs=V,Vs=It,Fs=qa,Ks=Gi,Ws=Le.exports;Ns({target:"Promise",proto:!0,real:!0,forced:!!qs&&Gs((function(){qs.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=Fs(this,Vs("Promise")),n="function"==typeof e;return this.then(n?function(n){return Ks(t,e()).then((function(){return n}))}:e,n?function(n){return Ks(t,e()).then((function(){throw n}))}:e)}}),"function"!=typeof qs||qs.prototype.finally||Ws(qs.prototype,"finally",Vs("Promise").prototype.finally);var zs=Se,Hs=function(){var e=zs(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},$s={},Qs=V;function Ys(e,t){return RegExp(e,t)}$s.UNSUPPORTED_Y=Qs((function(){var e=Ys("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),$s.BROKEN_CARET=Qs((function(){var e=Ys("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Js=Hs,Xs=$s,Zs=ze.exports,eo=RegExp.prototype.exec,to=Zs("native-string-replace",String.prototype.replace),no=eo,ro=function(){var e=/a/,t=/b*/g;return eo.call(e,"a"),eo.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),ao=Xs.UNSUPPORTED_Y||Xs.BROKEN_CARET,io=void 0!==/()??/.exec("")[1];(ro||io||ao)&&(no=function(e){var t,n,r,a,i=this,s=ao&&i.sticky,o=Js.call(i),d=i.source,u=0,c=e;return s&&(-1===(o=o.replace("y","")).indexOf("g")&&(o+="g"),c=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(d="(?: "+d+")",c=" "+c,u++),n=new RegExp("^(?:"+d+")",o)),io&&(n=new RegExp("^"+d+"$(?!\\s)",o)),ro&&(t=i.lastIndex),r=eo.call(s?n:i,c),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:ro&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),io&&r&&r.length>1&&to.call(r[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r});var so=no;Dn({target:"RegExp",proto:!0,forced:/./.exec!==so},{exec:so});var oo=Le.exports,uo=V,co=cr,lo=Pe,ho=co("species"),po=!uo((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),fo="$0"==="a".replace(/./,"$0"),mo=co("replace"),go=!!/./[mo]&&""===/./[mo]("a","$0"),vo=!uo((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]})),yo=function(e,t,n,r){var a=co(e),i=!uo((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!uo((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[ho]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||"replace"===e&&(!po||!fo||go)||"split"===e&&!vo){var o=/./[a],d=n(a,""[e],(function(e,t,n,r,a){return t.exec===RegExp.prototype.exec?i&&!a?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:fo,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:go}),u=d[0],c=d[1];oo(String.prototype,e,u),oo(RegExp.prototype,a,2==t?function(e,t){return c.call(e,this,t)}:function(e){return c.call(e,this)})}r&&lo(RegExp.prototype[a],"sham",!0)},bo=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},_o=Y,wo=so,Ao=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"!==_o(e))throw TypeError("RegExp#exec called on incompatible receiver");return wo.call(e,t)},Eo=Se,ko=ee,So=bo,xo=Ao;yo("search",1,(function(e,t,n){return[function(t){var n=ko(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=Eo(e),i=String(this),s=a.lastIndex;So(s,0)||(a.lastIndex=0);var o=xo(a,i);return So(a.lastIndex,s)||(a.lastIndex=s),null===o?-1:o.index}]}));var To=ee,Do="[\t\n\v\f\r \u2028\u2029\ufeff]",Ro=RegExp("^"+Do+Do+"*"),Oo=RegExp(Do+Do+"*$"),Io=function(e){return function(t){var n=String(To(t));return 1&e&&(n=n.replace(Ro,"")),2&e&&(n=n.replace(Oo,"")),n}},Co={start:Io(1),end:Io(2),trim:Io(3)},Po=V,Lo="\t\n\v\f\r \u2028\u2029\ufeff",Uo=Co.trim;Dn({target:"String",proto:!0,forced:function(e){return Po((function(){return!!Lo[e]()||"
"!="
"[e]()||Lo[e].name!==e}))}("trim")},{trim:function(){return Uo(this)}});var jo={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},Mo=V,Bo=Ar.forEach,No=q,qo=jo,Go=function(e,t){var n=[][e];return!!n&&Mo((function(){n.call(null,t||function(){throw 1},1)}))}("forEach")?[].forEach:function(e){return Bo(this,e,arguments.length>1?arguments[1]:void 0)},Vo=Pe;for(var Fo in qo){var Ko=No[Fo],Wo=Ko&&Ko.prototype;if(Wo&&Wo.forEach!==Go)try{Vo(Wo,"forEach",Go)}catch(e){Wo.forEach=Go}}var zo=ae,Ho=Se,$o=function(e){if(!zo(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Qo=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),$o(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),Yo=ae,Jo=Qo,Xo=ae,Zo=Y,ed=cr("match"),td=function(e){var t;return Xo(e)&&(void 0!==(t=e[ed])?!!t:"RegExp"==Zo(e))},nd=F,rd=q,ad=_n,id=function(e,t,n){var r,a;return Jo&&"function"==typeof(r=t.constructor)&&r!==n&&Yo(a=r.prototype)&&a!==n.prototype&&Jo(e,a),e},sd=Ee.f,od=Ct.f,dd=td,ud=Hs,cd=$s,ld=Le.exports,hd=V,pd=yt.set,fd=ca,md=cr("match"),gd=rd.RegExp,vd=gd.prototype,yd=/a/g,bd=/a/g,_d=new gd(yd)!==yd,wd=cd.UNSUPPORTED_Y;if(nd&&ad("RegExp",!_d||wd||hd((function(){return bd[md]=!1,gd(yd)!=yd||gd(bd)==bd||"/a/i"!=gd(yd,"i")})))){for(var Ad=function(e,t){var n,r=this instanceof Ad,a=dd(e),i=void 0===t;if(!r&&a&&e.constructor===Ad&&i)return e;_d?a&&!i&&(e=e.source):e instanceof Ad&&(i&&(t=ud.call(e)),e=e.source),wd&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=id(_d?new gd(e,t):gd(e,t),r?this:vd,Ad);return wd&&n&&pd(s,{sticky:n}),s},Ed=function(e){e in Ad||sd(Ad,e,{configurable:!0,get:function(){return gd[e]},set:function(t){gd[e]=t}})},kd=od(gd),Sd=0;kd.length>Sd;)Ed(kd[Sd++]);vd.constructor=Ad,Ad.prototype=vd,ld(rd,"RegExp",Ad)}fd("RegExp");var xd=Le.exports,Td=Se,Dd=V,Rd=Hs,Od=RegExp.prototype,Id=Od.toString,Cd=Dd((function(){return"/a/b"!=Id.call({source:"a",flags:"b"})})),Pd="toString"!=Id.name;(Cd||Pd)&&xd(RegExp.prototype,"toString",(function(){var e=Td(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Od)?Rd.call(e):n)}),{unsafe:!0});var Ld=Dn,Ud=V,jd=Vn,Md=ae,Bd=On,Nd=Bt,qd=Mr,Gd=fr,Vd=xr,Fd=Qn,Kd=cr("isConcatSpreadable"),Wd=Fd>=51||!Ud((function(){var e=[];return e[Kd]=!1,e.concat()[0]!==e})),zd=Vd("concat"),Hd=function(e){if(!Md(e))return!1;var t=e[Kd];return void 0!==t?!!t:jd(e)};Ld({target:"Array",proto:!0,forced:!Wd||!zd},{concat:function(e){var t,n,r,a,i,s=Bd(this),o=Gd(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Hd(i=-1===t?s:arguments[t])){if(d+(a=Nd(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,d++)n in i&&qd(o,d,i[n])}else{if(d>=9007199254740991)throw TypeError("Maximum allowed index exceeded");qd(o,d++,i)}return o.length=d,o}});var $d,Qd=td,Yd=function(e){if(Qd(e))throw TypeError("The method doesn't accept regular expressions");return e},Jd=cr("match"),Xd=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Jd]=!1,"/./"[e](t)}catch(e){}}return!1},Zd=Dn,eu=G.f,tu=Bt,nu=Yd,ru=ee,au=Xd,iu="".startsWith,su=Math.min,ou=au("startsWith");Zd({target:"String",proto:!0,forced:!!(ou||($d=eu(String.prototype,"startsWith"),!$d||$d.writable))&&!ou},{startsWith:function(e){var t=String(ru(this));nu(e);var n=tu(su(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return iu?iu.call(t,r,n):t.slice(n,n+r.length)===r}});var du=Ut,uu=ee,cu=function(e){return function(t,n){var r,a,i=String(uu(t)),s=du(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}},lu={codeAt:cu(!1),charAt:cu(!0)},hu=lu.charAt,pu=function(e,t,n){return t+(n?hu(e,t).length:1)},fu=On,mu=Math.floor,gu="".replace,vu=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,yu=/\$([$&'`]|\d{1,2})/g,bu=yo,_u=Se,wu=Bt,Au=Ut,Eu=ee,ku=pu,Su=function(e,t,n,r,a,i){var s=n+e.length,o=r.length,d=yu;return void 0!==a&&(a=fu(a),d=vu),gu.call(i,d,(function(i,d){var u;switch(d.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(s);case"<":u=a[d.slice(1,-1)];break;default:var c=+d;if(0===c)return i;if(c>o){var l=mu(c/10);return 0===l?i:l<=o?void 0===r[l-1]?d.charAt(1):r[l-1]+d.charAt(1):i}u=r[c-1]}return void 0===u?"":u}))},xu=Ao,Tu=Math.max,Du=Math.min;bu("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=Eu(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 o=n(t,e,this,r);if(o.done)return o.value}var d=_u(e),u=String(this),c="function"==typeof r;c||(r=String(r));var l=d.global;if(l){var h=d.unicode;d.lastIndex=0}for(var p=[];;){var f=xu(d,u);if(null===f)break;if(p.push(f),!l)break;""===String(f[0])&&(d.lastIndex=ku(u,wu(d.lastIndex),h))}for(var m,g="",v=0,y=0;y<p.length;y++){f=p[y];for(var b=String(f[0]),_=Tu(Du(Au(f.index),u.length),0),w=[],A=1;A<f.length;A++)w.push(void 0===(m=f[A])?m:String(m));var E=f.groups;if(c){var k=[b].concat(w,_,u);void 0!==E&&k.push(E);var S=String(r.apply(void 0,k))}else S=Su(b,u,_,w,E,r);_>=v&&(g+=u.slice(v,_)+S,v=_+b.length)}return g+u.slice(v)}]}));var Ru=F,Ou=Ee.f,Iu=Function.prototype,Cu=Iu.toString,Pu=/^\s*function ([^ (]*)/;Ru&&!("name"in Iu)&&Ou(Iu,"name",{configurable:!0,get:function(){try{return Cu.call(this).match(Pu)[1]}catch(e){return""}}});var Lu,Uu=Ee,ju=Se,Mu=Pn,Bu=F?Object.defineProperties:function(e,t){ju(e);for(var n,r=Mu(t),a=r.length,i=0;a>i;)Uu.f(e,n=r[i++],t[n]);return e},Nu=Se,qu=Bu,Gu=Zt,Vu=at,Fu=Ga,Ku=he,Wu=rt("IE_PROTO"),zu=function(){},Hu=function(e){return"<script>"+e+"<\/script>"},$u=function(){try{Lu=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;$u=Lu?function(e){e.write(Hu("")),e.close();var t=e.parentWindow.Object;return e=null,t}(Lu):((t=Ku("iframe")).style.display="none",Fu.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Hu("document.F=Object")),e.close(),e.F);for(var n=Gu.length;n--;)delete $u.prototype[Gu[n]];return $u()};Vu[Wu]=!0;var Qu=Object.create||function(e,t){var n;return null!==e?(zu.prototype=Nu(e),n=new zu,zu.prototype=null,n[Wu]=e):n=$u(),void 0===t?n:qu(n,t)},Yu={},Ju=re,Xu=Ct.f,Zu={}.toString,ec="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Yu.f=function(e){return ec&&"[object Window]"==Zu.call(e)?function(e){try{return Xu(e)}catch(e){return ec.slice()}}(e):Xu(Ju(e))};var tc={},nc=cr;tc.f=nc;var rc=Tt,ac=de,ic=tc,sc=Ee.f,oc=function(e){var t=rc.Symbol||(rc.Symbol={});ac(t,e)||sc(t,e,{value:ic.f(e)})},dc=Dn,uc=q,cc=It,lc=F,hc=Zn,pc=er,fc=V,mc=de,gc=Vn,vc=ae,yc=Se,bc=On,_c=re,wc=se,Ac=$,Ec=Qu,kc=Pn,Sc=Ct,xc=Yu,Tc=nn,Dc=G,Rc=Ee,Oc=K,Ic=Pe,Cc=Le.exports,Pc=ze.exports,Lc=at,Uc=Ze,jc=cr,Mc=tc,Bc=oc,Nc=ia,qc=yt,Gc=Ar.forEach,Vc=rt("hidden"),Fc=jc("toPrimitive"),Kc=qc.set,Wc=qc.getterFor("Symbol"),zc=Object.prototype,Hc=uc.Symbol,$c=cc("JSON","stringify"),Qc=Dc.f,Yc=Rc.f,Jc=xc.f,Xc=Oc.f,Zc=Pc("symbols"),el=Pc("op-symbols"),tl=Pc("string-to-symbol-registry"),nl=Pc("symbol-to-string-registry"),rl=Pc("wks"),al=uc.QObject,il=!al||!al.prototype||!al.prototype.findChild,sl=lc&&fc((function(){return 7!=Ec(Yc({},"a",{get:function(){return Yc(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Qc(zc,t);r&&delete zc[t],Yc(e,t,n),r&&e!==zc&&Yc(zc,t,r)}:Yc,ol=function(e,t){var n=Zc[e]=Ec(Hc.prototype);return Kc(n,{type:"Symbol",tag:e,description:t}),lc||(n.description=t),n},dl=pc?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Hc},ul=function(e,t,n){e===zc&&ul(el,t,n),yc(e);var r=wc(t,!0);return yc(n),mc(Zc,r)?(n.enumerable?(mc(e,Vc)&&e[Vc][r]&&(e[Vc][r]=!1),n=Ec(n,{enumerable:Ac(0,!1)})):(mc(e,Vc)||Yc(e,Vc,Ac(1,{})),e[Vc][r]=!0),sl(e,r,n)):Yc(e,r,n)},cl=function(e,t){yc(e);var n=_c(t),r=kc(n).concat(fl(n));return Gc(r,(function(t){lc&&!ll.call(n,t)||ul(e,t,n[t])})),e},ll=function(e){var t=wc(e,!0),n=Xc.call(this,t);return!(this===zc&&mc(Zc,t)&&!mc(el,t))&&(!(n||!mc(this,t)||!mc(Zc,t)||mc(this,Vc)&&this[Vc][t])||n)},hl=function(e,t){var n=_c(e),r=wc(t,!0);if(n!==zc||!mc(Zc,r)||mc(el,r)){var a=Qc(n,r);return!a||!mc(Zc,r)||mc(n,Vc)&&n[Vc][r]||(a.enumerable=!0),a}},pl=function(e){var t=Jc(_c(e)),n=[];return Gc(t,(function(e){mc(Zc,e)||mc(Lc,e)||n.push(e)})),n},fl=function(e){var t=e===zc,n=Jc(t?el:_c(e)),r=[];return Gc(n,(function(e){!mc(Zc,e)||t&&!mc(zc,e)||r.push(Zc[e])})),r};(hc||(Cc((Hc=function(){if(this instanceof Hc)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=Uc(e),n=function(e){this===zc&&n.call(el,e),mc(this,Vc)&&mc(this[Vc],t)&&(this[Vc][t]=!1),sl(this,t,Ac(1,e))};return lc&&il&&sl(zc,t,{configurable:!0,set:n}),ol(t,e)}).prototype,"toString",(function(){return Wc(this).tag})),Cc(Hc,"withoutSetter",(function(e){return ol(Uc(e),e)})),Oc.f=ll,Rc.f=ul,Dc.f=hl,Sc.f=xc.f=pl,Tc.f=fl,Mc.f=function(e){return ol(jc(e),e)},lc&&(Yc(Hc.prototype,"description",{configurable:!0,get:function(){return Wc(this).description}}),Cc(zc,"propertyIsEnumerable",ll,{unsafe:!0}))),dc({global:!0,wrap:!0,forced:!hc,sham:!hc},{Symbol:Hc}),Gc(kc(rl),(function(e){Bc(e)})),dc({target:"Symbol",stat:!0,forced:!hc},{for:function(e){var t=String(e);if(mc(tl,t))return tl[t];var n=Hc(t);return tl[t]=n,nl[n]=t,n},keyFor:function(e){if(!dl(e))throw TypeError(e+" is not a symbol");if(mc(nl,e))return nl[e]},useSetter:function(){il=!0},useSimple:function(){il=!1}}),dc({target:"Object",stat:!0,forced:!hc,sham:!lc},{create:function(e,t){return void 0===t?Ec(e):cl(Ec(e),t)},defineProperty:ul,defineProperties:cl,getOwnPropertyDescriptor:hl}),dc({target:"Object",stat:!0,forced:!hc},{getOwnPropertyNames:pl,getOwnPropertySymbols:fl}),dc({target:"Object",stat:!0,forced:fc((function(){Tc.f(1)}))},{getOwnPropertySymbols:function(e){return Tc.f(bc(e))}}),$c)&&dc({target:"JSON",stat:!0,forced:!hc||fc((function(){var e=Hc();return"[null]"!=$c([e])||"{}"!=$c({a:e})||"{}"!=$c(Object(e))}))},{stringify:function(e,t,n){for(var r,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(r=t,(vc(t)||void 0!==e)&&!dl(e))return gc(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!dl(t))return t}),a[1]=t,$c.apply(null,a)}});Hc.prototype[Fc]||Ic(Hc.prototype,Fc,Hc.prototype.valueOf),Nc(Hc,"Symbol"),Lc[Vc]=!0;var ml=Dn,gl=F,vl=q,yl=de,bl=ae,_l=Ee.f,wl=hn,Al=vl.Symbol;if(gl&&"function"==typeof Al&&(!("description"in Al.prototype)||void 0!==Al().description)){var El={},kl=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof kl?new Al(e):void 0===e?Al():Al(e);return""===e&&(El[t]=!0),t};wl(kl,Al);var Sl=kl.prototype=Al.prototype;Sl.constructor=kl;var xl=Sl.toString,Tl="Symbol(test)"==String(Al("test")),Dl=/^Symbol\((.*)\)[^)]+$/;_l(Sl,"description",{configurable:!0,get:function(){var e=bl(this)?this.valueOf():this,t=xl.call(e);if(yl(El,e))return"";var n=Tl?t.slice(7,-1):t.replace(Dl,"$1");return""===n?void 0:n}}),ml({global:!0,forced:!0},{Symbol:kl})}var Rl=Qu,Ol=Ee,Il=cr("unscopables"),Cl=Array.prototype;null==Cl[Il]&&Ol.f(Cl,Il,{configurable:!0,value:Rl(null)});var Pl=function(e){Cl[Il][e]=!0},Ll=Ht.includes,Ul=Pl;Dn({target:"Array",proto:!0},{includes:function(e){return Ll(this,e,arguments.length>1?arguments[1]:void 0)}}),Ul("includes");var jl=Yd,Ml=ee;Dn({target:"String",proto:!0,forced:!Xd("includes")},{includes:function(e){return!!~String(Ml(this)).indexOf(jl(e),arguments.length>1?arguments[1]:void 0)}});var Bl=Dn,Nl=Ar.find,ql=Pl,Gl=!0;"find"in[]&&Array(1).find((function(){Gl=!1})),Bl({target:"Array",proto:!0,forced:Gl},{find:function(e){return Nl(this,e,arguments.length>1?arguments[1]:void 0)}}),ql("find");var Vl="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Vl&&Vl,Fl="URLSearchParams"in Vl,Kl="Symbol"in Vl&&"iterator"in Symbol,Wl="FileReader"in Vl&&"Blob"in Vl&&function(){try{return new Blob,!0}catch(e){return!1}}(),zl="FormData"in Vl,Hl="ArrayBuffer"in Vl;if(Hl)var $l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Ql=ArrayBuffer.isView||function(e){return e&&$l.indexOf(Object.prototype.toString.call(e))>-1};function Yl(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Jl(e){return"string"!=typeof e&&(e=String(e)),e}function Xl(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Kl&&(t[Symbol.iterator]=function(){return t}),t}function Zl(e){this.map={},e instanceof Zl?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 eh(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function th(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function nh(e){var t=new FileReader,n=th(t);return t.readAsArrayBuffer(e),n}function rh(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function ah(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Wl&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:zl&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Fl&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Hl&&Wl&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=rh(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Hl&&(ArrayBuffer.prototype.isPrototypeOf(e)||Ql(e))?this._bodyArrayBuffer=rh(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):Fl&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Wl&&(this.blob=function(){var e=eh(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=eh(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(nh)}),this.text=function(){var e=eh(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=th(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)},zl&&(this.formData=function(){return this.text().then(oh)}),this.json=function(){return this.text().then(JSON.parse)},this}Zl.prototype.append=function(e,t){e=Yl(e),t=Jl(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Zl.prototype.delete=function(e){delete this.map[Yl(e)]},Zl.prototype.get=function(e){return e=Yl(e),this.has(e)?this.map[e]:null},Zl.prototype.has=function(e){return this.map.hasOwnProperty(Yl(e))},Zl.prototype.set=function(e,t){this.map[Yl(e)]=Jl(t)},Zl.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Zl.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Xl(e)},Zl.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Xl(e)},Zl.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Xl(e)},Kl&&(Zl.prototype[Symbol.iterator]=Zl.prototype.entries);var ih=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function sh(e,t){if(!(this instanceof sh))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 sh){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Zl(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 Zl(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),ih.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 oh(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=void 0===t.statusText?"":""+t.statusText,this.headers=new Zl(t.headers),this.url=t.url||"",this._initBody(e)}sh.prototype.clone=function(){return new sh(this,{body:this._bodyInit})},ah.call(sh.prototype),ah.call(dh.prototype),dh.prototype.clone=function(){return new dh(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Zl(this.headers),url:this.url})},dh.error=function(){var e=new dh(null,{status:0,statusText:""});return e.type="error",e};var uh=[301,302,303,307,308];dh.redirect=function(e,t){if(-1===uh.indexOf(t))throw new RangeError("Invalid status code");return new dh(null,{status:t,headers:{location:e}})};var ch=Vl.DOMException;try{new ch}catch(e){(ch=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),ch.prototype.constructor=ch}function lh(e,t){return new Promise((function(n,r){var a=new sh(e,t);if(a.signal&&a.signal.aborted)return r(new ch("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 Zl,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){n(new 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 ch("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&Vl.location.href?Vl.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&&(Wl?i.responseType="blob":Hl&&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 Zl?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,Jl(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)}))}lh.polyfill=!0,Vl.fetch||(Vl.fetch=lh,Vl.Headers=Zl,Vl.Request=sh,Vl.Response=dh);var hh={name:"@bygd/gd-sdk-pes",version:"1.22.3",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.2","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","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"}},ph=F,fh=V,mh=Pn,gh=nn,vh=K,yh=On,bh=Z,_h=Object.assign,wh=Object.defineProperty,Ah=!_h||fh((function(){if(ph&&1!==_h({b:1},_h(wh({},"a",{enumerable:!0,get:function(){wh(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!=_h({},e)[n]||mh(_h({},t)).join("")!=r}))?function(e,t){for(var n=yh(e),r=arguments.length,a=1,i=gh.f,s=vh.f;r>a;)for(var o,d=bh(arguments[a++]),u=i?mh(d).concat(i(d)):mh(d),c=u.length,l=0;c>l;)o=u[l++],ph&&!s.call(d,o)||(n[o]=d[o]);return n}:_h;Dn({target:"Object",stat:!0,forced:Object.assign!==Ah},{assign:Ah});var Eh=yo,kh=td,Sh=Se,xh=ee,Th=qa,Dh=pu,Rh=Bt,Oh=Ao,Ih=so,Ch=$s.UNSUPPORTED_Y,Ph=[].push,Lh=Math.min;Eh("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(xh(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!kh(e))return t.call(r,e,a);for(var i,s,o,d=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,l=new RegExp(e.source,u+"g");(i=Ih.call(l,r))&&!((s=l.lastIndex)>c&&(d.push(r.slice(c,i.index)),i.length>1&&i.index<r.length&&Ph.apply(d,i.slice(1)),o=i[0].length,c=s,d.length>=a));)l.lastIndex===i.index&&l.lastIndex++;return c===r.length?!o&&l.test("")||d.push(""):d.push(r.slice(c)),d.length>a?d.slice(0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var a=xh(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=Sh(e),o=String(this),d=Th(s,RegExp),u=s.unicode,c=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(Ch?"g":"y"),l=new d(Ch?"^(?:"+s.source+")":s,c),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===o.length)return null===Oh(l,o)?[o]:[];for(var p=0,f=0,m=[];f<o.length;){l.lastIndex=Ch?0:f;var g,v=Oh(l,Ch?o.slice(f):o);if(null===v||(g=Lh(Rh(l.lastIndex+(Ch?f:0)),o.length))===p)f=Dh(o,f,u);else{if(m.push(o.slice(p,f)),m.length===h)return m;for(var y=1;y<=v.length-1;y++)if(m.push(v[y]),m.length===h)return m;f=p=g}}return m.push(o.slice(p)),m}]}),Ch);var Uh=function(){function e(t){S.default(this,e),this.gameData=t}return x.default(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){try{var e={};if(this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled){var t=new R.default(location.href,!0);for(var n in t.query)e[n]=t.query[n];Object.keys(e).length;return e}}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),jh=function(){function e(t,n){S.default(this,e),this.adContainer=t,this.onResume=n}return x.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(){w.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}(),Mh=function(e){if(!e)return!1;var t=Bh.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)},Bh=Object.prototype.toString;function Nh(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 qh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nh(Object(n),!0).forEach((function(t){E.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gh(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}var Vh=function(e,t){try{var n={tp:e,data:t};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(m.Base64.encode(JSON.stringify(n)))))}catch(e){console.log("Send Atom Log Error...",e)}},Fh=["bidFloor","isDfpBidding"];function Kh(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 Wh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kh(Object(n),!0).forEach((function(t){E.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var zh=null,Hh=function(){function e(t,n,r){var a=this;if(S.default(this,e),zh)return zh;zh=this;var i={debug:!1,width:640,height:360,locale:"en"};this.options=n?d.extendDefaults(i,n):i,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new d.EventBus,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=r.parentDomain,this.topDomain=r.topDomain,this.parentURL=r.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=d.getIMASampleTags(),this.atom_display,this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==t?document.getElementById(t):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:s,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:o,this.gameId="0",this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){w.default(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){w.default(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,a,i,s,o,u,c,h,p,f,g,v,y,b,_,A,L;return x.default(e,[{key:"start",value:(L=k.default(T.default.mark((function e(){return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),e.next=14;break;case 11:throw e.prev=11,e.t0=e.catch(0),new Error(e.t0);case 14:case"end":return e.stop()}}),e,this,[[0,11]])}))),function(){return L.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=k.default(T.default.mark((function r(a){var i,s,o,u,c,h,p,f,m=this;return T.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(d.Ls.available&&d.Ls.getBoolean("gd_debug_ex")&&d.Ls.getBoolean("gd_tag"))){r.next=6;break}return i=n.IMASampleTags[e],s=Math.floor(Math.random()*i.length),o=i[s],a({url:o}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,u=n.nextAdPosition(e),n.eventBus.broadcast("AD_REQUEST",{message:u}),c=n.options,"preroll"===u&&l.isPlainObject(c.preroll)?c=c.preroll:"midroll"===u&&l.isPlainObject(c.midroll)?c=c.midroll:"rewarded"===u&&l.isPlainObject(c.rewarded)&&(c=c.rewarded),h="rewarded"===u?"rewardedVideo":"gdbanner"===u?"gd__banner":"midroll"===u?"midroll":"video1",r.next=16,window.idhb.isLoaded();case 16:if(p={tnl_keys:window.idhb.getAdserverTargetingForAdSlot(h)},!(t&&t.retry_on_success&&l.isPlainObject(c.retry_on_success)&&l.isPlainObject(c.retry_on_success.vast))){r.next=21;break}return r.abrupt("return",a(n._createCustomAdVastUrl(c.retry_on_success.vast,p)));case 21:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&l.isPlainObject(c.retry_on_failure.vast))){r.next=25;break}return r.abrupt("return",a(n._createCustomAdVastUrl(c.retry_on_failure.vast,p)));case 25:if(!l.isPlainObject(c.vast)){r.next=27;break}return r.abrupt("return",a(n._createCustomAdVastUrl(c.vast,p)));case 27:return r.next=29,n._create_dp_context(u,t);case 29:f=r.sent,window.idhb.requestAds({slots:E.default({},h,{bidFloor:null!=f&&f.floor_price?f.floor_price:void 0}),callback:function(e,t){var n=this;w.default(this,m),f&&!t.bidFloorApplied&&fetch(f.skip_url).catch(function(e){w.default(this,n)}.bind(this)),a({tnl_keys:window.idhb.getAdserverTargetingForAdSlot(h),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===d.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===d.AdType.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===d.AdType.Rewarded?"rewarded":e===d.AdType.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(r){if(w.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=Wh(Wh({},t),{},{adTag:o,tnl_ad_pos:i});this.adCounter[i]=this.adCounter[i]||0,this.adCounter[i]++;var u=e.dp,c=e.hl;if(u&&(u.adtag_url=o.url,this._extend_dp_with_adsense(u,c,null==e?void 0:e.tnl_keys)),this._isVMAP(i)){var l=function(e){var t=e.position||"midroll",n=e.dp_1,r=e.dp_2,a=Date.now(),i=new R.default(e.adtag_url_1,!0);i.query=qh(qh({},i.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:a,output:"xml_vast3"});var s=i.toString(),o=new R.default(e.adtag_url_2,!0);o.query=qh(qh({},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(Gh({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(Gh({id:u++,adtag_url:d,error_url:null==r?void 0:r.error_url,impression_url:null==r?void 0:r.impression_url}),'\n </vmap:AdSource>\n <vmap:Extensions>\n <vmap:Extension type="bumper" suppress_bumper="true"></vmap:Extension>\n </vmap:Extensions>\n</vmap:AdBreak>\n</vmap:VMAP>').trim()}(this._get_vmap_context({dp:u,adtag:o,position:"preroll"===d.tnl_ad_pos?"preroll":"midroll",config:this._get_vmap_config(i)}));s.adsResponse=l}else if(u&&c.bidFloorApplied){var h=function(e){return e.promo_url?e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="2" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():e.fallback_url?'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(u);s.adsResponse=h}else if(u&&u.fallback_url){var p=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(u);s.adsResponse=p}else s.adTagUrl=o.url;s.linearAdSlotWidth=this.options.width,s.linearAdSlotHeight=this.options.height,s.nonLinearAdSlotWidth=this.options.width,s.nonLinearAdSlotHeight=this.options.height,s.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(s.vastLoadTimeout=this.options.vast_load_timeout),s.setAdWillAutoPlay(t.autoplayAllowed),s.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(s,d);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:d})}catch(e){}r(s)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameId}})}}},{key:"_checkAutoPlay",value:(A=k.default(T.default.mark((function e(){var t=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=this;w.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):O.default.video({inline:!0,muted:!1}).then(function(t){w.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 A.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(_=k.default(T.default.mark((function e(){var t;return T.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=k.default(T.default.mark((function e(t){var n,r,a;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,r=t.adType,a=t.params,r!==d.AdType.Interstitial){e.next=22;break}if(!n){e.next=7;break}return e.abrupt("return",this._startInterstitialAd(a));case 7:if("preroll"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=11;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 11:if("start"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=15;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 15:if("next"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=19;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 19:return e.abrupt("return",this._startInterstitialAd(a));case 20:e.next=31;break;case 22:if(r!==d.AdType.Rewarded){e.next=30;break}if(!n){e.next=27;break}return e.abrupt("return",this._startRewardedAd(a));case 27:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 28:e.next=31;break;case 30:throw new Error("Unsupported ad type");case 31:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"preloadAd",value:(y=k.default(T.default.mark((function e(t){return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==d.AdType.Interstitial){e.next=4;break}return e.abrupt("return",this._preloadInterstitialAd());case 4:if(t!==d.AdType.Rewarded){e.next=8;break}return e.abrupt("return",this._preloadRewardedAd());case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){w.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new jh(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(v=k.default(T.default.mark((function e(t){var n=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=k.default(T.default.mark((function e(r,a){var i,s,o,u,c,l,h,p,f,m=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(s=t?t.containerId:null)||a("Container id is not specified"),o=document.getElementById(s),document.getElementById(s)||a("No container is found with this id - ".concat(s)),void 0===window.idhb.requestAds&&a("Prebid.js wrapper script hit an error or didn't exist!"),u=t.slotId?t.slotId:"gd__banner@".concat(s),document.getElementById(u)||(c="\n .gd__banner{\n z-index: ".concat(d.Layers.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((l=document.createElement("style")).type="text/css",l.id="gd__banner__style",l.styleSheet?l.styleSheet.cssText=c:l.appendChild(document.createTextNode(c)),o.appendChild(l)),(h=document.createElement("div")).id=u,h.classList.add("gd__banner"),o.appendChild(h)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,null!==(i=n.atom_display)&&void 0!==i&&i.params&&window.idhb.setAdserverTargeting(null===(p=n.atom_display)||void 0===p?void 0:p.params),(f={})[u]={maxSize:[o.offsetWidth,o.offsetHeight]},window.idhb.requestAds({slots:f,callback:function(e){w.default(this,m)}.bind(this)}),r(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),a(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:(g=k.default(T.default.mark((function e(t){var n;return T.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(Wh(Wh({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return g.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(f=k.default(T.default.mark((function e(t){var n,r,a=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(d.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,Wh({adType:d.AdType.Interstitial},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;w.default(this,a);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var i=function(t){w.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){w.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return f.apply(this,arguments)})},{key:"_startRewardedAd",value:(p=k.default(T.default.mark((function e(t){var n;return T.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(Wh(Wh({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return p.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=k.default(T.default.mark((function e(t){var n,r,a=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(d.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,Wh({adType:d.AdType.Rewarded},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;w.default(this,a);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var i=function(t){w.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){w.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return h.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(c=k.default(T.default.mark((function e(){return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(d.AdType.Interstitial);case 3:return this.preloadedInterstitialAdVast=e.sent,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return c.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(u=k.default(T.default.mark((function e(){return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(d.AdType.Rewarded);case 3:return this.preloadedRewardedAdVast=e.sent,e.abrupt("return",this.preloadedRewardedAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return u.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player.src="",this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var t=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var n=null==e?void 0:e.mode,r=this._isT4R(e),a=this._getT4ROptions();"loaded"===n?(this.activeAdContainer.style.opacity=r?.001:1,r&&this.eventBus.broadcast("AD_T4R"),r&&setTimeout(function(){w.default(this,t),this.activeAdContainer.style.opacity=1}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210))):"click"!==n&&"first_quartile"!==n||(this.activeAdContainer.style.opacity=1)}}},{key:"_createPlayer",value:function(){var e=this,t=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=d.Layers.AdsContainer.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var n=document.createElement("video");n.setAttribute("playsinline",!0),n.setAttribute("webkit-playsinline",!0),n.id="".concat(this.prefix,"advertisement_video"),n.style.position="absolute",n.style.backgroundColor="#000000",n.style.top="0",n.style.left="0",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px",this.video_ad_player=n,this.adContainer.appendChild(n);var r=document.createElement("div");r.id="".concat(this.prefix,"advertisement_slot"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.adContainerInner=r,this.activeAdContainer=this.adContainer,this.thirdPartyContainer?(this.adContainer.appendChild(r),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(r),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){w.default(this,e);var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:t,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var t=this,n=new google.ima.AdsRenderingSettings;n.autoAlign=!1,n.enablePreloading=!1,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.useStyledNonLinearAds=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,n),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){w.default(this,t),this.adsManager&&this.adsManager.resize(this.options.width,this.options.height,google.ima.ViewMode.NORMAL)}.bind(this)),this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0);var r=new Date,a=r.getHours(),i=r.getDate(),s=r.getMonth(),o=r.getFullYear(),d="AD_SDK_MANAGER_READY";this.eventBus.broadcast(d,{name:d,message:"AD SDK is ready",status:"success",analytics:{category:d,action:this.parentDomain,label:"h".concat(a," d").concat(i," m").concat(s," y").concat(o)}}),this._adrequest_user_context=e.getUserRequestContext()}},{key:"_onAdEvent",value:function(e){var t=new Date,n=t.getHours(),r=t.getDate(),a=t.getMonth(),i=t.getFullYear(),s=d.getKeyByValue(google.ima.AdEvent.Type,e.type),o=!1,u=e.getAd().getContentType()||"",c=!u.startsWith("image")&&!u.startsWith("text");this._sendIMAEventsToHB(e);var l="";switch(e.type){case google.ima.AdEvent.Type.AD_BREAK_READY:l="Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false.";break;case google.ima.AdEvent.Type.AD_METADATA:l="Fired when an ads list is loaded.";break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:o=!0,l="Fired when the ads manager is done playing all the ads.";break;case google.ima.AdEvent.Type.CLICK:l="Fired when the ad is clicked.";var h=e.getAd().getContentType();this._show({mode:"click",contentType:h});break;case google.ima.AdEvent.Type.COMPLETE:o=this._is_completed(e.getAd()),l="Fired when the ad completes playing.";break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:l="Fired when content should be paused. This usually happens right before an ad is about to cover the content.";break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:l="Fired when content should be resumed. This usually happens when an ad finishes or collapses.",o=!0;break;case google.ima.AdEvent.Type.DURATION_CHANGE:l="Fired when the ad's duration changes.";break;case google.ima.AdEvent.Type.FIRST_QUARTILE:l="Fired when the ad playhead crosses first quartile.";var p=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:p});break;case google.ima.AdEvent.Type.IMPRESSION:l="Fired when the impression URL has been pinged.";break;case google.ima.AdEvent.Type.INTERACTION:l="Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data.";break;case google.ima.AdEvent.Type.LINEAR_CHANGED:l="Fired when the displayed ad changes from linear to nonlinear, or vice versa.";break;case google.ima.AdEvent.Type.LOADED:var f=e.getAd().getContentType();l=f,this._show({mode:"loaded",contentType:f});break;case google.ima.AdEvent.Type.LOG:e.getAdData().adError&&(l=e.getAdData());break;case google.ima.AdEvent.Type.MIDPOINT:l="Fired when the ad playhead crosses midpoint.";break;case google.ima.AdEvent.Type.PAUSED:c&&this.adResume.show(),l="Fired when the ad is paused.";break;case google.ima.AdEvent.Type.RESUMED:l="Fired when the ad is resumed.",c&&this.adResume.hide();break;case google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED:l="Fired when the displayed ads skippable state is changed.";break;case google.ima.AdEvent.Type.SKIPPED:o=this._is_completed(e.getAd()),l="Fired when the ad is skipped by the user.";break;case google.ima.AdEvent.Type.STARTED:l="Fired when the ad starts playing.";break;case google.ima.AdEvent.Type.THIRD_QUARTILE:l="Fired when the ad playhead crosses third quartile.";break;case google.ima.AdEvent.Type.USER_CLOSE:o=this._is_completed(e.getAd()),l="Fired when the ad is closed by the user.";break;case google.ima.AdEvent.Type.VOLUME_CHANGED:l="Fired when the ad volume has changed.";break;case google.ima.AdEvent.Type.VOLUME_MUTED:l="Fired when the ad volume has been muted."}""!==s&&""!==l&&this.eventBus.broadcast(s,{name:s,message:l,status:"success",analytics:{category:s,action:this.parentDomain,label:"h".concat(n," d").concat(r," m").concat(a," y").concat(i)}}),o&&!this.adSuccess&&(this.adSuccess=!0,this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}),this.resetForNext(e))}},{key:"_onAdError",value:function(e){this.requestRunning=!1,this._resetAdsLoader(),this._clearSafetyTimer("ERROR"),this._hide("_onAdError"),this._sendIMAEventsToHB(e);try{var t="AD_ERROR",n=e.getError(),r=n.getErrorCode().toString()||n.getVastErrorCode().toString(),a=this._getInnerErrorCode(n);this.eventBus.broadcast(t,{message:r,details:a,status:"warning",analytics:{category:t,action:a,label:r}})}catch(e){}}},{key:"_sendIMAEventsToHB",value:function(e){if(window.idhb&&"function"==typeof window.idhb.onImaEvent)try{window.idhb.onImaEvent({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(){w.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(Mh(e.getInnerError)){var t=e.getInnerError();if(t)return Mh(t.getErrorCode)&&Mh(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(w.default(this,n),t&&t.tnl_keys)return t.tnl_keys[e.toLowerCase()]}.bind(this)});for(var a in r.query||{}){var i=r.query[a];l.isPlainObject(i)&&(r.query[a]=C.default.stringify(i))}var s=new R.default(r.url,!0);return P.default(s.query,r.query||{}),Wh({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new R.default(e.url,!0),a=this._transformQuery(e,t,r);a&&(n.url=r.toString());var i=a?r:new R.default(e.url,!0);if(i.query.cust_params){var s=C.default.parse(i.query.cust_params);n.bidder=s.hb_bidder,n.cust_params=s}n.url_parsed=i}catch(e){n.hasError=!0,n.message=e.message,n.bidder="error",console.log(e.message)}return n}},{key:"_transformQuery",value:function(e,t,n){var r=this;if(e&&t&&e.tnl_keys){var a=this.options.vast_query;if(t.retry_on_success&&this.options.retry_on_success&&l.isPlainObject(this.options.retry_on_success.vast_query)?a=this.options.retry_on_success.vast_query:t.retry_on_failure&&this.options.retry_on_failure&&l.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=I.default(a),l.isPlainObject(a)){var i=n.query;if(a.$$remove){for(var s in i){new RegExp(a.$$remove,"i").test(s)&&delete i[s]}delete a.$$remove}var o=C.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 w.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,P.default(i,u),i.cust_params=C.default.stringify(i.cust_params),!0}}}},{key:"_isT4R",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h=null===(t=this._adrequest_user_context)||void 0===t?void 0:t.tnl_ad_pos;return h&&((null==e||null===(n=e.contentType)||void 0===n?void 0:n.startsWith("image/"))||"text"===(null==e?void 0:e.contentType))&&("preroll"===h&&(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.t4r)||void 0===i?void 0:i.enabled)||"midroll"===h&&(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o||null===(d=o.t4r)||void 0===d?void 0:d.enabled)||"rewarded"===h&&(null===(u=this.gameData)||void 0===u||null===(c=u.rAds)||void 0===c||null===(l=c.t4r)||void 0===l?void 0:l.enabled))}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h,p,f,m;if(!e)return!1;var g="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.vmap)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(d=this.gameData)||void 0===d||null===(u=d.mAds)||void 0===u||null===(c=u.vmap)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.vmap)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!g)return!1;var v=this._get_vmap_config(e),y=this.adCounter[e];return void 0!==(null==v?void 0:v.start)?y>=(null==v?void 0:v.start):g}},{key:"_getT4ROptions",value:function(){var e,t,n,r,a,i,s;switch(null===(e=this._adrequest_user_context)||void 0===e?void 0:e.tnl_ad_pos){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.t4r;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.t4r;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.t4r}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,a=e.dp,i=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:a,d=null!=r&&r.vast_2?void 0:a;return{adtag_url_1:null==i?void 0:i.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:d}}},{key:"_get_vmap_config",value:function(e){var t,n,r,a,i,s,o,d;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.vmap;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(d=o.pAds)||void 0===d?void 0:d.vmap}}},{key:"_isDP",value:function(e){var t,n,r,a,i,s,o,d,u,c,l,h,p,f,m;return!!e&&("preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.dp)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.dp)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.dp)||!0===(null===(d=this.gameData)||void 0===d||null===(u=d.mAds)||void 0===u||null===(c=u.dp)||void 0===c?void 0:c.enabled))||"rewarded"===e&&(!0===(null===(l=this.gameData)||void 0===l||null===(h=l.rAds)||void 0===h?void 0:h.dp)||!0===(null===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.dp)||void 0===m?void 0:m.enabled)))}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(t){var n=this;w.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Uh(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(m.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return w.default(this,n),e.json()}.bind(this)).then(function(e){if(w.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){w.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=k.default(T.default.mark((function r(a){var i,s,o,d,u,c,l=this;return T.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 Uh(n.gameData).checkCustomParams())&&(s.cp=o),d=encodeURIComponent(m.Base64.encode(JSON.stringify(s))),u=null===(i=n.gameData.promo)||void 0===i?void 0:i.rainbow,c=(null==u?void 0:u.enabled)&&!0!==(null==t?void 0:t.fallback_adsense),fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(d)).then(function(e){return w.default(this,l),e.json()}.bind(this)).then(function(e){if(w.default(this,l),!e||!e.p)return n.msgrt.send("dp.na",{message:"atom"}),a();var t=e.p/100;a({id:Date.now(),floor_price:t,error_url:"https://tag.atom.gamedistribution.com/v1/err?ar=".concat(d,"&ec=[ERRORCODE]"),impression_url:"https://tag.atom.gamedistribution.com/v1/imp?ar=".concat(d),skip_url:"https://tag.atom.gamedistribution.com/v1/skp?ar=".concat(d),promo_url:c?"https://tag.atom.gamedistribution.com/v1/rainbow?ar=".concat(d):void 0,promo_imp_blue_url:c?"https://tag.atom.gamedistribution.com/v1/rainbow/blue":void 0,promo_imp_green_url:c?"https://tag.atom.gamedistribution.com/v1/rainbow/green":void 0})}.bind(this)).catch(function(e){w.default(this,l),n.msgrt.send("dp.err",{message:(null==e?void 0:e.message)||e}),a()}.bind(this)),r.next=18;break;case 14:r.prev=14,r.t0=r.catch(0),n.msgrt.send("dp.err",{message:(null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0}),a();case 18:case"end":return r.stop()}}),r,this,[[0,14]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"_extend_dp_with_adsense",value:function(e,t,n){if(e&&t&&n)try{var r,a=new R.default(t.vastUrl,!0);if(null===(r=a.query)||void 0===r||!r.cust_params)return;if(!C.default.parse(a.query.cust_params).tnl_asset_id)return;n.bidFloor,n.isDfpBidding;var i=D.default(n,Fh);a.query.cust_params=C.default.stringify(Wh(Wh({},i),{},{adsense:1}),!1),e.fallback_url=a.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(o=k.default(T.default.mark((function e(t){var n,r,a,i,s,o,u=this;return T.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.gameId,pageType:"gd"}),window.idhb.que=window.idhb.que||[],e.next=8,d.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return w.default(this,u),window.idhb.requestAds}.bind(this)});case 8:a={top_domain:this.topDomain,parent_domain:this.parentDomain,game:this.gameId,pageUrl:"page_url=".concat(encodeURIComponent(this.topDomain||this.parentDomain))},Vh("page_url",a),i=d.getQueryString("ch",window.location.href),s=d.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.setRefererUrl(encodeURIComponent(this.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(this.userAllowedPersonalizedAds)),window.idhb.addEventListener("slotRenderEnded",function(e){var t=this;w.default(this,u);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){w.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){w.default(this,t)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:r,status:"success"}))}catch(e){}}.bind(this));case 19:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_ima_script",value:(s=k.default(T.default.mark((function e(t){var n,r,a=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],r=this.options.debug?n[0]:n[1],e.next=4,d.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return w.default(this,a),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"_init_afg_script",value:(i=k.default(T.default.mark((function e(t){var n,r,a,i,s=this;return T.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(i={}).crossorigin="anonymous",i["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",i["data-ad-frequency-hint"]="30s",(null==t||null===(r=t.adsense_channel)||void 0===r?void 0:r.length)>0&&(i["data-ad-channel"]=t.adsense_channel),(null==t||null===(a=t.adsense_host)||void 0===a?void 0:a.length)>0&&(i["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(i["data-adbreak-test"]="on"),e.next=13,d.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return w.default(this,s),!!window.adsbygoogle}.bind(this),attrs:i});case 13:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 15:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementRewardedAd",value:(a=k.default(T.default.mark((function e(t){var n,r,a,i,s,o,d=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),n=function(){w.default(this,d),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){w.default(this,d),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){w.default(this,d),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){w.default(this,d),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){w.default(this,d),e()}.bind(this),o=function(e){w.default(this,d),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),t={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:r,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:o},window.adsbygoogle.push(t),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var t}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=k.default(T.default.mark((function e(t){var n,r=this;return T.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){w.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=k.default(T.default.mark((function e(t){var n,r,a,i=this;return T.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(){w.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){w.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){w.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=k.default(T.default.mark((function e(t){var n,r,a,i=this;return T.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(){w.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){w.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){w.default(this,i),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),t={type:"next",name:"next-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var t}),e,this,[[1,14]])}))),function(e){return t.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,a=n._ua,i={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:a.browser.name,brvs:a.browser.version,osnm:a.os.name,osvs:a.os.version,dvmd:a.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(m.Base64.encode(JSON.stringify(i)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t})}},{key:"_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;n===d.AdType.Rewarded?t="reward":n===d.AdType.Interstitial&&(this._isAfgPositionStart(e)?t="start":this._isAfgPositionNext(e)&&(t="next")),e.params.position=t}}]),e}(),$h=Array.isArray,Qh=Object.prototype.toString,Yh=$h||function(e){return!!e&&"[object Array]"==Qh.call(e)},Jh=Dn,Xh=ae,Zh=Vn,ep=Vt,tp=Bt,np=re,rp=Mr,ap=cr,ip=xr("slice"),sp=ap("species"),op=[].slice,dp=Math.max;Jh({target:"Array",proto:!0,forced:!ip},{slice:function(e,t){var n,r,a,i=np(this),s=tp(i.length),o=ep(e,s),d=ep(void 0===t?s:t,s);if(Zh(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Zh(n.prototype)?Xh(n)&&null===(n=n[sp])&&(n=void 0):n=void 0,n===Array||void 0===n))return op.call(i,o,d);for(r=new(void 0===n?Array:n)(dp(d-o,0)),a=0;o<d;o++,a++)o in i&&rp(r,a,i[o]);return r.length=a,r}});var up=Se,cp=wa,lp=qn,hp=On,pp=function(e,t,n,r){try{return r?t(up(n)[0],n[1]):t(n)}catch(t){throw cp(e),t}},fp=ma,mp=Bt,gp=Mr,vp=ba,yp=function(e){var t,n,r,a,i,s,o=hp(e),d="function"==typeof this?this:Array,u=arguments.length,c=u>1?arguments[1]:void 0,l=void 0!==c,h=vp(o),p=0;if(l&&(c=lp(c,u>2?arguments[2]:void 0,2)),null==h||d==Array&&fp(h))for(n=new d(t=mp(o.length));t>p;p++)s=l?c(o[p],p):o[p],gp(n,p,s);else for(i=(a=h.call(o)).next,n=new d;!(r=i.call(a)).done;p++)s=l?pp(a,c,[r.value,p],!0):r.value,gp(n,p,s);return n.length=p,n};Dn({target:"Array",stat:!0,forced:!ja((function(e){Array.from(e)}))},{from:yp});var bp,_p,wp,Ap=!V((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ep=de,kp=On,Sp=Ap,xp=rt("IE_PROTO"),Tp=Object.prototype,Dp=Sp?Object.getPrototypeOf:function(e){return e=kp(e),Ep(e,xp)?e[xp]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Tp:null},Rp=V,Op=Dp,Ip=Pe,Cp=de,Pp=cr("iterator"),Lp=!1;[].keys&&("next"in(wp=[].keys())?(_p=Op(Op(wp)))!==Object.prototype&&(bp=_p):Lp=!0),(null==bp||Rp((function(){var e={};return bp[Pp].call(e)!==e})))&&(bp={}),Cp(bp,Pp)||Ip(bp,Pp,(function(){return this}));var Up={IteratorPrototype:bp,BUGGY_SAFARI_ITERATORS:Lp},jp=Up.IteratorPrototype,Mp=Qu,Bp=$,Np=ia,qp=la,Gp=function(){return this},Vp=Dn,Fp=function(e,t,n){var r=t+" Iterator";return e.prototype=Mp(jp,{next:Bp(1,n)}),Np(e,r,!1),qp[r]=Gp,e},Kp=Dp,Wp=Qo,zp=ia,Hp=Pe,$p=Le.exports,Qp=la,Yp=Up.IteratorPrototype,Jp=Up.BUGGY_SAFARI_ITERATORS,Xp=cr("iterator"),Zp=function(){return this},ef=function(e,t,n,r,a,i,s){Fp(n,t,r);var o,d,u,c=function(e){if(e===a&&m)return m;if(!Jp&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,p=e.prototype,f=p[Xp]||p["@@iterator"]||a&&p[a],m=!Jp&&f||c(a),g="Array"==t&&p.entries||f;if(g&&(o=Kp(g.call(new e)),Yp!==Object.prototype&&o.next&&(Kp(o)!==Yp&&(Wp?Wp(o,Yp):"function"!=typeof o[Xp]&&Hp(o,Xp,Zp)),zp(o,l,!0))),"values"==a&&f&&"values"!==f.name&&(h=!0,m=function(){return f.call(this)}),p[Xp]!==m&&Hp(p,Xp,m),Qp[t]=m,a)if(d={values:c("values"),keys:i?m:c("keys"),entries:c("entries")},s)for(u in d)(Jp||h||!(u in p))&&$p(p,u,d[u]);else Vp({target:t,proto:!0,forced:Jp||h},d);return d},tf=lu.charAt,nf=yt,rf=ef,af=nf.set,sf=nf.getterFor("String Iterator");rf(String,"String",(function(e){af(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=sf(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=tf(n,r),t.index+=e.length,{value:e,done:!1})})),oc("iterator");var of=re,df=Pl,uf=la,cf=yt,lf=ef,hf=cf.set,pf=cf.getterFor("Array Iterator"),ff=lf(Array,"Array",(function(e,t){hf(this,{type:"Array Iterator",target:of(e),index:0,kind:t})}),(function(){var e=pf(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");uf.Arguments=uf.Array,df("keys"),df("values"),df("entries");var mf=q,gf=jo,vf=ff,yf=Pe,bf=cr,_f=bf("iterator"),wf=bf("toStringTag"),Af=vf.values;for(var Ef in gf){var kf=mf[Ef],Sf=kf&&kf.prototype;if(Sf){if(Sf[_f]!==Af)try{yf(Sf,_f,Af)}catch(e){Sf[_f]=Af}if(Sf[wf]||yf(Sf,wf,Ef),gf[Ef])for(var xf in vf)if(Sf[xf]!==vf[xf])try{yf(Sf,xf,vf[xf])}catch(e){Sf[xf]=vf[xf]}}}function Tf(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 Df(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 Df(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 Df(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 Rf(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 Of(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rf(Object(n),!0).forEach((function(t){E.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var If={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"}},Cf={},Pf=function(e,t){Cf[e]=Of(Of({},t),{},{isLoading:!1})},Lf=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(w.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))},Uf=function(){var e=k.default(T.default.mark((function e(t){var n,r,a,i,s,o,d,u;return T.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=Cf[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=Tf(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=If[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Lf({id:s,src:If[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,Lf({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)}}(),jf=function e(t){var n=this;S.default(this,e),E.default(this,"load",k.default(T.default.mark((function e(){return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uf(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),E.default(this,"promo",k.default(T.default.mark((function e(){return T.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},Pf(this.moduleName,this.moduleConfig)},Mf=function e(t){var n=this;S.default(this,e),E.default(this,"load",k.default(T.default.mark((function e(){return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uf(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),E.default(this,"splash",k.default(T.default.mark((function e(){return T.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},Pf(this.moduleName,this.moduleConfig)},Bf=function(e,t){console.log(e,t)},Nf={},qf={},Gf=null;function Vf(){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 Nf.version=r,Nf.frame=e,Nf.function=n,Nf.version}function Ff(e){var t=this;return Gf||(Gf=new Promise(function(n){function r(t,r){if(Bf("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:Nf,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}w.default(this,t),Vf(),Nf.frame?2===Nf.version?(Bf("TCF v2 CMP found. Fetching the consent."),Nf.function?(Bf("CMP API is directly accessible, calling it now..."),Nf.function("addEventListener",Nf.version,r)):(Bf("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!==qf[r.callId]&&qf[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){w.default(this,r);var o=Math.random()+"",d="".concat(a,"Call"),u=E.default({},d,{command:e,parameter:s,callId:o,version:n});qf[o]=i,t.postMessage(u,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,Nf.version,n)}("addEventListener",Nf.frame,r))):n({result:"cmpVersionNotV2",cmp:Nf}):n({result:"cmpNotFound"})}.bind(this)))}var Kf=new(function(){function e(){S.default(this,e),this.productName="Game Distribution"}var t;return x.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=k.default(T.default.mark((function e(t,n){var r,a,i,s,o,d;return T.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 Wf(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 j.default(n,e)}function d(e,t){return M.default(n,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new R.default(e,t)}catch(e){console.log(e)}}function c(){for(var t=(null==e?void 0:e.urls)||[a,s],n=0;n<t.length;n++){var r,i=u(t[n]);if(i){var o=null===(r=i.query)||void 0===r?void 0:r.gd_sdk_referrer_url;if(o&&(o=decodeURIComponent(o),L.default.isURL(o)))return o}}}return function(){var e;w.default(this,t),function(){var e=0,t=window;try{for(;t!=t.parent;)e++,t=t.parent}catch(e){d("depth.error",e.message)}d("depth.value",e)}(),function(){var e=r,t=n.depth.value,a=i;if(d("top.domain.from","fallback"),e&&e.length>0)a=e[e.length-1],d("top.domain.from","origins");else if(0===t)a=i,d("top.domain.from","self-top");else if(1===t){var o=u(s);o&&(a=o.origin,d("top.domain.from","referrer"))}d("top.domain.value",a.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2"))}(),function(){var e=c();if(e)if(U.default(e))d("partner.domain.value",e),d("partner.domain.from","partner-domain");else{var t=u(e,!1);if(t)d("partner.domain.value",t.origin.replace(/^https?:\/\/(www\.)?(.*)$/i,"$2")),d("partner.domain.from","partner-url");else d("partner.domain.value",n.top.domain.value),d("partner.domain.from","partner-fallback")}else d("partner.domain.value",n.top.domain.value),d("partner.domain.from","fallback")}(),e=c(),0===n.depth.value?(d("partner.url.value",a),d("partner.url.from","self-top")):e?U.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))}}}function zf(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 Hf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zf(Object(n),!0).forEach((function(t){E.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $f=null,Qf=function(){function e(t){var n=this;if(S.default(this,e),$f)return $f;$f=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new Wf,this._location.print(),this._parentURL=this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){w.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){w.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e=this;w.default(this,n),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),window.addEventListener("DOMNodeInserted",function(){if(w.default(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var t=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];t&&t.setAttribute("style","display:none")}}.bind(this)),this._checkFullscreen()}.bind(this))}var t,n,r,a,i,s,o,u,c,l;return x.default(e,[{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var e=Vf();console.log("CMP found",e),k.default(T.default.mark((function e(){var t;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ff({});case 2:t=e.sent,console.log("After lookup IAB consent",t);case 4:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),n=this._isMasterGameURL();this._isLoaded=(e||t&&!n)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"}),this._initGamedockTracker(window.GamedockSDK,"gameplay")}catch(e){}}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(l=k.default(T.default.mark((function e(t,n){var r,a=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:this._gameData=e.sent,this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(r=this._gameData.enableAds)||void 0===r?void 0:r.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){return w.default(this,a),console.error(e.message||e)}.bind(this))),this._sendSDKReady(),t(this._gameData),e.next=20;break;case 15:e.prev=15,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),n(e.t0);case 20:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e,t){return l.apply(this,arguments)})},{key:"_getDefaultOptions",value:function(){return{debug:!1,testing:!1,gameId:"4f3d7d38d24b740c95da2b03dc3a2333",prefix:"gdsdk__",onEvent:function(e){},onLoaderEvent:function(e){},flashSettings:{adContainerId:"",splashContainerId:""},advertisementSettings:{},resumeGame:function(){},pauseGame:function(){},onInit:function(e){},onError:function(e){},loader:{}}}},{key:"_extendDefaultOptions",value:function(e,t){var n=I.default(e);this.options=t?d.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=hh.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){"undefined"===this._topDomain&&(this._topDomain=void 0);var t={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(C.default.stringify(t)))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=d.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,d.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!d.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(d.Ls.set("gd_debug_ex",!0),d.Ls.set("gd_disable_midroll_timer",!0),d.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(d.Ls.set("gd_debug_ex",!0),d.Ls.set("gd_disable_midroll_timer",!0)),d.Ls.getBoolean("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new d.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:d.getIframeDepth(),version:hh.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:d.getMobilePlatform(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var t=["https://cdn.gamedock.io/gamedock-web-tracker/4.3.0/script/gamedock-sdk.min.js"];d.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){w.default(this,e);var t=this._initGamedockTracker(window.GamedockSDK,"pageview");Kf.track(t,this._gameData)}.bind(this)).catch(function(t){w.default(this,e),this._sendSDKError(t)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e,t){if(!this._bridge.isCoreSDKMode){var n=e.initialize("gd",this._parentDomain);return n.tracking.trackEvent(t,{pageId:this.options.gameId,pageType:"game"}),n}}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var t=["https://ext.minijuegosgratis.com/external-host/main.js"];d.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){w.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];d.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return w.default(this,e),window.ga}.bind(this)}).then(function(){w.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){w.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new d.EventBus,d.SDKEvents.forEach(function(t){var n=this;return w.default(this,e),this.eventBus.subscribe(t,function(e){return w.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),d.IMAEvents.forEach(function(t){var n=this;return w.default(this,e),this.eventBus.subscribe(t,function(e){return w.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(w.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 w.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){w.default(this,e),this.msgrt.send("ad.impression")}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){w.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){w.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){w.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){w.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){w.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 w.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(hh.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(c=k.default(T.default.mark((function e(){var t,n,r=this;return T.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(){w.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(C.default.stringify({domain:this._parentDomain,id:n.gameId,img:this._get_game_thumbnail_url(),title:n.title}))}.bind(this),100));case 5:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"_checkGameDeleted",value:function(){var e=this;6===this._gameData.status&&(console.log("%c %c %c This game was deleted, please remove it in your website... ","background: #F2181A","background: #F23818","color: #fff; background: #F23818;","background: #F55E60","background: #F55E60","background: #c4161e; color: #fff;"),setTimeout(function(){w.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;d.Ls.available&&d.Ls.getBoolean("gd_debug_ex")&&(d.Ls.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r,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=k.default(T.default.mark((function e(){var t;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=d.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new d.Macros({game:t,bridge:this._bridge}),this.adInstance=new Hh(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=hh,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){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){d.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var e=this;return new Promise(function(t){var n=this;w.default(this,e);var r=this._getDefaultGameData(),a=this._getGameDataUrl();fetch(a).then(function(e){return w.default(this,n),e.json()}.bind(this)).then(function(e){if(w.default(this,n),e.success){var a,i,s,o=e.result.game,u={gameId:o.gameMd5,slug:o.slug,pname:o.pname,dname:o.dname,status:o.status,description:o.description,enableAds:!0===o.enableAds||!0===(null===(a=o.enableAds)||void 0===a?void 0:a.enabled),preroll:o.preRoll,midroll:6e4*o.timeAds,rewardedAds:o.rewardedAds,title:o.title,tags:o.tags,category:o.category,assets:o.assets,disp_2nd_prer:o.disp_2nd_prer,ctry_vst:o.ctry_vst,ctry:o.ctry,crtv:o.crtv,dmain:o.dmain,block_exts:this._parseAndSelectRandomOne(o.push_cuda),bloc_gard:this._parseAndSelectRandomOne(o.bloc_gard),cookie:this._parseAndSelectRandomOne(o.cookie),gdpr:this._parseAndSelectRandomOne(o.gdpr),diagnostic:this._parseAndSelectRandomOne(o.diagnostic),sdk:this._parseAndSelectRandomOne(o.sdk)||{},loader:this._parseAndSelectRandomOne(o.loader)||{},splash:this._parseAndSelectRandomOne(o.splash)||{},promo:this._parseAndSelectRandomOne(o.promo)||{},dAds:this._parseAndSelectRandomOne(o.dads)||{},pAds:this._parseAndSelectRandomOne(o.pads)||{},mAds:this._parseAndSelectRandomOne(o.mads)||{},rAds:this._parseAndSelectRandomOne(o.rads)||{}},c=d.extendDefaults(I.default(r),u);c.afg_disabled=!1===(null===(i=c.sdk)||void 0===i||null===(s=i.afg)||void 0===s?void 0:s.enabled),this._bridge.noPreroll=(!this._getisMobile()||!1!==c.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(c),d.setDankLog(c.diagnostic),t(c)}else r.failed=!0,t(r)}.bind(this)).catch(function(e){w.default(this,n),r.failed=!0,t(r)}.bind(this))}.bind(this))}},{key:"_createSplash",value:(o=k.default(T.default.mark((function e(t,n){var r,a,i=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:r=e.sent,(a=new r(Hf(Hf({},this.options),{},{isConsentDomain:n,version:hh.version}),t,this._parentDomain)).on("playClick",function(){var e=this;if(w.default(this,i),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this.showAd(d.AdType.Interstitial,{position:"preroll"}).catch(function(t){w.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(){w.default(this,i),a.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){w.default(this,i),a.hide()}.bind(this));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(s=k.default(T.default.mark((function e(t,n){var r,a,i,s,o=this;return T.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(Hf(Hf({},this.options),{},{isConsentDomain:n,version:hh.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){w.default(this,o),s.hide(),this._createSplash(t,n)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(t,n);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return s.apply(this,arguments)})},{key:"_createPromo",value:(i=k.default(T.default.mark((function e(t,n){var r,a,i,s,o=this;return T.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(Hf(Hf({},this.options),{},{isConsentDomain:n,version:hh.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){w.default(this,o),s.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return i.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(d.AdType.Interstitial).catch(function(){w.default(this,e)}.bind(this))}},{key:"showAd",value:(a=k.default(T.default.mark((function e(t){var n,r=this,a=arguments;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.abrupt("return",new Promise(function(){var e=k.default(T.default.mark((function e(a,i){var s,o,d,u,c,l,h=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s={adType:t,params:n,adTimestamp:r.adRequestTimer},e.next=4,r.sdkReady;case 4:return o=e.sent,e.next=7,r.videoAdReady;case 7:return r._sendLoadedEvent(),r._rejectAdIfGameBlocked({gameData:o,adRequest:s}),r._rejectAdIfAdDisabled({gameData:o,adRequest:s}),r._rejectAdIfUnsupportedType({adRequest:s}),r._rejectAdIfRewardedDisabled({gameData:o,adRequest:s}),r._rejectAdIfAdRateHits({gameData:o,adRequest:s}),r.adInstance.attachAfgPosition(s),r._attachAfgFallback({gameData:o,adRequest:s}),d="main.showad",u=function(e){w.default(this,h),r.eventBus.unsubscribeScope(d),r.onResumeGame(e.message,"warning"),i(e.message)}.bind(this),c=function(e){w.default(this,h),r.eventBus.unsubscribeScope(d),r.adRequestTimer=Date.now(),r.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),a(e.message)}.bind(this),l=function(e){var s=this;w.default(this,h),r.eventBus.unsubscribeScope(d),n.fallback_adsense=!1,r.showAd(t,Hf(Hf({},n),{},{adapter:"adsense"})).then(function(e){w.default(this,s),a(e)}.bind(this)).catch(function(e){w.default(this,s),i(e)}.bind(this))}.bind(this),r.eventBus.subscribe("AD_ERROR",null!=n&&n.fallback_adsense?l:u,d),r.eventBus.subscribe("AD_SDK_CANCELED",null!=n&&n.fallback_adsense?l:u,d),r.eventBus.subscribe("AD_SUCCESS",c,d),e.next=24,r.adInstance.startAd(s);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 2:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{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!==d.AdType.Interstitial&&t.adType!==d.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=d.AdType.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===d.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t=e.gameData;if(e.adRequest.adType===d.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<t.midroll)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=k.default(T.default.mark((function e(t){var n=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=k.default(T.default.mark((function e(r,a){var i,s;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return i=e.sent,e.next=6,n.videoAdReady;case 6:if(!i.bloc_gard||!0!==i.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(i.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=d.AdType.Rewarded,e.next=16;break;case 14:if(t===d.AdType.Interstitial||t===d.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==d.AdType.Rewarded||i.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:s=e.sent,r(s),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"cancelAd",value:(n=k.default(T.default.mark((function e(){var t=this;return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=k.default(T.default.mark((function e(n,r){return T.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=k.default(T.default.mark((function n(r,a){var i;return T.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return i=n.sent,n.next=6,t.videoAdReady;case 6:if(!i.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:a("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),a(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_START";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"onPauseGame",value:function(e,t){this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_PAUSE";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"openConsole",value:function(){try{new d.ImplementationTest(this).start(),d.Ls.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var t=this._gameData;t.sdk.fullscreen&&"auto"===t.sdk.fullscreen&&document.addEventListener("click",function(){if(w.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){w.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;w.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 w.default(this,n),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var a=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:d.getParentUrl()),i=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:d.getParentDomain()),s=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===d.getIframeDepth()?i:d.getTopDomain()),o=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:o,noLoadedEvent:u,noBlockerEvent:c,noPreroll:m,parentURL:a,parentDomain:i,topDomain:s&&s.length?s:i,noGAPageView:l,noLotamePageView:h,noGamedockSDK:p,noMinijuegosSDK:f,version:r.version,pauseGameOnStartup:g,depth:d.getIframeDepth(),domainMatched:i===s,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new R.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 R.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new R.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(m.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Mf(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=k.default(T.default.mark((function e(t){var n,r,a,i,s;return T.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 jf(i),e.abrupt("return",s.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(m.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new R.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(C.default.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new R.default(e,!0);return n.query=Hf(Hf({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return m.Base64.encode(JSON.stringify(e))}},{key:"_parseAndSelectRandomOne",value:function(e){var t=this._selectRandomOne("object"===A.default(e)?e:d.parseJSON(e));return t&&t.version?hh.version>=t.version?t:void 0:t}},{key:"_selectRandomOne",value:function(e){var t=this;if(!Yh(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){w.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=k.default(T.default.mark((function t(n,r){var a;return T.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 w.default(this,e),t.hasOwnProperty("name")&&512===t.width&&512===t.height}.bind(this));return n||(n=t.assets.length>0?t.assets[0]:{name:"logo.svg"}),"https://img.gamedistribution.com/".concat(n.name)}},{key:"_post_message",value:function(e){var t,n=e.topic,r=e.data,a=null!==(t=location.ancestorOrigins)&&void 0!==t&&t.length?location.ancestorOrigins[location.ancestorOrigins.length-1]:"*";try{var i=window.top||window.parent;i&&i.postMessage({source:"gdsdk",topic:n,data:r},a)}catch(e){console.error((null==e?void 0:e.message)||e)}}}]),e}(),Yf=new function e(){var t=this;S.default(this,e),E.default(this,"load",k.default(T.default.mark((function e(){return T.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Uf("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),E.default(this,"showLeaderboard",function(){var e=k.default(T.default.mark((function e(n){var r;return T.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)}}()),E.default(this,"addScore",function(){var e=k.default(T.default.mark((function e(n){return T.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"]},Pf(this.moduleName,this.moduleConfig)},Jf=new Qf(function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":A.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===A.default(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}());function Xf(){var e=this;this.AdType=d.AdType,this.preloadAd=function(e){return Jf.preloadAd(e)},this.showAd=function(e,t){return e===d.AdType.Display?Jf.showDisplayAd(t):Jf.showAd(e)},this.cancelAd=function(){return Jf.cancelAd()},this.openConsole=function(){Jf.openConsole()},this.getSession=function(){return Jf.session()},this.leaderboard={show:function(){w.default(this,e),Yf.showLeaderboard()}.bind(this),addScore:function(t){w.default(this,e),Yf.addScore(t)}.bind(this)}}Xf.prototype=new function(){this.showBanner=function(){Jf.showBanner()},this.play=function(){},this.customLog=function(){}},window.gdsdk=new Xf,window.gdApi=window.gdsdk;
|
|
1
|
+
"use strict";var e=require("@babel/runtime/helpers/newArrowCheck"),t=require("@babel/runtime/helpers/typeof"),n=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/asyncToGenerator"),a=require("@babel/runtime/helpers/classCallCheck"),i=require("@babel/runtime/helpers/createClass"),s=require("@babel/runtime/regenerator"),o=require("@babel/runtime/helpers/objectWithoutProperties"),d=require("@bygd/gd-sdk-era/dist/default"),u=require("url-parse"),l=require("can-autoplay"),c=require("is-plain-object"),h=require("lodash.clonedeep"),p=require("querystringify"),f=require("lodash.merge"),m=require("js-base64"),g=require("validator"),v=require("is-valid-domain"),y=require("get-value"),b=require("set-value");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var w=_(e),A=_(t),E=_(n),k=_(r),S=_(a),T=_(i),x=_(s),D=_(o),R=_(u),I=_(l),O=_(h),C=_(p),P=_(f),L=_(g),U=_(v),j=_(y),M=_(b),B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},N=function(e){return e&&e.Math==Math&&e},q=N("object"==typeof globalThis&&globalThis)||N("object"==typeof window&&window)||N("object"==typeof self&&self)||N("object"==typeof B&&B)||function(){return this}()||Function("return this")(),G={},V=function(e){try{return!!e()}catch(e){return!0}},F=!V((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),K={},W={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,H=z&&!W.call({1:2},1);K.f=H?function(e){var t=z(this,e);return!!t&&t.enumerable}:W;var $=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Q={}.toString,Y=function(e){return Q.call(e).slice(8,-1)},J=Y,X="".split,Z=V((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==J(e)?X.call(e,""):Object(e)}:Object,ee=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},te=Z,ne=ee,re=function(e){return te(ne(e))},ae=function(e){return"object"==typeof e?null!==e:"function"==typeof e},ie=ae,se=function(e,t){if(!ie(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!ie(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!ie(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!ie(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},oe={}.hasOwnProperty,de=function(e,t){return oe.call(e,t)},ue=ae,le=q.document,ce=ue(le)&&ue(le.createElement),he=function(e){return ce?le.createElement(e):{}},pe=he,fe=!F&&!V((function(){return 7!=Object.defineProperty(pe("div"),"a",{get:function(){return 7}}).a})),me=F,ge=K,ve=$,ye=re,be=se,_e=de,we=fe,Ae=Object.getOwnPropertyDescriptor;G.f=me?Ae:function(e,t){if(e=ye(e),t=be(t,!0),we)try{return Ae(e,t)}catch(e){}if(_e(e,t))return ve(!ge.f.call(e,t),e[t])};var Ee={},ke=ae,Se=function(e){if(!ke(e))throw TypeError(String(e)+" is not an object");return e},Te=F,xe=fe,De=Se,Re=se,Ie=Object.defineProperty;Ee.f=Te?Ie:function(e,t,n){if(De(e),t=Re(t,!0),De(n),xe)try{return Ie(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=Ee,Ce=$,Pe=F?function(e,t,n){return Oe.f(e,t,Ce(1,n))}:function(e,t,n){return e[t]=n,e},Le={exports:{}},Ue=q,je=Pe,Me=function(e,t){try{je(Ue,e,t)}catch(n){Ue[e]=t}return t},Be=Me,Ne=q["__core-js_shared__"]||Be("__core-js_shared__",{}),qe=Ne,Ge=Function.toString;"function"!=typeof qe.inspectSource&&(qe.inspectSource=function(e){return Ge.call(e)});var Ve=qe.inspectSource,Fe=Ve,Ke=q.WeakMap,We="function"==typeof Ke&&/native code/.test(Fe(Ke)),ze={exports:{}},He=Ne;(ze.exports=function(e,t){return He[e]||(He[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.10.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var $e,Qe,Ye,Je=0,Xe=Math.random(),Ze=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Je+Xe).toString(36)},et=ze.exports,tt=Ze,nt=et("keys"),rt=function(e){return nt[e]||(nt[e]=tt(e))},at={},it=We,st=ae,ot=Pe,dt=de,ut=Ne,lt=rt,ct=at,ht=q.WeakMap;if(it){var pt=ut.state||(ut.state=new ht),ft=pt.get,mt=pt.has,gt=pt.set;$e=function(e,t){return t.facade=e,gt.call(pt,e,t),t},Qe=function(e){return ft.call(pt,e)||{}},Ye=function(e){return mt.call(pt,e)}}else{var vt=lt("state");ct[vt]=!0,$e=function(e,t){return t.facade=e,ot(e,vt,t),t},Qe=function(e){return dt(e,vt)?e[vt]:{}},Ye=function(e){return dt(e,vt)}}var yt={set:$e,get:Qe,has:Ye,enforce:function(e){return Ye(e)?Qe(e):$e(e,{})},getterFor:function(e){return function(t){var n;if(!st(t)||(n=Qe(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},bt=q,_t=Pe,wt=de,At=Me,Et=Ve,kt=yt.get,St=yt.enforce,Tt=String(String).split("String");(Le.exports=function(e,t,n,r){var a,i=!!r&&!!r.unsafe,s=!!r&&!!r.enumerable,o=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof t||wt(n,"name")||_t(n,"name",t),(a=St(n)).source||(a.source=Tt.join("string"==typeof t?t:""))),e!==bt?(i?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=n:_t(e,t,n)):s?e[t]=n:At(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&kt(this).source||Et(this)}));var xt=q,Dt=xt,Rt=q,It=function(e){return"function"==typeof e?e:void 0},Ot=function(e,t){return arguments.length<2?It(Dt[e])||It(Rt[e]):Dt[e]&&Dt[e][t]||Rt[e]&&Rt[e][t]},Ct={},Pt=Math.ceil,Lt=Math.floor,Ut=function(e){return isNaN(e=+e)?0:(e>0?Lt:Pt)(e)},jt=Ut,Mt=Math.min,Bt=function(e){return e>0?Mt(jt(e),9007199254740991):0},Nt=Ut,qt=Math.max,Gt=Math.min,Vt=function(e,t){var n=Nt(e);return n<0?qt(n+t,0):Gt(n,t)},Ft=re,Kt=Bt,Wt=Vt,zt=function(e){return function(t,n,r){var a,i=Ft(t),s=Kt(i.length),o=Wt(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}},Ht={includes:zt(!0),indexOf:zt(!1)},$t=de,Qt=re,Yt=Ht.indexOf,Jt=at,Xt=function(e,t){var n,r=Qt(e),a=0,i=[];for(n in r)!$t(Jt,n)&&$t(r,n)&&i.push(n);for(;t.length>a;)$t(r,n=t[a++])&&(~Yt(i,n)||i.push(n));return i},Zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],en=Xt,tn=Zt.concat("length","prototype");Ct.f=Object.getOwnPropertyNames||function(e){return en(e,tn)};var nn={};nn.f=Object.getOwnPropertySymbols;var rn=Ct,an=nn,sn=Se,on=Ot("Reflect","ownKeys")||function(e){var t=rn.f(sn(e)),n=an.f;return n?t.concat(n(e)):t},dn=de,un=on,ln=G,cn=Ee,hn=function(e,t){for(var n=un(t),r=cn.f,a=ln.f,i=0;i<n.length;i++){var s=n[i];dn(e,s)||r(e,s,a(t,s))}},pn=V,fn=/#|\.prototype\./,mn=function(e,t){var n=vn[gn(e)];return n==bn||n!=yn&&("function"==typeof t?pn(t):!!t)},gn=mn.normalize=function(e){return String(e).replace(fn,".").toLowerCase()},vn=mn.data={},yn=mn.NATIVE="N",bn=mn.POLYFILL="P",_n=mn,wn=q,An=G.f,En=Pe,kn=Le.exports,Sn=Me,Tn=hn,xn=_n,Dn=function(e,t){var n,r,a,i,s,o=e.target,d=e.global,u=e.stat;if(n=d?wn:u?wn[o]||Sn(o,{}):(wn[o]||{}).prototype)for(r in t){if(i=t[r],a=e.noTargetGet?(s=An(n,r))&&s.value:n[r],!xn(d?r:o+(u?".":"#")+r,e.forced)&&void 0!==a){if(typeof i==typeof a)continue;Tn(i,a)}(e.sham||a&&a.sham)&&En(i,"sham",!0),kn(n,r,i,e)}},Rn=ee,In=function(e){return Object(Rn(e))},On=Xt,Cn=Zt,Pn=Object.keys||function(e){return On(e,Cn)},Ln=In,Un=Pn;Dn({target:"Object",stat:!0,forced:V((function(){Un(1)}))},{keys:function(e){return Un(Ln(e))}});var jn,Mn,Bn=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Nn=Bn,qn=function(e,t,n){if(Nn(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)}},Gn=Y,Vn=Array.isArray||function(e){return"Array"==Gn(e)},Fn="process"==Y(q.process),Kn=Ot("navigator","userAgent")||"",Wn=Kn,zn=q.process,Hn=zn&&zn.versions,$n=Hn&&Hn.v8;$n?Mn=(jn=$n.split("."))[0]+jn[1]:Wn&&(!(jn=Wn.match(/Edge\/(\d+)/))||jn[1]>=74)&&(jn=Wn.match(/Chrome\/(\d+)/))&&(Mn=jn[1]);var Qn=Mn&&+Mn,Yn=Fn,Jn=Qn,Xn=V,Zn=!!Object.getOwnPropertySymbols&&!Xn((function(){return!Symbol.sham&&(Yn?38===Jn:Jn>37&&Jn<41)})),er=Zn&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tr=q,nr=ze.exports,rr=de,ar=Ze,ir=Zn,sr=er,or=nr("wks"),dr=tr.Symbol,ur=sr?dr:dr&&dr.withoutSetter||ar,lr=function(e){return rr(or,e)&&(ir||"string"==typeof or[e])||(ir&&rr(dr,e)?or[e]=dr[e]:or[e]=ur("Symbol."+e)),or[e]},cr=ae,hr=Vn,pr=lr("species"),fr=function(e,t){var n;return hr(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!hr(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=qn,gr=Z,vr=In,yr=Bt,br=fr,_r=[].push,wr=function(e){var t=1==e,n=2==e,r=3==e,a=4==e,i=6==e,s=7==e,o=5==e||i;return function(d,u,l,c){for(var h,p,f=vr(d),m=gr(f),g=mr(u,l,3),v=yr(m.length),y=0,b=c||br,_=t?b(d,v):n||s?b(d,0):void 0;v>y;y++)if((o||y in m)&&(p=g(h=m[y],y,f),e))if(t)_[y]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:_r.call(_,h)}else switch(e){case 4:return!1;case 7:_r.call(_,h)}return i?-1:r||a?a:_}},Ar={forEach:wr(0),map:wr(1),filter:wr(2),some:wr(3),every:wr(4),find:wr(5),findIndex:wr(6),filterOut:wr(7)},Er=V,kr=Qn,Sr=lr("species"),Tr=function(e){return kr>=51||!Er((function(){var t=[];return(t.constructor={})[Sr]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},xr=Ar.filter;Dn({target:"Array",proto:!0,forced:!Tr("filter")},{filter:function(e){return xr(this,e,arguments.length>1?arguments[1]:void 0)}});var Dr=Dn,Rr=V,Ir=re,Or=G.f,Cr=F,Pr=Rr((function(){Or(1)}));Dr({target:"Object",stat:!0,forced:!Cr||Pr,sham:!Cr},{getOwnPropertyDescriptor:function(e,t){return Or(Ir(e),t)}});var Lr=se,Ur=Ee,jr=$,Mr=function(e,t,n){var r=Lr(t);r in e?Ur.f(e,r,jr(0,n)):e[r]=n},Br=on,Nr=re,qr=G,Gr=Mr;Dn({target:"Object",stat:!0,sham:!F},{getOwnPropertyDescriptors:function(e){for(var t,n,r=Nr(e),a=qr.f,i=Br(r),s={},o=0;i.length>o;)void 0!==(n=a(r,t=i[o++]))&&Gr(s,t,n);return s}});var Vr={};Vr[lr("toStringTag")]="z";var Fr="[object z]"===String(Vr),Kr=Fr,Wr=Y,zr=lr("toStringTag"),Hr="Arguments"==Wr(function(){return arguments}()),$r=Kr?Wr: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),zr))?n:Hr?Wr(t):"Object"==(r=Wr(t))&&"function"==typeof t.callee?"Arguments":r},Qr=$r,Yr=Fr?{}.toString:function(){return"[object "+Qr(this)+"]"},Jr=Fr,Xr=Le.exports,Zr=Yr;Jr||Xr(Object.prototype,"toString",Zr,{unsafe:!0});var ea=q.Promise,ta=Le.exports,na=Ee.f,ra=de,aa=lr("toStringTag"),ia=function(e,t,n){e&&!ra(e=n?e:e.prototype,aa)&&na(e,aa,{configurable:!0,value:t})},sa=Ot,oa=Ee,da=F,ua=lr("species"),la=function(e){var t=sa(e),n=oa.f;da&&t&&!t[ua]&&n(t,ua,{configurable:!0,get:function(){return this}})},ca={},ha=ca,pa=lr("iterator"),fa=Array.prototype,ma=function(e){return void 0!==e&&(ha.Array===e||fa[pa]===e)},ga=$r,va=ca,ya=lr("iterator"),ba=function(e){if(null!=e)return e[ya]||e["@@iterator"]||va[ga(e)]},_a=Se,wa=function(e){var t=e.return;if(void 0!==t)return _a(t.call(e)).value},Aa=Se,Ea=ma,ka=Bt,Sa=qn,Ta=ba,xa=wa,Da=function(e,t){this.stopped=e,this.result=t},Ra=lr("iterator"),Ia=!1;try{var Oa=0,Ca={next:function(){return{done:!!Oa++}},return:function(){Ia=!0}};Ca[Ra]=function(){return this},Array.from(Ca,(function(){throw 2}))}catch(e){}var Pa,La,Ua,ja=function(e,t){if(!t&&!Ia)return!1;var n=!1;try{var r={};r[Ra]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Ma=Se,Ba=Bn,Na=lr("species"),qa=function(e,t){var n,r=Ma(e).constructor;return void 0===r||null==(n=Ma(r)[Na])?t:Ba(n)},Ga=Ot("document","documentElement"),Va=/(?:iphone|ipod|ipad).*applewebkit/i.test(Kn),Fa=q,Ka=V,Wa=qn,za=Ga,Ha=he,$a=Va,Qa=Fn,Ya=Fa.location,Ja=Fa.setImmediate,Xa=Fa.clearImmediate,Za=Fa.process,ei=Fa.MessageChannel,ti=Fa.Dispatch,ni=0,ri={},ai=function(e){if(ri.hasOwnProperty(e)){var t=ri[e];delete ri[e],t()}},ii=function(e){return function(){ai(e)}},si=function(e){ai(e.data)},oi=function(e){Fa.postMessage(e+"",Ya.protocol+"//"+Ya.host)};Ja&&Xa||(Ja=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return ri[++ni]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Pa(ni),ni},Xa=function(e){delete ri[e]},Qa?Pa=function(e){Za.nextTick(ii(e))}:ti&&ti.now?Pa=function(e){ti.now(ii(e))}:ei&&!$a?(Ua=(La=new ei).port2,La.port1.onmessage=si,Pa=Wa(Ua.postMessage,Ua,1)):Fa.addEventListener&&"function"==typeof postMessage&&!Fa.importScripts&&Ya&&"file:"!==Ya.protocol&&!Ka(oi)?(Pa=oi,Fa.addEventListener("message",si,!1)):Pa="onreadystatechange"in Ha("script")?function(e){za.appendChild(Ha("script")).onreadystatechange=function(){za.removeChild(this),ai(e)}}:function(e){setTimeout(ii(e),0)});var di,ui,li,ci,hi,pi,fi,mi,gi={set:Ja,clear:Xa},vi=/web0s(?!.*chrome)/i.test(Kn),yi=q,bi=G.f,_i=gi.set,wi=Va,Ai=vi,Ei=Fn,ki=yi.MutationObserver||yi.WebKitMutationObserver,Si=yi.document,Ti=yi.process,xi=yi.Promise,Di=bi(yi,"queueMicrotask"),Ri=Di&&Di.value;Ri||(di=function(){var e,t;for(Ei&&(e=Ti.domain)&&e.exit();ui;){t=ui.fn,ui=ui.next;try{t()}catch(e){throw ui?ci():li=void 0,e}}li=void 0,e&&e.enter()},wi||Ei||Ai||!ki||!Si?xi&&xi.resolve?(fi=xi.resolve(void 0),mi=fi.then,ci=function(){mi.call(fi,di)}):ci=Ei?function(){Ti.nextTick(di)}:function(){_i.call(yi,di)}:(hi=!0,pi=Si.createTextNode(""),new ki(di).observe(pi,{characterData:!0}),ci=function(){pi.data=hi=!hi}));var Ii=Ri||function(e){var t={fn:e,next:void 0};li&&(li.next=t),ui||(ui=t,ci()),li=t},Oi={},Ci=Bn,Pi=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=Ci(t),this.reject=Ci(n)};Oi.f=function(e){return new Pi(e)};var Li,Ui,ji,Mi,Bi=Se,Ni=ae,qi=Oi,Gi=function(e,t){if(Bi(e),Ni(t)&&t.constructor===e)return t;var n=qi.f(e);return(0,n.resolve)(t),n.promise},Vi=q,Fi=Dn,Ki=q,Wi=Ot,zi=ea,Hi=Le.exports,$i=function(e,t,n){for(var r in t)ta(e,r,t[r],n);return e},Qi=ia,Yi=la,Ji=ae,Xi=Bn,Zi=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},es=Ve,ts=function(e,t,n){var r,a,i,s,o,d,u,l=n&&n.that,c=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),f=Sa(t,l,1+c+p),m=function(e){return r&&xa(r),new Da(!0,e)},g=function(e){return c?(Aa(e),p?f(e[0],e[1],m):f(e[0],e[1])):p?f(e,m):f(e)};if(h)r=e;else{if("function"!=typeof(a=Ta(e)))throw TypeError("Target is not iterable");if(Ea(a)){for(i=0,s=ka(e.length);s>i;i++)if((o=g(e[i]))&&o instanceof Da)return o;return new Da(!1)}r=a.call(e)}for(d=r.next;!(u=d.call(r)).done;){try{o=g(u.value)}catch(e){throw xa(r),e}if("object"==typeof o&&o&&o instanceof Da)return o}return new Da(!1)},ns=ja,rs=qa,as=gi.set,is=Ii,ss=Gi,os=function(e,t){var n=Vi.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},ds=Oi,us=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},ls=yt,cs=_n,hs=Fn,ps=Qn,fs=lr("species"),ms="Promise",gs=ls.get,vs=ls.set,ys=ls.getterFor(ms),bs=zi,_s=Ki.TypeError,ws=Ki.document,As=Ki.process,Es=Wi("fetch"),ks=ds.f,Ss=ks,Ts=!!(ws&&ws.createEvent&&Ki.dispatchEvent),xs="function"==typeof PromiseRejectionEvent,Ds=cs(ms,(function(){if(!(es(bs)!==String(bs))){if(66===ps)return!0;if(!hs&&!xs)return!0}if(ps>=51&&/native code/.test(bs))return!1;var e=bs.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[fs]=t,!(e.then((function(){}))instanceof t)})),Rs=Ds||!ns((function(e){bs.all(e).catch((function(){}))})),Is=function(e){var t;return!(!Ji(e)||"function"!=typeof(t=e.then))&&t},Os=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;is((function(){for(var r=e.value,a=1==e.state,i=0;n.length>i;){var s,o,d,u=n[i++],l=a?u.ok:u.fail,c=u.resolve,h=u.reject,p=u.domain;try{l?(a||(2===e.rejection&&Us(e),e.rejection=1),!0===l?s=r:(p&&p.enter(),s=l(r),p&&(p.exit(),d=!0)),s===u.promise?h(_s("Promise-chain cycle")):(o=Is(s))?o.call(s,c,h):c(s)):h(r)}catch(e){p&&!d&&p.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Ps(e)}))}},Cs=function(e,t,n){var r,a;Ts?((r=ws.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),Ki.dispatchEvent(r)):r={promise:t,reason:n},!xs&&(a=Ki["on"+e])?a(r):"unhandledrejection"===e&&os("Unhandled promise rejection",n)},Ps=function(e){as.call(Ki,(function(){var t,n=e.facade,r=e.value;if(Ls(e)&&(t=us((function(){hs?As.emit("unhandledRejection",r,n):Cs("unhandledrejection",n,r)})),e.rejection=hs||Ls(e)?2:1,t.error))throw t.value}))},Ls=function(e){return 1!==e.rejection&&!e.parent},Us=function(e){as.call(Ki,(function(){var t=e.facade;hs?As.emit("rejectionHandled",t):Cs("rejectionhandled",t,e.value)}))},js=function(e,t,n){return function(r){e(t,r,n)}},Ms=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Os(e,!0))},Bs=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw _s("Promise can't be resolved itself");var r=Is(t);r?is((function(){var n={done:!1};try{r.call(t,js(Bs,n,e),js(Ms,n,e))}catch(t){Ms(n,t,e)}})):(e.value=t,e.state=1,Os(e,!1))}catch(t){Ms({done:!1},t,e)}}};Ds&&(bs=function(e){Zi(this,bs,ms),Xi(e),Li.call(this);var t=gs(this);try{e(js(Bs,t),js(Ms,t))}catch(e){Ms(t,e)}},(Li=function(e){vs(this,{type:ms,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=$i(bs.prototype,{then:function(e,t){var n=ys(this),r=ks(rs(this,bs));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=hs?As.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Os(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),Ui=function(){var e=new Li,t=gs(e);this.promise=e,this.resolve=js(Bs,t),this.reject=js(Ms,t)},ds.f=ks=function(e){return e===bs||e===ji?new Ui(e):Ss(e)},"function"==typeof zi&&(Mi=zi.prototype.then,Hi(zi.prototype,"then",(function(e,t){var n=this;return new bs((function(e,t){Mi.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Es&&Fi({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return ss(bs,Es.apply(Ki,arguments))}}))),Fi({global:!0,wrap:!0,forced:Ds},{Promise:bs}),Qi(bs,ms,!1),Yi(ms),ji=Wi(ms),Fi({target:ms,stat:!0,forced:Ds},{reject:function(e){var t=ks(this);return t.reject.call(void 0,e),t.promise}}),Fi({target:ms,stat:!0,forced:Ds},{resolve:function(e){return ss(this,e)}}),Fi({target:ms,stat:!0,forced:Rs},{all:function(e){var t=this,n=ks(t),r=n.resolve,a=n.reject,i=us((function(){var n=Xi(t.resolve),i=[],s=0,o=1;ts(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=ks(t),r=n.reject,a=us((function(){var a=Xi(t.resolve);ts(e,(function(e){a.call(t,e).then(n.resolve,r)}))}));return a.error&&r(a.value),n.promise}});var Ns=Dn,qs=ea,Gs=V,Vs=Ot,Fs=qa,Ks=Gi,Ws=Le.exports;Ns({target:"Promise",proto:!0,real:!0,forced:!!qs&&Gs((function(){qs.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=Fs(this,Vs("Promise")),n="function"==typeof e;return this.then(n?function(n){return Ks(t,e()).then((function(){return n}))}:e,n?function(n){return Ks(t,e()).then((function(){throw n}))}:e)}}),"function"!=typeof qs||qs.prototype.finally||Ws(qs.prototype,"finally",Vs("Promise").prototype.finally);var zs=Se,Hs=function(){var e=zs(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},$s={},Qs=V;function Ys(e,t){return RegExp(e,t)}$s.UNSUPPORTED_Y=Qs((function(){var e=Ys("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),$s.BROKEN_CARET=Qs((function(){var e=Ys("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var Js=Hs,Xs=$s,Zs=ze.exports,eo=RegExp.prototype.exec,to=Zs("native-string-replace",String.prototype.replace),no=eo,ro=function(){var e=/a/,t=/b*/g;return eo.call(e,"a"),eo.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),ao=Xs.UNSUPPORTED_Y||Xs.BROKEN_CARET,io=void 0!==/()??/.exec("")[1];(ro||io||ao)&&(no=function(e){var t,n,r,a,i=this,s=ao&&i.sticky,o=Js.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)),io&&(n=new RegExp("^"+d+"$(?!\\s)",o)),ro&&(t=i.lastIndex),r=eo.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:ro&&r&&(i.lastIndex=i.global?r.index+r[0].length:t),io&&r&&r.length>1&&to.call(r[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r});var so=no;Dn({target:"RegExp",proto:!0,forced:/./.exec!==so},{exec:so});var oo=Le.exports,uo=V,lo=lr,co=Pe,ho=lo("species"),po=!uo((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),fo="$0"==="a".replace(/./,"$0"),mo=lo("replace"),go=!!/./[mo]&&""===/./[mo]("a","$0"),vo=!uo((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]})),yo=function(e,t,n,r){var a=lo(e),i=!uo((function(){var t={};return t[a]=function(){return 7},7!=""[e](t)})),s=i&&!uo((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[ho]=function(){return n},n.flags="",n[a]=/./[a]),n.exec=function(){return t=!0,null},n[a](""),!t}));if(!i||!s||"replace"===e&&(!po||!fo||go)||"split"===e&&!vo){var o=/./[a],d=n(a,""[e],(function(e,t,n,r,a){return t.exec===RegExp.prototype.exec?i&&!a?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:fo,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:go}),u=d[0],l=d[1];oo(String.prototype,e,u),oo(RegExp.prototype,a,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}r&&co(RegExp.prototype[a],"sham",!0)},bo=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},_o=Y,wo=so,Ao=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"!==_o(e))throw TypeError("RegExp#exec called on incompatible receiver");return wo.call(e,t)},Eo=Se,ko=ee,So=bo,To=Ao;yo("search",1,(function(e,t,n){return[function(t){var n=ko(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=Eo(e),i=String(this),s=a.lastIndex;So(s,0)||(a.lastIndex=0);var o=To(a,i);return So(a.lastIndex,s)||(a.lastIndex=s),null===o?-1:o.index}]}));var xo=ee,Do="[\t\n\v\f\r \u2028\u2029\ufeff]",Ro=RegExp("^"+Do+Do+"*"),Io=RegExp(Do+Do+"*$"),Oo=function(e){return function(t){var n=String(xo(t));return 1&e&&(n=n.replace(Ro,"")),2&e&&(n=n.replace(Io,"")),n}},Co={start:Oo(1),end:Oo(2),trim:Oo(3)},Po=V,Lo="\t\n\v\f\r \u2028\u2029\ufeff",Uo=Co.trim;Dn({target:"String",proto:!0,forced:function(e){return Po((function(){return!!Lo[e]()||"
"!="
"[e]()||Lo[e].name!==e}))}("trim")},{trim:function(){return Uo(this)}});var jo={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},Mo=V,Bo=Ar.forEach,No=q,qo=jo,Go=function(e,t){var n=[][e];return!!n&&Mo((function(){n.call(null,t||function(){throw 1},1)}))}("forEach")?[].forEach:function(e){return Bo(this,e,arguments.length>1?arguments[1]:void 0)},Vo=Pe;for(var Fo in qo){var Ko=No[Fo],Wo=Ko&&Ko.prototype;if(Wo&&Wo.forEach!==Go)try{Vo(Wo,"forEach",Go)}catch(e){Wo.forEach=Go}}var zo=ae,Ho=Se,$o=function(e){if(!zo(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Qo=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),$o(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),Yo=ae,Jo=Qo,Xo=ae,Zo=Y,ed=lr("match"),td=function(e){var t;return Xo(e)&&(void 0!==(t=e[ed])?!!t:"RegExp"==Zo(e))},nd=F,rd=q,ad=_n,id=function(e,t,n){var r,a;return Jo&&"function"==typeof(r=t.constructor)&&r!==n&&Yo(a=r.prototype)&&a!==n.prototype&&Jo(e,a),e},sd=Ee.f,od=Ct.f,dd=td,ud=Hs,ld=$s,cd=Le.exports,hd=V,pd=yt.set,fd=la,md=lr("match"),gd=rd.RegExp,vd=gd.prototype,yd=/a/g,bd=/a/g,_d=new gd(yd)!==yd,wd=ld.UNSUPPORTED_Y;if(nd&&ad("RegExp",!_d||wd||hd((function(){return bd[md]=!1,gd(yd)!=yd||gd(bd)==bd||"/a/i"!=gd(yd,"i")})))){for(var Ad=function(e,t){var n,r=this instanceof Ad,a=dd(e),i=void 0===t;if(!r&&a&&e.constructor===Ad&&i)return e;_d?a&&!i&&(e=e.source):e instanceof Ad&&(i&&(t=ud.call(e)),e=e.source),wd&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var s=id(_d?new gd(e,t):gd(e,t),r?this:vd,Ad);return wd&&n&&pd(s,{sticky:n}),s},Ed=function(e){e in Ad||sd(Ad,e,{configurable:!0,get:function(){return gd[e]},set:function(t){gd[e]=t}})},kd=od(gd),Sd=0;kd.length>Sd;)Ed(kd[Sd++]);vd.constructor=Ad,Ad.prototype=vd,cd(rd,"RegExp",Ad)}fd("RegExp");var Td=Le.exports,xd=Se,Dd=V,Rd=Hs,Id=RegExp.prototype,Od=Id.toString,Cd=Dd((function(){return"/a/b"!=Od.call({source:"a",flags:"b"})})),Pd="toString"!=Od.name;(Cd||Pd)&&Td(RegExp.prototype,"toString",(function(){var e=xd(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Id)?Rd.call(e):n)}),{unsafe:!0});var Ld=Dn,Ud=V,jd=Vn,Md=ae,Bd=In,Nd=Bt,qd=Mr,Gd=fr,Vd=Tr,Fd=Qn,Kd=lr("isConcatSpreadable"),Wd=Fd>=51||!Ud((function(){var e=[];return e[Kd]=!1,e.concat()[0]!==e})),zd=Vd("concat"),Hd=function(e){if(!Md(e))return!1;var t=e[Kd];return void 0!==t?!!t:jd(e)};Ld({target:"Array",proto:!0,forced:!Wd||!zd},{concat:function(e){var t,n,r,a,i,s=Bd(this),o=Gd(s,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(Hd(i=-1===t?s:arguments[t])){if(d+(a=Nd(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,d++)n in i&&qd(o,d,i[n])}else{if(d>=9007199254740991)throw TypeError("Maximum allowed index exceeded");qd(o,d++,i)}return o.length=d,o}});var $d,Qd=td,Yd=function(e){if(Qd(e))throw TypeError("The method doesn't accept regular expressions");return e},Jd=lr("match"),Xd=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Jd]=!1,"/./"[e](t)}catch(e){}}return!1},Zd=Dn,eu=G.f,tu=Bt,nu=Yd,ru=ee,au=Xd,iu="".startsWith,su=Math.min,ou=au("startsWith");Zd({target:"String",proto:!0,forced:!!(ou||($d=eu(String.prototype,"startsWith"),!$d||$d.writable))&&!ou},{startsWith:function(e){var t=String(ru(this));nu(e);var n=tu(su(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return iu?iu.call(t,r,n):t.slice(n,n+r.length)===r}});var du=Ut,uu=ee,lu=function(e){return function(t,n){var r,a,i=String(uu(t)),s=du(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}},cu={codeAt:lu(!1),charAt:lu(!0)},hu=cu.charAt,pu=function(e,t,n){return t+(n?hu(e,t).length:1)},fu=In,mu=Math.floor,gu="".replace,vu=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,yu=/\$([$&'`]|\d{1,2})/g,bu=yo,_u=Se,wu=Bt,Au=Ut,Eu=ee,ku=pu,Su=function(e,t,n,r,a,i){var s=n+e.length,o=r.length,d=yu;return void 0!==a&&(a=fu(a),d=vu),gu.call(i,d,(function(i,d){var u;switch(d.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(s);case"<":u=a[d.slice(1,-1)];break;default:var l=+d;if(0===l)return i;if(l>o){var c=mu(l/10);return 0===c?i:c<=o?void 0===r[c-1]?d.charAt(1):r[c-1]+d.charAt(1):i}u=r[l-1]}return void 0===u?"":u}))},Tu=Ao,xu=Math.max,Du=Math.min;bu("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=Eu(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 o=n(t,e,this,r);if(o.done)return o.value}var d=_u(e),u=String(this),l="function"==typeof r;l||(r=String(r));var c=d.global;if(c){var h=d.unicode;d.lastIndex=0}for(var p=[];;){var f=Tu(d,u);if(null===f)break;if(p.push(f),!c)break;""===String(f[0])&&(d.lastIndex=ku(u,wu(d.lastIndex),h))}for(var m,g="",v=0,y=0;y<p.length;y++){f=p[y];for(var b=String(f[0]),_=xu(Du(Au(f.index),u.length),0),w=[],A=1;A<f.length;A++)w.push(void 0===(m=f[A])?m:String(m));var E=f.groups;if(l){var k=[b].concat(w,_,u);void 0!==E&&k.push(E);var S=String(r.apply(void 0,k))}else S=Su(b,u,_,w,E,r);_>=v&&(g+=u.slice(v,_)+S,v=_+b.length)}return g+u.slice(v)}]}));var Ru=F,Iu=Ee.f,Ou=Function.prototype,Cu=Ou.toString,Pu=/^\s*function ([^ (]*)/;Ru&&!("name"in Ou)&&Iu(Ou,"name",{configurable:!0,get:function(){try{return Cu.call(this).match(Pu)[1]}catch(e){return""}}});var Lu,Uu=Ee,ju=Se,Mu=Pn,Bu=F?Object.defineProperties:function(e,t){ju(e);for(var n,r=Mu(t),a=r.length,i=0;a>i;)Uu.f(e,n=r[i++],t[n]);return e},Nu=Se,qu=Bu,Gu=Zt,Vu=at,Fu=Ga,Ku=he,Wu=rt("IE_PROTO"),zu=function(){},Hu=function(e){return"<script>"+e+"<\/script>"},$u=function(){try{Lu=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;$u=Lu?function(e){e.write(Hu("")),e.close();var t=e.parentWindow.Object;return e=null,t}(Lu):((t=Ku("iframe")).style.display="none",Fu.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Hu("document.F=Object")),e.close(),e.F);for(var n=Gu.length;n--;)delete $u.prototype[Gu[n]];return $u()};Vu[Wu]=!0;var Qu=Object.create||function(e,t){var n;return null!==e?(zu.prototype=Nu(e),n=new zu,zu.prototype=null,n[Wu]=e):n=$u(),void 0===t?n:qu(n,t)},Yu={},Ju=re,Xu=Ct.f,Zu={}.toString,el="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Yu.f=function(e){return el&&"[object Window]"==Zu.call(e)?function(e){try{return Xu(e)}catch(e){return el.slice()}}(e):Xu(Ju(e))};var tl={},nl=lr;tl.f=nl;var rl=xt,al=de,il=tl,sl=Ee.f,ol=function(e){var t=rl.Symbol||(rl.Symbol={});al(t,e)||sl(t,e,{value:il.f(e)})},dl=Dn,ul=q,ll=Ot,cl=F,hl=Zn,pl=er,fl=V,ml=de,gl=Vn,vl=ae,yl=Se,bl=In,_l=re,wl=se,Al=$,El=Qu,kl=Pn,Sl=Ct,Tl=Yu,xl=nn,Dl=G,Rl=Ee,Il=K,Ol=Pe,Cl=Le.exports,Pl=ze.exports,Ll=at,Ul=Ze,jl=lr,Ml=tl,Bl=ol,Nl=ia,ql=yt,Gl=Ar.forEach,Vl=rt("hidden"),Fl=jl("toPrimitive"),Kl=ql.set,Wl=ql.getterFor("Symbol"),zl=Object.prototype,Hl=ul.Symbol,$l=ll("JSON","stringify"),Ql=Dl.f,Yl=Rl.f,Jl=Tl.f,Xl=Il.f,Zl=Pl("symbols"),ec=Pl("op-symbols"),tc=Pl("string-to-symbol-registry"),nc=Pl("symbol-to-string-registry"),rc=Pl("wks"),ac=ul.QObject,ic=!ac||!ac.prototype||!ac.prototype.findChild,sc=cl&&fl((function(){return 7!=El(Yl({},"a",{get:function(){return Yl(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=Ql(zl,t);r&&delete zl[t],Yl(e,t,n),r&&e!==zl&&Yl(zl,t,r)}:Yl,oc=function(e,t){var n=Zl[e]=El(Hl.prototype);return Kl(n,{type:"Symbol",tag:e,description:t}),cl||(n.description=t),n},dc=pl?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Hl},uc=function(e,t,n){e===zl&&uc(ec,t,n),yl(e);var r=wl(t,!0);return yl(n),ml(Zl,r)?(n.enumerable?(ml(e,Vl)&&e[Vl][r]&&(e[Vl][r]=!1),n=El(n,{enumerable:Al(0,!1)})):(ml(e,Vl)||Yl(e,Vl,Al(1,{})),e[Vl][r]=!0),sc(e,r,n)):Yl(e,r,n)},lc=function(e,t){yl(e);var n=_l(t),r=kl(n).concat(fc(n));return Gl(r,(function(t){cl&&!cc.call(n,t)||uc(e,t,n[t])})),e},cc=function(e){var t=wl(e,!0),n=Xl.call(this,t);return!(this===zl&&ml(Zl,t)&&!ml(ec,t))&&(!(n||!ml(this,t)||!ml(Zl,t)||ml(this,Vl)&&this[Vl][t])||n)},hc=function(e,t){var n=_l(e),r=wl(t,!0);if(n!==zl||!ml(Zl,r)||ml(ec,r)){var a=Ql(n,r);return!a||!ml(Zl,r)||ml(n,Vl)&&n[Vl][r]||(a.enumerable=!0),a}},pc=function(e){var t=Jl(_l(e)),n=[];return Gl(t,(function(e){ml(Zl,e)||ml(Ll,e)||n.push(e)})),n},fc=function(e){var t=e===zl,n=Jl(t?ec:_l(e)),r=[];return Gl(n,(function(e){!ml(Zl,e)||t&&!ml(zl,e)||r.push(Zl[e])})),r};(hl||(Cl((Hl=function(){if(this instanceof Hl)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=Ul(e),n=function(e){this===zl&&n.call(ec,e),ml(this,Vl)&&ml(this[Vl],t)&&(this[Vl][t]=!1),sc(this,t,Al(1,e))};return cl&&ic&&sc(zl,t,{configurable:!0,set:n}),oc(t,e)}).prototype,"toString",(function(){return Wl(this).tag})),Cl(Hl,"withoutSetter",(function(e){return oc(Ul(e),e)})),Il.f=cc,Rl.f=uc,Dl.f=hc,Sl.f=Tl.f=pc,xl.f=fc,Ml.f=function(e){return oc(jl(e),e)},cl&&(Yl(Hl.prototype,"description",{configurable:!0,get:function(){return Wl(this).description}}),Cl(zl,"propertyIsEnumerable",cc,{unsafe:!0}))),dl({global:!0,wrap:!0,forced:!hl,sham:!hl},{Symbol:Hl}),Gl(kl(rc),(function(e){Bl(e)})),dl({target:"Symbol",stat:!0,forced:!hl},{for:function(e){var t=String(e);if(ml(tc,t))return tc[t];var n=Hl(t);return tc[t]=n,nc[n]=t,n},keyFor:function(e){if(!dc(e))throw TypeError(e+" is not a symbol");if(ml(nc,e))return nc[e]},useSetter:function(){ic=!0},useSimple:function(){ic=!1}}),dl({target:"Object",stat:!0,forced:!hl,sham:!cl},{create:function(e,t){return void 0===t?El(e):lc(El(e),t)},defineProperty:uc,defineProperties:lc,getOwnPropertyDescriptor:hc}),dl({target:"Object",stat:!0,forced:!hl},{getOwnPropertyNames:pc,getOwnPropertySymbols:fc}),dl({target:"Object",stat:!0,forced:fl((function(){xl.f(1)}))},{getOwnPropertySymbols:function(e){return xl.f(bl(e))}}),$l)&&dl({target:"JSON",stat:!0,forced:!hl||fl((function(){var e=Hl();return"[null]"!=$l([e])||"{}"!=$l({a:e})||"{}"!=$l(Object(e))}))},{stringify:function(e,t,n){for(var r,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(r=t,(vl(t)||void 0!==e)&&!dc(e))return gl(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!dc(t))return t}),a[1]=t,$l.apply(null,a)}});Hl.prototype[Fl]||Ol(Hl.prototype,Fl,Hl.prototype.valueOf),Nl(Hl,"Symbol"),Ll[Vl]=!0;var mc=Dn,gc=F,vc=q,yc=de,bc=ae,_c=Ee.f,wc=hn,Ac=vc.Symbol;if(gc&&"function"==typeof Ac&&(!("description"in Ac.prototype)||void 0!==Ac().description)){var Ec={},kc=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof kc?new Ac(e):void 0===e?Ac():Ac(e);return""===e&&(Ec[t]=!0),t};wc(kc,Ac);var Sc=kc.prototype=Ac.prototype;Sc.constructor=kc;var Tc=Sc.toString,xc="Symbol(test)"==String(Ac("test")),Dc=/^Symbol\((.*)\)[^)]+$/;_c(Sc,"description",{configurable:!0,get:function(){var e=bc(this)?this.valueOf():this,t=Tc.call(e);if(yc(Ec,e))return"";var n=xc?t.slice(7,-1):t.replace(Dc,"$1");return""===n?void 0:n}}),mc({global:!0,forced:!0},{Symbol:kc})}var Rc=Qu,Ic=Ee,Oc=lr("unscopables"),Cc=Array.prototype;null==Cc[Oc]&&Ic.f(Cc,Oc,{configurable:!0,value:Rc(null)});var Pc=function(e){Cc[Oc][e]=!0},Lc=Ht.includes,Uc=Pc;Dn({target:"Array",proto:!0},{includes:function(e){return Lc(this,e,arguments.length>1?arguments[1]:void 0)}}),Uc("includes");var jc=Yd,Mc=ee;Dn({target:"String",proto:!0,forced:!Xd("includes")},{includes:function(e){return!!~String(Mc(this)).indexOf(jc(e),arguments.length>1?arguments[1]:void 0)}});var Bc=Dn,Nc=Ar.find,qc=Pc,Gc=!0;"find"in[]&&Array(1).find((function(){Gc=!1})),Bc({target:"Array",proto:!0,forced:Gc},{find:function(e){return Nc(this,e,arguments.length>1?arguments[1]:void 0)}}),qc("find");var Vc="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==Vc&&Vc,Fc="URLSearchParams"in Vc,Kc="Symbol"in Vc&&"iterator"in Symbol,Wc="FileReader"in Vc&&"Blob"in Vc&&function(){try{return new Blob,!0}catch(e){return!1}}(),zc="FormData"in Vc,Hc="ArrayBuffer"in Vc;if(Hc)var $c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Qc=ArrayBuffer.isView||function(e){return e&&$c.indexOf(Object.prototype.toString.call(e))>-1};function Yc(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Jc(e){return"string"!=typeof e&&(e=String(e)),e}function Xc(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return Kc&&(t[Symbol.iterator]=function(){return t}),t}function Zc(e){this.map={},e instanceof Zc?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 eh(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function th(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function nh(e){var t=new FileReader,n=th(t);return t.readAsArrayBuffer(e),n}function rh(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function ah(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:Wc&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:zc&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Fc&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Hc&&Wc&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=rh(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Hc&&(ArrayBuffer.prototype.isPrototypeOf(e)||Qc(e))?this._bodyArrayBuffer=rh(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):Fc&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Wc&&(this.blob=function(){var e=eh(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=eh(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(nh)}),this.text=function(){var e=eh(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=th(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)},zc&&(this.formData=function(){return this.text().then(oh)}),this.json=function(){return this.text().then(JSON.parse)},this}Zc.prototype.append=function(e,t){e=Yc(e),t=Jc(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},Zc.prototype.delete=function(e){delete this.map[Yc(e)]},Zc.prototype.get=function(e){return e=Yc(e),this.has(e)?this.map[e]:null},Zc.prototype.has=function(e){return this.map.hasOwnProperty(Yc(e))},Zc.prototype.set=function(e,t){this.map[Yc(e)]=Jc(t)},Zc.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},Zc.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),Xc(e)},Zc.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),Xc(e)},Zc.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),Xc(e)},Kc&&(Zc.prototype[Symbol.iterator]=Zc.prototype.entries);var ih=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function sh(e,t){if(!(this instanceof sh))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 sh){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Zc(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 Zc(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),ih.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 oh(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=void 0===t.statusText?"":""+t.statusText,this.headers=new Zc(t.headers),this.url=t.url||"",this._initBody(e)}sh.prototype.clone=function(){return new sh(this,{body:this._bodyInit})},ah.call(sh.prototype),ah.call(dh.prototype),dh.prototype.clone=function(){return new dh(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Zc(this.headers),url:this.url})},dh.error=function(){var e=new dh(null,{status:0,statusText:""});return e.type="error",e};var uh=[301,302,303,307,308];dh.redirect=function(e,t){if(-1===uh.indexOf(t))throw new RangeError("Invalid status code");return new dh(null,{status:t,headers:{location:e}})};var lh=Vc.DOMException;try{new lh}catch(e){(lh=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),lh.prototype.constructor=lh}function ch(e,t){return new Promise((function(n,r){var a=new sh(e,t);if(a.signal&&a.signal.aborted)return r(new lh("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 Zc,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var a=n.join(":").trim();t.append(r,a)}})),t)};r.url="responseURL"in i?i.responseURL:r.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){n(new 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 lh("Aborted","AbortError"))}),0)},i.open(a.method,function(e){try{return""===e&&Vc.location.href?Vc.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&&(Wc?i.responseType="blob":Hc&&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 Zc?a.headers.forEach((function(e,t){i.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){i.setRequestHeader(e,Jc(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)}))}ch.polyfill=!0,Vc.fetch||(Vc.fetch=ch,Vc.Headers=Zc,Vc.Request=sh,Vc.Response=dh);var hh={name:"@bygd/gd-sdk-pes",version:"1.22.7",files:["dist/*"],scripts:{build:"NODE_ENV=production rollup --config",watch:"rollup --config --watch --sourcemap --environment DEVELOPMENT","deploy-base":"npm install && npm run build && npm publish --access public",deploy:"npm run deploy-base && gdtool pm-upload"},repository:{type:"git",url:"git@gitlab.azerdev.com:gamedistribution/gd-sdk-pes.git"},author:"",license:"ISC",devDependencies:{"@babel/core":"^7.14.6","@babel/plugin-transform-runtime":"^7.14.5","@babel/preset-env":"^7.14.7","@rollup/plugin-babel":"^5.2.3","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.0","@rollup/plugin-replace":"^3.0.0",postcss:"^8.3.5",rollup:"^2.52.8","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-browsersync":"^1.3.3","rollup-plugin-delete":"^2.0.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-postcss":"^4.0.0","rollup-plugin-terser":"^7.0.2"},dependencies:{"@babel/runtime":"^7.14.6","@bygd/gd-sdk-era":"^0.3.2","can-autoplay":"^3.0.2",events:"^3.3.0","get-value":"^3.0.1","is-plain-object":"^5.0.0","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"}},ph=Se,fh=Bt,mh=ee,gh=pu,vh=Ao;yo("match",1,(function(e,t,n){return[function(t){var n=mh(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=ph(e),i=String(this);if(!a.global)return vh(a,i);var s=a.unicode;a.lastIndex=0;for(var o,d=[],u=0;null!==(o=vh(a,i));){var l=String(o[0]);d[u]=l,""===l&&(a.lastIndex=gh(i,fh(a.lastIndex),s)),u++}return 0===u?null:d}]}));var yh=yo,bh=td,_h=Se,wh=ee,Ah=qa,Eh=pu,kh=Bt,Sh=Ao,Th=so,xh=$s.UNSUPPORTED_Y,Dh=[].push,Rh=Math.min;yh("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(wh(this)),a=void 0===n?4294967295:n>>>0;if(0===a)return[];if(void 0===e)return[r];if(!bh(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=Th.call(c,r))&&!((s=c.lastIndex)>l&&(d.push(r.slice(l,i.index)),i.length>1&&i.index<r.length&&Dh.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=wh(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=_h(e),o=String(this),d=Ah(s,RegExp),u=s.unicode,l=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(xh?"g":"y"),c=new d(xh?"^(?:"+s.source+")":s,l),h=void 0===a?4294967295:a>>>0;if(0===h)return[];if(0===o.length)return null===Sh(c,o)?[o]:[];for(var p=0,f=0,m=[];f<o.length;){c.lastIndex=xh?0:f;var g,v=Sh(c,xh?o.slice(f):o);if(null===v||(g=Rh(kh(c.lastIndex+(xh?f:0)),o.length))===p)f=Eh(o,f,u);else{if(m.push(o.slice(p,f)),m.length===h)return m;for(var y=1;y<=v.length-1;y++)if(m.push(v[y]),m.length===h)return m;f=p=g}}return m.push(o.slice(p)),m}]}),xh);var Ih=function(){function e(t){S.default(this,e),this.gameData=t}return T.default(e,[{key:"_getFakeCustomParams",value:function(){var e={_vid:["bla_bla1","bla_bla2","bla_bla3"],_1ld:["1ld_1","1ld_2","1ld_3","1ld_4"],_1lp:["1lp_1","1lp_2"]},t={};for(var n in e){var r=e[n];t[n]=r[Math.floor(Math.random()*r.length)]}return t}},{key:"checkCustomParams",value:function(){try{var e={};if(this.gameData.diagnostic&&this.gameData.diagnostic.cp&&this.gameData.diagnostic.cp.enabled){var t=new R.default(location.href,!0);for(var n in t.query)e[n]=t.query[n];Object.keys(e).length;return e}}catch(e){console.log("_checkCustomParams.Error",e)}}}]),e}(),Oh=function(){function e(t,n){S.default(this,e),this.adContainer=t,this.onResume=n}return T.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(){w.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}(),Ch=function(e){if(!e)return!1;var t=Ph.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)},Ph=Object.prototype.toString;function Lh(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 Uh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lh(Object(n),!0).forEach((function(t){E.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jh(e){return null!=e&&e.error_url?"<vmap:VASTAdData>".concat(function(e){return e.promo_url?'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="promo">\n <Wrapper>\n <AdSystem>Rainbow</AdSystem>\n <Impression><![CDATA[').concat(e.promo_imp_green_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.promo_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim():'<VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper>\n <AdSystem>GDFP</AdSystem>\n <Error><![CDATA[').concat(e.error_url,"]]></Error>\n <Impression><![CDATA[").concat(e.impression_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,"]]></VASTAdTagURI>\n </Wrapper>\n </Ad>\n </VAST>").trim()}(e),"</vmap:VASTAdData>").trim():'<vmap:AdTagURI templateType="vast3"><![CDATA['.concat(null==e?void 0:e.adtag_url,"]]></vmap:AdTagURI>").trim()}var Mh=["bidFloor","isDfpBidding"];function Bh(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 Nh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bh(Object(n),!0).forEach((function(t){E.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qh=null,Gh=function(){function e(t,n,r){var a=this;if(S.default(this,e),qh)return qh;qh=this;var i={debug:!1,width:640,height:360,locale:"en"};this.options=n?d.extendDefaults(i,n):i,this.prefix="gdsdk__",this.adsLoader=null,this.adsManager=null,this.adDisplayContainer=null,this.eventBus=new d.EventBus,this.safetyTimer=null,this.containerTransitionSpeed=0,this.adCounter={},this.adPrerollCount=0,this.adMidrollCount=0,this.adRewardedCount=0,this.preloadedAdType=null,this.requestRunning=!1,this.parentDomain=r.parentDomain,this.topDomain=r.topDomain,this.parentURL=r.parentURL,this.adDisplayContainerInitialized=!1,this.IMASampleTags=d.getIMASampleTags(),this.atom_display,this.userAllowedPersonalizedAds=document.location.search.indexOf("gdpr-targeting=0")>=0||document.cookie.indexOf("ogdpr_advertisement=0")>=0?"0":"1",this.parentDomain.includes("girlsgogames")&&(this.userAllowedPersonalizedAds=!1),this.thirdPartyContainer=""!==t?document.getElementById(t):null,this.options.width="number"==typeof this.options.width?this.options.width:"100%"===this.options.width?640:this.options.width.replace(/[^0-9]/g,""),this.options.height="number"==typeof this.options.height?this.options.height:"100%"===this.options.height?360:this.options.height.replace(/[^0-9]/g,"");var s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:s,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:o,this.gameId="0",this.category="",this.tags=[],this.eventCategory="AD",this.eventBus.subscribe("LOADED",function(){w.default(this,a),this._clearSafetyTimer("LOADED"),this._startSafetyTimer(8e3,"LOADED")}.bind(this),"ima"),this.eventBus.subscribe("STARTED",function(){w.default(this,a),this._clearSafetyTimer("STARTED")}.bind(this),"ima")}var t,n,r,a,i,s,o,u,l,h,p,f,g,v,y,b,_,A,L;return T.default(e,[{key:"start",value:(L=k.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._init_afg_script({adsense_channel:"4089988593"});case 3:return e.next=5,this._init_hl_script();case 5:return e.next=7,this._init_ima_script();case 7:this._createPlayer(),this._setUpIMA(),e.next=14;break;case 11:throw e.prev=11,e.t0=e.catch(0),new Error(e.t0);case 14:case"end":return e.stop()}}),e,this,[[0,11]])}))),function(){return L.apply(this,arguments)})},{key:"_getAdVast",value:function(e,t){var n=this;return new Promise(function(){var r=k.default(x.default.mark((function r(a){var i,s,o,u,l,h,p,f,m,g,v=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(d.Ls.available&&d.Ls.getBoolean("gd_debug_ex")&&d.Ls.getBoolean("gd_tag"))){r.next=6;break}return i=n.IMASampleTags[e],s=Math.floor(Math.random()*i.length),o=i[s],a({url:o}),r.abrupt("return");case 6:if(void 0!==window.idhb.requestAds){r.next=8;break}throw new Error("Prebid.js wrapper script hit an error or didn't exist!");case 8:return r.prev=8,r.next=11,n._getTunnlKeys(e);case 11:if(u=r.sent,l=u.data,h=l.nsid?l.nsid:"TNL_T-17102571517",p=l.tid?l.tid:"TNL_NS-18101700058",f="".concat(h,"/").concat(p),delete l.nsid,delete l.tid,P.default(l,{tnl_system:"1",tnl_content_category:n.category.toLowerCase()}),n.eventBus.broadcast("AD_REQUEST",{message:l.tnl_ad_pos}),m=n.options,"preroll"===l.tnl_ad_pos&&c.isPlainObject(m.preroll)?m=m.preroll:"midroll"===l.tnl_ad_pos&&c.isPlainObject(m.midroll)?m=m.midroll:"rewarded"===l.tnl_ad_pos&&c.isPlainObject(m.rewarded)&&(m=m.rewarded),!(t&&t.retry_on_success&&c.isPlainObject(m.retry_on_success)&&c.isPlainObject(m.retry_on_success.vast))){r.next=26;break}return r.abrupt("return",a(n._createCustomAdVastUrl(m.retry_on_success.vast,{tnl_keys:l})));case 26:if(!(t&&t.retry_on_failure&&n.options.retry_on_failure&&c.isPlainObject(m.retry_on_failure.vast))){r.next=30;break}return r.abrupt("return",a(n._createCustomAdVastUrl(m.retry_on_failure.vast,{tnl_keys:l})));case 30:if(!c.isPlainObject(m.vast)){r.next=32;break}return r.abrupt("return",a(n._createCustomAdVastUrl(m.vast,{tnl_keys:l})));case 32:return r.next=34,n._create_dp_context(l.tnl_ad_pos,t);case 34:g=r.sent,window.idhb.que.push(function(){var e=this;w.default(this,v),window.idhb.setRefererUrl(encodeURIComponent(n.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(n.userAllowedPersonalizedAds));var t="rewarded"===l.tnl_ad_pos?"rewardedVideo":"gdbanner"===l.tnl_ad_pos?"gd__banner":"midroll"===l.tnl_ad_pos?"midroll":"video1";window.idhb.setDfpAdUnitCodeForAdSlot(t,f),window.idhb.setAdserverTargetingForAdSlot(t,l),window.idhb.requestAds({slots:E.default({},t,{bidFloor:null!=g&&g.floor_price?g.floor_price:void 0}),callback:function(t,n){var r=this;w.default(this,e),g&&!n.bidFloorApplied&&fetch(g.skip_url).catch(function(e){w.default(this,r)}.bind(this)),a({tnl_keys:l,url:t,dp:g,hl:n})}.bind(this)})}.bind(this)),r.next=41;break;case 38:throw r.prev=38,r.t0=r.catch(8),new Error(r.t0);case 41:case"end":return r.stop()}}),r,this,[[8,38]])})));return function(e){return r.apply(this,arguments)}}())}},{key:"nextAdPosition",value:function(e){if(e===d.AdType.Rewarded)return this.adRewardedCount++,"rewarded";if(e===d.AdType.Interstitial){var t=!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount;return t?this.adMidrollCount++:this.adPrerollCount++,t||this.adMidrollCount>0?"midroll":"preroll"}return"midroll"}},{key:"getAdPosition",value:function(e){return e===d.AdType.Rewarded?"rewarded":e===d.AdType.Interstitial?!1===this.gameData.preroll||!0===this.noPreroll||1===this.adPrerollCount||this.adMidrollCount>0?"midroll":"preroll":"midroll"}},{key:"_getTunnlKeys",value:function(e){var t=this;return new Promise(function(n){var r=this;w.default(this,t);var a="";!navigator.userAgent.match(/Crosswalk/i)&&void 0===window.cordova||"m.hopy.com"!==this.parentDomain?("undefined"===this.topDomain&&(this.topDomain=void 0),a="page_url=".concat(encodeURIComponent(this.topDomain||this.parentDomain))):a="bundle=com.hopy.frivgames",function(e,t){try{var n={tp:e,data:t};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(m.Base64.encode(JSON.stringify(n)))))}catch(e){console.log("Send Atom Log Error...",e)}}("page_url",{top_domain:this.topDomain,parent_domain:this.parentDomain,game:this.gameId,pageUrl:a});var i=this.nextAdPosition(e),s=d.getQueryString("ch",window.location.href),o=d.getQueryString("ch_date",window.location.href),u=s?"&ch=".concat(s):"",l=o?"&ch_date=".concat(o):"",c="https://pub.headerlift.com/opphb?".concat(a,"&player_width=").concat(this.options.width,"&player_height=").concat(this.options.height,"&ad_type=video_image&game_id=").concat(this.gameId,"&ad_position=").concat(i).concat(u).concat(l,"&correlator=").concat(Date.now()),h=new Request(c,{method:"GET"});fetch(h).then(function(e){w.default(this,r);var t=e.headers.get("content-type");if(t&&-1!==t.indexOf("application/json"))return e.json();throw new TypeError("Oops, we didn't get JSON!")}.bind(this)).then(function(e){w.default(this,r),d.isObjectEmpty(e)&&(e=this._createTunnlReportingFallbackKeys(i),this.eventBus.broadcast("AD_REQUEST_KEYS_EMPTY",{message:"Tunnl returned empty response.",details:c})),n({data:e,url:c})}.bind(this)).catch(function(e){w.default(this,r);var t=this._createTunnlReportingFallbackKeys(i);this.eventBus.broadcast("AD_REQUEST_KEYS_FALLBACK",{message:e.message,details:c}),n({data:t,url:c})}.bind(this))}.bind(this))}},{key:"_createTunnlReportingFallbackKeys",value:function(e){return{tid:"TNL_T-17102571517",nsid:"TNL_NS-18101700058",tnl_tid:"T-17102571517",tnl_nsid:"NS-18101700058",tnl_pw:this.options.width,tnl_ph:this.options.height,tnl_pt:"22",tnl_pid:"P-17101800031",tnl_paid:"17",tnl_ad_type:"video_image",tnl_asset_id:this.gameId.toString(),tnl_ad_pos:e,tnl_skippable:"1",tnl_cp1:"",tnl_cp2:"",tnl_cp3:"",tnl_cp4:"",tnl_cp5:"",tnl_cp6:"",tnl_campaign:"2",tnl_gdpr:"0",tnl_gdpr_consent:"1",consent_string:"BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA",tnl_content_category:this.category.toLowerCase()}}},{key:"_requestAd",value:function(e,t){var n=this;return t=t||{},new Promise(function(r){if(w.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=Nh(Nh({},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 R.default(e.adtag_url_1,!0);i.query=Uh(Uh({},i.query),{},{ad_rule:0,vpos:t,pod:1,ppos:1,lip:!0,correlator:a,output:"xml_vast3"});var s=i.toString(),o=new R.default(e.adtag_url_2,!0);o.query=Uh(Uh({},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(jh({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(jh({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 p=function(e){return'<?xml version="1.0" encoding="utf-8"?>\n <VAST version="3.0">\n <Ad id="'.concat(e.id,'">\n <Wrapper fallbackOnNoAd="true">\n <AdSystem>GDFP</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.adtag_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="0" />\n </Extensions>\n </Wrapper>\n </Ad>\n <Ad id="fallback">\n <Wrapper>\n <AdSystem>ADS</AdSystem>\n <Impression><![CDATA[').concat(e.fallback_imp_url,"]]></Impression>\n <VASTAdTagURI><![CDATA[").concat(e.fallback_url,']]></VASTAdTagURI>\n <Extensions>\n <Extension type="waterfall" fallback_index="1" />\n </Extensions>\n </Wrapper>\n </Ad>\n </VAST>').trim()}(u);s.adsResponse=p}else s.adTagUrl=o.url;s.linearAdSlotWidth=this.options.width,s.linearAdSlotHeight=this.options.height,s.nonLinearAdSlotWidth=this.options.width,s.nonLinearAdSlotHeight=this.options.height,s.forceNonLinearFullSlot=!0,this.options.vast_load_timeout&&(s.vastLoadTimeout=this.options.vast_load_timeout),s.setAdWillAutoPlay(t.autoplayAllowed),s.setAdWillPlayMuted(t.autoplayRequiresMute),this.adsLoader.requestAds(s,d);try{this.eventBus.broadcast("AD_SDK_REQUEST",{message:d})}catch(e){}r(s)}catch(e){throw new Error(e)}}.bind(this))}},{key:"cancel",value:function(){if(!1!==this.requestRunning){this.requestRunning=!1,this._resetAdsLoader(),this._hide("cancel");var e="AD_SDK_CANCELED";this.eventBus.broadcast(e,{name:e,message:"Advertisement has been canceled.",status:"warning",analytics:{category:this.eventCategory,action:e,label:this.gameId}})}}},{key:"_checkAutoPlay",value:(A=k.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=this;w.default(this,t);var a=navigator.userAgent.toLowerCase();a.indexOf("safari")>-1&&a.indexOf("chrome")<0?e({autoplayAllowed:!0,autoplayRequiresMute:!0}):I.default.video({inline:!0,muted:!1}).then(function(t){w.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 A.apply(this,arguments)})},{key:"_initDisplayContainerWithAutoPlay",value:(_=k.default(x.default.mark((function e(){var t;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._checkAutoPlay(!1);case 2:return t=e.sent,this._autoplay=t,this.video_ad_player.autoplay=t.autoplayAllowed,this.video_ad_player.volume=t.autoplayRequiresMute?0:1,this.video_ad_player.muted=!!t.autoplayRequiresMute,t.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0),e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"startAd",value:(b=k.default(x.default.mark((function e(t){var n,r,a;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.gameData.afg_disabled,r=t.adType,a=t.params,r!==d.AdType.Interstitial){e.next=22;break}if(!n){e.next=7;break}return e.abrupt("return",this._startInterstitialAd(a));case 7:if("preroll"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=11;break}return e.abrupt("return",this._startAdsensePlacementPreroll(t));case 11:if("start"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=15;break}return e.abrupt("return",this._startAdsensePlacementStart(t));case 15:if("next"!==(null==a?void 0:a.position)||"adsense"!==(null==a?void 0:a.adapter)){e.next=19;break}return e.abrupt("return",this._startAdsensePlacementNext(t));case 19:return e.abrupt("return",this._startInterstitialAd(a));case 20:e.next=31;break;case 22:if(r!==d.AdType.Rewarded){e.next=30;break}if(!n){e.next=27;break}return e.abrupt("return",this._startRewardedAd(a));case 27:return e.abrupt("return",this._startAdsensePlacementRewardedAd(t));case 28:e.next=31;break;case 30:throw new Error("Unsupported ad type");case 31:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"preloadAd",value:(y=k.default(x.default.mark((function e(t){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==d.AdType.Interstitial){e.next=4;break}return e.abrupt("return",this._preloadInterstitialAd());case 4:if(t!==d.AdType.Rewarded){e.next=8;break}return e.abrupt("return",this._preloadRewardedAd());case 8:throw new Error("Unsupported ad type");case 9:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"addAdResume",value:function(){var e=this,t=function(){w.default(this,e),this.adsManager.resume()}.bind(this);try{this.adResume=new Oh(this.adContainer,t),this.adResume.add()}catch(e){console.log("error on adding adResume",e)}}},{key:"loadDisplayAd",value:(v=k.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=k.default(x.default.mark((function e(r,a){var i,s,o,u,l,c,h=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(i=t?t.containerId:null)||a("Container id is not specified"),s=document.getElementById(i),document.getElementById(i)||a("No container is found with this id - ".concat(i)),void 0===window.idhb.requestAds&&a("Prebid.js wrapper script hit an error or didn't exist!"),o=t.slotId?t.slotId:"gd__banner@".concat(i),document.getElementById(o)||(u="\n .gd__banner{\n z-index: ".concat(d.Layers.DisplayContainer.zIndex,";\n height: 100%;\n display: flex !important;\n align-items: center;\n justify-content: center;\n }"),document.getElementById("gd__banner__style")||((l=document.createElement("style")).type="text/css",l.id="gd__banner__style",l.styleSheet?l.styleSheet.cssText=u:l.appendChild(document.createTextNode(u)),s.appendChild(l)),(c=document.createElement("div")).id=o,c.classList.add("gd__banner"),s.appendChild(c)),e.next=10,n._create_dp_display_context();case 10:n.atom_display=e.sent,window.idhb.que.push(function(){var e,t,r=this;w.default(this,h),window.idhb.setRefererUrl(encodeURIComponent(n.parentURL)),window.idhb.allowPersonalizedAds(!!parseInt(n.userAllowedPersonalizedAds)),window.idhb.setDefaultGdprConsentString("BOWJjG9OWJjG9CLAAAENBx-AAAAiDAAA"),null!==(e=n.atom_display)&&void 0!==e&&e.params&&window.idhb.setAdserverTargeting(null===(t=n.atom_display)||void 0===t?void 0:t.params);var a={};a[o]={maxSize:[s.offsetWidth,s.offsetHeight]},window.idhb.requestAds({slots:a,callback:function(e){w.default(this,r)}.bind(this)})}.bind(this)),r(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),a(e.t0.message||e.t0);case 18:case"end":return e.stop()}}),e,this,[[0,15]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return v.apply(this,arguments)})},{key:"_startInterstitialAd",value:(g=k.default(x.default.mark((function e(t){var n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadInterstitialAd(Nh(Nh({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return g.apply(this,arguments)})},{key:"_loadInterstitialAd",value:(f=k.default(x.default.mark((function e(t){var n,r,a=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedInterstitialAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(d.AdType.Interstitial,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedInterstitialAdVast,e.next=11,this._requestAd(n,Nh({adType:d.AdType.Interstitial},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;w.default(this,a);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var i=function(t){w.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){w.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return f.apply(this,arguments)})},{key:"_startRewardedAd",value:(p=k.default(x.default.mark((function e(t){var n;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.requestRunning){e.next=4;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 4:return this.requestRunning=!0,e.next=7,this._initDisplayContainerWithAutoPlay();case 7:return n=e.sent,e.next=10,this._loadRewardedAd(Nh(Nh({},n),t));case 10:n.autoplayRequiresMute&&this.adsManager.setVolume(0),this.adsManager.init(this.options.width,this.options.height,google.ima.ViewMode.NORMAL),this.adsManager.start(),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),this._onError(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return p.apply(this,arguments)})},{key:"_loadRewardedAd",value:(h=k.default(x.default.mark((function e(t){var n,r,a=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._resetAdsLoader(),e.prev=1,e.t0=this.preloadedRewardedAdVast,e.t0){e.next=7;break}return e.next=6,this._getAdVast(d.AdType.Rewarded,t);case 6:e.t0=e.sent;case 7:return n=e.t0,delete this.preloadedRewardedAdVast,e.next=11,this._requestAd(n,Nh({adType:d.AdType.Rewarded},t));case 11:return r=e.sent,e.next=14,new Promise(function(e,t){var n=this;w.default(this,a);var r="videoad.preloadad";this.eventBus.unsubscribeScope(r);var i=function(t){w.default(this,n),this.eventBus.unsubscribeScope(r),e(t.message)}.bind(this),s=function(e){w.default(this,n),this.eventBus.unsubscribeScope(r),t(e.message)}.bind(this);this.eventBus.subscribe("AD_SDK_MANAGER_READY",i,r),this.eventBus.subscribe("AD_SDK_CANCELED",s,r),this.eventBus.subscribe("AD_ERROR",s,r)}.bind(this));case 14:return e.abrupt("return",r);case 17:throw e.prev=17,e.t1=e.catch(1),new Error(e.t1);case 20:case"end":return e.stop()}}),e,this,[[1,17]])}))),function(e){return h.apply(this,arguments)})},{key:"_preloadInterstitialAd",value:(l=k.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(d.AdType.Interstitial);case 3:return this.preloadedInterstitialAdVast=e.sent,e.abrupt("return",this.preloadedInterstitialAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return l.apply(this,arguments)})},{key:"_preloadRewardedAd",value:(u=k.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getAdVast(d.AdType.Rewarded);case 3:return this.preloadedRewardedAdVast=e.sent,e.abrupt("return",this.preloadedRewardedAdVast.url);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return u.apply(this,arguments)})},{key:"_onError",value:function(e){this.cancel(),this._clearSafetyTimer("ERROR")}},{key:"_hide",value:function(e){this.video_ad_player.src="",this.activeAdContainer&&(this.activeAdContainer.style.visibility="hidden")}},{key:"_show",value:function(e){var t=this;if(this.activeAdContainer){this.activeAdContainer.style.visibility="visible";var n=null==e?void 0:e.mode,r=this._isT4R(e),a=this._getT4ROptions();"loaded"===n?(this.activeAdContainer.style.opacity=r?.001:1,r&&this.eventBus.broadcast("AD_T4R"),r&&setTimeout(function(){w.default(this,t),this.activeAdContainer.style.opacity=1}.bind(this),((null==a?void 0:a.min)||1234)+Math.random()*((null==a?void 0:a.max)||3210))):"click"!==n&&"first_quartile"!==n||(this.activeAdContainer.style.opacity=1)}}},{key:"_createPlayer",value:function(){var e=this,t=document.body||document.getElementsByTagName("body")[0];this.adContainer=document.createElement("div"),this.adContainer.id="".concat(this.prefix,"advertisement"),this.adContainer.style.position=this.thirdPartyContainer?"absolute":"fixed",this.adContainer.style.zIndex=d.Layers.AdsContainer.zIndex,this.adContainer.style.top="0",this.adContainer.style.left="0",this.adContainer.style.width="100%",this.adContainer.style.height="100%",this.thirdPartyContainer&&(this.thirdPartyContainer.style.transform=null);var n=document.createElement("video");n.setAttribute("playsinline",!0),n.setAttribute("webkit-playsinline",!0),n.id="".concat(this.prefix,"advertisement_video"),n.style.position="absolute",n.style.backgroundColor="#000000",n.style.top="0",n.style.left="0",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px",this.video_ad_player=n,this.adContainer.appendChild(n);var r=document.createElement("div");r.id="".concat(this.prefix,"advertisement_slot"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",this.adContainerInner=r,this.activeAdContainer=this.adContainer,this.thirdPartyContainer?(this.adContainer.appendChild(r),this.thirdPartyContainer.appendChild(this.adContainer),this.activeAdContainer=this.thirdPartyContainer):(this.adContainer.appendChild(r),t.appendChild(this.adContainer)),this.addAdResume(),this.activeAdContainer.style.visibility="hidden";var a=function(){w.default(this,e);var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.options.width=this.thirdPartyContainer?this.thirdPartyContainer.offsetWidth:t,this.options.height=this.thirdPartyContainer?this.thirdPartyContainer.offsetHeight:a,r.style.width=this.options.width+"px",r.style.height=this.options.height+"px",n.style.width=this.options.width+"px",n.style.height=this.options.height+"px"}.bind(this);window.addEventListener("resize",a),window.document.addEventListener("DOMContentLoaded",a)}},{key:"_setUpIMA",value:function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.adContainerInner,this.video_ad_player),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setDisableCustomPlaybackForIOS10Plus(!0),this.adsLoader.getSettings().setLocale(this.options.locale),this.adsLoader.getSettings().setVpaidMode(this._getVPAIDMode()),this.adsLoader.getSettings().setAutoPlayAdBreaks(!0);var e=this.adsLoader.getSettings().getNumRedirects();this.adsLoader.getSettings().setNumRedirects(2*e),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this._onAdsManagerLoaded,!1,this),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError,!1,this)}},{key:"_onAdsManagerLoaded",value:function(e){var t=this,n=new google.ima.AdsRenderingSettings;n.autoAlign=!1,n.enablePreloading=!1,n.restoreCustomPlaybackStateOnAdBreakComplete=!0,n.useStyledNonLinearAds=!0,n.uiElements=[google.ima.UiElements.AD_ATTRIBUTION,google.ima.UiElements.COUNTDOWN],this.adsManager=e.getAdsManager(this.video_ad_player,n),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this._onAdError.bind(this),!1,this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_METADATA,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.DURATION_CHANGE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.FIRST_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.IMPRESSION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.INTERACTION,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LINEAR_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.MIDPOINT,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPABLE_STATE_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.THIRD_QUARTILE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.USER_CLOSE,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_CHANGED,this._onAdEvent.bind(this),this),this.adsManager.addEventListener(google.ima.AdEvent.Type.VOLUME_MUTED,this._onAdEvent.bind(this),this),window.addEventListener("resize",function(){w.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(),a=n.getDate(),i=n.getMonth(),s=n.getFullYear(),o=d.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 p=e.getAd().getContentType();this._show({mode:"click",contentType:p});break;case google.ima.AdEvent.Type.COMPLETE:u=this._is_completed(e.getAd()),h="Fired when the ad completes playing.";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 f=e.getAd().getContentType();this._show({mode:"first_quartile",contentType:f});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."}""!==o&&""!==h&&this.eventBus.broadcast(o,{name:o,message:h,status:"success",analytics:{category:o,action:this.parentDomain,label:"h".concat(r," d").concat(a," m").concat(i," y").concat(s)}}),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(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(){w.default(this,n),this.cancel(),this._clearSafetyTimer(t)}.bind(this),e)}},{key:"_clearSafetyTimer",value:function(e){void 0!==this.safetyTimer&&null!==this.safetyTimer&&(clearTimeout(this.safetyTimer),this.safetyTimer=void 0)}},{key:"_getVPAIDMode",value:function(){return google.ima.ImaSdkSettings.VpaidMode.ENABLED}},{key:"_getPrebidScripts",value:function(){var e=["https://hb.improvedigital.com/pbw/gameDistributionV1.3.min.js","http://hb.improvedigital.com/pbw/gameDistributionV1.3.min.js"];return this.options.hb_script?[this.options.hb_script].concat(e):e}},{key:"_getInnerErrorCode",value:function(e){if(Ch(e.getInnerError)){var t=e.getInnerError();if(t)return Ch(t.getErrorCode)&&Ch(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(w.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];c.isPlainObject(i)&&(r.query[a]=C.default.stringify(i))}var s=new R.default(r.url,!0);return P.default(s.query,r.query||{}),Nh({url:s.toString()},t)}}},{key:"_transformVast",value:function(e,t){var n={url:e.url};try{var r=new R.default(e.url,!0),a=this._transformQuery(e,t,r);a&&(n.url=r.toString());var i=a?r:new R.default(e.url,!0);if(i.query.cust_params){var s=C.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&&c.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&&c.isPlainObject(this.options.retry_on_failure.vast_query)&&(a=this.options.retry_on_failure.vast_query),a=O.default(a),c.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=C.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 w.default(this,r),e.tnl_keys[t.toLowerCase()]}.bind(this)});return i.cust_params=o,P.default(i,u),i.cust_params=C.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;return h&&((null==e||null===(n=e.contentType)||void 0===n?void 0:n.startsWith("image/"))||"text"===(null==e?void 0:e.contentType))&&("preroll"===h&&(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.t4r)||void 0===i?void 0:i.enabled)||"midroll"===h&&(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o||null===(d=o.t4r)||void 0===d?void 0:d.enabled)||"rewarded"===h&&(null===(u=this.gameData)||void 0===u||null===(l=u.rAds)||void 0===l||null===(c=l.t4r)||void 0===c?void 0:c.enabled))}},{key:"_isVMAP",value:function(e){var t,n,r,a,i,s,o,d,u,l,c,h,p,f,m;if(!e)return!1;var g="preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.vmap)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.vmap)||!0===(null===(d=this.gameData)||void 0===d||null===(u=d.mAds)||void 0===u||null===(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===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.vmap)||void 0===m?void 0:m.enabled));if(!g)return!1;var v=this._get_vmap_config(e),y=this.adCounter[e];return void 0!==(null==v?void 0:v.start)?y>=(null==v?void 0:v.start):g}},{key:"_getT4ROptions",value:function(){var e,t,n,r,a,i,s;switch(null===(e=this._adrequest_user_context)||void 0===e?void 0:e.tnl_ad_pos){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.t4r;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.t4r;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.t4r}}},{key:"_is_completed",value:function(e){var t=e.getContentType(),n=e.getAdPodInfo();return!(!t.startsWith("image/")&&"text"!==t&&1!==n.getTotalAds())}},{key:"_get_vmap_context",value:function(e){var t=e.adtag,n=e.position,r=e.config,a=e.dp,i=this._createCustomAdVastUrl(null==r?void 0:r.vast_1)||t,s=this._createCustomAdVastUrl(null==r?void 0:r.vast_2)||t,o=null!=r&&r.vast_1?void 0:a,d=null!=r&&r.vast_2?void 0:a;return{adtag_url_1:null==i?void 0:i.url,adtag_url_2:null==s?void 0:s.url,position:n,dp_1:o,dp_2:d}}},{key:"_get_vmap_config",value:function(e){var t,n,r,a,i,s,o,d;switch(e){case"preroll":return null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.vmap;case"midroll":return null===(r=this.gameData)||void 0===r||null===(a=r.mAds)||void 0===a?void 0:a.vmap;case"rewarded":return null===(i=this.gameData)||void 0===i||null===(s=i.rAds)||void 0===s?void 0:s.vmap;default:return null===(o=this.gameData)||void 0===o||null===(d=o.pAds)||void 0===d?void 0:d.vmap}}},{key:"_isDP",value:function(e){var t,n,r,a,i,s,o,d,u,l,c,h,p,f,m;return!!e&&("preroll"===e&&(!0===(null===(t=this.gameData)||void 0===t||null===(n=t.pAds)||void 0===n?void 0:n.dp)||!0===(null===(r=this.gameData)||void 0===r||null===(a=r.pAds)||void 0===a||null===(i=a.dp)||void 0===i?void 0:i.enabled))||"midroll"===e&&(!0===(null===(s=this.gameData)||void 0===s||null===(o=s.mAds)||void 0===o?void 0:o.dp)||!0===(null===(d=this.gameData)||void 0===d||null===(u=d.mAds)||void 0===u||null===(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===(p=this.gameData)||void 0===p||null===(f=p.rAds)||void 0===f||null===(m=f.dp)||void 0===m?void 0:m.enabled)))}},{key:"_create_dp_display_context",value:function(){var e=this;return new Promise(function(t){var n=this;w.default(this,e);try{var r={id:this.topDomain||this.parentDomain,au:"display",ty:"display",aid:this.gameData.gameId,pgu:this.parentURL},a=new Ih(this.gameData).checkCustomParams();a&&(r.cp=a);var i=encodeURIComponent(m.Base64.encode(JSON.stringify(r)));fetch("https://tag.atom.gamedistribution.com/v1/atm?ar=".concat(i)).then(function(e){return w.default(this,n),e.json()}.bind(this)).then(function(e){if(w.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){w.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=k.default(x.default.mark((function r(a){var i,s,o,d,u,l,c=this;return x.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,n._isDP(e)){r.next=5;break}return n.msgrt.send("dp.na",{message:"rule"}),r.abrupt("return",a());case 5:s={id:n.topDomain||n.parentDomain,au:e||"unknown",ty:"video",aid:n.gameData.gameId,pgu:n.parentURL},(o=new Ih(n.gameData).checkCustomParams())&&(s.cp=o),d=encodeURIComponent(m.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 w.default(this,c),e.json()}.bind(this)).then(function(e){if(w.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){w.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,n){if(e&&t&&n)try{var r,a=new R.default(t.vastUrl,!0);if(null===(r=a.query)||void 0===r||!r.cust_params)return;if(!C.default.parse(a.query.cust_params).tnl_asset_id)return;n.bidFloor,n.isDfpBidding;var i=D.default(n,Mh);a.query.cust_params=C.default.stringify(Nh(Nh({},i),{},{adsense:1}),!1),e.fallback_url=a.toString(),e.fallback_imp_url="https://tag.atom.gamedistribution.com/v1/rainbow/green"}catch(e){}}},{key:"_init_hl_script",value:(o=k.default(x.default.mark((function e(t){var n,r,a=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getPrebidScripts(),r=n[0],window.HB_OPTIONSgd={gameId:this.gameId},e.next=5,d.getScript(r,"gdsdk_prebid",{alternates:n,error_prefix:"Blocked:",exists:function(){return w.default(this,a),window.idhb}.bind(this)});case 5:window.idhb=window.idhb||{},window.idhb.que=window.idhb.que||[],window.idhb.que.push(function(){var e=this;w.default(this,a),window.idhb.addEventListener("slotRenderEnded",function(t){var n=this;w.default(this,e);try{var r,a=t.slotId.split("@");a=1===a.length?a[0]:a[1],t.isEmpty?(null!==(r=this.atom_display)&&void 0!==r&&r.error_url&&(fetch(this.atom_display.error_url).catch(function(e){w.default(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_ERROR",{message:a,status:"warning"})):(this.atom_display.impression_url&&(fetch(this.atom_display.impression_url).catch(function(e){w.default(this,n)}.bind(this)),delete this.atom_display),this.eventBus.broadcast("DISPLAYAD_IMPRESSION",{message:a,status:"success"}))}catch(e){}}.bind(this))}.bind(this));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"_init_ima_script",value:(s=k.default(x.default.mark((function e(t){var n,r,a=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=["https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","https://imasdk.googleapis.com/js/sdkloader/ima3.js","http://imasdk.googleapis.com/js/sdkloader/ima3_debug.js","http://imasdk.googleapis.com/js/sdkloader/ima3.js"],r=this.options.debug?n[0]:n[1],e.next=4,d.getScript(r,"gdsdk_ima",{alternates:n,error_prefix:"Blocked:",exists:function(){return w.default(this,a),window.google&&window.google.ima}.bind(this)});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"_init_afg_script",value:(i=k.default(x.default.mark((function e(t){var n,r,a,i,s=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.gameData.afg_disabled){e.next=3;break}return e.abrupt("return");case 3:return(i={}).crossorigin="anonymous",i["data-ad-client"]=(null==t||null===(n=t.adsense_client)||void 0===n?void 0:n.length)>0?t.adsense_client:"ca-pub-2316275586951220",i["data-ad-frequency-hint"]="30s",(null==t||null===(r=t.adsense_channel)||void 0===r?void 0:r.length)>0&&(i["data-ad-channel"]=t.adsense_channel),(null==t||null===(a=t.adsense_host)||void 0===a?void 0:a.length)>0&&(i["data-ad-host"]=t.adsense_host),!0===(null==t?void 0:t.adsense_adbreak_test)&&(i["data-adbreak-test"]="on"),e.next=13,d.getScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js","afg",{error_prefix:"Blocked:",exists:function(){return w.default(this,s),!!window.adsbygoogle}.bind(this),attrs:i});case 13:window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({sound:"on",preloadAdBreaks:"on"});case 15:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_startAdsensePlacementRewardedAd",value:(a=k.default(x.default.mark((function e(t){var n,r,a,i,s,o,d=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.rw.requested"),n=function(){w.default(this,d),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){w.default(this,d),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(){w.default(this,d),this._send_atom_event("sg.ad.rw.dismissed")}.bind(this),i=function(){w.default(this,d),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this._send_atom_event("sg.ad.rw.viewed")}.bind(this),s=function(e){w.default(this,d),e()}.bind(this),o=function(e){w.default(this,d),this.resetForNext(),this.adCounter.rewarded=this.adCounter.rewarded||0,this.adCounter.rewarded++,"viewed"===e.breakStatus?this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"}):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),"dismissed"!==e.breakStatus&&this._send_atom_event("sg.dbg.rw",e))}.bind(this),t={type:"reward",name:"reward-in-game",beforeAd:n,afterAd:r,adDismissed:a,adViewed:i,beforeReward:s,adBreakDone:o},window.adsbygoogle.push(t),e.next=21;break;case 17:throw e.prev=17,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 21:case"end":return e.stop()}var t}),e,this,[[1,17]])}))),function(e){return a.apply(this,arguments)})},{key:"_startAdsensePlacementPreroll",value:(r=k.default(x.default.mark((function e(t){var n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(e){w.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=k.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.pr.requested"),n=function(){w.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){w.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){w.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=k.default(x.default.mark((function e(t){var n,r,a,i=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=1,!this.requestRunning){e.next=5;break}return this.eventBus.broadcast("AD_IS_ALREADY_RUNNING",{status:"warning"}),e.abrupt("return");case 5:this.requestRunning=!0,this._send_atom_event("sg.ad.mr.requested"),n=function(){w.default(this,i),this.eventBus.broadcast("CONTENT_PAUSE_REQUESTED",{message:"",status:"success"}),this.eventBus.broadcast("IMPRESSION",{message:"",status:"success"})}.bind(this),r=function(){w.default(this,i),this.eventBus.broadcast("CONTENT_RESUME_REQUESTED",{message:"",status:"success"})}.bind(this),a=function(e){w.default(this,i),this.resetForNext(),this.adCounter.midroll=this.adCounter.midroll||0,this.adCounter.midroll++,"viewed"===e.breakStatus?(this._send_atom_event("sg.ad.mr.viewed"),this.eventBus.broadcast("COMPLETE",{message:"",status:"success"}),this.eventBus.broadcast("AD_SUCCESS",{message:"Ad succeeded.",status:"success"})):(this.eventBus.broadcast("AD_ERROR",{message:e.breakStatus,status:"error"}),this._send_atom_event("sg.dbg.mr",e))}.bind(this),t={type:"next",name:"next-in-game",beforeAd:n,afterAd:r,adBreakDone:a},window.adsbygoogle.push(t),e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(1),this._onError(e.t0),e.t0;case 18:case"end":return e.stop()}var t}),e,this,[[1,14]])}))),function(e){return t.apply(this,arguments)})},{key:"_send",value:function(e,t){try{var n=this.msgrt,r=n._layout,a=n._ua,i={tp:e,ct:0,vrs:this.PackageJSON.version,url:this.parentURL,rfr:document.referrer,tdmn:this.topDomain||this.parentDomain,dpth:0,args:t,ua:{brnm:a.browser.name,brvs:a.browser.version,osnm:a.os.name,osvs:a.os.version,dvmd:a.device.model,w:r.w,h:r.h}};fetch("https://tag.atom.gamedistribution.com/v1/dmp?ar=".concat(encodeURIComponent(m.Base64.encode(JSON.stringify(i)))))}catch(e){}}},{key:"_send_atom_event",value:function(e,t){this._send(e,{gid:this.gameData.slug,md5:this.gameData.gameId,pid:0,pnm:this.gameData.pname,ctry:this.gameData.ctry,lcl:"en",hle:1,ads:1,args:t})}},{key:"_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;n===d.AdType.Rewarded?t="reward":n===d.AdType.Interstitial&&(this._isAfgPositionStart(e)?t="start":this._isAfgPositionNext(e)&&(t="next")),e.params.position=t}}]),e}(),Vh=Array.isArray,Fh=Object.prototype.toString,Kh=Vh||function(e){return!!e&&"[object Array]"==Fh.call(e)},Wh=Dn,zh=ae,Hh=Vn,$h=Vt,Qh=Bt,Yh=re,Jh=Mr,Xh=lr,Zh=Tr("slice"),ep=Xh("species"),tp=[].slice,np=Math.max;Wh({target:"Array",proto:!0,forced:!Zh},{slice:function(e,t){var n,r,a,i=Yh(this),s=Qh(i.length),o=$h(e,s),d=$h(void 0===t?s:t,s);if(Hh(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Hh(n.prototype)?zh(n)&&null===(n=n[ep])&&(n=void 0):n=void 0,n===Array||void 0===n))return tp.call(i,o,d);for(r=new(void 0===n?Array:n)(np(d-o,0)),a=0;o<d;o++,a++)o in i&&Jh(r,a,i[o]);return r.length=a,r}});var rp=Se,ap=wa,ip=qn,sp=In,op=function(e,t,n,r){try{return r?t(rp(n)[0],n[1]):t(n)}catch(t){throw ap(e),t}},dp=ma,up=Bt,lp=Mr,cp=ba,hp=function(e){var t,n,r,a,i,s,o=sp(e),d="function"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,c=void 0!==l,h=cp(o),p=0;if(c&&(l=ip(l,u>2?arguments[2]:void 0,2)),null==h||d==Array&&dp(h))for(n=new d(t=up(o.length));t>p;p++)s=c?l(o[p],p):o[p],lp(n,p,s);else for(i=(a=h.call(o)).next,n=new d;!(r=i.call(a)).done;p++)s=c?op(a,l,[r.value,p],!0):r.value,lp(n,p,s);return n.length=p,n};Dn({target:"Array",stat:!0,forced:!ja((function(e){Array.from(e)}))},{from:hp});var pp,fp,mp,gp=!V((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),vp=de,yp=In,bp=gp,_p=rt("IE_PROTO"),wp=Object.prototype,Ap=bp?Object.getPrototypeOf:function(e){return e=yp(e),vp(e,_p)?e[_p]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?wp:null},Ep=V,kp=Ap,Sp=Pe,Tp=de,xp=lr("iterator"),Dp=!1;[].keys&&("next"in(mp=[].keys())?(fp=kp(kp(mp)))!==Object.prototype&&(pp=fp):Dp=!0),(null==pp||Ep((function(){var e={};return pp[xp].call(e)!==e})))&&(pp={}),Tp(pp,xp)||Sp(pp,xp,(function(){return this}));var Rp={IteratorPrototype:pp,BUGGY_SAFARI_ITERATORS:Dp},Ip=Rp.IteratorPrototype,Op=Qu,Cp=$,Pp=ia,Lp=ca,Up=function(){return this},jp=Dn,Mp=function(e,t,n){var r=t+" Iterator";return e.prototype=Op(Ip,{next:Cp(1,n)}),Pp(e,r,!1),Lp[r]=Up,e},Bp=Ap,Np=Qo,qp=ia,Gp=Pe,Vp=Le.exports,Fp=ca,Kp=Rp.IteratorPrototype,Wp=Rp.BUGGY_SAFARI_ITERATORS,zp=lr("iterator"),Hp=function(){return this},$p=function(e,t,n,r,a,i,s){Mp(n,t,r);var o,d,u,l=function(e){if(e===a&&m)return m;if(!Wp&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+" Iterator",h=!1,p=e.prototype,f=p[zp]||p["@@iterator"]||a&&p[a],m=!Wp&&f||l(a),g="Array"==t&&p.entries||f;if(g&&(o=Bp(g.call(new e)),Kp!==Object.prototype&&o.next&&(Bp(o)!==Kp&&(Np?Np(o,Kp):"function"!=typeof o[zp]&&Gp(o,zp,Hp)),qp(o,c,!0))),"values"==a&&f&&"values"!==f.name&&(h=!0,m=function(){return f.call(this)}),p[zp]!==m&&Gp(p,zp,m),Fp[t]=m,a)if(d={values:l("values"),keys:i?m:l("keys"),entries:l("entries")},s)for(u in d)(Wp||h||!(u in p))&&Vp(p,u,d[u]);else jp({target:t,proto:!0,forced:Wp||h},d);return d},Qp=cu.charAt,Yp=yt,Jp=$p,Xp=Yp.set,Zp=Yp.getterFor("String Iterator");Jp(String,"String",(function(e){Xp(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Zp(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Qp(n,r),t.index+=e.length,{value:e,done:!1})})),ol("iterator");var ef=re,tf=Pc,nf=ca,rf=yt,af=$p,sf=rf.set,of=rf.getterFor("Array Iterator"),df=af(Array,"Array",(function(e,t){sf(this,{type:"Array Iterator",target:ef(e),index:0,kind:t})}),(function(){var e=of(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");nf.Arguments=nf.Array,tf("keys"),tf("values"),tf("entries");var uf=q,lf=jo,cf=df,hf=Pe,pf=lr,ff=pf("iterator"),mf=pf("toStringTag"),gf=cf.values;for(var vf in lf){var yf=uf[vf],bf=yf&&yf.prototype;if(bf){if(bf[ff]!==gf)try{hf(bf,ff,gf)}catch(e){bf[ff]=gf}if(bf[mf]||hf(bf,mf,vf),lf[vf])for(var _f in cf)if(bf[_f]!==cf[_f])try{hf(bf,_f,cf[_f])}catch(e){bf[_f]=cf[_f]}}}function wf(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 Af(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 Af(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 Af(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 Ef(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 kf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ef(Object(n),!0).forEach((function(t){E.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ef(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Sf={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"}},Tf={},xf=function(e,t){Tf[e]=kf(kf({},t),{},{isLoading:!1})},Df=function(e){var t=this,n=e.id,r=e.src;return new Promise(function(e,a){if(w.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))},Rf=function(){var e=k.default(x.default.mark((function e(t){var n,r,a,i,s,o,d,u;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=window[t])){e.next=3;break}return e.abrupt("return",n);case 3:if(!(r=Tf[t]).isLoading){e.next=6;break}return e.abrupt("return");case 6:r.isLoading=!0,a=wf(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=Sf[s].name,!window[o]){e.next=16;break}return e.abrupt("continue",24);case 16:return e.next=18,Df({id:s,src:Sf[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,Df({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)}}(),If=function e(t){var n=this;S.default(this,e),E.default(this,"load",k.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rf(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),E.default(this,"promo",k.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-stone-dynamic",a=t.package_version||"1.1.1",i=t.template||"puzzle",s=t.dependencies||[];this.moduleName="GDPromoByOrbit",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},xf(this.moduleName,this.moduleConfig)},Of=function e(t){var n=this;S.default(this,e),E.default(this,"load",k.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rf(n.moduleName);case 2:n.module=e.sent;case 3:case"end":return e.stop()}}),e)})))),E.default(this,"splash",k.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.module){e.next=3;break}return e.next=3,n.load();case 3:return e.abrupt("return",n.module[n.moduleDefault]);case 4:case"end":return e.stop()}}),e)}))));var r=t.package||"gd-sdk-air-dynamic",a=t.package_version||"1.2.0",i=t.template||"pluto",s=t.dependencies||[];this.moduleName="GDSplashDynamic",this.moduleDefault=i.charAt(0).toUpperCase()+i.slice(1),this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/".concat(r,"/").concat(a,"/dist/").concat(i.toLowerCase(),"/iife/index.js"),dependencies:s},xf(this.moduleName,this.moduleConfig)},Cf=function(e,t){console.log(e,t)},Pf={},Lf={},Uf=null;function jf(){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 Pf.version=r,Pf.frame=e,Pf.function=n,Pf.version}function Mf(e){var t=this;return Uf||(Uf=new Promise(function(n){function r(t,r){if(Cf("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:Pf,consentData:a}),void n({result:"ok",consentData:t})):void 0;n({result:"ok",consentData:t})}else n({result:"cmpCallFailed"})}w.default(this,t),jf(),Pf.frame?2===Pf.version?(Cf("TCF v2 CMP found. Fetching the consent."),Pf.function?(Cf("CMP API is directly accessible, calling it now..."),Pf.function("addEventListener",Pf.version,r)):(Cf("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!==Lf[r.callId]&&Lf[r.callId](r.returnValue,r.success)}}window[a]=function(e,n,i,s){w.default(this,r);var o=Math.random()+"",d="".concat(a,"Call"),u=E.default({},d,{command:e,parameter:s,callId:o,version:n});Lf[o]=i,t.postMessage(u,"*")}.bind(this),window.addEventListener("message",i,!1),window[a](e,Pf.version,n)}("addEventListener",Pf.frame,r))):n({result:"cmpVersionNotV2",cmp:Pf}):n({result:"cmpNotFound"})}.bind(this)))}var Bf=new(function(){function e(){S.default(this,e),this.productName="Game Distribution"}var t;return T.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=k.default(x.default.mark((function e(t,n){var r,a,i,s,o,d;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkIfExcluded(n)){e.next=3;break}return e.abrupt("return");case 3:if(a=null==t||null===(r=t.visitor)||void 0===r?void 0:r.visitorId){e.next=6;break}return e.abrupt("return");case 6:return i=encodeURIComponent(this.productName),s=encodeURIComponent(a),e.prev=8,o="https://tracker-v4.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=12,fetch(o,{method:"POST"});case 12:e.next=28;break;case 15:return e.prev=15,e.t0=e.catch(8),console.log("GAME_DOCK. fail v4",e.t0),e.prev=18,d="https://tracker.gamedock.io/v1/events-tracker/track/product/".concat(i,"/user_id/").concat(s),e.next=22,fetch(d,{method:"POST"});case 22:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(18),console.log("GAME_DOCK. fail v6",e.t1);case 28:case"end":return e.stop()}}),e,this,[[8,15],[18,25]])}))),function(e,n){return t.apply(this,arguments)})}]),e}());function Nf(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 j.default(n,e)}function d(e,t){return M.default(n,e,t)}function u(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e&&""!==e)try{return new R.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),L.default.isURL(o)))return o}}}return function(){var e;w.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(U.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?U.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))}}}function qf(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 Gf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qf(Object(n),!0).forEach((function(t){E.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Vf=null,Ff=function(){function e(t){var n=this;if(S.default(this,e),Vf)return Vf;Vf=this,this._defaults=this._getDefaultOptions(),this._extendDefaultOptions(this._defaults,t),this._version=t.version||"0.0.0",this._bridge=this._getBridgeContext(),this._location=new Nf,this._location.print(),this._parentURL=this._bridge.parentURL,this._parentDomain=this._bridge.parentDomain,this._topDomain=this._bridge.topDomain,this._isFullScreen=!1,this._setConsoleBanner(),this._initializeMessageRouter(),this._checkConsole(),this._subscribeToEvents(),this.sdkReady=new Promise(this._initializeSDKWithGameData.bind(this)),this.sdkReady.then(function(e){w.default(this,n),this._sdk_ready=!0}.bind(this)).catch(function(e){w.default(this,n),this._sdk_ready=!1}.bind(this)).finally(function(){var e=this;w.default(this,n),this._sendLoaderDataEvent(),this._checkSplashAndPromoScreens(),this._initBlockingExternals(),window.addEventListener("DOMNodeInserted",function(){if(w.default(this,e),this._gameData.block_exts&&this._removeExternalsInHtml({enabled:!1}),document.getElementsByClassName("webgl-content")[0]){var t=document.getElementsByClassName("webgl-content")[0].getElementsByClassName("footer")[0];t&&t.setAttribute("style","display:none")}}.bind(this)),this._checkFullscreen()}.bind(this))}var t,n,r,a,i,s,o,u,l,c;return T.default(e,[{key:"testConsent",value:function(){console.log("test-consent. Finding CMP");try{var e=jf();console.log("CMP found",e),k.default(x.default.mark((function e(){var t;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Mf({});case 2:t=e.sent,console.log("After lookup IAB consent",t);case 4:case"end":return e.stop()}}),e)})))()}catch(e){console.log("find CMP error",e)}}},{key:"_sendLoaderDataEvent",value:function(){try{this.options.onLoaderEvent&&this.options.onLoaderEvent({name:"LOADER_DATA",message:{game:this._gameData,bridge:this._bridge},status:this._sdk_ready?"success":"error"})}catch(e){}}},{key:"isLoaded",value:function(){if(void 0===this._isLoaded){var e=this._isTokenGameURL(),t=this._isExtHostedGameURL(),n=this._isMasterGameURL();this._isLoaded=(e||t&&!n)&&this._gameData.loader.enabled}return this._isLoaded}},{key:"setIsLoaded",value:function(e){this._isLoaded=e}},{key:"_sendLoadedEvent",value:function(){if(!this.isLoaded()){this.setIsLoaded(!0);try{this._sendTunnlEvent(1),this.msgrt.send("loaded",{message:this._hasBlocker?"Has Blocker":"No Blocker"}),this._initGamedockTracker(window.GamedockSDK,"gameplay")}catch(e){}}}},{key:"_safeInit",value:function(){this._checkUserDeclinedTracking(),this._checkWhitelabelPartner();var e=this._gameData.diagnostic;void 0!==e&&void 0!==e.close_ga&&!1!==e.close_ga||!this._bridge.isCoreSDKMode&&this._loadGoogleAnalytics(),void 0!==e&&void 0!==e.close_gamedock&&!1!==e.close_gamedock||!this._bridge.isCoreSDKMode&&!this._bridge.noGamedockSDK&&this._loadGamedockTracker(),void 0!==e&&void 0!==e.close_minijuegos&&!1!==e.close_minijuegos||!this._bridge.isCoreSDKMode&&!this._bridge.noMinijuegosSDK&&document.location.search.indexOf("mp_game_id")>=0&&this._loadMiniJuegosGratisTracker()}},{key:"_initializeSDKWithGameData",value:(c=k.default(x.default.mark((function e(t,n){var r,a=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._getGameData();case 3:this._gameData=e.sent,this._bridge.isCoreSDKMode=!(!0===this._gameData.enableAds||!0===(null===(r=this._gameData.enableAds)||void 0===r?void 0:r.enabled)),this._safeInit(),this._checkGameId(),this._checkGameDeleted(),this._checkBlocking(),this._changeMidrollInDebugMode(),void 0!==this._gameData.diagnostic&&void 0!==this._gameData.diagnostic.close_ads&&!1!==this._gameData.diagnostic.close_ads||(this.videoAdReady=this._initializeVideoAd().catch(function(e){return w.default(this,a),console.error(e.message||e)}.bind(this))),this._sendSDKReady(),t(this._gameData),e.next=20;break;case 15:e.prev=15,e.t0=e.catch(0),this._sendSDKError(e.t0),this.onResumeGame(e.t0.message,"warning"),n(e.t0);case 20:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e,t){return 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=O.default(e);this.options=t?d.extendDefaults(n,t):n,this.options.gameId=this.options.gameId.trim()}},{key:"_setConsoleBanner",value:function(){if(!this._bridge.noConsoleBanner){var e=hh.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){"undefined"===this._topDomain&&(this._topDomain=void 0);var t={page_url:this._topDomain||this._parentDomain,game_id:this.options.gameId,eventtype:e,ts:Date.now()};fetch("https://ana.headerlift.com/event?".concat(C.default.stringify(t)))}},{key:"_sendAdRequestContext",value:function(e){this.msgrt.send("adctx",{message:e.adTag.bidder})}},{key:"_checkWhitelabelPartner",value:function(){this._whitelabelPartner=!1;var e=d.getQueryParams("xanthophyll");e.hasOwnProperty("xanthophyll")&&"true"===e.xanthophyll&&(this._whitelabelPartner=!0,d.dankLog("White label publisher","".concat(this._whitelabelPartner),"success"))}},{key:"_checkConsole",value:function(){try{if(!d.Ls.available)return;"developer.gamedistribution.com"===this._parentDomain?(d.Ls.set("gd_debug_ex",!0),d.Ls.set("gd_disable_midroll_timer",!0),d.Ls.set("gd_tag",!0)):"localhost:3000"===this._parentDomain&&(d.Ls.set("gd_debug_ex",!0),d.Ls.set("gd_disable_midroll_timer",!0)),d.Ls.getBoolean("gd_debug_ex")&&(this.openConsole(),this.msgrt.send("dev.console",{message:this._parentDomain}))}catch(e){}}},{key:"_checkUserDeclinedTracking",value:function(){this._userDeclinedTracking=this._bridge.isCoreSDKMode||document.location.search.indexOf("gdpr-tracking=0")>=0||document.cookie.indexOf("ogdpr_tracking=0")>=0}},{key:"_initializeMessageRouter",value:function(){this.msgrt=new d.MessageRouter({gameId:this.options.gameId,hours:(new Date).getHours(),topDomain:this._topDomain,domain:this._parentDomain,referrer:this._parentURL,depth:d.getIframeDepth(),version:hh.version,tracking:this._userDeclinedTracking,whitelabel:this._whitelabelPartner,platform:d.getMobilePlatform(),byloader:this._bridge.isTokenGameURL,isTokenGameURL:this._bridge.isTokenGameURL,isMasterGameURL:this._bridge.isMasterGameURL,isExtHostedGameURL:this._bridge.isExtHostedGameURL,byloaderVersion:this._bridge.version})}},{key:"_loadGamedockTracker",value:function(){var e=this;try{var t=["https://cdn.gamedock.io/gamedock-web-tracker/4.3.0/script/gamedock-sdk.min.js"];d.getScript(t[0],"GamedockSDK",{alternates:t}).then(function(){w.default(this,e);var t=this._initGamedockTracker(window.GamedockSDK,"pageview");Bf.track(t,this._gameData)}.bind(this)).catch(function(t){w.default(this,e),this._sendSDKError(t)}.bind(this))}catch(e){}}},{key:"_initGamedockTracker",value:function(e,t){if(!this._bridge.isCoreSDKMode){var n=e.initialize("gd",this._parentDomain);return n.tracking.trackEvent(t,{pageId:this.options.gameId,pageType:"game"}),n}}},{key:"_loadMiniJuegosGratisTracker",value:function(){var e=this;window.mpConfig={game:this.options.gameId,partner:"game-distribution"};var t=["https://ext.minijuegosgratis.com/external-host/main.js"];d.getScript(t[0],"MinijuegosSDK",{alternates:t}).catch(function(t){w.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_loadGoogleAnalytics",value:function(){var e=this,t=["https://www.google-analytics.com/analytics.js"];d.getScript(t[0],"gdsdk_google_analytics",{alternates:t,error_prefix:"Blocked:",exists:function(){return w.default(this,e),window.ga}.bind(this)}).then(function(){w.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){w.default(this,e),this._sendSDKError(t)}.bind(this))}},{key:"_subscribeToEvents",value:function(){var e=this;this.eventBus=new d.EventBus,d.SDKEvents.forEach(function(t){var n=this;return w.default(this,e),this.eventBus.subscribe(t,function(e){return w.default(this,n),this._onEvent(e)}.bind(this),"sdk")}.bind(this)),d.IMAEvents.forEach(function(t){var n=this;return w.default(this,e),this.eventBus.subscribe(t,function(e){return w.default(this,n),this._onEvent(e)}.bind(this),"ima")}.bind(this)),this.eventBus.subscribe("COMPLETE",function(){if(w.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 w.default(this,e),this.onPauseGame("New advertisements requested and loaded","success")}.bind(this),"ima"),this.eventBus.subscribe("IMPRESSION",function(t){var n,r;if(w.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){var a=this._initGamedockTracker(window.GamedockSDK,"adView");Bf.track(a,this._gameData)}}.bind(this),"ima"),this.eventBus.subscribe("AD_ERROR",function(t){w.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){w.default(this,e),this._sendAdRequestContext(t.message)}.bind(this),"sdk"),this.eventBus.subscribe("SDK_ERROR",function(t){w.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){w.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){w.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 w.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(hh.version,"&localTime=").concat((new Date).getHours())}},{key:"_checkBlocking",value:(l=k.default(x.default.mark((function e(){var t,n,r=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this._gameData,t=void 0===this._gameData.dmain||this._gameData.dmain,(n.bloc_gard&&!0===n.bloc_gard.enabled||!t)&&(this.msgrt.send("blocked"),setTimeout(function(){w.default(this,r),window.location.href="https://html5.api.gamedistribution.com/blocked.html?".concat(C.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(){w.default(this,e),document.location="https://html5.api.gamedistribution.com/deleted.html"}.bind(this),100))}},{key:"_changeMidrollInDebugMode",value:function(){var e=this._gameData;d.Ls.available&&d.Ls.getBoolean("gd_debug_ex")&&(d.Ls.getBoolean("gd_disable_midroll_timer")?e.midroll=0:e.midroll=this._getDefaultGameData().midroll)}},{key:"_checkSplashAndPromoScreens",value:function(){var e,t,n;this._gameData.loader&&!1===this._gameData.loader.mobile&&this._getisMobile()&&(this._gameData.loader.enabled=!1);var r,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=k.default(x.default.mark((function e(){var t;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._bridge.isCoreSDKMode){e.next=2;break}return e.abrupt("return");case 2:return(t=this._gameData).sdk.enabled&&(this.options.advertisementSettings=d.extendDefaults(this.options.advertisementSettings,t.sdk)),this.macros=new d.Macros({game:t,bridge:this._bridge}),this.adInstance=new Gh(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=hh,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){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_sendSDKError",value:function(e){e=e.message?e:{message:e};this.eventBus.broadcast("SDK_ERROR",{message:e.message,status:"error"});try{this.options.onError(e)}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_onEvent",value:function(e){d.dankLog(e.name,e.message,e.status);try{this.options.onEvent({name:e.name,message:e.message,status:e.status})}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}}},{key:"_getGameData",value:function(){var e=this;return new Promise(function(t){var n=this;w.default(this,e);var r=this._getDefaultGameData(),a=this._getGameDataUrl();fetch(a).then(function(e){return w.default(this,n),e.json()}.bind(this)).then(function(e){if(w.default(this,n),e.success){var a,i,s,o,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===(a=u.enableAds)||void 0===a?void 0:a.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),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)||{}},c=d.extendDefaults(O.default(r),l);c.afg_disabled=!1===(null===(i=c.sdk)||void 0===i||null===(s=i.afg)||void 0===s?void 0:s.enabled),c.preroll=!0===(null===(o=c.pAds)||void 0===o?void 0:o.enabled),this._bridge.noPreroll=(!this._getisMobile()||!1!==c.loader.mobile)&&this._bridge.noPreroll,this._bridge.noPreroll&&(this.adRequestTimer=Date.now()),this.msgrt.setGameData(c),d.setDankLog(c.diagnostic),t(c)}else r.failed=!0,t(r)}.bind(this)).catch(function(e){w.default(this,n),r.failed=!0,t(r)}.bind(this))}.bind(this))}},{key:"_createSplash",value:(o=k.default(x.default.mark((function e(t,n){var r,a,i=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getSplashTemplate(t);case 2:r=e.sent,(a=new r(Gf(Gf({},this.options),{},{isConsentDomain:n,version:hh.version}),t,this._parentDomain)).on("playClick",function(){var e=this;if(w.default(this,i),n){var t=new Date;t.setDate(t.getDate()+90),document.cookie="ogdpr_tracking=1; expires=".concat(t.toUTCString(),"; path=/")}this.showAd(d.AdType.Interstitial,{position:"preroll"}).catch(function(t){w.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(){w.default(this,i),a.hide()}.bind(this)),this.eventBus.subscribe("SDK_GAME_START",function(){w.default(this,i),a.hide()}.bind(this));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"_createPromoBeforeSplash",value:(s=k.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Gf(Gf({},this.options),{},{isConsentDomain:n,version:hh.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){w.default(this,o),s.hide(),this._createSplash(t,n)}.bind(this)),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),this._createSplash(t,n);case 12:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e,t){return s.apply(this,arguments)})},{key:"_createPromo",value:(i=k.default(x.default.mark((function e(t,n){var r,a,i,s,o=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._createPrerollPromoTemplate(t);case 3:i=e.sent,(s=new i(Gf(Gf({},this.options),{},{isConsentDomain:n,version:hh.version,template:null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll}),t)).on("done",function(){w.default(this,o),s.hide(),this.onResumeGame("Resumed after the promo","warning")}.bind(this)),this.onPauseGame("Pause the game for the promo","success"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),this.onResumeGame("Resumed after the promo","warning");case 12:case"end":return e.stop()}}),e,this,[[0,9]])}))),function(e,t){return i.apply(this,arguments)})},{key:"showBanner",value:function(){var e=this;this.showAd(d.AdType.Interstitial).catch(function(){w.default(this,e)}.bind(this))}},{key:"showAd",value:(a=k.default(x.default.mark((function e(t){var n,r=this,a=arguments;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:{},e.abrupt("return",new Promise(function(){var e=k.default(x.default.mark((function e(a,i){var s,o,d,u,l,c,h,p,f,m,g,v,y=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,h={adType:t,params:n,adTimestamp:r.adRequestTimer},e.next=4,r.sdkReady;case 4:return p=e.sent,e.next=7,r.videoAdReady;case 7:return r._sendLoadedEvent(),r._rejectAdIfGameBlocked({gameData:p,adRequest:h}),r._rejectAdIfAdDisabled({gameData:p,adRequest:h}),r._rejectAdIfUnsupportedType({adRequest:h}),r._rejectAdIfRewardedDisabled({gameData:p,adRequest:h}),(null===(s=p.mAds)||void 0===s||null===(o=s.gift)||void 0===o||!o.enabled||null!==(d=p.mAds)&&void 0!==d&&null!==(u=d.gift)&&void 0!==u&&u.enabled&&(null==p||null===(l=p.mAds)||void 0===l||null===(c=l.gift)||void 0===c?void 0:c.after)!==r.adInstance.adMidrollCount)&&r._rejectAdIfAdRateHits({gameData:p,adRequest:h}),r.adInstance.attachAfgPosition(h),r._attachAfgFallback({gameData:p,adRequest:h}),f="main.showad",m=function(e){var t,n,a,s;w.default(this,y),r.eventBus.unsubscribeScope(f),r.onResumeGame(e.message,"warning"),null!=p&&null!==(t=p.mAds)&&void 0!==t&&null!==(n=t.gift)&&void 0!==n&&n.enabled&&(null==p||null===(a=p.mAds)||void 0===a||null===(s=a.gift)||void 0===s?void 0:s.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),i(e.message)}.bind(this),g=function(e){var t,n,i,s;w.default(this,y),r.eventBus.unsubscribeScope(f),r.adRequestTimer=Date.now(),r.onResumeGame("Advertisement(s) are done. Start / resume the game.","success"),null!=p&&null!==(t=p.mAds)&&void 0!==t&&null!==(n=t.gift)&&void 0!==n&&n.enabled&&(null==p||null===(i=p.mAds)||void 0===i||null===(s=i.gift)||void 0===s?void 0:s.after)===r.adInstance.adMidrollCount&&r.decideToGiveAGift(),a(e.message)}.bind(this),v=function(e){var s=this;w.default(this,y),r.eventBus.unsubscribeScope(f),n.fallback_adsense=!1,r.showAd(t,Gf(Gf({},n),{},{adapter:"adsense"})).then(function(e){w.default(this,s),a(e)}.bind(this)).catch(function(e){w.default(this,s),i(e)}.bind(this))}.bind(this),r.eventBus.subscribe("AD_ERROR",null!=n&&n.fallback_adsense?v:m,f),r.eventBus.subscribe("AD_SDK_CANCELED",null!=n&&n.fallback_adsense?v:m,f),r.eventBus.subscribe("AD_SUCCESS",g,f),e.next=24,r.adInstance.startAd(h);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 2:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{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!==d.AdType.Interstitial&&t.adType!==d.AdType.Rewarded)throw new Error("Unsupported an advertisement type: ",t.adType)}else t.adType=d.AdType.Interstitial}},{key:"_rejectAdIfRewardedDisabled",value:function(e){var t=e.gameData;if(e.adRequest.adType===d.AdType.Rewarded&&!t.rewardedAds)throw new Error("Rewarded ads are disabled.")}},{key:"_rejectAdIfAdRateHits",value:function(e){var t=e.gameData;if(e.adRequest.adType===d.AdType.Interstitial&&void 0!==this.adRequestTimer&&Date.now()-this.adRequestTimer<t.midroll)throw new Error("The advertisement was requested too soon.")}},{key:"preloadAd",value:(r=k.default(x.default.mark((function e(t){var n=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=k.default(x.default.mark((function e(r,a){var i,s;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.sdkReady;case 3:return i=e.sent,e.next=6,n.videoAdReady;case 6:if(!i.bloc_gard||!0!==i.bloc_gard.enabled){e.next=8;break}throw new Error("Game or domain is blocked.");case 8:if(i.enableAds&&!n._whitelabelPartner){e.next=10;break}throw new Error("Advertisements are disabled.");case 10:if(t){e.next=14;break}t=d.AdType.Rewarded,e.next=16;break;case 14:if(t===d.AdType.Interstitial||t===d.AdType.Rewarded){e.next=16;break}throw new Error("Unsupported an advertisement type:"+t);case 16:if(t!==d.AdType.Rewarded||i.rewardedAds){e.next=18;break}throw new Error("Rewarded ads are disabled.");case 18:return e.next=20,n.adInstance.preloadAd(t);case 20:s=e.sent,r(s),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),a(e.t0);case 27:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return r.apply(this,arguments)})},{key:"cancelAd",value:(n=k.default(x.default.mark((function e(){var t=this;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=k.default(x.default.mark((function e(n,r){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t.adInstance.cancel(),t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),r()}catch(e){t.onResumeGame("Advertisement(s) are cancelled. Start / resume the game.","success"),n(e.message)}case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"showDisplayAd",value:function(e){var t=this;return new Promise(function(){var n=k.default(x.default.mark((function n(r,a){var i;return x.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.sdkReady;case 3:return i=n.sent,n.next=6,t.videoAdReady;case 6:if(!i.dAds.enabled){n.next=13;break}return n.next=9,t.adInstance.loadDisplayAd(e);case 9:t._post_message({topic:"adrequest.display"}),r(),n.next=14;break;case 13:a("Display-Ads are disabled.");case 14:n.next=19;break;case 16:n.prev=16,n.t0=n.catch(0),a(n.t0.message||n.t0);case 19:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(e,t){return n.apply(this,arguments)}}())}},{key:"onResumeGame",value:function(e,t){this._allowExternals({enabled:!1});try{this.options.resumeGame()}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_START";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"onPauseGame",value:function(e,t){this._allowExternals({enabled:!0});try{this.options.pauseGame()}catch(e){d.dankLog("DEVELOPER_ERROR",e.message,"warning")}var n="SDK_GAME_PAUSE";this.eventBus.broadcast(n,{name:n,message:e,status:t,analytics:{category:"SDK",action:n,label:this.options.gameId+""}})}},{key:"openConsole",value:function(){try{new d.ImplementationTest(this).start(),d.Ls.set("gd_debug_ex",!0)}catch(e){console.log(e)}}},{key:"_initBlockingExternals",value:function(){var e=this._gameData;(e.failed||e.block_exts&&e.block_exts.enabled)&&(this.window_open=window.open,this._allowExternals({enabled:!1}),this._removeExternalsInHtml({enabled:!1}))}},{key:"_checkFullscreen",value:function(){var e=this;try{var t=this._gameData;t.sdk.fullscreen&&"auto"===t.sdk.fullscreen&&document.addEventListener("click",function(){if(w.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){w.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;w.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 w.default(this,n),e.preventDefault(),this.msgrt.send("external",{message:"H> ".concat(a)}),!1}.bind(this))}.bind(this))}},{key:"_getBridgeContext",value:function(){var e=this._isTokenGameURL(),t=this._isMasterGameURL(),n=this._isExtHostedGameURL(),r=e||n?this._getTokenGameURLConfig():{};r=r||{};var a=decodeURIComponent((e||n)&&r.parentURL?r.parentURL:d.getParentUrl()),i=decodeURIComponent((e||n)&&r.parentDomain?r.parentDomain:d.getParentDomain()),s=decodeURIComponent((e||n)&&r.topDomain?r.topDomain:n&&0===d.getIframeDepth()?i:d.getTopDomain()),o=(e||n)&&r.loaderEnabled,u=(e||n)&&r.loaderEnabled,l=(e||n)&&r.loaderEnabled,c=(e||n)&&r.loaderEnabled,h=(e||n)&&r.loaderEnabled,p=(e||n)&&r.loaderEnabled,f=(e||n)&&r.loaderEnabled,m=(e||n)&&r.loaderEnabled,g=(e||n)&&r.loaderEnabled&&r.hasImpression&&r.version>="1.1.24";return{isTokenGameURL:e,isMasterGameURL:t,isExtHostedGameURL:n,noConsoleBanner:o,noLoadedEvent:u,noBlockerEvent:l,noPreroll:m,parentURL:a,parentDomain:i,topDomain:s&&s.length?s:i,noGAPageView:c,noLotamePageView:h,noGamedockSDK:p,noMinijuegosSDK:f,version:r.version,pauseGameOnStartup:g,depth:d.getIframeDepth(),domainMatched:i===s,exports:{formatTokenURLSearch:this._formatTokenURLSearch.bind(this),extendUrlQuery:this._extendUrlQuery.bind(this),base64Encode:this._base64_encode.bind(this)}}}},{key:"_isMasterGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Fa-f0-9]{32})(.*)$/i;return e.test(location.href)||!this._isTokenGameURL()&&e.test(document.referrer)}},{key:"_isTokenGameURL",value:function(){var e=/http[s]?:\/\/(html5\.gamedistribution\.com\/[A-Za-z0-9]{8})\/(.*)$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_isExtHostedGameURL",value:function(){var e=/^http[s]?:\/\/.*?gd_sdk_referrer_url=.*$/i;return e.test(location.href)||e.test(document.referrer)}},{key:"_getTokenGameURLConfig",value:function(){try{var e,t=/http[s]?:\/\/html5\.gamedistribution\.com\/[A-Za-z0-9]{8}\/[A-Fa-f0-9]{32}\/.*/i;if(t.test(location.href)){var n=new R.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 R.default(document.referrer,!0);if(!r.query.gd_zone_config)return;e=r.query.gd_zone_config}else{var a=new R.default(location.href,!0);if(!a.query.gd_zone_config)return;e=a.query.gd_zone_config}return JSON.parse(m.Base64.decode(decodeURIComponent(e)))}catch(e){}}},{key:"_getSplashTemplate",value:function(e){var t=e.splash;return new Of(t).splash()}},{key:"_createPrerollPromoTemplate",value:(t=k.default(x.default.mark((function e(t){var n,r,a,i,s;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null===(n=t.promo)||void 0===n?void 0:n[null===(r=t.promo)||void 0===r||null===(a=r.template)||void 0===a?void 0:a.preroll],s=new If(i),e.abrupt("return",s.promo());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"_formatTokenURLSearch",value:function(e){var t="";try{t=encodeURIComponent(m.Base64.encode(JSON.stringify(e)))}catch(e){}try{var n=new R.default(location.href,!0);return n.query=n.query||{},n.query.gd_zone_config=t,"?".concat(C.default.stringify(n.query))}catch(e){return"?gd_zone_config=".concat(t)}}},{key:"_extendUrlQuery",value:function(e,t){var n=new R.default(e,!0);return n.query=Gf(Gf({},n.query),t),n.toString()}},{key:"_base64_encode",value:function(e){return m.Base64.encode(JSON.stringify(e))}},{key:"_parseAndSelectRandomOne",value:function(e){var t=this._selectRandomOne("object"===A.default(e)?e:d.parseJSON(e));return t&&t.version?hh.version>=t.version?t:void 0:t}},{key:"_selectRandomOne",value:function(e){var t=this;if(!Kh(e)||0===e.length)return e;if(1===e.length)return e[0];var n=0;e.forEach(function(e){w.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=k.default(x.default.mark((function t(n,r){var a;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sdkReady;case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:a=e._gameData,n({ads:{display:{enabled:a.dAds.enabled},rewarded:{enabled:a.rewardedAds}},location:{parentDomain:e._bridge.parentDomain,topDomain:e._bridge.topDomain,parentURL:e._bridge.parentURL,depth:e._bridge.depth,loadedByGameZone:e._bridge.isTokenGameURL}});case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,n){return t.apply(this,arguments)}}())}},{key:"_getisMobile",value:function(){var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),!1===t&&window.orientation>-1&&(t=!0),t}},{key:"_get_game_thumbnail_url",value:function(){var e=this,t=this._gameData,n=t.assets.find(function(t){return w.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,r=null===(t=this._gameData)||void 0===t||null===(n=t.mAds)||void 0===n?void 0:n.gift;this.giftInterval=setInterval(k.default(x.default.mark((function t(){var n=this;return x.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.adInstance.requestRunning?console.log("Advertisement already running..."):(e.showAd(d.AdType.Interstitial,{position:"midroll"}).catch(function(e){w.default(this,n)}.bind(this)),clearInterval(e.giftInterval),e.giftInterval=void 0);case 1:case"end":return t.stop()}}),t,this)}))),1e3*r.wait)}catch(e){console.log("Advertisement Error...")}}}]),e}(),Kf=new function e(){var t=this;S.default(this,e),E.default(this,"load",k.default(x.default.mark((function e(){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rf("Leaderboard");case 2:t.leaderboard=e.sent;case 3:case"end":return e.stop()}}),e)})))),E.default(this,"showLeaderboard",function(){var e=k.default(x.default.mark((function e(n){var r;return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=window.GD_OPTIONS.gameId,t.leaderboard){e.next=4;break}return e.next=4,t.load();case 4:t.leaderboard.showLeaderBoard(r,n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),E.default(this,"addScore",function(){var e=k.default(x.default.mark((function e(n){return x.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.leaderboard){e.next=3;break}return e.next=3,t.load();case 3:t.leaderboard.addScore(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.moduleName="Leaderboard",this.moduleConfig={source:"https://pm.gamedistribution.com/@bygd/gd-sdk-leaderboard/0.1.43/dist/default/iife/index.js",dependencies:["react","react-dom","redux","react-redux","material-ui-core"]},xf(this.moduleName,this.moduleConfig)},Wf=new Ff(function(){var e={};try{"object"===("undefined"==typeof GD_OPTIONS?"undefined":A.default(GD_OPTIONS))&&GD_OPTIONS?e=GD_OPTIONS:window.gdApi&&"object"===A.default(window.gdApi.q[0][0])&&window.gdApi.q[0][0]&&((e=window.gdApi.q[0][0]).hasOwnProperty("advertisementSettings")||(e.advertisementSettings={autoplay:!0}))}catch(e){console.log("_get_developer_sets failed",e)}return e}());function zf(){var e=this;this.AdType=d.AdType,this.preloadAd=function(e){return Wf.preloadAd(e)},this.showAd=function(e,t){return e===d.AdType.Display?Wf.showDisplayAd(t):Wf.showAd(e)},this.cancelAd=function(){return Wf.cancelAd()},this.openConsole=function(){Wf.openConsole()},this.getSession=function(){return Wf.session()},this.leaderboard={show:function(){w.default(this,e),Kf.showLeaderboard()}.bind(this),addScore:function(t){w.default(this,e),Kf.addScore(t)}.bind(this)}}zf.prototype=new function(){this.showBanner=function(){Wf.showBanner()},this.play=function(){},this.customLog=function(){}},window.gdsdk=new zf,window.gdApi=window.gdsdk;
|