(function(){'use strict';var p;function aa(a){var b=0;return function(){return b>>0)+"_",h=0;return b}); u("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c0:!1}function Ia(){return D()?Ha("Chromium"):(C("Chrome")||C("CriOS"))&&!(D()?0:C("Edge"))||C("Silk")};var Ja=D()?!1:C("Trident")||C("MSIE");!C("Android")||Ia();Ia();C("Safari")&&(Ia()||(D()?0:C("Coast"))||(D()?0:C("Opera"))||(D()?0:C("Edge"))||(D()?Ha("Microsoft Edge"):C("Edg/"))||D()&&Ha("Opera"));var Ka={},E=null;var La=typeof Uint8Array!=="undefined",Ma=!Ja&&typeof btoa==="function";var G=typeof Symbol==="function"&&typeof Symbol()==="symbol";function Na(a){return typeof Symbol==="function"&&typeof Symbol()==="symbol"?Symbol():a}var Oa=Na(),H=Na("1oa");var I=G?function(a){return a[Oa]|0}:function(a){return a.g|0},J=G?function(a){return a[Oa]}:function(a){return a.g},L=G?function(a,b){a[Oa]=b}:function(a,b){a.g!==void 0?a.g=b:Object.defineProperties(a,{g:{value:b,configurable:!0,writable:!0,enumerable:!1}})};var Pa={},Qa={};function Ra(a){return!(!a||typeof a!=="object"||a.g!==Qa)}function Sa(a){return a!==null&&typeof a==="object"&&!Array.isArray(a)&&a.constructor===Object}function M(a,b,c){if(!Array.isArray(a)||a.length)return!1;var d=I(a);if(d&1)return!0;if(!(b&&(Array.isArray(b)?b.includes(c):b.has(c))))return!1;L(a,d|1);return!0}function Ta(a){if(a&2)throw Error();}Object.freeze({});var Ua=Object.freeze({});var Va; function N(a,b,c){a==null&&(a=Va);Va=void 0;if(a==null){var d=96;c?(a=[c],d|=512):a=[];b&&(d=d&-16760833|(b&1023)<<14)}else{if(!Array.isArray(a))throw Error("narr");d=I(a);if(d&2048)throw Error("farr");if(d&64)return a;d|=64;if(c&&(d|=512,c!==a[0]))throw Error("mid");a:{c=a;var h=c.length;if(h){var l=h-1;if(Sa(c[l])){d|=256;b=l-(+!!(d&512)-1);if(b>=1024)throw Error("pvtlmt");d=d&-16760833|(b&1023)<<14;break a}}if(b){b=Math.max(b,h-(+!!(d&512)-1));if(b>1024)throw Error("spvt");d=d&-16760833|(b&1023)<< 14}}}L(a,d);return a};function Wa(a){switch(typeof a){case "number":return isFinite(a)?a:String(a);case "boolean":return a?1:0;case "object":if(a)if(Array.isArray(a)){if(M(a,void 0,0))return}else if(La&&a!=null&&a instanceof Uint8Array){if(Ma){for(var b="",c=0,d=a.length-10240;c>2];g=b[(g&3)<<4|k>>4];k=b[(k&15)<<2|f>>6];f=b[f&63];c[h++]=e+g+k+f}e=0;f=d;switch(a.length-l){case 2:e=a[l+1],f=b[(e&15)<<2]||d;case 1:a=a[l],c[h]=b[a>>2]+b[(a&3)<<4|e>>4]+f+d}a=c.join("")}return a}}return a};function Xa(a,b,c,d,h){if(a!=null){if(Array.isArray(a))a=M(a,void 0,0)?void 0:h&&I(a)&2?a:Ya(a,b,c,d!==void 0,h);else if(Sa(a)){var l={},e;for(e in a)l[e]=Xa(a[e],b,c,d,h);a=l}else a=b(a,d);return a}}function Ya(a,b,c,d,h){var l=d||c?I(a):0;d=d?!!(l&32):void 0;a=Array.prototype.slice.call(a);for(var e=0;e>14&1023||536870912;if(c>=h){var l=b;if(b&256)var e=a[a.length-1];else{if(d==null)return l;e=a[h+(+!!(b&512)-1)]={};l|=256}e[c]=d;c>14&1023||536870912;e>=k?f=g&256?f[f.length-1][e]:void 0:(g=e+(+!!(g&512)-1),f=g<0||g>=f.length||g>=k?void 0:f[g])}f!=null&&(h!==0&&(c=O(b,c,h)),h=e)}a.set(d,h);return h} function P(a,b,c){var d=db;c==null&&(c=void 0);a:{var h=a.l,l=J(h);Ta(l);if(c==null){var e=cb(h);if(bb(e,h,l,d)===b)e.set(d,0);else break a}else{e=cb(h);var f=bb(e,h,l,d);f!==b&&(f&&(l=O(h,l,f)),e.set(d,b))}O(h,l,b,c)}return a}function eb(a,b){a=2&b?a|2:a&-3;return(a|32)&-2049}function fb(a,b){32&b||(a&=-33);return a}function gb(a,b,c){if(c!=null&&typeof c!=="string")throw Error();var d=a.l,h=J(d);Ta(h);O(d,h,b,c);return a};var Q,hb;function R(a,b,c){this.l=N(a,b,c)}R.prototype.toJSON=function(){return ib(this)};R.prototype.M=Pa;R.prototype.toString=function(){try{return Q=!0,ib(this).toString()}finally{Q=!1}}; function ib(a){var b=Q?a.l:hb?Ya(a.l,Za,void 0,void 0,!1):Ya(a.l,$a,void 0,void 0,!1);var c=!Q;var d=Fa?void 0:a.constructor.na;var h=J(c?a.l:b);if(a=b.length){var l=b[a-1],e=Sa(l);e?a--:l=void 0;h=+!!(h&512)-1;var f=b;if(e){b:{var g=l;var k={};e=!1;if(g)for(var m in g)if(isNaN(+m))k[m]=g[m];else{var n=g[m];Array.isArray(n)&&(M(n,d,+m)||Ra(n)&&n.size===0)&&(n=null);n==null&&(e=!0);n!=null&&(k[m]=n)}if(e){for(var q in k)break b;k=null}else k=g}g=k==null?l!=null:k!==l}for(var x;a>0;a--){q=a-1;m=f[q]; q-=h;if(!(m==null||M(m,d,q)||Ra(m)&&m.size===0))break;x=!0}if(f!==b||g||x){if(!c)f=Array.prototype.slice.call(f,0,a);else if(x||g||k)f.length=a;k&&f.push(k)}b=f}return b};function jb(a){this.l=N(a)}w(jb,R);jb.prototype.H=function(){return ab(this,kb)};var kb=[2,3,4,5,6,7];function S(a){a=Error.call(this,a);this.message=a.message;"stack"in a&&(this.stack=a.stack)}w(S,Error);function lb(a){this.l=N(a)}w(lb,R);lb.na=[1];function mb(a,b){this.data=a;this.channel=b};function nb(a){this.g=a}nb.prototype.send=function(a,b,c){c=c===void 0?[]:c;b=ob(b);this.g.postMessage(a,[b.port2].concat(c))};function pb(a,b){qb(a,b);return new nb(a)}function ob(a){var b=new MessageChannel;qb(b.port1,a);return b}function qb(a,b){b&&(a.onmessage=function(c){var d=c.data;c=pb(c.ports[0]);b(new mb(d,c))})};function T(a){try{a()}catch(b){Da(b)}};function rb(a){var b=this;var c=a.ea;var d=a.ma===void 0?function(){}:a.ma;var h=a.ja===void 0?function(){}:a.ja;a=a.ia===void 0?function(){}:a.ia;this.g=new Map;this.h=c;this.m=d;this.j=h;this.i=a;this.onMessage=function(l){return sb(b,l)}}rb.prototype.register=function(a,b){this.g.set(a,b);return this};function sb(a,b){var c=a.h(b.data),d=a.g.get(c);d?(T(function(){return a.j(b,c)}),T(function(){return d(b)}),T(function(){return a.i(b,c)})):T(function(){return a.m(b,c)})};function tb(a){this.g=a}tb.prototype.send=function(a,b,c){var d=this.g,h=d.send;try{hb=!0;var l=ib(a)}finally{hb=!1}h.call(d,l,b,c)};function ub(a,b){return function(c){var d=new a(c.data);return b(new mb(d,c.channel))}}function vb(a){return function(b){return a(new mb(b.data,new tb(b.channel)))}};function wb(a,b,c,d){this.j=a;this.i=b;this.L=c;this.J=d;this.g=!1;this.h=new Set} function xb(a){var b=new rb({ea:a.H}),c={destination:window.parent,origin:a.origin,G:a.G,onMessage:vb(ub(a.L,b.onMessage))};var d=c.destination;var h=c.origin;var l=c.oa===void 0?void 0:c.oa;var e=c.G===void 0?"ZNWN1d":c.G;c=c.onMessage===void 0?void 0:c.onMessage;if(h==="*")throw Error("Sending to wildcard origin not allowed.");var f=ob(c),g={};l=l?(g.n=e,g.t=l,g):e;d.postMessage(l,h,[f.port2]);d=pb(f.port1,c);return new wb(b,new tb(d),a.L,a.J)} wb.prototype.send=function(a){if(!this.g)throw new S("Attempted to send a message before initialisation.");this.i.send(a)}; wb.prototype.init=function(){var a=this;return sa(new ra(new oa(function(b){if(a.g)throw new S("Attempted to initialise twice. The SDK can only be initialised once.");if(a.J!==void 0){var c=a.i,d=c.send,h=a.J,l=new lb;var e=[].concat(da(a.h)),f=l.l,g=J(f);Ta(g);if(e==null)O(f,g,1);else{var k=I(e),m=k,n=!!(2&k)||Object.isFrozen(e),q;if(q=!n)q=void 0===Ua||!1;if(!(4&k))for(k=21,n&&(e=Array.prototype.slice.call(e),m=0,k=eb(k,g),k=fb(k,g)),n=0;n1&&(b=decodeURIComponent(c[0].replace("+"," ")),d=decodeURIComponent(c[1].replace("+"," ")));c=this.g.get(b);c==null&&(c=[],this.g.set(b,c));c.push(d)}}Z.prototype.get=function(a){return(a=this.g.get(a))&&a.length?a[0]:null}; Z.prototype.getAll=function(a){return[].concat(da(this.g.get(a)||[]))};Z.prototype.has=function(a){return this.g.has(a)};Z.prototype[Symbol.iterator]=function(){return bc.apply(null,da($b(this.g,function(a){var b=a[0];return $b(a[1],function(c){return[b,c]})})))};Z.prototype.toString=function(){return ic(this)}; function ic(a){function b(c){return encodeURIComponent(c).replace(/[!()~']|(%20)/g,function(d){return{"!":"%21","(":"%28",")":"%29","%20":"+","'":"%27","~":"%7E"}[d]})}return Array.from(a,function(c){return b(c[0])+"="+b(c[1])}).join("&")} function jc(a){var b=ec();try{dc(b,new Y(a));var c=b.protocol}catch(h){throw Error(a+" is not a valid URL.");}if(c===""||c===":"||c[c.length-1]!=":")throw Error(a+" is not a valid URL.");if(!kc.has(c))throw Error(a+" is not a valid URL.");if(!b.hostname)throw Error(a+" is not a valid URL.");var d=b.href;a={href:d,protocol:b.protocol,username:"",password:"",hostname:b.hostname,pathname:"/"+b.pathname,search:b.search,hash:b.hash,toString:function(){return d}};kc.get(b.protocol)===b.port?(a.host=a.hostname, a.port="",a.origin=a.protocol+"//"+a.hostname):(a.host=b.host,a.port=b.port,a.origin=a.protocol+"//"+a.hostname+":"+a.port);return a}var kc=new Map([["http:","80"],["https:","443"],["ws:","80"],["wss:","443"],["ftp:","21"]]);var lc={google_ama_config:!0};function mc(a){this.channel=a===void 0?null:a;this.g={};if(a=nc.da()||nc.ca())try{var b=JSON.parse(atob(decodeURIComponent(a)));if(typeof b!=="object")throw Error("malformed gameData param: "+a);this.g=b}catch(c){console.error("Error parsing gameData param: "+JSON.stringify(c))}}p=mc.prototype;p.clear=function(){var a=new V;var b=new Qb;a=P(a,4,b);var c;(c=this.channel)==null||c.send(a);this.g={}};p.getItem=function(a){var b;return(b=this.g[a])!=null?b:null}; p.setItem=function(a,b){["boolean","number"].includes(typeof b)&&(b=b.toString());if(!lc[a]){var c=new V;var d=new Sb;d=gb(d,1,a);d=gb(d,2,b);c=P(c,1,d);var h;(h=this.channel)==null||h.send(c);this.g[a]=b}};p.removeItem=function(a){var b=new V;var c=new Rb;c=gb(c,1,a);b=P(b,3,c);var d;(d=this.channel)==null||d.send(b);delete this.g[a]};p.key=function(a){var b=Object.keys(this.g);return a>=b.length?null:b[a]};p.hasOwnProperty=function(a){return this.g.hasOwnProperty(a)}; t.Object.defineProperties(mc.prototype,{length:{configurable:!0,enumerable:!0,get:function(){var a;return(a=Object.keys(this.g).length)!=null?a:0}}}); var nc={ca:function(){var a=window.location.href;if(hc){try{var b=new fc(a)}catch(d){throw Error(a+" is not a valid URL.");}var c=kc.get(b.protocol);if(!c)throw Error(a+" is not a valid URL.");if(!b.hostname)throw Error(a+" is not a valid URL.");b.origin=="null"&&(a={href:b.href,protocol:b.protocol,username:"",password:"",host:b.host,port:b.port,hostname:b.hostname,pathname:b.pathname,search:b.search,hash:b.hash},a.origin=c===b.port?b.protocol+"//"+b.hostname:b.protocol+"//"+b.hostname+":"+b.port, b=a)}else b=jc(a);return(hc&&b.searchParams?b.searchParams:new Z(b.search)).get("gameData")},da:function(a){a=a||window.location.hash;return Ab(a).get("gameData")}};function oc(a,b,c,d,h){b=b===void 0?null:b;c=c===void 0?Bb:c;d=d===void 0?Cb:d;W.call(this);this.postMessageHandler=a;this.channel=b;this.monetizationScriptAttributes=c;this.experimentFlags=d;this.i=h;this.audio=new U(this.postMessageHandler);this.ad=new Fb(this.postMessageHandler,this.monetizationScriptAttributes,this.audio.j.bind(this.audio),this);this.game=new Tb(this.postMessageHandler,this.channel,this.monetizationScriptAttributes,this.audio,this.ad);this.score=new Xb(this.postMessageHandler); this.storage=new mc(this.channel);this.postMessageHandler.send({messageType:"LOADED"});a.A("SET_LOG_LEVEL",Ib);this.j=new Wb(this.audio);X(this,wa(Vb,this.j));X(this,wa(Vb,a));this.i&&X(this,wa(Vb,this.i));b&&(yb(b,4),b.init())}w(oc,W);function pc(){W.apply(this,arguments);this.targetOrigin=""}w(pc,W);pc.prototype.A=function(){};pc.prototype.send=function(){};function qc(a){W.call(this);var b=this;this.targetOrigin=a;this.i=new Map;if(a==="*")throw Error("targetOrigin of '*' is insecure. Use the origin of the parent frame.");X(this,function(){b.i.clear()});window.addEventListener("message",function(c){var d=c.data;if(c.origin===b.targetOrigin&&typeof(d==null?void 0:d.messageType)==="string"&&(c=d.messageType,typeof d!=="object"||d===null?0:d.messageType===c)&&(c=b.i.get(c))){c=v(c);for(var h=c.next();!h.done;h=c.next())h=h.value,h(d)}})}w(qc,W); qc.prototype.A=function(a,b){if(!this.h){var c=this.i.get(a);c||(c=new Set,this.i.set(a,c));c.add(b)}};qc.prototype.send=function(a){window.parent.postMessage(a,this.targetOrigin)};function rc(a,b){W.call(this);var c=this;this.postMessageHandler=a;this.window=b;this.i=this.userActivityLoggingIntervalMs=0;this.m=function(d){d=d.userActivityLoggingIntervalMs;d<=0||(c.userActivityLoggingIntervalMs=d,c.window.addEventListener("pointerdown",c.j,!0))};this.j=function(d){!d.isTrusted||Date.now()-c.i